From 61341b8bdd589a01432e18da975eacedc98571a7 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 21 Aug 2007 03:21:41 +0000 Subject: [PATCH] 2007-08-20 Don Allingham * src/ScratchPad.py (ScratchPadSourceRef.__init__): handle the removal of the get_text() function svn: r8844 --- ChangeLog | 4 ++++ src/ScratchPad.py | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8eb4a7387..4c75a6c04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-08-20 Don Allingham + * src/ScratchPad.py (ScratchPadSourceRef.__init__): handle the removal + of the get_text() function + 2007-08-20 Benny Malengier * src/ExportAssistant.py: new export manager-feature parity diff --git a/src/ScratchPad.py b/src/ScratchPad.py index 7601d0b91..06c2bdba9 100644 --- a/src/ScratchPad.py +++ b/src/ScratchPad.py @@ -45,6 +45,7 @@ from gtk.gdk import ACTION_COPY, BUTTON1_MASK # #------------------------------------------------------------------------- import const +import RelLib import TreeTips import DateHandler import GrampsDisplay @@ -455,7 +456,16 @@ class ScratchPadSourceRef(ScratchPadGrampsTypeWrapper): base = self._db.get_source_from_handle(self._obj.get_reference_handle()) self._title = base.get_title() - self._value = self._obj.get_text() + + notelist = [ self._db.get_note_from_handle(hndl) + for hndl in self._obj.get_note_list() ] + srctxtlist = [ note for note in notelist + if note.get_type() == RelLib.NoteType.SOURCE_TEXT] + + if len(srctxtlist) > 0: + self._value = srctxtlist[0].get_text() + else: + self._value = u"" def tooltip(self): global escape