From 93ea5ab2693a2890aaa43e6fbd89b411364e091f Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Mon, 9 Oct 2006 02:45:05 +0000 Subject: [PATCH] 2006-10-08 Don Allingham * src/Editors/_EditReference.py: call cancel_and_close on window cancel * src/DisplayTabs/_SourceRefModel.py: remove debug * src/DisplayTabs/_EmbeddedList.py: remove debug svn: r7372 --- gramps2/ChangeLog | 6 ++++++ gramps2/src/DisplayTabs/_EmbeddedList.py | 1 - gramps2/src/DisplayTabs/_SourceRefModel.py | 1 - gramps2/src/Editors/_EditReference.py | 11 +++++++---- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 73cca81d3..2ee6a2af9 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,9 @@ +2006-10-08 Don Allingham + * src/Editors/_EditReference.py: call cancel_and_close on window + cancel + * src/DisplayTabs/_SourceRefModel.py: remove debug + * src/DisplayTabs/_EmbeddedList.py: remove debug + 2006-10-08 Alex Roitman * src/RelLib/_Location.py (set_county, get_county): Move into LocationBase class. diff --git a/gramps2/src/DisplayTabs/_EmbeddedList.py b/gramps2/src/DisplayTabs/_EmbeddedList.py index ed62f33dc..4ac9be545 100644 --- a/gramps2/src/DisplayTabs/_EmbeddedList.py +++ b/gramps2/src/DisplayTabs/_EmbeddedList.py @@ -278,7 +278,6 @@ class EmbeddedList(ButtonTab): (model, node) = self.selection.get_selected() if node: obj = self.model.get_value(node, self._HANDLE_COL) - print "Select", obj, obj.ref, obj.get_reference_handle() return model.get_value(node, self._HANDLE_COL) return None diff --git a/gramps2/src/DisplayTabs/_SourceRefModel.py b/gramps2/src/DisplayTabs/_SourceRefModel.py index f61798761..1360d7e5f 100644 --- a/gramps2/src/DisplayTabs/_SourceRefModel.py +++ b/gramps2/src/DisplayTabs/_SourceRefModel.py @@ -46,6 +46,5 @@ class SourceRefModel(gtk.ListStore): self.db = db for sref in sref_list: src = self.db.get_source_from_handle(sref.get_reference_handle()) - print "Model", sref, sref.ref, sref.get_reference_handle() self.append(row=[src.gramps_id, src.title, src.author, sref.page, sref, ]) diff --git a/gramps2/src/Editors/_EditReference.py b/gramps2/src/Editors/_EditReference.py index 6e9c03d0b..cda9f6692 100644 --- a/gramps2/src/Editors/_EditReference.py +++ b/gramps2/src/Editors/_EditReference.py @@ -98,12 +98,16 @@ class EditReference(ManagedWindow.ManagedWindow): else: return id(self) - def define_ok_button(self,button,function): + def define_ok_button(self, button, function): button.connect('clicked',function) button.set_sensitive(not self.db.readonly) - def define_cancel_button(self,button): - button.connect('clicked',self.close) + def define_cancel_button(self, button): + button.connect('clicked',self.close_and_cancel) + + def close_and_cancel(self, obj): + self._cleanup_on_exit() + self.close(obj) def define_help_button(self,button,tag): import GrampsDisplay @@ -115,5 +119,4 @@ class EditReference(ManagedWindow.ManagedWindow): def close(self,*obj): for key in self.signal_keys: self.db.disconnect(key) - self._cleanup_on_exit() ManagedWindow.ManagedWindow.close(self)