From d6205d09d1d1fdc5f6dd2f69129481cf2992074c Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Tue, 2 Feb 2010 09:02:31 +0000 Subject: [PATCH] fix bug: close not disconnected on dbchange svn: r14190 --- src/gui/editors/editprimary.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/editors/editprimary.py b/src/gui/editors/editprimary.py index 980eaf943..b6ca9a764 100644 --- a/src/gui/editors/editprimary.py +++ b/src/gui/editors/editprimary.py @@ -85,7 +85,8 @@ class EditPrimary(ManagedWindow.ManagedWindow, DbGUIElement): self._connect_signals() #if the database is changed, all info shown is invalid and the window # should close - self.dbstate.connect('database-changed', self._do_close) + self.dbstate_connect_key = self.dbstate.connect('database-changed', + self._do_close) self.show() self._post_init() @@ -170,6 +171,7 @@ class EditPrimary(ManagedWindow.ManagedWindow, DbGUIElement): def _do_close(self, *obj): self._cleanup_db_connects() + self.dbstate.disconnect(self.dbstate_connect_key) self._cleanup_on_exit() ManagedWindow.ManagedWindow.close(self) @@ -218,7 +220,6 @@ class EditPrimary(ManagedWindow.ManagedWindow, DbGUIElement): return gen.lib.PrimaryObject def data_has_changed(self): - if self.db.readonly: return False elif self.obj.handle: