diff --git a/ChangeLog b/ChangeLog index 04ee3757b..7aa4e3ed9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-03-26 Zsolt Foldvari + * src/Editors/_EditNote.py (save): pass the handle to the callback + instead of the object itself. + * src/DisplayTabs/_NoteTab.py: pass the add and edit callback functions + to EditNote; side button tooltips. + 2007-03-25 Brian Matherly * src/ReportBase/_ReportOptions.py: Remove get_display_format (not used) * src/ReportBase/_BareReportDialog.py: diff --git a/src/DisplayTabs/_NoteTab.py b/src/DisplayTabs/_NoteTab.py index 65d187afa..64d0d2890 100644 --- a/src/DisplayTabs/_NoteTab.py +++ b/src/DisplayTabs/_NoteTab.py @@ -49,10 +49,16 @@ class NoteTab(EmbeddedList): _HANDLE_COL = 2 + _MSG = { + 'add' : _('Create and add a new note'), + 'del' : _('Remove the existing note'), + 'edit' : _('Edit the selected note'), + } + _column_names = [ (_('Type'), 0, 100), (_('Preview'), 1, 200), - ] + ] def __init__(self, dbstate, uistate, track, data): self.data = data @@ -74,7 +80,7 @@ class NoteTab(EmbeddedList): def add_button_clicked(self, obj): note = RelLib.Note() try: - EditNote(self.dbstate, self.uistate, [], note) + EditNote(self.dbstate, self.uistate, [], note, self.add_callback) except Errors.WindowActiveError: pass @@ -88,7 +94,8 @@ class NoteTab(EmbeddedList): if handle: note = self.dbstate.db.get_note_from_handle(handle) try: - EditNote(self.dbstate, self.uistate, [], note) + EditNote(self.dbstate, self.uistate, [], note, + self.edit_callback) except Errors.WindowActiveError: pass diff --git a/src/Editors/_EditNote.py b/src/Editors/_EditNote.py index e5f296faa..c40c1619f 100644 --- a/src/Editors/_EditNote.py +++ b/src/Editors/_EditNote.py @@ -33,7 +33,6 @@ from gettext import gettext as _ # #------------------------------------------------------------------------- import gtk -import pango #------------------------------------------------------------------------- # @@ -46,6 +45,7 @@ import Config from _EditPrimary import EditPrimary from MarkupText import EditorBuffer from GrampsWidgets import * +from RelLib import Note #------------------------------------------------------------------------- # @@ -56,7 +56,7 @@ class EditNote(EditPrimary): def __init__(self, state, uistate, track, note, callback=None): """ - Creates an EditPerson window. Associates a person with the window. + Creates an EditNote window. Associates a note with the window. """ EditPrimary.__init__(self, state, uistate, track, note, state.db.get_note_from_handle, callback) @@ -66,7 +66,7 @@ class EditNote(EditPrimary): Returns an empty Person object for comparison for changes. This is used by the base class (EditPrimary) """ - return RelLib.Note() + return Note() def get_menu_title(self): if self.obj.get_handle(): @@ -209,7 +209,7 @@ class EditNote(EditPrimary): start = buffer.get_start_iter() stop = buffer.get_end_iter() text = buffer.get_text(start, stop) - print text + log.debug(text) self.obj.set(text) else: log.debug("NOTE OBJ DOES NOT EXIST") @@ -239,7 +239,7 @@ class EditNote(EditPrimary): self.db.transaction_commit(trans, _("Edit Note")) if self.callback: - self.callback(self.obj) + self.callback(self.obj.get_handle()) self.close() def _cleanup_on_exit(self):