* src/StartupDialog.py: fix close

* src/plugins/Desbrowser.py: Use ActivPersonTool
	* src/PluginUtils/_Tool.py: active person tool added


svn: r6412
This commit is contained in:
Don Allingham
2006-04-22 04:48:40 +00:00
parent 64b7cb7ad1
commit 3ee48954ea
6 changed files with 41 additions and 20 deletions
-1
View File
@@ -88,7 +88,6 @@ class PluginStatus(ManagedWindow.ManagedWindow):
scrolled_window.add(self.list)
self.window.vbox.add(scrolled_window)
self.window.connect
self.window.show_all()
for i in PluginMgr.failmsg_list:
+3 -7
View File
@@ -101,8 +101,7 @@ class PluginDialog(ManagedWindow.ManagedWindow):
self.dialog = gtk.glade.XML(const.plugins_glade,"report","gramps")
self.dialog.signal_autoconnect({
"on_report_apply_clicked" : self.on_apply_clicked,
"destroy_passed_object" : self.close,
"on_delete_event" : self.on_delete_event,
"destroy_passed_object" : self.close_window,
})
self.tree = self.dialog.get_widget("tree")
@@ -146,11 +145,8 @@ class PluginDialog(ManagedWindow.ManagedWindow):
self.build_plugin_tree(item_list,categories)
self.window.show()
def on_delete_event(self,obj,b):
pass
def close(self,ok=0):
self.window.destroy()
def close_window(self, obj):
self.close()
def on_apply_clicked(self,obj):
"""Execute the selected report"""
+22
View File
@@ -96,6 +96,28 @@ class Tool:
pass
class ActivePersonTool(Tool):
"""
The Tool base class. This is a base class for generating
customized tools. It cannot be used as is, but it can be easily
sub-classed to create a functional tool.
"""
def __init__(self, dbstate, options_class, name):
if not dbstate.get_active_person():
from QuestionDialog import ErrorDialog
ErrorDialog(_('Active person has not been set'),
_('You must select an active person for this '
'tool to work properly.'))
self.fail = True
return
Tool.__init__(self, dbstate, options_class, name)
self.fail = False
#------------------------------------------------------------------------
#
# Command-line tool