4340: Error when adding source reference

svn: r16110
This commit is contained in:
Benny Malengier 2010-11-02 13:19:13 +00:00
parent e6f6d5d00c
commit ea9df739a4
2 changed files with 36 additions and 0 deletions

View File

@ -178,6 +178,7 @@ class EditPrimary(ManagedWindow.ManagedWindow, DbGUIElement):
def _do_close(self, *obj): def _do_close(self, *obj):
self._cleanup_db_connects() self._cleanup_db_connects()
self.dbstate.disconnect(self.dbstate_connect_key) self.dbstate.disconnect(self.dbstate_connect_key)
self._cleanup_connects()
self._cleanup_on_exit() self._cleanup_on_exit()
self.get_from_handle = None self.get_from_handle = None
self.get_from_gramps_id = None self.get_from_gramps_id = None
@ -199,6 +200,23 @@ class EditPrimary(ManagedWindow.ManagedWindow, DbGUIElement):
if hasattr(tab, 'callman'): if hasattr(tab, 'callman'):
tab._cleanup_callbacks() tab._cleanup_callbacks()
def _cleanup_connects(self):
"""
Connects to interface elements to things outside the element should be
removed before destroying the interface
"""
self._cleanup_local_connects()
for tab in [tab for tab in self.__tabs if hasattr(tab, '_cleanup_local_connects')]:
tab._cleanup_local_connects()
def _cleanup_local_connects(self):
"""
Connects to interface elements to things outside the element should be
removed before destroying the interface. This methods cleans connects
of the main interface, not of the displaytabs.
"""
pass
def check_for_close(self, handles): def check_for_close(self, handles):
""" """
Callback method for delete signals. Callback method for delete signals.

View File

@ -134,6 +134,7 @@ class EditSecondary(ManagedWindow.ManagedWindow, DbGUIElement):
def close(self,*obj): def close(self,*obj):
self._cleanup_db_connects() self._cleanup_db_connects()
self._cleanup_connects()
ManagedWindow.ManagedWindow.close(self) ManagedWindow.ManagedWindow.close(self)
self._cleanup_on_exit() self._cleanup_on_exit()
@ -148,3 +149,20 @@ class EditSecondary(ManagedWindow.ManagedWindow, DbGUIElement):
self._cleanup_callbacks() self._cleanup_callbacks()
for tab in [tab for tab in self.__tabs if hasattr(tab, 'callman')]: for tab in [tab for tab in self.__tabs if hasattr(tab, 'callman')]:
tab._cleanup_callbacks() tab._cleanup_callbacks()
def _cleanup_connects(self):
"""
Connects to interface elements to things outside the element should be
removed before destroying the interface
"""
self._cleanup_local_connects()
for tab in [tab for tab in self.__tabs if hasattr(tab, '_cleanup_local_connects')]:
tab._cleanup_local_connects()
def _cleanup_local_connects(self):
"""
Connects to interface elements to things outside the element should be
removed before destroying the interface. This methods cleans connects
of the main interface, not of the displaytabs.
"""
pass