From 37255a3b02698e816288539409af54266eafdfea Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Mon, 30 Apr 2007 20:50:41 +0000 Subject: [PATCH] 2007-04-30 Benny Malengier * src/Editors/_EditPlace.py: * src/Editors/_EditSource.py: * src/Editors/_EditNote.py: * src/Editors/_EditPerson.py: * src/Editors/_EditRepository.py: * src/Editors/_EditFamily.py: * src/DisplayTabs/_NoteTab.py: Add meaningfull title to the note dialog instead of only the note number, when called from place, source, person, family or repo svn: r8432 --- ChangeLog | 10 ++++++++++ src/DisplayTabs/_NoteTab.py | 8 +++++--- src/Editors/_EditFamily.py | 2 +- src/Editors/_EditNote.py | 7 ++++++- src/Editors/_EditPerson.py | 2 +- src/Editors/_EditPlace.py | 2 +- src/Editors/_EditRepository.py | 2 +- src/Editors/_EditSource.py | 2 +- 8 files changed, 26 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e37038fd..09a960acb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-04-30 Benny Malengier + * src/Editors/_EditPlace.py: + * src/Editors/_EditSource.py: + * src/Editors/_EditNote.py: + * src/Editors/_EditPerson.py: + * src/Editors/_EditRepository.py: + * src/Editors/_EditFamily.py: + * src/DisplayTabs/_NoteTab.py: + Add meaningfull title to the note dialog instead of only the note number, when called from place, source, person, family or repo + 2007-04-29 Brian Matherly * src/ReportBase/_Report.py: * src/BaseDoc.py: diff --git a/src/DisplayTabs/_NoteTab.py b/src/DisplayTabs/_NoteTab.py index b13c863e4..edac3e3f5 100644 --- a/src/DisplayTabs/_NoteTab.py +++ b/src/DisplayTabs/_NoteTab.py @@ -71,8 +71,9 @@ class NoteTab(EmbeddedList): (_('Preview'), 1, 200), ] - def __init__(self, dbstate, uistate, track, data): + def __init__(self, dbstate, uistate, track, data, callertitle=None): self.data = data + self.callertitle = callertitle EmbeddedList.__init__(self, dbstate, uistate, track, _("Notes"), NoteModel, move=True) @@ -103,7 +104,8 @@ class NoteTab(EmbeddedList): def add_button_clicked(self, obj): note = RelLib.Note() try: - EditNote(self.dbstate, self.uistate, [], note, self.add_callback) + EditNote(self.dbstate, self.uistate, [], note, self.add_callback, + self.callertitle) except Errors.WindowActiveError: pass @@ -118,7 +120,7 @@ class NoteTab(EmbeddedList): note = self.dbstate.db.get_note_from_handle(handle) try: EditNote(self.dbstate, self.uistate, [], note, - self.edit_callback) + self.edit_callback, self.callertitle ) except Errors.WindowActiveError: pass diff --git a/src/Editors/_EditFamily.py b/src/Editors/_EditFamily.py index 3bf51389e..042a411b4 100644 --- a/src/Editors/_EditFamily.py +++ b/src/Editors/_EditFamily.py @@ -570,7 +570,7 @@ class EditFamily(EditPrimary): self.note_tab = self._add_tab( notebook, NoteTab(self.dbstate, self.uistate, self.track, - self.obj.get_note_list())) + self.obj.get_note_list(), self.get_menu_title())) self.gallery_tab = self._add_tab( notebook, diff --git a/src/Editors/_EditNote.py b/src/Editors/_EditNote.py index f755f4897..c093706b2 100644 --- a/src/Editors/_EditNote.py +++ b/src/Editors/_EditNote.py @@ -54,8 +54,10 @@ from RelLib import Note #------------------------------------------------------------------------- class EditNote(EditPrimary): - def __init__(self, state, uistate, track, note, callback=None): + def __init__(self, state, uistate, track, note, callback=None + , callertitle = None): """Create an EditNote window. Associate a note with the window.""" + self.callertitle = callertitle EditPrimary.__init__(self, state, uistate, track, note, state.db.get_note_from_handle, callback) @@ -72,6 +74,9 @@ class EditNote(EditPrimary): title = _('Note') + ': %s' % self.obj.get_gramps_id() else: title = _('New Note') + if self.callertitle : + title += ' - ' + self.callertitle + return title def _local_init(self): diff --git a/src/Editors/_EditPerson.py b/src/Editors/_EditPerson.py index 2d9ef98ae..864e4de24 100644 --- a/src/Editors/_EditPerson.py +++ b/src/Editors/_EditPerson.py @@ -308,7 +308,7 @@ class EditPerson(EditPrimary): self.note_tab = self._add_tab( notebook, NoteTab(self.dbstate, self.uistate, self.track, - self.obj.get_note_list())) + self.obj.get_note_list(), self.get_menu_title())) self.gallery_tab = self._add_tab( notebook, diff --git a/src/Editors/_EditPlace.py b/src/Editors/_EditPlace.py index cfb0443a5..026e83162 100644 --- a/src/Editors/_EditPlace.py +++ b/src/Editors/_EditPlace.py @@ -179,7 +179,7 @@ class EditPlace(EditPrimary): self.note_tab = self._add_tab( notebook, NoteTab(self.dbstate, self.uistate, self.track, - self.obj.get_note_list())) + self.obj.get_note_list(), self.get_menu_title())) self.gallery_tab = self._add_tab( notebook, diff --git a/src/Editors/_EditRepository.py b/src/Editors/_EditRepository.py index 28fa04276..eb3831054 100644 --- a/src/Editors/_EditRepository.py +++ b/src/Editors/_EditRepository.py @@ -124,7 +124,7 @@ class EditRepository(EditPrimary): self.note_tab = self._add_tab( notebook, NoteTab(self.dbstate, self.uistate, self.track, - self.obj.get_note_list())) + self.obj.get_note_list(), self.get_menu_title())) self.backref_tab = self._add_tab( notebook, diff --git a/src/Editors/_EditSource.py b/src/Editors/_EditSource.py index 66a9df777..49499bb5c 100644 --- a/src/Editors/_EditSource.py +++ b/src/Editors/_EditSource.py @@ -130,7 +130,7 @@ class EditSource(EditPrimary): self.note_tab = self._add_tab( notebook, NoteTab(self.dbstate, self.uistate, self.track, - self.obj.get_note_list())) + self.obj.get_note_list(), self.get_menu_title())) self.gallery_tab = self._add_tab( notebook,