fix bug: close not disconnected on dbchange
svn: r14190
This commit is contained in:
parent
1fbca887cf
commit
d6205d09d1
@ -85,7 +85,8 @@ class EditPrimary(ManagedWindow.ManagedWindow, DbGUIElement):
|
|||||||
self._connect_signals()
|
self._connect_signals()
|
||||||
#if the database is changed, all info shown is invalid and the window
|
#if the database is changed, all info shown is invalid and the window
|
||||||
# should close
|
# 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.show()
|
||||||
self._post_init()
|
self._post_init()
|
||||||
|
|
||||||
@ -170,6 +171,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._cleanup_on_exit()
|
self._cleanup_on_exit()
|
||||||
ManagedWindow.ManagedWindow.close(self)
|
ManagedWindow.ManagedWindow.close(self)
|
||||||
|
|
||||||
@ -218,7 +220,6 @@ class EditPrimary(ManagedWindow.ManagedWindow, DbGUIElement):
|
|||||||
return gen.lib.PrimaryObject
|
return gen.lib.PrimaryObject
|
||||||
|
|
||||||
def data_has_changed(self):
|
def data_has_changed(self):
|
||||||
|
|
||||||
if self.db.readonly:
|
if self.db.readonly:
|
||||||
return False
|
return False
|
||||||
elif self.obj.handle:
|
elif self.obj.handle:
|
||||||
|
Loading…
Reference in New Issue
Block a user