From e674fed647cc468f7fd4a362500acfbc08d78ed0 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Sun, 8 Oct 2006 06:19:07 +0000 Subject: [PATCH] * src/Editors/_EditSourceRef.py (_cleanup_on_exit): Factor out cleanup into its own method (as in the parent class). FIXME: This needs to be fixed so that _cleanup_on_exit is not run on OK, only on cancel. Maybe we need _clean_up_on_cancel() ? * src/DisplayTabs/_TextTab.py (cancel): Only reset text, not the whole source reference. svn: r7370 --- gramps2/ChangeLog | 6 ++++++ gramps2/src/DisplayTabs/_TextTab.py | 4 ++-- gramps2/src/Editors/_EditSourceRef.py | 8 ++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index b450bebbd..8297b405a 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,10 @@ 2006-10-07 Alex Roitman + * src/Editors/_EditSourceRef.py (_cleanup_on_exit): Factor out + cleanup into its own method (as in the parent class). + FIXME: This needs to be fixed so that _cleanup_on_exit is not + run on OK, only on cancel. Maybe we need _clean_up_on_cancel() ? + * src/DisplayTabs/_TextTab.py (cancel): Only reset text, not the + whole source reference. * src/plugins/BookReport.py (BookList.parse): Catch ValueError exception (coming from urllib2). * src/LdsUtils.py (temples): Correct code for San Antonio. diff --git a/gramps2/src/DisplayTabs/_TextTab.py b/gramps2/src/DisplayTabs/_TextTab.py index 9b3731707..8611dd718 100644 --- a/gramps2/src/DisplayTabs/_TextTab.py +++ b/gramps2/src/DisplayTabs/_TextTab.py @@ -51,7 +51,7 @@ class TextTab(GrampsTab): def __init__(self, dbstate, uistate, track, obj, title=_('Text')): self.obj = obj - self.original = obj.serialize() + self.original = self.obj.get_text() GrampsTab.__init__(self, dbstate, uistate, track, title) self.show_all() @@ -109,4 +109,4 @@ class TextTab(GrampsTab): self._set_label() def cancel(self): - self.obj.unserialize(self.original) + self.obj.set_text(self.original) diff --git a/gramps2/src/Editors/_EditSourceRef.py b/gramps2/src/Editors/_EditSourceRef.py index 3fd33214e..8fd80b53b 100644 --- a/gramps2/src/Editors/_EditSourceRef.py +++ b/gramps2/src/Editors/_EditSourceRef.py @@ -73,11 +73,15 @@ class EditSourceRef(EditReference): self.define_ok_button(self.top.get_widget('ok'),self.ok_clicked) self.define_cancel_button(self.top.get_widget('cancel')) - def close(self, *obj): + def _cleanup_on_exit(self): + # FIXME: the second call was causing the problem, as it was + # re-setting the whole sref to its original state. + # that problem is fixed, but _cleanup_on_exit SHOULD NOT be run + # in close(), because close() is called on OK. + # Until this is fixed, notes, text and comments are not saved!!! self.note_tab.cancel() self.text_tab.cancel() self.comment_tab.cancel() - EditReference.close(self,obj) def _setup_fields(self): self.ref_privacy = PrivacyButton(