2006-04-28 Alex Roitman <shura@gramps-project.org>
* src/ScratchPad.py (ScratchPadWindow.__init__): Allow only one instance; translate label; remove unneeded event handlers. * src/ViewManager.py (ViewManager.scratchpad): Catch exception. svn: r6485
This commit is contained in:
parent
f0ff12df0e
commit
7fbc99f60f
@ -1,3 +1,8 @@
|
||||
2006-04-28 Alex Roitman <shura@gramps-project.org>
|
||||
* 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 <shura@gramps-project.org>
|
||||
* src/ViewManager.py (ViewManager.build_plugin_menu): Use unique
|
||||
command-line name for action menu.
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user