diff --git a/ChangeLog b/ChangeLog index 59180a4fc..d867e6f4e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-08-04 Zsolt Foldvari + * src/DataViews/_PersonView.py (__init__): connection to "active- + person-changed" signal moved to set_active() + (set_active, set_inactive): Reconnect to/disconnect from dbstate's + "active-person-changed" signal. + * src/DataViews/_RelationView.py (__init__): connection to "active- + person-changed" signal moved to set_active() + (set_active, set_inactive): Reconnect to/disconnect from dbstate's + "active-person-changed" signal. + 2006-08-03 Alex Roitman * src/Filters/_GenericFilter.py (GenericFilterFactory): Add factory function. diff --git a/src/DataViews/_PersonView.py b/src/DataViews/_PersonView.py index 31e1af417..495c60cb5 100644 --- a/src/DataViews/_PersonView.py +++ b/src/DataViews/_PersonView.py @@ -85,7 +85,7 @@ class PersonView(PageView.PersonNavView): self.inactive = False dbstate.connect('database-changed',self.change_db) - dbstate.connect('active-changed',self.goto_active_person) + #dbstate.connect('active-changed',self.goto_active_person) self.handle_col = PeopleModel.COLUMN_INT_ID self.model = None self.generic_filter = None @@ -101,7 +101,17 @@ class PersonView(PageView.PersonNavView): def change_page(self): pass - + + def set_active(self): + PageView.PersonNavView.set_active(self) + self.key_active_changed = self.dbstate.connect('active-changed', + self.goto_active_person) + self.goto_active_person() + + def set_inactive(self): + PageView.PersonNavView.set_inactive(self) + self.dbstate.disconnect(self.key_active_changed) + def define_actions(self): """ Required define_actions function for PageView. Builds the action diff --git a/src/DataViews/_RelationView.py b/src/DataViews/_RelationView.py index 282706eb0..8a7c4a7ac 100644 --- a/src/DataViews/_RelationView.py +++ b/src/DataViews/_RelationView.py @@ -90,7 +90,7 @@ class RelationshipView(PageView.PersonNavView): self, _('Relationships'), dbstate, uistate) dbstate.connect('database-changed', self.change_db) - dbstate.connect('active-changed', self.redraw) + #dbstate.connect('active-changed', self.redraw) self.show_siblings = Config.get(Config.FAMILY_SIBLINGS) self.show_details = Config.get(Config.FAMILY_DETAILS) self.connect_to_db(dbstate.db) @@ -102,6 +102,16 @@ class RelationshipView(PageView.PersonNavView): Config.client.notify_add("/apps/gramps/preferences/relation-shade", self.shade_update) + def set_active(self): + PageView.PersonNavView.set_active(self) + self.key_active_changed = self.dbstate.connect('active-changed', + self.redraw) + self.build_tree() + + def set_inactive(self): + PageView.PersonNavView.set_inactive(self) + self.dbstate.disconnect(self.key_active_changed) + def shade_update(self, client, cnxn_id, entry, data): self.use_shade = Config.get(Config.RELATION_SHADE) self.uistate.modify_statusbar(self.dbstate)