diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 5fcac221e..f19e38556 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,8 @@ +2006-04-28 Alex Roitman + * src/ScratchPad.py (ScratchPadWindow.__init__): Allow only one + instance; translate label; remove unneeded event handlers. + * src/ViewManager.py (ViewManager.scratchpad): Catch exception. + 2006-04-27 Alex Roitman * src/ViewManager.py (ViewManager.build_plugin_menu): Use unique command-line name for action menu. diff --git a/gramps2/src/ScratchPad.py b/gramps2/src/ScratchPad.py index 6bd894a09..ea170c3e8 100644 --- a/gramps2/src/ScratchPad.py +++ b/gramps2/src/ScratchPad.py @@ -928,7 +928,7 @@ class ScratchPadWindow(ManagedWindow.ManagedWindow): def __init__(self, dbstate, uistate): """Initializes the ScratchPad class, and displays the window""" - ManagedWindow.ManagedWindow.__init__(self, uistate, [], self) + ManagedWindow.ManagedWindow.__init__(self,uistate,[],self.__class__) self.db = dbstate.db self.database_changed(self.db) @@ -962,11 +962,9 @@ class ScratchPadWindow(ManagedWindow.ManagedWindow): self.object_list.set_model(ScratchPadWindow.otree) self.top.signal_autoconnect({ - "on_close_scratchpad" : self.on_close_scratchpad, + "on_close_scratchpad" : self.close, "on_clear_clicked": self.on_clear_clicked, "on_help_clicked": self.on_help_clicked, - "on_objectlist_delete_event": self.close, - "on_scratch_pad_delete_event": self.close, }) self.clear_all_btn.connect_object('clicked', gtk.ListStore.clear, @@ -976,7 +974,7 @@ class ScratchPadWindow(ManagedWindow.ManagedWindow): self.show() def build_menu_names(self,obj): - return ('ScratchPad',None) + return (_('ScratchPad'),None) def database_changed(self,database): self.db = database @@ -998,9 +996,6 @@ class ScratchPadWindow(ManagedWindow.ManagedWindow): """Display the relevant portion of GRAMPS manual""" GrampsDisplay.help('tools-util-scratch-pad') - def on_close_scratchpad(self,obj): - self.close() - def on_clear_clicked(self,obj): """Deletes the selected object from the object list""" selection = self.object_list.get_selection() diff --git a/gramps2/src/ViewManager.py b/gramps2/src/ViewManager.py index 9a5cdc6e6..c10440635 100644 --- a/gramps2/src/ViewManager.py +++ b/gramps2/src/ViewManager.py @@ -958,7 +958,10 @@ class ViewManager: def scratchpad(self, obj): import ScratchPad - ScratchPad.ScratchPadWindow(self.state, self.uistate) + try: + ScratchPad.ScratchPadWindow(self.state, self.uistate) + except Errors.WindowActiveError: + pass def undo(self, obj): self.state.db.undo()