move src/Editors/* to src/gui/editors as part of GEP008

svn: r13807
This commit is contained in:
Brian Matherly 2009-12-15 05:56:12 +00:00
parent baa13df670
commit bbe2b6da0c
71 changed files with 194 additions and 280 deletions

View File

@ -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:

View File

@ -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):

View File

@ -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:

View File

@ -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

View File

@ -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):

View File

@ -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):

View File

@ -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:

View File

@ -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):

View File

@ -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:

View File

@ -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)

View File

@ -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] )

View File

@ -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

View File

@ -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(

View File

@ -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)

View File

@ -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:

View File

@ -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:

View File

@ -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));

View File

@ -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 *

View File

@ -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

View File

@ -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))

View File

@ -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:

View File

@ -4,6 +4,7 @@
# If not using GNU make, then list all .py files individually
SUBDIRS = \
editors \
selectors \
views \
widgets

View File

@ -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" ]

View File

@ -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));

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
#-------------------------------------------------------------------------
#

View File

@ -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')

View File

@ -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)

View File

@ -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 _

View File

@ -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

View File

@ -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
#-------------------------------------------------------------------------
#

View File

@ -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,

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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
#-------------------------------------------------------------------------

View File

@ -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

View File

@ -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

View File

@ -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
#-------------------------------------------------------------------------
#

View File

@ -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

View File

@ -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

View File

@ -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
#-------------------------------------------------------------------------

View File

@ -37,4 +37,4 @@ from toolcomboentry import *
from validatedcomboentry import *
from validatedmaskedentry import *
from valueaction import *
from valuetoolitem import *
from valuetoolitem import *

View File

@ -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
#-------------------------------------------------------------------------
#

View File

@ -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, [],

View File

@ -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:

View File

@ -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

View File

@ -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)

View File

@ -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:

View File

@ -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)

View File

@ -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)

View File

@ -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
#-------------------------------------------------------------------------
#

View File

@ -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)

View File

@ -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

View File

@ -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
#-------------------------------------------------------------------------
#

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
#-------------------------------------------------------------------------
#

View File

@ -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

View File

@ -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)

View File

@ -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)