From 9172f95988856e2404bec6c521335a5cb11ce3a6 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Sun, 30 Jul 2006 03:24:16 +0000 Subject: [PATCH] 2006-07-29 Alex Roitman * src/ManagedWindow.py (ManagedWindow.show): Set opened flag; (ManagedWindow.close): Unser opened flag. * src/ViewManager.py (undo_history_close): Only close undo history window if it is open. * src/UndoHistory.py: (UndoHistory.__init__): Remove signal handling; (UndoHistory.close): Remove method, use one from the parent class. svn: r7089 --- gramps2/ChangeLog | 8 ++++++++ gramps2/src/ManagedWindow.py | 2 ++ gramps2/src/UndoHistory.py | 5 ----- gramps2/src/ViewManager.py | 3 ++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 312aef2b8..7f094b17d 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,11 @@ +2006-07-29 Alex Roitman + * src/ManagedWindow.py (ManagedWindow.show): Set opened flag; + (ManagedWindow.close): Unser opened flag. + * src/ViewManager.py (undo_history_close): Only close undo history + window if it is open. + * src/UndoHistory.py: (UndoHistory.__init__): Remove signal handling; + (UndoHistory.close): Remove method, use one from the parent class. + 2006-07-29 Zsolt Foldvari * src/NameDisplay.py (display_given): Cleanup * src/Gramps.Cfg.py (NameFormatEditDlg.run): Verification of the diff --git a/gramps2/src/ManagedWindow.py b/gramps2/src/ManagedWindow.py index 9f945073a..e7fee7e62 100644 --- a/gramps2/src/ManagedWindow.py +++ b/gramps2/src/ManagedWindow.py @@ -365,6 +365,7 @@ class ManagedWindow: def show(self): assert self.window, "ManagedWindow: self.window does not exist!" self.window.set_transient_for(self.parent_window) + self.opened = True self.window.show() def close(self,*obj): @@ -374,6 +375,7 @@ class ManagedWindow: Takes care of closing children and removing itself from menu. """ self.uistate.gwm.close_track(self.track) + self.opened = False def present(self): """ diff --git a/gramps2/src/UndoHistory.py b/gramps2/src/UndoHistory.py index 8ac6cc4d2..a04040ce8 100644 --- a/gramps2/src/UndoHistory.py +++ b/gramps2/src/UndoHistory.py @@ -103,14 +103,9 @@ class UndoHistory(ManagedWindow.ManagedWindow): self._build_model() self._update_ui() - self.db_change_key = dbstate.connect('database-changed',self.close) self.selection.connect('changed',self._selection_changed) self.show() - def close(self,obj=None): - self.dbstate.disconnect(self.db_change_key) - self.window.destroy() - def _selection_changed(self,obj): (model,node) = self.selection.get_selected() if not node: diff --git a/gramps2/src/ViewManager.py b/gramps2/src/ViewManager.py index 2b5976609..39538d85e 100644 --- a/gramps2/src/ViewManager.py +++ b/gramps2/src/ViewManager.py @@ -835,7 +835,8 @@ class ViewManager: def undo_history_close(self): try: # Try closing undo history window if it exists - self.undo_history_window.close() + if self.undo_history_window.opened: + self.undo_history_window.close() except AttributeError: # Let it go: history window does not exist pass