In .:
2006-07-31 Alex Roitman <shura@gramps-project.org> * src/Filters/_SearchBar.py (SearchBar.__init__): Take dbstate as a constructor argument; (SearchBar.apply_filter): pass dbstate. * src/PageView.py (BookMarkView.add_bookmark, PersonNavView.jumpto, PersonNavView.fwd_clicked, PersonNavView.back_clicked, ListView.build_widget): Pass dbstate. * src/Navigation.py (BaseNavigation.__init__, PersonNavigation.__init__): Take dbstate as a constructor argument; (PersonNavigation.build_item_name): properly access dbstate. * src/DisplayState.py (__init__): Do not take dbstate as a constructor argument; Do not connect dbstate signal here (moved to ViewManager); (display_relationship,push_message,modify_statusbar): Make dbstate an argument. * src/plugins/Checkpoint.py (run_tool): Pass dbstate. * src/ViewManager.py (_build_main_window): Do not pass dbstate to uistate DisplayState constructor; connect dbstate signal handler; pass dbstate to Navigation; (keypress): Pass dbstate; (statusbar_key_update): Pass dbstate; (do_load_plugins): Pass dbstate; (ViewManager.add_bookmark): Pass dbstate. * src/DataViews/_RelationView.py (shade_update): Pass dbstate. * src/DataViews/_PersonView.py (build_widget,_goto, key_goto_home_person, key_edit_selected_person): Pass dbstate. * src/Filters/Makefile.am (pkgdata_PYTHON): Remove obsolete file. * src/Filters/__init__.py: Remove importing obsolete module. * src/Filters/_FilterWidget.py: Remove obsolete module. In po: 2006-07-31 Alex Roitman <shura@gramps-project.org> * POTFILES.in: Remove obsolete file. svn: r7104
This commit is contained in:
@ -75,9 +75,10 @@ class BaseNavigation:
|
||||
self.func - array of functions to take action based off of.
|
||||
|
||||
"""
|
||||
def __init__(self, uistate, history, title):
|
||||
def __init__(self, dbstate, uistate, history, title):
|
||||
self.title = title
|
||||
self.ui = "".join(_top) + "".join(_btm)
|
||||
self.dbstate = dbstate
|
||||
self.uistate = uistate
|
||||
self.action_group = gtk.ActionGroup(self.title)
|
||||
self.active = DISABLED
|
||||
@ -148,14 +149,15 @@ class PersonNavigation(BaseNavigation):
|
||||
"""
|
||||
Builds a navigation item for the Person class.
|
||||
"""
|
||||
def __init__(self, uistate):
|
||||
def __init__(self, dbstate, uistate):
|
||||
"""
|
||||
Associates the functions with the associated items. Builds the function
|
||||
array so that there are unique functions for each possible index (0-9)
|
||||
The callback simply calls change_active_handle
|
||||
"""
|
||||
BaseNavigation.__init__(self, uistate, uistate.phistory, 'PersonHistory')
|
||||
fcn_ptr = self.uistate.dbstate.change_active_handle
|
||||
BaseNavigation.__init__(self, dbstate, uistate,
|
||||
uistate.phistory, 'PersonHistory')
|
||||
fcn_ptr = self.dbstate.change_active_handle
|
||||
|
||||
self.func = [ generate(fcn_ptr, self.items, index) \
|
||||
for index in range(0, 10) ]
|
||||
@ -164,7 +166,7 @@ class PersonNavigation(BaseNavigation):
|
||||
"""
|
||||
Builds a name in the format of 'NAME [GRAMPSID]'
|
||||
"""
|
||||
person = self.uistate.dbstate.db.get_person_from_handle(item)
|
||||
person = self.dbstate.db.get_person_from_handle(item)
|
||||
return "%s [%s]" % (NameDisplay.displayer.display(person),
|
||||
person.gramps_id)
|
||||
|
||||
|
Reference in New Issue
Block a user