From bbe2b6da0c0cbc2352eb545512688eb8c8a2e4ef Mon Sep 17 00:00:00 2001 From: Brian Matherly Date: Tue, 15 Dec 2009 05:56:12 +0000 Subject: [PATCH] move src/Editors/* to src/gui/editors as part of GEP008 svn: r13807 --- src/DisplayTabs/_AddrEmbedList.py | 6 +-- src/DisplayTabs/_AttrEmbedList.py | 2 +- src/DisplayTabs/_BackRefList.py | 18 ++------ src/DisplayTabs/_EventEmbedList.py | 6 +-- src/DisplayTabs/_FamilyAttrEmbedList.py | 2 +- src/DisplayTabs/_FamilyLdsEmbedList.py | 2 +- src/DisplayTabs/_GalleryTab.py | 6 +-- src/DisplayTabs/_LdsEmbedList.py | 2 +- src/DisplayTabs/_LocationEmbedList.py | 6 +-- src/DisplayTabs/_NameEmbedList.py | 5 +- src/DisplayTabs/_NoteTab.py | 4 +- src/DisplayTabs/_PersonEventEmbedList.py | 4 +- src/DisplayTabs/_PersonRefEmbedList.py | 9 ++-- src/DisplayTabs/_RepoEmbedList.py | 12 ++--- src/DisplayTabs/_SourceEmbedList.py | 12 ++--- src/DisplayTabs/_WebEmbedList.py | 6 +-- src/Editors/Makefile.am | 46 ------------------- src/Editors/__init__.py | 40 ---------------- src/Makefile.am | 2 - src/PluginUtils/_PluginWindows.py | 3 +- src/Simple/_SimpleTable.py | 4 +- src/gui/Makefile.am | 1 + src/gui/__init__.py | 2 +- src/gui/editors/Makefile.am | 46 +++++++++++++++++++ src/gui/editors/__init__.py | 40 ++++++++++++++++ .../AddMedia.py => gui/editors/addmedia.py} | 0 .../editors/editaddress.py} | 4 +- .../editors/editattribute.py} | 4 +- .../editors/editchildref.py} | 4 +- .../editors/editevent.py} | 7 ++- .../editors/editeventref.py} | 6 +-- .../editors/editfamily.py} | 12 ++--- .../editors/editldsord.py} | 4 +- .../editors/editlocation.py} | 4 +- .../editors/editmedia.py} | 6 +-- .../editors/editmediaref.py} | 5 +- .../_EditName.py => gui/editors/editname.py} | 4 +- .../_EditNote.py => gui/editors/editnote.py} | 4 +- .../editors/editperson.py} | 11 ++--- .../editors/editpersonref.py} | 2 +- .../editors/editplace.py} | 4 +- .../editors/editprimary.py} | 0 .../editors/editreference.py} | 0 .../editors/editreporef.py} | 5 +- .../editors/editrepository.py} | 6 +-- .../editors/editsecondary.py} | 0 .../editors/editsource.py} | 6 +-- .../editors/editsourceref.py} | 4 +- .../_EditUrl.py => gui/editors/editurl.py} | 4 +- .../editors/objectentries.py} | 6 +-- src/gui/views/placebaseview.py | 2 +- src/gui/widgets/__init__.py | 2 +- src/plugins/gramplet/FanChartGramplet.py | 2 +- src/plugins/gramplet/NoteGramplet.py | 6 +-- src/plugins/tool/Desbrowser.py | 3 +- src/plugins/tool/NotRelated.py | 3 +- src/plugins/tool/RemoveUnused.py | 2 +- src/plugins/tool/Verify.py | 3 +- src/plugins/view/eventview.py | 6 +-- src/plugins/view/familyview.py | 3 +- src/plugins/view/fanchartview.py | 5 +- src/plugins/view/grampletview.py | 5 +- src/plugins/view/mediaview.py | 2 +- src/plugins/view/noteview.py | 2 +- src/plugins/view/pedigreeview.py | 2 +- src/plugins/view/pedigreeviewext.py | 4 +- src/plugins/view/personview.py | 2 +- src/plugins/view/placetreeview.py | 2 +- src/plugins/view/relview.py | 9 +--- src/plugins/view/repoview.py | 7 ++- src/plugins/view/sourceview.py | 4 +- 71 files changed, 194 insertions(+), 280 deletions(-) delete mode 100644 src/Editors/Makefile.am delete mode 100644 src/Editors/__init__.py create mode 100644 src/gui/editors/Makefile.am create mode 100644 src/gui/editors/__init__.py rename src/{Editors/AddMedia.py => gui/editors/addmedia.py} (100%) rename src/{Editors/_EditAddress.py => gui/editors/editaddress.py} (98%) rename src/{Editors/_EditAttribute.py => gui/editors/editattribute.py} (98%) rename src/{Editors/_EditChildRef.py => gui/editors/editchildref.py} (99%) rename src/{Editors/_EditEvent.py => gui/editors/editevent.py} (99%) rename src/{Editors/_EditEventRef.py => gui/editors/editeventref.py} (98%) rename src/{Editors/_EditFamily.py => gui/editors/editfamily.py} (99%) rename src/{Editors/_EditLdsOrd.py => gui/editors/editldsord.py} (99%) rename src/{Editors/_EditLocation.py => gui/editors/editlocation.py} (98%) rename src/{Editors/_EditMedia.py => gui/editors/editmedia.py} (99%) rename src/{Editors/_EditMediaRef.py => gui/editors/editmediaref.py} (99%) rename src/{Editors/_EditName.py => gui/editors/editname.py} (99%) rename src/{Editors/_EditNote.py => gui/editors/editnote.py} (99%) rename src/{Editors/_EditPerson.py => gui/editors/editperson.py} (99%) rename src/{Editors/_EditPersonRef.py => gui/editors/editpersonref.py} (99%) rename src/{Editors/_EditPlace.py => gui/editors/editplace.py} (99%) rename src/{Editors/_EditPrimary.py => gui/editors/editprimary.py} (100%) rename src/{Editors/_EditReference.py => gui/editors/editreference.py} (100%) rename src/{Editors/_EditRepoRef.py => gui/editors/editreporef.py} (98%) rename src/{Editors/_EditRepository.py => gui/editors/editrepository.py} (98%) rename src/{Editors/_EditSecondary.py => gui/editors/editsecondary.py} (100%) rename src/{Editors/_EditSource.py => gui/editors/editsource.py} (99%) rename src/{Editors/_EditSourceRef.py => gui/editors/editsourceref.py} (99%) rename src/{Editors/_EditUrl.py => gui/editors/editurl.py} (98%) rename src/{Editors/ObjectEntries.py => gui/editors/objectentries.py} (99%) diff --git a/src/DisplayTabs/_AddrEmbedList.py b/src/DisplayTabs/_AddrEmbedList.py index e8e0d161c..bcea98b16 100644 --- a/src/DisplayTabs/_AddrEmbedList.py +++ b/src/DisplayTabs/_AddrEmbedList.py @@ -107,8 +107,7 @@ class AddrEmbedList(EmbeddedList): """ addr = gen.lib.Address() try: - from Editors import EditAddress - + from gui.editors import EditAddress EditAddress(self.dbstate, self.uistate, self.track, addr, self.add_callback) except Errors.WindowActiveError: @@ -131,8 +130,7 @@ class AddrEmbedList(EmbeddedList): addr = self.get_selected() if addr: try: - from Editors import EditAddress - + from gui.editors import EditAddress EditAddress(self.dbstate, self.uistate, self.track, addr, self.edit_callback) except Errors.WindowActiveError: diff --git a/src/DisplayTabs/_AttrEmbedList.py b/src/DisplayTabs/_AttrEmbedList.py index b1d7f6222..74af66b4d 100644 --- a/src/DisplayTabs/_AttrEmbedList.py +++ b/src/DisplayTabs/_AttrEmbedList.py @@ -69,7 +69,7 @@ class AttrEmbedList(EmbeddedList): AttrModel, move_buttons=True) def get_editor(self): - from Editors import EditAttribute + from gui.editors import EditAttribute return EditAttribute def get_user_values(self): diff --git a/src/DisplayTabs/_BackRefList.py b/src/DisplayTabs/_BackRefList.py index f35ede3b9..36fac305f 100644 --- a/src/DisplayTabs/_BackRefList.py +++ b/src/DisplayTabs/_BackRefList.py @@ -128,59 +128,49 @@ class BackRefList(EmbeddedList): return (None, None) def edit_button_clicked(self, obj): + + from gui.editors import EditEvent, EditPerson, EditFamily, EditSource, \ + EditPlace, EditMedia, EditRepository + (reftype, ref) = self.find_node() if reftype == 'Person': try: - from Editors import EditPerson - person = self.dbstate.db.get_person_from_handle(ref) EditPerson(self.dbstate, self.uistate, [], person) except Errors.WindowActiveError: pass elif reftype == 'Family': try: - from Editors import EditFamily - family = self.dbstate.db.get_family_from_handle(ref) EditFamily(self.dbstate, self.uistate, [], family) except Errors.WindowActiveError: pass elif reftype == 'Source': try: - from Editors import EditSource - source = self.dbstate.db.get_source_from_handle(ref) EditSource(self.dbstate, self.uistate, [], source) except Errors.WindowActiveError: pass elif reftype == 'Place': try: - from Editors import EditPlace - place = self.dbstate.db.get_place_from_handle(ref) EditPlace(self.dbstate, self.uistate, [], place) except Errors.WindowActiveError: pass elif reftype == 'MediaObject': try: - from Editors import EditMedia - obj = self.dbstate.db.get_object_from_handle(ref) EditMedia(self.dbstate, self.uistate, [], obj) except Errors.WindowActiveError: pass elif reftype == 'Event': try: - from Editors import EditEvent - event = self.dbstate.db.get_event_from_handle(ref) EditEvent(self.dbstate, self.uistate, [], event) except Errors.WindowActiveError: pass elif reftype == 'Repository': try: - from Editors import EditRepository - repo = self.dbstate.db.get_repository_from_handle(ref) EditRepository(self.dbstate, self.uistate, [], repo) except Errors.WindowActiveError: diff --git a/src/DisplayTabs/_EventEmbedList.py b/src/DisplayTabs/_EventEmbedList.py index 94c3fbc3b..8fd2ae0eb 100644 --- a/src/DisplayTabs/_EventEmbedList.py +++ b/src/DisplayTabs/_EventEmbedList.py @@ -139,7 +139,7 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList): self.rebuild_callback() def get_ref_editor(self): - from Editors import EditFamilyEventRef + from gui.editors import EditFamilyEventRef return EditFamilyEventRef def get_icon_name(self): @@ -329,10 +329,10 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList): def editnotworkgroup(self, key): """ Edit non native event in own editor - """ - from Editors import EditPerson + """ person = self.dbstate.db.get_person_from_handle(key) try: + from gui.editors import EditPerson EditPerson(self.dbstate, self.uistate, [], person) except Errors.WindowActiveError: pass diff --git a/src/DisplayTabs/_FamilyAttrEmbedList.py b/src/DisplayTabs/_FamilyAttrEmbedList.py index 7ab02ded2..04135fbe2 100644 --- a/src/DisplayTabs/_FamilyAttrEmbedList.py +++ b/src/DisplayTabs/_FamilyAttrEmbedList.py @@ -38,7 +38,7 @@ class FamilyAttrEmbedList(AttrEmbedList): AttrEmbedList.__init__(self, dbstate, uistate, track, data) def get_editor(self): - from Editors import EditFamilyAttribute + from gui.editors import EditFamilyAttribute return EditFamilyAttribute def get_user_values(self): diff --git a/src/DisplayTabs/_FamilyLdsEmbedList.py b/src/DisplayTabs/_FamilyLdsEmbedList.py index 660d85a76..56d7c3fcd 100644 --- a/src/DisplayTabs/_FamilyLdsEmbedList.py +++ b/src/DisplayTabs/_FamilyLdsEmbedList.py @@ -59,7 +59,7 @@ class FamilyLdsEmbedList(LdsEmbedList): LdsEmbedList.__init__(self, dbstate, uistate, track, data) def get_editor(self): - from Editors import EditFamilyLdsOrd + from gui.editors import EditFamilyLdsOrd return EditFamilyLdsOrd def new_data(self): diff --git a/src/DisplayTabs/_GalleryTab.py b/src/DisplayTabs/_GalleryTab.py index ca6032398..08fd6f455 100644 --- a/src/DisplayTabs/_GalleryTab.py +++ b/src/DisplayTabs/_GalleryTab.py @@ -267,7 +267,7 @@ class GalleryTab(ButtonTab, DbGUIElement): def add_button_clicked(self, obj): try: - from Editors import EditMediaRef + from gui.editors import EditMediaRef EditMediaRef(self.dbstate, self.uistate, self.track, gen.lib.MediaObject(), gen.lib.MediaRef(), self.add_callback) @@ -295,7 +295,7 @@ class GalleryTab(ButtonTab, DbGUIElement): if src: sref = gen.lib.MediaRef() try: - from Editors import EditMediaRef + from gui.editors import EditMediaRef EditMediaRef(self.dbstate, self.uistate, self.track, src, sref, self.add_callback) except Errors.WindowActiveError: @@ -313,7 +313,7 @@ class GalleryTab(ButtonTab, DbGUIElement): obj = self.dbstate.db.get_object_from_handle( ref.get_reference_handle()) try: - from Editors import EditMediaRef + from gui.editors import EditMediaRef EditMediaRef(self.dbstate, self.uistate, self.track, obj, ref, None) except Errors.WindowActiveError: diff --git a/src/DisplayTabs/_LdsEmbedList.py b/src/DisplayTabs/_LdsEmbedList.py index 20d889e01..fdeee8f12 100644 --- a/src/DisplayTabs/_LdsEmbedList.py +++ b/src/DisplayTabs/_LdsEmbedList.py @@ -71,7 +71,7 @@ class LdsEmbedList(EmbeddedList): LdsModel, move_buttons=True) def get_editor(self): - from Editors import EditLdsOrd + from gui.editors import EditLdsOrd return EditLdsOrd def new_data(self): diff --git a/src/DisplayTabs/_LocationEmbedList.py b/src/DisplayTabs/_LocationEmbedList.py index e641c562a..4d2290f60 100644 --- a/src/DisplayTabs/_LocationEmbedList.py +++ b/src/DisplayTabs/_LocationEmbedList.py @@ -73,8 +73,7 @@ class LocationEmbedList(EmbeddedList): def add_button_clicked(self, obj): loc = gen.lib.Location() try: - from Editors import EditLocation - + from gui.editors import EditLocation EditLocation(self.dbstate, self.uistate, self.track, loc, self.add_callback) except Errors.WindowActiveError: @@ -88,8 +87,7 @@ class LocationEmbedList(EmbeddedList): loc = self.get_selected() if loc: try: - from Editors import EditLocation - + from gui.editors import EditLocation EditLocation(self.dbstate, self.uistate, self.track, loc, self.edit_callback) except Errors.WindowActiveError: diff --git a/src/DisplayTabs/_NameEmbedList.py b/src/DisplayTabs/_NameEmbedList.py index 1878882cb..e7f403019 100644 --- a/src/DisplayTabs/_NameEmbedList.py +++ b/src/DisplayTabs/_NameEmbedList.py @@ -147,8 +147,7 @@ class NameEmbedList(GroupEmbeddedList): def add_button_clicked(self, obj): name = gen.lib.Name() try: - from Editors import EditName - + from gui.editors import EditName EditName(self.dbstate, self.uistate, self.track, name, self.add_callback) except Errors.WindowActiveError: @@ -162,7 +161,7 @@ class NameEmbedList(GroupEmbeddedList): name = self.get_selected() if name and name[1] is not None: try: - from Editors import EditName + from gui.editors import EditName if name[0] == NameModel.ALTINDEX: EditName(self.dbstate, self.uistate, self.track, name[1], self.edit_callback) diff --git a/src/DisplayTabs/_NoteTab.py b/src/DisplayTabs/_NoteTab.py index 060b30c15..cdab4c0bc 100644 --- a/src/DisplayTabs/_NoteTab.py +++ b/src/DisplayTabs/_NoteTab.py @@ -130,7 +130,7 @@ class NoteTab(EmbeddedList, DbGUIElement): if self.notetype : note.set_type(self.notetype) try: - from Editors import EditNote + from gui.editors import EditNote EditNote(self.dbstate, self.uistate, self.track, note, self.add_callback, self.callertitle, extratype = [self.notetype]) @@ -159,7 +159,7 @@ class NoteTab(EmbeddedList, DbGUIElement): if handle: note = self.dbstate.db.get_note_from_handle(handle) try: - from Editors import EditNote + from gui.editors import EditNote EditNote(self.dbstate, self.uistate, self.track, note, callertitle = self.callertitle, extratype = [self.notetype] ) diff --git a/src/DisplayTabs/_PersonEventEmbedList.py b/src/DisplayTabs/_PersonEventEmbedList.py index a8531ae54..2fc9fb56b 100644 --- a/src/DisplayTabs/_PersonEventEmbedList.py +++ b/src/DisplayTabs/_PersonEventEmbedList.py @@ -117,16 +117,16 @@ class PersonEventEmbedList(EventEmbedList): return gen.lib.EventType(gen.lib.EventType.BIRTH) def get_ref_editor(self): - from Editors import EditEventRef + from gui.editors import EditEventRef return EditEventRef def editnotworkgroup(self, key): """ Edit non native event in own editor """ - from Editors import EditFamily family = self.dbstate.db.get_family_from_handle(key) try: + from gui.editors import EditFamily EditFamily(self.dbstate, self.uistate, [], family) except Errors.WindowActiveError: pass diff --git a/src/DisplayTabs/_PersonRefEmbedList.py b/src/DisplayTabs/_PersonRefEmbedList.py index 4c84359ea..95ee18c0d 100644 --- a/src/DisplayTabs/_PersonRefEmbedList.py +++ b/src/DisplayTabs/_PersonRefEmbedList.py @@ -71,7 +71,7 @@ class PersonRefEmbedList(EmbeddedList): move_buttons=True) def get_ref_editor(self): - from Editors import EditPersonRef + from gui.editors import EditPersonRef return EditPersonRef def get_data(self): @@ -81,8 +81,7 @@ class PersonRefEmbedList(EmbeddedList): return ((1, 0), (1, 1), (1, 2)) def add_button_clicked(self, obj): - from Editors import EditPersonRef - + from gui.editors import EditPersonRef try: ref = gen.lib.PersonRef() ref.rel = _('Godfather') @@ -97,10 +96,10 @@ class PersonRefEmbedList(EmbeddedList): self.rebuild() def edit_button_clicked(self, obj): + from gui.editors import EditPersonRef ref = self.get_selected() if ref: try: - from Editors import EditPersonRef EditPersonRef( self.dbstate, self.uistate, self.track, ref, self.edit_callback) @@ -115,8 +114,8 @@ class PersonRefEmbedList(EmbeddedList): And event reference that is from a drag and drop has an unknown event reference type """ + from gui.editors import EditPersonRef try: - from Editors import EditPersonRef ref = gen.lib.PersonRef(obj) ref.rel = _('Unknown') EditPersonRef( diff --git a/src/DisplayTabs/_RepoEmbedList.py b/src/DisplayTabs/_RepoEmbedList.py index 1828a5731..612f983b1 100644 --- a/src/DisplayTabs/_RepoEmbedList.py +++ b/src/DisplayTabs/_RepoEmbedList.py @@ -99,9 +99,8 @@ class RepoEmbedList(EmbeddedList, DbGUIElement): return ((1, 0), (1, 1), (1, 2), (1, 3)) def handle_extra_type(self, objtype, obj): + from gui.editors import EditRepoRef try: - from Editors import EditRepoRef - ref = gen.lib.RepoRef() repo = self.dbstate.db.get_repository_from_handle(obj) EditRepoRef( @@ -111,11 +110,10 @@ class RepoEmbedList(EmbeddedList, DbGUIElement): pass def add_button_clicked(self, obj): + from gui.editors import EditRepoRef ref = gen.lib.RepoRef() repo = gen.lib.Repository() try: - from Editors import EditRepoRef - EditRepoRef( self.dbstate, self.uistate, self.track, repo, ref, self.add_callback) @@ -133,8 +131,7 @@ class RepoEmbedList(EmbeddedList, DbGUIElement): repo = sel.run() if repo: try: - from Editors import EditRepoRef - + from gui.editors import EditRepoRef ref = gen.lib.RepoRef() EditRepoRef(self.dbstate, self.uistate, @@ -158,8 +155,7 @@ class RepoEmbedList(EmbeddedList, DbGUIElement): if ref: repo = self.dbstate.db.get_repository_from_handle(ref.ref) try: - from Editors import EditRepoRef - + from gui.editors import EditRepoRef EditRepoRef( self.dbstate, self.uistate, self.track, repo, ref, self.edit_callback) diff --git a/src/DisplayTabs/_SourceEmbedList.py b/src/DisplayTabs/_SourceEmbedList.py index ae8267339..be90cfb93 100644 --- a/src/DisplayTabs/_SourceEmbedList.py +++ b/src/DisplayTabs/_SourceEmbedList.py @@ -99,9 +99,8 @@ class SourceEmbedList(EmbeddedList, DbGUIElement): return ((1, 0), (1, 1), (1, 2), (1, 3)) def add_button_clicked(self, obj): + from gui.editors import EditSourceRef try: - from Editors import EditSourceRef - sref = gen.lib.SourceRef() src = gen.lib.Source() EditSourceRef( @@ -115,14 +114,13 @@ class SourceEmbedList(EmbeddedList, DbGUIElement): pass def share_button_clicked(self, obj): + from gui.editors import EditSourceRef SelectSource = SelectorFactory('Source') sel = SelectSource(self.dbstate,self.uistate,self.track) src = sel.run() if src: try: - from Editors import EditSourceRef - ref = gen.lib.SourceRef() EditSourceRef(self.dbstate, self.uistate, @@ -135,13 +133,12 @@ class SourceEmbedList(EmbeddedList, DbGUIElement): pass def edit_button_clicked(self, obj): + from gui.editors import EditSourceRef sref = self.get_selected() if sref: src = self.dbstate.db.get_source_from_handle(sref.ref) try: - from Editors import EditSourceRef - EditSourceRef(self.dbstate, self.uistate, self.track, src, sref, self.object_edited) except Errors.WindowActiveError: @@ -180,11 +177,10 @@ class SourceEmbedList(EmbeddedList, DbGUIElement): self.rebuild() def handle_extra_type(self, objtype, obj): + from gui.editors import EditSourceRef sref = gen.lib.SourceRef() src = self.dbstate.db.get_source_from_handle(obj) try: - from Editors import EditSourceRef - EditSourceRef(self.dbstate, self.uistate, self.track, src, sref, self.object_added) except Errors.WindowActiveError: diff --git a/src/DisplayTabs/_WebEmbedList.py b/src/DisplayTabs/_WebEmbedList.py index 5bfaaa5d9..4d4435939 100644 --- a/src/DisplayTabs/_WebEmbedList.py +++ b/src/DisplayTabs/_WebEmbedList.py @@ -81,10 +81,9 @@ class WebEmbedList(EmbeddedList): return ((1, 0), (1, 1), (1, 2)) def add_button_clicked(self, obj): + from gui.editors import EditUrl url = gen.lib.Url() try: - from Editors import EditUrl - EditUrl(self.dbstate, self.uistate, self.track, '', url, self.add_callback) except Errors.WindowActiveError: @@ -95,11 +94,10 @@ class WebEmbedList(EmbeddedList): self.rebuild() def edit_button_clicked(self, obj): + from gui.editors import EditUrl url = self.get_selected() if url: try: - from Editors import EditUrl - EditUrl(self.dbstate, self.uistate, self.track, '', url, self.edit_callback) except Errors.WindowActiveError: diff --git a/src/Editors/Makefile.am b/src/Editors/Makefile.am deleted file mode 100644 index 56d645415..000000000 --- a/src/Editors/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ -# This is the src/Editors level Makefile for Gramps -# We could use GNU make's ':=' syntax for nice wildcard use, -# but that is not necessarily portable. -# If not using GNU make, then list all .py files individually - -pkgdatadir = $(datadir)/@PACKAGE@/Editors - -pkgdata_PYTHON = \ - AddMedia.py\ - __init__.py\ - _EditAddress.py \ - _EditAttribute.py \ - _EditChildRef.py \ - _EditEvent.py \ - _EditEventRef.py \ - _EditFamily.py \ - _EditLdsOrd.py \ - _EditLocation.py \ - _EditMedia.py \ - _EditMediaRef.py \ - _EditName.py \ - _EditPerson.py \ - _EditPersonRef.py \ - _EditPlace.py \ - _EditPrimary.py \ - _EditReference.py \ - _EditRepository.py \ - _EditRepoRef.py \ - _EditSecondary.py \ - _EditSource.py \ - _EditSourceRef.py \ - _EditNote.py \ - _EditUrl.py \ - ObjectEntries.py - -pkgpyexecdir = @pkgpyexecdir@/Editors -pkgpythondir = @pkgpythondir@/Editors - -# Clean up all the byte-compiled files -MOSTLYCLEANFILES = *pyc *pyo - -GRAMPS_PY_MODPATH = "../" - -pycheck: - (export PYTHONPATH=$(GRAMPS_PY_MODPATH); \ - pychecker $(pkgdata_PYTHON)); diff --git a/src/Editors/__init__.py b/src/Editors/__init__.py deleted file mode 100644 index fb3719020..000000000 --- a/src/Editors/__init__.py +++ /dev/null @@ -1,40 +0,0 @@ -# -# Gramps - a GTK+/GNOME based genealogy program -# -# Copyright (C) 2000-2006 Donald N. Allingham -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -from _EditNote import * -from _EditAddress import * -from _EditAttribute import * -from _EditEvent import * -from _EditEventRef import * -from _EditFamily import * -from _EditLdsOrd import * -from _EditLocation import * -from _EditMedia import * -from _EditMediaRef import * -from _EditName import * -from _EditPerson import * -from _EditPlace import * -from _EditRepository import * -from _EditRepoRef import * -from _EditSource import * -from _EditSourceRef import * -from _EditUrl import * -from _EditPersonRef import * -from _EditChildRef import * diff --git a/src/Makefile.am b/src/Makefile.am index bb97360d4..d41997064 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -8,7 +8,6 @@ SUBDIRS = \ DateHandler \ DisplayTabs \ docgen \ - Editors \ Filters \ FilterEditor \ gen \ @@ -24,7 +23,6 @@ SUBDIRS = \ PluginUtils \ plugins \ ReportBase \ - Selectors \ Simple gdirdir=$(prefix)/share/gramps diff --git a/src/PluginUtils/_PluginWindows.py b/src/PluginUtils/_PluginWindows.py index 6ea7a6a4a..b6f46720f 100644 --- a/src/PluginUtils/_PluginWindows.py +++ b/src/PluginUtils/_PluginWindows.py @@ -51,7 +51,7 @@ from gui.utils import open_file_with_default_application from gui.pluginmanager import GuiPluginManager import _Tool as Tool from QuestionDialog import InfoDialog -import config +from gui.editors import EditPerson #------------------------------------------------------------------------- # @@ -468,7 +468,6 @@ class ToolManagedWindowBase(ManagedWindow.ManagedWindow): return False # handle event further, if necessary def on_button_press(self, view, event): - from Editors import EditPerson buffer_location = view.window_to_buffer_coords(gtk.TEXT_WINDOW_TEXT, int(event.x), int(event.y)) diff --git a/src/Simple/_SimpleTable.py b/src/Simple/_SimpleTable.py index 232e51ca4..f97913d85 100644 --- a/src/Simple/_SimpleTable.py +++ b/src/Simple/_SimpleTable.py @@ -31,6 +31,8 @@ import gen.lib import Errors import config import DateHandler +from gui.editors import (EditPerson, EditEvent, EditFamily, EditSource, + EditPlace, EditRepository) class SimpleTable(object): """ @@ -84,8 +86,6 @@ class SimpleTable(object): """ Handle events on tables. obj is a treeview """ - from Editors import (EditPerson, EditEvent, EditFamily, EditSource, - EditPlace, EditRepository) selection = obj.get_selection() store, node = selection.get_selected() if not node: diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 2a995ff06..c32b8deae 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -4,6 +4,7 @@ # If not using GNU make, then list all .py files individually SUBDIRS = \ + editors \ selectors \ views \ widgets diff --git a/src/gui/__init__.py b/src/gui/__init__.py index 0b4733d99..bbbcab505 100644 --- a/src/gui/__init__.py +++ b/src/gui/__init__.py @@ -26,4 +26,4 @@ Package init for the gui package. # DO NOT IMPORT METHODS/CLASSES FROM src/gui HERE ! Only __all__ -__all__ = [ "views", "widgets" ] +__all__ = [ "editors", "selectors", "views", "widgets" ] diff --git a/src/gui/editors/Makefile.am b/src/gui/editors/Makefile.am new file mode 100644 index 000000000..a82c93fcc --- /dev/null +++ b/src/gui/editors/Makefile.am @@ -0,0 +1,46 @@ +# This is the src/Editors level Makefile for Gramps +# We could use GNU make's ':=' syntax for nice wildcard use, +# but that is not necessarily portable. +# If not using GNU make, then list all .py files individually + +pkgdatadir = $(datadir)/@PACKAGE@/gui/editors + +pkgdata_PYTHON = \ + addmedia.py\ + __init__.py\ + editaddress.py \ + editattribute.py \ + editchildRef.py \ + editevent.py \ + editeventRef.py \ + editfamily.py \ + editldsOrd.py \ + editlocation.py \ + editmedia.py \ + editmediaRef.py \ + editname.py \ + editnote.py \ + editperson.py \ + editpersonRef.py \ + editplace.py \ + editprimary.py \ + editreference.py \ + editrepository.py \ + editrepoRef.py \ + editsecondary.py \ + editsource.py \ + editsourceRef.py \ + editurl.py \ + objectentries.py + +pkgpyexecdir = @pkgpyexecdir@/src/editors +pkgpythondir = @pkgpythondir@/src/editors + +# Clean up all the byte-compiled files +MOSTLYCLEANFILES = *pyc *pyo + +GRAMPS_PY_MODPATH = "../../" + +pycheck: + (export PYTHONPATH=$(GRAMPS_PY_MODPATH); \ + pychecker $(pkgdata_PYTHON)); diff --git a/src/gui/editors/__init__.py b/src/gui/editors/__init__.py new file mode 100644 index 000000000..fef572c17 --- /dev/null +++ b/src/gui/editors/__init__.py @@ -0,0 +1,40 @@ +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2000-2006 Donald N. Allingham +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +from editaddress import EditAddress +from editattribute import EditAttribute, EditFamilyAttribute +from editchildref import EditChildRef +from editevent import EditEvent, DeleteEventQuery +from editeventref import EditEventRef +from editfamily import EditFamily +from editldsord import EditLdsOrd, EditFamilyLdsOrd +from editlocation import EditLocation +from editmedia import EditMedia, DeleteMediaQuery +from editmediaref import EditMediaRef +from editname import EditName +from editnote import EditNote, DeleteNoteQuery +from editperson import EditPerson +from editpersonref import EditPersonRef +from editplace import EditPlace, DeletePlaceQuery +from editrepository import EditRepository, DeleteRepositoryQuery +from editreporef import EditRepoRef +from editsource import EditSource, DeleteSrcQuery +from editsourceref import EditSourceRef +from editurl import EditUrl diff --git a/src/Editors/AddMedia.py b/src/gui/editors/addmedia.py similarity index 100% rename from src/Editors/AddMedia.py rename to src/gui/editors/addmedia.py diff --git a/src/Editors/_EditAddress.py b/src/gui/editors/editaddress.py similarity index 98% rename from src/Editors/_EditAddress.py rename to src/gui/editors/editaddress.py index 3c9b1d14b..df8d3146a 100644 --- a/src/Editors/_EditAddress.py +++ b/src/gui/editors/editaddress.py @@ -45,9 +45,7 @@ import gtk # gramps modules # #------------------------------------------------------------------------- -import const -import config -from _EditSecondary import EditSecondary +from editsecondary import EditSecondary from gen.lib import NoteType from glade import Glade from DisplayTabs import SourceEmbedList, NoteTab diff --git a/src/Editors/_EditAttribute.py b/src/gui/editors/editattribute.py similarity index 98% rename from src/Editors/_EditAttribute.py rename to src/gui/editors/editattribute.py index 4fb5d9143..04ba9b192 100644 --- a/src/Editors/_EditAttribute.py +++ b/src/gui/editors/editattribute.py @@ -45,9 +45,7 @@ import gtk # gramps modules # #------------------------------------------------------------------------- -import const -import config -from _EditSecondary import EditSecondary +from editsecondary import EditSecondary from gen.lib import NoteType from glade import Glade from DisplayTabs import SourceEmbedList, NoteTab diff --git a/src/Editors/_EditChildRef.py b/src/gui/editors/editchildref.py similarity index 99% rename from src/Editors/_EditChildRef.py rename to src/gui/editors/editchildref.py index 2e5780ed4..27bf7fcb3 100644 --- a/src/Editors/_EditChildRef.py +++ b/src/gui/editors/editchildref.py @@ -45,11 +45,9 @@ import gtk # gramps modules # #------------------------------------------------------------------------- -import const -from _EditSecondary import EditSecondary +from editsecondary import EditSecondary from gen.lib import NoteType import Errors -import config from glade import Glade from DisplayTabs import SourceEmbedList, NoteTab from gui.widgets import MonitoredDataType, PrivacyButton diff --git a/src/Editors/_EditEvent.py b/src/gui/editors/editevent.py similarity index 99% rename from src/Editors/_EditEvent.py rename to src/gui/editors/editevent.py index 477f68e73..680254b77 100644 --- a/src/Editors/_EditEvent.py +++ b/src/gui/editors/editevent.py @@ -41,11 +41,10 @@ import gtk # #------------------------------------------------------------------------- import const -import config import gen.lib import GrampsDisplay -from _EditPrimary import EditPrimary -from ObjectEntries import PlaceEntry +from editprimary import EditPrimary +from objectentries import PlaceEntry from glade import Glade from QuestionDialog import ErrorDialog from DisplayTabs import (SourceEmbedList, NoteTab, GalleryTab, @@ -316,7 +315,7 @@ class EditFamilyEvent(EditEvent): # Delete Query class # #------------------------------------------------------------------------- -class DelEventQuery(object): +class DeleteEventQuery(object): def __init__(self, dbstate, uistate, event, person_list, family_list): self.event = event self.db = dbstate.db diff --git a/src/Editors/_EditEventRef.py b/src/gui/editors/editeventref.py similarity index 98% rename from src/Editors/_EditEventRef.py rename to src/gui/editors/editeventref.py index eda619d36..3bf72b2bc 100644 --- a/src/Editors/_EditEventRef.py +++ b/src/gui/editors/editeventref.py @@ -33,17 +33,15 @@ from gettext import gettext as _ # gramps modules # #------------------------------------------------------------------------- -import const -import config import gen.lib from glade import Glade from DisplayTabs import (SourceEmbedList, NoteTab, GalleryTab, EventBackRefList, AttrEmbedList) from gui.widgets import (PrivacyButton, MonitoredEntry, MonitoredDate, MonitoredDataType) -from _EditReference import RefTab, EditReference +from editreference import RefTab, EditReference -from ObjectEntries import PlaceEntry +from objectentries import PlaceEntry #------------------------------------------------------------------------- # diff --git a/src/Editors/_EditFamily.py b/src/gui/editors/editfamily.py similarity index 99% rename from src/Editors/_EditFamily.py rename to src/gui/editors/editfamily.py index 23e9382e4..b12c3f649 100644 --- a/src/Editors/_EditFamily.py +++ b/src/gui/editors/editfamily.py @@ -54,7 +54,6 @@ import pango # #------------------------------------------------------------------------- import Utils -import const import config from BasicUtils import name_displayer import gen.lib @@ -62,7 +61,9 @@ import Errors import DateHandler from glade import Glade -from Editors import EditPrimary +from editprimary import EditPrimary +from editchildref import EditChildRef +from editperson import EditPerson from ReportBase import ReportUtils from DisplayTabs import (EmbeddedList, EventEmbedList, SourceEmbedList, FamilyAttrEmbedList, NoteTab, GalleryTab, @@ -203,7 +204,6 @@ class ChildEmbedList(EmbeddedList): (0, 8), (0, 9)] def add_button_clicked(self, obj): - from Editors import EditPerson person = gen.lib.Person() autoname = config.get('behavior.surname-guessing') #_("Father's surname"), @@ -268,8 +268,6 @@ class ChildEmbedList(EmbeddedList): self.call_edit_childref(handle) def call_edit_childref(self, handle): - from Editors import EditChildRef - for ref in self.family.get_child_ref_list(): if ref.ref == handle: p = self.dbstate.db.get_person_from_handle(handle) @@ -284,8 +282,6 @@ class ChildEmbedList(EmbeddedList): def edit_child_button_clicked(self, obj): handle = self.get_selected() if handle: - from Editors import EditPerson - for ref in self.family.get_child_ref_list(): if ref.ref == handle: p = self.dbstate.db.get_person_from_handle(handle) @@ -736,7 +732,6 @@ class EditFamily(EditPrimary): self.mbutton_del, self.mbutton_edit) def add_mother_clicked(self, obj): - from Editors import EditPerson person = gen.lib.Person() person.set_gender(gen.lib.Person.FEMALE) autoname = config.get('behavior.surname-guessing') @@ -754,7 +749,6 @@ class EditFamily(EditPrimary): self.new_mother_added) def add_father_clicked(self, obj): - from Editors import EditPerson person = gen.lib.Person() person.set_gender(gen.lib.Person.MALE) autoname = config.get('behavior.surname-guessing') diff --git a/src/Editors/_EditLdsOrd.py b/src/gui/editors/editldsord.py similarity index 99% rename from src/Editors/_EditLdsOrd.py rename to src/gui/editors/editldsord.py index 37a18c4fc..fd60688e6 100644 --- a/src/Editors/_EditLdsOrd.py +++ b/src/gui/editors/editldsord.py @@ -48,8 +48,8 @@ import gen.lib from BasicUtils import name_displayer import LdsUtils from glade import Glade -from _EditSecondary import EditSecondary -from ObjectEntries import PlaceEntry +from editsecondary import EditSecondary +from objectentries import PlaceEntry from DisplayTabs import SourceEmbedList,NoteTab from gui.widgets import (PrivacyButton, MonitoredDate, MonitoredMenu, MonitoredStrMenu) diff --git a/src/Editors/_EditLocation.py b/src/gui/editors/editlocation.py similarity index 98% rename from src/Editors/_EditLocation.py rename to src/gui/editors/editlocation.py index 73577e86e..54853ef70 100644 --- a/src/Editors/_EditLocation.py +++ b/src/gui/editors/editlocation.py @@ -26,9 +26,7 @@ # gramps modules # #------------------------------------------------------------------------- -import const -import config -from _EditSecondary import EditSecondary +from editsecondary import EditSecondary from glade import Glade from gui.widgets import MonitoredEntry from gettext import gettext as _ diff --git a/src/Editors/_EditMedia.py b/src/gui/editors/editmedia.py similarity index 99% rename from src/Editors/_EditMedia.py rename to src/gui/editors/editmedia.py index 12a3b5047..bf64a219f 100644 --- a/src/Editors/_EditMedia.py +++ b/src/gui/editors/editmedia.py @@ -41,17 +41,15 @@ import gtk # #------------------------------------------------------------------------- from gui.utils import open_file_with_default_application -import const -import config import gen.lib import Mime import ThumbNails import Utils -from Editors import EditPrimary +from editprimary import EditPrimary from gui.widgets import MonitoredDate, MonitoredEntry, PrivacyButton from DisplayTabs import (SourceEmbedList, AttrEmbedList, NoteTab, MediaBackRefList) -from Editors.AddMedia import AddMediaObject +from addmedia import AddMediaObject from QuestionDialog import ErrorDialog from glade import Glade diff --git a/src/Editors/_EditMediaRef.py b/src/gui/editors/editmediaref.py similarity index 99% rename from src/Editors/_EditMediaRef.py rename to src/gui/editors/editmediaref.py index 4460ac81f..6b6d4c84c 100644 --- a/src/Editors/_EditMediaRef.py +++ b/src/gui/editors/editmediaref.py @@ -43,7 +43,6 @@ import gtk #------------------------------------------------------------------------- from gui.utils import open_file_with_default_application import const -import config import Mime import ThumbNails import Utils @@ -52,8 +51,8 @@ from glade import Glade from DisplayTabs import (SourceEmbedList, AttrEmbedList, MediaBackRefList, NoteTab) from gui.widgets import MonitoredSpinButton, MonitoredEntry, PrivacyButton -from _EditReference import RefTab, EditReference -from AddMedia import AddMediaObject +from editreference import RefTab, EditReference +from addmedia import AddMediaObject #------------------------------------------------------------------------- # diff --git a/src/Editors/_EditName.py b/src/gui/editors/editname.py similarity index 99% rename from src/Editors/_EditName.py rename to src/gui/editors/editname.py index 3a508030d..10a3ec96c 100644 --- a/src/Editors/_EditName.py +++ b/src/gui/editors/editname.py @@ -41,10 +41,8 @@ import gtk # gramps modules # #------------------------------------------------------------------------- -import const -import config from BasicUtils import name_displayer -from _EditSecondary import EditSecondary +from editsecondary import EditSecondary from gen.lib import NoteType from DisplayTabs import GrampsTab,SourceEmbedList,NoteTab from gui.widgets import (MonitoredEntry, MonitoredMenu, MonitoredDate, diff --git a/src/Editors/_EditNote.py b/src/gui/editors/editnote.py similarity index 99% rename from src/Editors/_EditNote.py rename to src/gui/editors/editnote.py index 793459b68..282586dcf 100644 --- a/src/Editors/_EditNote.py +++ b/src/gui/editors/editnote.py @@ -29,7 +29,7 @@ #------------------------------------------------------------------------- from gettext import gettext as _ import logging -_LOG = logging.getLogger(".Editors.EditNote") +_LOG = logging.getLogger(".gui.editors.EditNote") #------------------------------------------------------------------------- # @@ -48,7 +48,7 @@ import pango import config import const from gui.widgets import StyledTextEditor -from Editors._EditPrimary import EditPrimary +from editprimary import EditPrimary from DisplayTabs import GrampsTab, NoteBackRefList from gui.widgets import (MonitoredDataType, MonitoredCheckbox, MonitoredEntry, PrivacyButton) diff --git a/src/Editors/_EditPerson.py b/src/gui/editors/editperson.py similarity index 99% rename from src/Editors/_EditPerson.py rename to src/gui/editors/editperson.py index 62e44feb6..80caf3d2a 100644 --- a/src/Editors/_EditPerson.py +++ b/src/gui/editors/editperson.py @@ -57,7 +57,9 @@ import Errors from glade import Glade from gen.utils import set_birth_death_index -from Editors._EditPrimary import EditPrimary +from editprimary import EditPrimary +from editmediaref import EditMediaRef +from editname import EditName import config from QuestionDialog import ErrorDialog, ICON @@ -481,9 +483,7 @@ class EditPerson(EditPrimary): if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1: media_list = self.obj.get_media_list() - if media_list: - from Editors import EditMediaRef - + if media_list: media_ref = media_list[0] object_handle = media_ref.get_reference_handle() media_obj = self.db.get_object_from_handle(object_handle) @@ -535,8 +535,6 @@ class EditPerson(EditPrimary): """ media_list = self.obj.get_media_list() if media_list: - from Editors import EditMediaRef - media_ref = media_list[0] object_handle = media_ref.get_reference_handle() media_obj = self.db.get_object_from_handle(object_handle) @@ -768,7 +766,6 @@ class EditPerson(EditPrimary): on the main form (not in the names tab). """ - from Editors import EditName EditName(self.dbstate, self.uistate, self.track, self.pname, self._update_name) diff --git a/src/Editors/_EditPersonRef.py b/src/gui/editors/editpersonref.py similarity index 99% rename from src/Editors/_EditPersonRef.py rename to src/gui/editors/editpersonref.py index 6c8354de8..0a6225952 100644 --- a/src/Editors/_EditPersonRef.py +++ b/src/gui/editors/editpersonref.py @@ -46,7 +46,7 @@ import gtk # #------------------------------------------------------------------------- from BasicUtils import name_displayer -from _EditSecondary import EditSecondary +from editsecondary import EditSecondary from gen.lib import NoteType from gui.widgets import MonitoredEntry, PrivacyButton from gui.selectors import SelectorFactory diff --git a/src/Editors/_EditPlace.py b/src/gui/editors/editplace.py similarity index 99% rename from src/Editors/_EditPlace.py rename to src/gui/editors/editplace.py index b8dc5db6e..f3cc1d4c5 100644 --- a/src/Editors/_EditPlace.py +++ b/src/gui/editors/editplace.py @@ -42,10 +42,8 @@ import gtk # gramps modules # #------------------------------------------------------------------------- -import const -import config import gen.lib -from Editors._EditPrimary import EditPrimary +from editprimary import EditPrimary from DisplayTabs import (GrampsTab, LocationEmbedList, SourceEmbedList, GalleryTab, NoteTab, WebEmbedList, PlaceBackRefList) from gui.widgets import MonitoredEntry, PrivacyButton diff --git a/src/Editors/_EditPrimary.py b/src/gui/editors/editprimary.py similarity index 100% rename from src/Editors/_EditPrimary.py rename to src/gui/editors/editprimary.py diff --git a/src/Editors/_EditReference.py b/src/gui/editors/editreference.py similarity index 100% rename from src/Editors/_EditReference.py rename to src/gui/editors/editreference.py diff --git a/src/Editors/_EditRepoRef.py b/src/gui/editors/editreporef.py similarity index 98% rename from src/Editors/_EditRepoRef.py rename to src/gui/editors/editreporef.py index 00bcdf7b0..270285315 100644 --- a/src/Editors/_EditRepoRef.py +++ b/src/gui/editors/editreporef.py @@ -33,14 +33,11 @@ from gettext import gettext as _ # gramps modules # #------------------------------------------------------------------------- -import const -import config - from gen.lib import NoteType from DisplayTabs import NoteTab,AddrEmbedList,WebEmbedList,SourceBackRefList from gui.widgets import MonitoredEntry, PrivacyButton, MonitoredDataType -from _EditReference import RefTab, EditReference +from editreference import RefTab, EditReference from glade import Glade #------------------------------------------------------------------------- diff --git a/src/Editors/_EditRepository.py b/src/gui/editors/editrepository.py similarity index 98% rename from src/Editors/_EditRepository.py rename to src/gui/editors/editrepository.py index 76e928e8e..54801a297 100644 --- a/src/Editors/_EditRepository.py +++ b/src/gui/editors/editrepository.py @@ -40,13 +40,11 @@ import gtk # gramps modules # #------------------------------------------------------------------------- -import const -import config import gen.lib from gui.widgets import MonitoredEntry, MonitoredDataType, PrivacyButton from DisplayTabs import AddrEmbedList, WebEmbedList, NoteTab, SourceBackRefList -from Editors._EditPrimary import EditPrimary +from editprimary import EditPrimary from QuestionDialog import ErrorDialog from glade import Glade @@ -195,7 +193,7 @@ class EditRepository(EditPrimary): def _cleanup_on_exit(self): self.backref_list.close() -class DelRepositoryQuery(object): +class DeleteRepositoryQuery(object): def __init__(self, dbstate, uistate, repository, sources): self.obj = repository self.db = dbstate.db diff --git a/src/Editors/_EditSecondary.py b/src/gui/editors/editsecondary.py similarity index 100% rename from src/Editors/_EditSecondary.py rename to src/gui/editors/editsecondary.py diff --git a/src/Editors/_EditSource.py b/src/gui/editors/editsource.py similarity index 99% rename from src/Editors/_EditSource.py rename to src/gui/editors/editsource.py index 183ec3808..14f9ac0ea 100644 --- a/src/Editors/_EditSource.py +++ b/src/gui/editors/editsource.py @@ -42,10 +42,8 @@ import gtk # gramps modules # #------------------------------------------------------------------------- -import const -import config import gen.lib -from Editors._EditPrimary import EditPrimary +from editprimary import EditPrimary from DisplayTabs import (NoteTab, GalleryTab, DataEmbedList, SourceBackRefList, RepoEmbedList) @@ -213,7 +211,7 @@ class EditSource(EditPrimary): def _cleanup_on_exit(self): self.backref_tab.close() -class DelSrcQuery(object): +class DeleteSrcQuery(object): def __init__(self, dbstate, uistate, source, the_lists): self.source = source self.db = dbstate.db diff --git a/src/Editors/_EditSourceRef.py b/src/gui/editors/editsourceref.py similarity index 99% rename from src/Editors/_EditSourceRef.py rename to src/gui/editors/editsourceref.py index 9691c118a..103de9c74 100644 --- a/src/Editors/_EditSourceRef.py +++ b/src/gui/editors/editsourceref.py @@ -33,15 +33,13 @@ from gettext import gettext as _ # gramps modules # #------------------------------------------------------------------------- -import const -import config import gen.lib from glade import Glade from DisplayTabs import (NoteTab, GalleryTab, SourceBackRefList, DataEmbedList, RepoEmbedList) from gui.widgets import (PrivacyButton, MonitoredEntry, MonitoredMenu, MonitoredDate) -from _EditReference import RefTab, EditReference +from editreference import RefTab, EditReference #------------------------------------------------------------------------- # diff --git a/src/Editors/_EditUrl.py b/src/gui/editors/editurl.py similarity index 98% rename from src/Editors/_EditUrl.py rename to src/gui/editors/editurl.py index 7d5b4e565..f436bc4f1 100644 --- a/src/Editors/_EditUrl.py +++ b/src/gui/editors/editurl.py @@ -33,9 +33,7 @@ from gettext import gettext as _ # gramps modules # #------------------------------------------------------------------------- -import const -import config -from _EditSecondary import EditSecondary +from editsecondary import EditSecondary from gui.widgets import MonitoredEntry, PrivacyButton, MonitoredDataType from glade import Glade diff --git a/src/Editors/ObjectEntries.py b/src/gui/editors/objectentries.py similarity index 99% rename from src/Editors/ObjectEntries.py rename to src/gui/editors/objectentries.py index 483475c83..07905cd45 100644 --- a/src/Editors/ObjectEntries.py +++ b/src/gui/editors/objectentries.py @@ -45,9 +45,9 @@ from pango import ELLIPSIZE_END # #------------------------------------------------------------------------- from gen.lib import (Place, MediaObject, Note) -from Editors._EditPlace import EditPlace -from Editors._EditMedia import EditMedia -from Editors._EditNote import EditNote +from editplace import EditPlace +from editmedia import EditMedia +from editnote import EditNote from gui.selectors import SelectorFactory from DdTargets import DdTargets from Errors import WindowActiveError diff --git a/src/gui/views/placebaseview.py b/src/gui/views/placebaseview.py index 4ac2477be..d0a70ca39 100644 --- a/src/gui/views/placebaseview.py +++ b/src/gui/views/placebaseview.py @@ -52,7 +52,7 @@ import config from QuestionDialog import ErrorDialog from gui.pluginmanager import GuiPluginManager from DdTargets import DdTargets -from Editors import EditPlace, DeletePlaceQuery +from gui.editors import EditPlace, DeletePlaceQuery from Filters.SideBar import PlaceSidebarFilter #------------------------------------------------------------------------- diff --git a/src/gui/widgets/__init__.py b/src/gui/widgets/__init__.py index 62aa34fd8..bb3f95922 100644 --- a/src/gui/widgets/__init__.py +++ b/src/gui/widgets/__init__.py @@ -37,4 +37,4 @@ from toolcomboentry import * from validatedcomboentry import * from validatedmaskedentry import * from valueaction import * -from valuetoolitem import * +from valuetoolitem import * diff --git a/src/plugins/gramplet/FanChartGramplet.py b/src/plugins/gramplet/FanChartGramplet.py index a1e0fb2ca..dc4fb01f6 100644 --- a/src/plugins/gramplet/FanChartGramplet.py +++ b/src/plugins/gramplet/FanChartGramplet.py @@ -59,7 +59,7 @@ from Utils import (find_children, find_parents, find_witnessed_people) from libformatting import FormattingHelper import gen.lib import Errors -from Editors import EditPerson, EditFamily +from gui.editors import EditPerson, EditFamily #------------------------------------------------------------------------- # diff --git a/src/plugins/gramplet/NoteGramplet.py b/src/plugins/gramplet/NoteGramplet.py index c0fec1330..0f57af915 100644 --- a/src/plugins/gramplet/NoteGramplet.py +++ b/src/plugins/gramplet/NoteGramplet.py @@ -34,8 +34,8 @@ import pango from gen.plug import Gramplet from BasicUtils import name_displayer from TransUtils import sgettext as _ -from const import GLADE_FILE from gui.widgets import StyledTextEditor +from gui.editors import EditPerson, EditFamily from gen.lib import StyledText, Note import Errors @@ -130,7 +130,7 @@ class NoteGramplet(Gramplet): def build_interface(self): """ - Based on src/Editors/_EditNote.py + Based on src/gui/editors/editnote.py """ vbox = gtk.VBox() self.texteditor = StyledTextEditor() @@ -220,7 +220,6 @@ class NoteGramplet(Gramplet): self.update() def edit_person(self, obj): - from Editors import EditPerson try: EditPerson(self.gui.dbstate, self.gui.uistate, [], @@ -230,7 +229,6 @@ class NoteGramplet(Gramplet): pass def edit_family(self, obj): - from Editors import EditFamily try: EditFamily(self.gui.dbstate, self.gui.uistate, [], diff --git a/src/plugins/tool/Desbrowser.py b/src/plugins/tool/Desbrowser.py index e9f82db24..650686fc4 100644 --- a/src/plugins/tool/Desbrowser.py +++ b/src/plugins/tool/Desbrowser.py @@ -42,6 +42,7 @@ import GrampsDisplay import ManagedWindow from TransUtils import sgettext as _ from glade import Glade +from gui.editors import EditPerson #------------------------------------------------------------------------ # @@ -114,8 +115,6 @@ class DesBrowse(Tool.ActivePersonTool, ManagedWindow.ManagedWindow): return item_id def button_press_event(self, obj,event): - from Editors import EditPerson - if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1: store, node = self.tree.get_selection().get_selected() if node: diff --git a/src/plugins/tool/NotRelated.py b/src/plugins/tool/NotRelated.py index 69a20a04a..780e430e9 100644 --- a/src/plugins/tool/NotRelated.py +++ b/src/plugins/tool/NotRelated.py @@ -40,8 +40,7 @@ import const from gettext import ngettext from PluginUtils import Tool from ReportBase import ReportUtils -from PluginUtils import Tool -from Editors import EditPerson, EditFamily +from gui.editors import EditPerson, EditFamily import ManagedWindow from gui.utils import ProgressMeter import GrampsDisplay diff --git a/src/plugins/tool/RemoveUnused.py b/src/plugins/tool/RemoveUnused.py index 7da623296..b0f3d5a1a 100644 --- a/src/plugins/tool/RemoveUnused.py +++ b/src/plugins/tool/RemoveUnused.py @@ -347,7 +347,7 @@ class RemoveUnused(Tool.Tool, ManagedWindow.ManagedWindow, UpdateCallback): def call_editor(self, the_type, handle): try: obj = self.tables[the_type]['get_func'](handle) - editor_str = 'from Editors import %s as editor' \ + editor_str = 'from gui.editors import %s as editor' \ % self.tables[the_type]['editor'] exec(editor_str) editor(self.dbstate, self.uistate, [], obj) diff --git a/src/plugins/tool/Verify.py b/src/plugins/tool/Verify.py index 872bdd6eb..c4ccdff33 100644 --- a/src/plugins/tool/Verify.py +++ b/src/plugins/tool/Verify.py @@ -54,6 +54,7 @@ import gobject #------------------------------------------------------------------------ import const import gen.lib +from gui.editors import EditPerson, EditFamily import Utils import GrampsDisplay from ManagedWindow import ManagedWindow @@ -605,14 +606,12 @@ class VerifyResults(ManagedWindow): handle = row[VerifyResults.OBJ_HANDLE_COL] if the_type == 'Person': try: - from Editors import EditPerson person = self.dbstate.db.get_person_from_handle(handle) EditPerson(self.dbstate, self.uistate, [], person) except Errors.WindowActiveError: pass elif the_type == 'Family': try: - from Editors import EditFamily family = self.dbstate.db.get_family_from_handle(handle) EditFamily(self.dbstate, self.uistate, [], family) except Errors.WindowActiveError: diff --git a/src/plugins/view/eventview.py b/src/plugins/view/eventview.py index dcdc232b5..5c5e5ef6c 100644 --- a/src/plugins/view/eventview.py +++ b/src/plugins/view/eventview.py @@ -53,7 +53,7 @@ import Errors import Bookmarks import config from DdTargets import DdTargets -from Editors import EditEvent, DelEventQuery +from gui.editors import EditEvent, DeleteEventQuery from Filters.SideBar import EventSidebarFilter from gen.plug import CATEGORY_QR_EVENT @@ -233,8 +233,8 @@ class EventView(ListView): object = self.dbstate.db.get_event_from_handle(handle) - query = DelEventQuery(self.dbstate, self.uistate, object, - person_list, family_list) + query = DeleteEventQuery(self.dbstate, self.uistate, object, + person_list, family_list) is_used = len(person_list) + len(family_list) > 0 return (query, is_used, object) diff --git a/src/plugins/view/familyview.py b/src/plugins/view/familyview.py index e8d628bed..13223413e 100644 --- a/src/plugins/view/familyview.py +++ b/src/plugins/view/familyview.py @@ -46,6 +46,7 @@ import gtk import gen.lib from gui.views.listview import ListView from gui.views.treemodels import FamilyModel +from gui.editors import EditFamily import Bookmarks import Errors import config @@ -191,7 +192,6 @@ class FamilyView(ListView): "no one was selected.")) def add(self, obj): - from Editors import EditFamily family = gen.lib.Family() try: EditFamily(self.dbstate, self.uistate, [], family) @@ -215,7 +215,6 @@ class FamilyView(ListView): def edit(self, obj): for handle in self.selected_handles(): - from Editors import EditFamily family = self.dbstate.db.get_family_from_handle(handle) try: EditFamily(self.dbstate, self.uistate, [], family) diff --git a/src/plugins/view/fanchartview.py b/src/plugins/view/fanchartview.py index 910ffcb6b..ea7a0d514 100644 --- a/src/plugins/view/fanchartview.py +++ b/src/plugins/view/fanchartview.py @@ -43,6 +43,7 @@ try: import cairo except ImportError: pass +from gettext import gettext as _ if gtk.pygtk_version < (2,3,93): raise Exception("PyGtk 2.3.93 or later required") @@ -54,14 +55,12 @@ if gtk.pygtk_version < (2,3,93): #------------------------------------------------------------------------- from gui.views.navigationview import NavigationView from BasicUtils import name_displayer -from gettext import gettext as _ -from gen.plug import Gramplet from Utils import (find_children, find_parents, find_witnessed_people) from libformatting import FormattingHelper import gen.lib import Errors import Bookmarks -from Editors import EditPerson, EditFamily +from gui.editors import EditPerson, EditFamily #------------------------------------------------------------------------- # diff --git a/src/plugins/view/grampletview.py b/src/plugins/view/grampletview.py index 4d958b609..19a2c539c 100644 --- a/src/plugins/view/grampletview.py +++ b/src/plugins/view/grampletview.py @@ -47,6 +47,7 @@ from gettext import gettext as _ import Errors import const from gui.views.pageview import PageView +from gui.editors import EditPerson, EditFamily import ManagedWindow import ConfigParser from gui.utils import add_menuitem @@ -656,7 +657,6 @@ class GuiGramplet(object): if event.button == 1: # left mouse if event.type == gtk.gdk._2BUTTON_PRESS: # double try: - from Editors import EditPerson EditPerson(self.dbstate, self.uistate, [], person) @@ -669,7 +669,6 @@ class GuiGramplet(object): elif event.button == 3: # right mouse #FIXME: add a popup menu with options try: - from Editors import EditPerson EditPerson(self.dbstate, self.uistate, [], person) @@ -714,7 +713,6 @@ class GuiGramplet(object): if event.button == 1: # left mouse if event.type == gtk.gdk._2BUTTON_PRESS: # double try: - from Editors import EditFamily EditFamily(self.dbstate, self.uistate, [], family) @@ -724,7 +722,6 @@ class GuiGramplet(object): elif event.button == 3: # right mouse #FIXME: add a popup menu with options try: - from Editors import EditFamily EditFamily(self.dbstate, self.uistate, [], family) diff --git a/src/plugins/view/mediaview.py b/src/plugins/view/mediaview.py index b1e21cc4e..2433132c9 100644 --- a/src/plugins/view/mediaview.py +++ b/src/plugins/view/mediaview.py @@ -56,7 +56,7 @@ import Utils import Bookmarks import Mime import gen.lib -from Editors import EditMedia, DeleteMediaQuery +from gui.editors import EditMedia, DeleteMediaQuery import Errors from Filters.SideBar import MediaSidebarFilter from DdTargets import DdTargets diff --git a/src/plugins/view/noteview.py b/src/plugins/view/noteview.py index f12ae69a9..0f00ad81a 100644 --- a/src/plugins/view/noteview.py +++ b/src/plugins/view/noteview.py @@ -54,7 +54,7 @@ import ColumnOrder from gen.lib import Note from DdTargets import DdTargets from Filters.SideBar import NoteSidebarFilter -from Editors import EditNote, DeleteNoteQuery +from gui.editors import EditNote, DeleteNoteQuery #------------------------------------------------------------------------- # diff --git a/src/plugins/view/pedigreeview.py b/src/plugins/view/pedigreeview.py index 5803779e0..419f5e32f 100644 --- a/src/plugins/view/pedigreeview.py +++ b/src/plugins/view/pedigreeview.py @@ -61,7 +61,7 @@ import DateHandler import ThumbNails import Errors from ReportBase import ReportUtils -from Editors import EditPerson, EditFamily +from gui.editors import EditPerson, EditFamily from DdTargets import DdTargets import cPickle as pickle import config diff --git a/src/plugins/view/pedigreeviewext.py b/src/plugins/view/pedigreeviewext.py index 56bf73245..966a087a6 100644 --- a/src/plugins/view/pedigreeviewext.py +++ b/src/plugins/view/pedigreeviewext.py @@ -58,11 +58,9 @@ from BasicUtils import name_displayer from Utils import (media_path_full, probably_alive, find_children, find_parents, find_witnessed_people) from libformatting import FormattingHelper -import DateHandler import ThumbNails import Errors -from ReportBase import ReportUtils -from Editors import EditPerson, EditFamily +from gui.editors import EditPerson, EditFamily from DdTargets import DdTargets import cPickle as pickle import config diff --git a/src/plugins/view/personview.py b/src/plugins/view/personview.py index 4ca3eb576..cbec99aa1 100644 --- a/src/plugins/view/personview.py +++ b/src/plugins/view/personview.py @@ -56,7 +56,7 @@ import Errors import Bookmarks import config from DdTargets import DdTargets -from Editors import EditPerson +from gui.editors import EditPerson from Filters.SideBar import PersonSidebarFilter from gen.plug import CATEGORY_QR_PERSON diff --git a/src/plugins/view/placetreeview.py b/src/plugins/view/placetreeview.py index 2aca19179..3a8fc32a8 100644 --- a/src/plugins/view/placetreeview.py +++ b/src/plugins/view/placetreeview.py @@ -32,7 +32,7 @@ from gui.views.placebaseview import PlaceBaseView from gui.views.treemodels import PlaceTreeModel import gen.lib import Errors -from Editors import EditPlace +from gui.editors import EditPlace #------------------------------------------------------------------------- # diff --git a/src/plugins/view/relview.py b/src/plugins/view/relview.py index 2c13af993..4b4dfa41a 100644 --- a/src/plugins/view/relview.py +++ b/src/plugins/view/relview.py @@ -47,6 +47,7 @@ import pango #------------------------------------------------------------------------- import gen.lib import gui.views.pageview as PageView +from gui.editors import EditPerson, EditFamily from gui.views.navigationview import NavigationView from BasicUtils import name_displayer from Utils import media_path_full, probably_alive @@ -1206,7 +1207,6 @@ class RelationshipView(NavigationView): return item def edit_menu(self, obj, handle): - from Editors import EditPerson person = self.dbstate.db.get_person_from_handle(handle) try: EditPerson(self.dbstate, self.uistate, [], person) @@ -1394,7 +1394,6 @@ class RelationshipView(NavigationView): self.edit_person(obj, handle) def edit_person(self, obj, handle): - from Editors import EditPerson person = self.dbstate.db.get_person_from_handle(handle) try: EditPerson(self.dbstate, self.uistate, [], person) @@ -1403,7 +1402,6 @@ class RelationshipView(NavigationView): def edit_family(self, obj, event, handle): if button_activated(event, _LEFT_BUTTON): - from Editors import EditFamily family = self.dbstate.db.get_family_from_handle(handle) try: EditFamily(self.dbstate, self.uistate, [], family) @@ -1412,7 +1410,6 @@ class RelationshipView(NavigationView): def add_family(self, obj, event, handle): if button_activated(event, _LEFT_BUTTON): - from Editors import EditFamily family = gen.lib.Family() person = self.dbstate.active if not person: @@ -1429,7 +1426,6 @@ class RelationshipView(NavigationView): pass def add_spouse(self, obj): - from Editors import EditFamily family = gen.lib.Family() person = self.dbstate.active @@ -1453,7 +1449,6 @@ class RelationshipView(NavigationView): def add_child_to_fam(self, obj, event, handle): if button_activated(event, _LEFT_BUTTON): callback = lambda x: self.callback_add_child(x, handle) - from Editors import EditPerson person = gen.lib.Person() family = self.dbstate.db.get_family_from_handle(handle) father = self.dbstate.db.get_person_from_handle( @@ -1539,7 +1534,6 @@ class RelationshipView(NavigationView): child) def add_parents(self, obj): - from Editors import EditFamily family = gen.lib.Family() person = self.dbstate.active @@ -1557,7 +1551,6 @@ class RelationshipView(NavigationView): def add_parent_family(self, obj, event, handle): if button_activated(event, _LEFT_BUTTON): - from Editors import EditFamily family = gen.lib.Family() person = self.dbstate.active diff --git a/src/plugins/view/repoview.py b/src/plugins/view/repoview.py index b99c5eb6e..7e00c60a5 100644 --- a/src/plugins/view/repoview.py +++ b/src/plugins/view/repoview.py @@ -39,11 +39,10 @@ import gtk import gen.lib from gui.views.listview import ListView from gui.views.treemodels import RepositoryModel -import Utils import Bookmarks import Errors import config -from Editors import EditRepository, DelRepositoryQuery +from gui.editors import EditRepository, DeleteRepositoryQuery from DdTargets import DdTargets from Filters.SideBar import RepoSidebarFilter from gen.plug import CATEGORY_QR_REPOSITORY @@ -199,8 +198,8 @@ class RepositoryView(ListView): item[1] for item in self.dbstate.db.find_backlink_handles(handle, ['Source'])] object = self.dbstate.db.get_repository_from_handle(handle) - query = DelRepositoryQuery(self.dbstate, self.uistate, object, - source_list) + query = DeleteRepositoryQuery(self.dbstate, self.uistate, object, + source_list) is_used = len(source_list) > 0 return (query, is_used, object) diff --git a/src/plugins/view/sourceview.py b/src/plugins/view/sourceview.py index 12d2eac82..402d79978 100644 --- a/src/plugins/view/sourceview.py +++ b/src/plugins/view/sourceview.py @@ -45,7 +45,7 @@ import Bookmarks import Errors from DdTargets import DdTargets from QuestionDialog import ErrorDialog -from Editors import EditSource, DelSrcQuery +from gui.editors import EditSource, DeleteSrcQuery from Filters.SideBar import SourceSidebarFilter #------------------------------------------------------------------------- @@ -186,7 +186,7 @@ class SourceView(ListView): def remove_object_from_handle(self, handle): the_lists = Utils.get_source_referents(handle, self.dbstate.db) object = self.dbstate.db.get_source_from_handle(handle) - query = DelSrcQuery(self.dbstate, self.uistate, object, the_lists) + query = DeleteSrcQuery(self.dbstate, self.uistate, object, the_lists) is_used = any(the_lists) return (query, is_used, object)