updated PluginStatus dialog
svn: r6390
This commit is contained in:
@@ -297,73 +297,6 @@ class ToolPlugins(PluginDialog):
|
||||
_("Run selected tool"),
|
||||
TOOLS)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# PluginStatus
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
class PluginStatus(ManagedWindow.ManagedWindow):
|
||||
"""Displays a dialog showing the status of loaded plugins"""
|
||||
|
||||
def __init__(self,state,uistate,track):
|
||||
|
||||
import cStringIO
|
||||
ManagedWindow.ManagedWindow.__init__(self, uistate, [], None)
|
||||
|
||||
self.state = state
|
||||
self.uistate = uistate
|
||||
|
||||
self.glade = gtk.glade.XML(const.plugins_glade,"plugstat","gramps")
|
||||
self.window = self.glade.get_widget("plugstat")
|
||||
self.window.set_title("%s - GRAMPS" % _('Plugin status'))
|
||||
window = self.glade.get_widget("text")
|
||||
self.pop_button = self.glade.get_widget("pop_button")
|
||||
self.pop_button.set_active(Config.get_pop_plugin_status())
|
||||
self.pop_button.connect('toggled',
|
||||
lambda obj: Config.save_pop_plugin_status(self.pop_button.get_active()))
|
||||
Config.client.notify_add("/apps/gramps/behavior/pop-plugin-status",
|
||||
self.pop_button_update)
|
||||
self.glade.signal_autoconnect({
|
||||
'on_close_clicked' : self.close,
|
||||
'on_help_clicked' : self.help,
|
||||
'on_plugstat_delete_event' : self.on_delete,
|
||||
})
|
||||
|
||||
info = cStringIO.StringIO()
|
||||
|
||||
if len(_PluginMgr.expect_list) + len(_PluginMgr.failmsg_list) == 0:
|
||||
window.get_buffer().set_text(_('All modules were successfully loaded.'))
|
||||
else:
|
||||
info.write(_("The following modules could not be loaded:"))
|
||||
info.write("\n\n")
|
||||
|
||||
for (filename,msg) in _PluginMgr.expect_list:
|
||||
info.write("%s: %s\n\n" % (filename,msg))
|
||||
|
||||
for (filename,msgs) in _PluginMgr.failmsg_list:
|
||||
error = str(msgs[0])
|
||||
if error[0:11] == "exceptions.":
|
||||
error = error[11:]
|
||||
info.write("%s: %s\n" % (filename,error) )
|
||||
traceback.print_exception(msgs[0],msgs[1],msgs[2],None,info)
|
||||
info.write('\n')
|
||||
info.seek(0)
|
||||
window.get_buffer().set_text(info.read())
|
||||
|
||||
def on_delete(self,obj1,obj2):
|
||||
pass
|
||||
|
||||
def close(self,obj):
|
||||
self.window.destroy()
|
||||
|
||||
def help(self,obj):
|
||||
"""Display the GRAMPS manual"""
|
||||
GrampsDisplay.help('gramps-getting-started')
|
||||
|
||||
def pop_button_update(self, client,cnxn_id,entry,data):
|
||||
self.pop_button.set_active(Config.get_pop_plugin_status())
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Building pulldown menus
|
||||
|
Reference in New Issue
Block a user