* 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:
@@ -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:
|
||||
|
||||
@@ -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"""
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user