2006-04-21 Alex Roitman <shura@gramps-project.org>
* src/PluginUtils/_PluginStatus.py: Many small fixes. * src/ManagedWindow.py (GrampsWindowManager.display_menu_list): Fix building the menu for child-less windows. svn: r6395
This commit is contained in:
parent
1b9e003148
commit
9d4fdf1bb2
@ -1,3 +1,8 @@
|
|||||||
|
2006-04-21 Alex Roitman <shura@gramps-project.org>
|
||||||
|
* src/PluginUtils/_PluginStatus.py: Many small fixes.
|
||||||
|
* src/ManagedWindow.py (GrampsWindowManager.display_menu_list):
|
||||||
|
Fix building the menu for child-less windows.
|
||||||
|
|
||||||
2006-04-21 Don Allingham <don@gramps-project.org>
|
2006-04-21 Don Allingham <don@gramps-project.org>
|
||||||
* src/GrampsDb/_GrampsDbBase.py: AttributeType changes
|
* src/GrampsDb/_GrampsDbBase.py: AttributeType changes
|
||||||
* src/GrampsDb/_ReadGedcom.py: AttributeType changes
|
* src/GrampsDb/_ReadGedcom.py: AttributeType changes
|
||||||
|
@ -200,16 +200,21 @@ class GrampsWindowManager:
|
|||||||
return str(item.window_id)
|
return str(item.window_id)
|
||||||
|
|
||||||
def display_menu_list(self,data,action_data,mlist):
|
def display_menu_list(self,data,action_data,mlist):
|
||||||
i = mlist[0]
|
if type(mlist) in (list,tuple):
|
||||||
idval = self.generate_id(i)
|
i = mlist[0]
|
||||||
data.write('<menu action="M:%s">' % idval)
|
idval = self.generate_id(i)
|
||||||
data.write('<menuitem action="%s"/>' % idval)
|
data.write('<menu action="M:%s">' % idval)
|
||||||
|
action_data.append(("M:"+idval,None,i.submenu_label,
|
||||||
|
None,None,None))
|
||||||
|
else:
|
||||||
|
i = mlist
|
||||||
|
idval = self.generate_id(i)
|
||||||
|
|
||||||
action_data.append(("M:"+idval,None,i.submenu_label,None,None,None))
|
data.write('<menuitem action="%s"/>' % idval)
|
||||||
action_data.append((idval,None,i.menu_label,None,None,
|
action_data.append((idval,None,i.menu_label,None,None,
|
||||||
self.call_back_factory(i)))
|
self.call_back_factory(i)))
|
||||||
|
|
||||||
if len(mlist) > 1:
|
if (type(mlist) in (list,tuple)) and (len(mlist) > 1):
|
||||||
for i in mlist[1:]:
|
for i in mlist[1:]:
|
||||||
if type(i) == list:
|
if type(i) == list:
|
||||||
self.display_menu_list(data,action_data,i)
|
self.display_menu_list(data,action_data,i)
|
||||||
@ -219,7 +224,8 @@ class GrampsWindowManager:
|
|||||||
% self.generate_id(i))
|
% self.generate_id(i))
|
||||||
action_data.append((idval,None,i.menu_label,None,None,
|
action_data.append((idval,None,i.menu_label,None,None,
|
||||||
self.call_back_factory(i)))
|
self.call_back_factory(i)))
|
||||||
data.write('</menu>')
|
if type(mlist) in (list,tuple):
|
||||||
|
data.write('</menu>')
|
||||||
|
|
||||||
def build_windows_menu(self):
|
def build_windows_menu(self):
|
||||||
if self.active != DISABLED:
|
if self.active != DISABLED:
|
||||||
|
@ -22,57 +22,78 @@
|
|||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# PluginStatus
|
# GTK modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# GRAMPS modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
import ManagedWindow
|
import ManagedWindow
|
||||||
import Errors
|
import Errors
|
||||||
import _PluginMgr as PluginMgr
|
import _PluginMgr as PluginMgr
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# PluginStatus
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
class PluginStatus(ManagedWindow.ManagedWindow):
|
class PluginStatus(ManagedWindow.ManagedWindow):
|
||||||
"""Displays a dialog showing the status of loaded plugins"""
|
"""Displays a dialog showing the status of loaded plugins"""
|
||||||
|
|
||||||
def __init__(self,state,uistate,track):
|
def __init__(self,state,uistate,track=[]):
|
||||||
|
|
||||||
ManagedWindow.ManagedWindow.__init__(self, uistate, [], self)
|
self.title = _("Plugin Status")
|
||||||
|
ManagedWindow.ManagedWindow.__init__(self, uistate, track, self)
|
||||||
|
|
||||||
self.set_window(gtk.Window())
|
self.set_window(
|
||||||
|
gtk.Dialog("%s - GRAMPS" % self.title,
|
||||||
|
uistate.window,
|
||||||
|
gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||||
|
(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)
|
||||||
|
)
|
||||||
|
)
|
||||||
self.window.set_size_request(600,400)
|
self.window.set_size_request(600,400)
|
||||||
|
self.window.connect('delete-event',self.close)
|
||||||
|
|
||||||
scrolled_window = gtk.ScrolledWindow()
|
scrolled_window = gtk.ScrolledWindow()
|
||||||
self.list = gtk.TreeView()
|
self.list = gtk.TreeView()
|
||||||
self.model = gtk.ListStore(str, str, str)
|
self.model = gtk.ListStore(str, str, str)
|
||||||
self.list.set_model(self.model)
|
self.list.set_model(self.model)
|
||||||
|
|
||||||
self.list.append_column(gtk.TreeViewColumn(_('Status'), gtk.CellRendererText(),
|
self.list.append_column(gtk.TreeViewColumn(_('Status'),
|
||||||
|
gtk.CellRendererText(),
|
||||||
markup=0))
|
markup=0))
|
||||||
self.list.append_column(gtk.TreeViewColumn(_('File'), gtk.CellRendererText(),
|
self.list.append_column(gtk.TreeViewColumn(_('File'),
|
||||||
|
gtk.CellRendererText(),
|
||||||
text=1))
|
text=1))
|
||||||
self.list.append_column(gtk.TreeViewColumn(_('Message'), gtk.CellRendererText(),
|
self.list.append_column(gtk.TreeViewColumn(_('Message'),
|
||||||
|
gtk.CellRendererText(),
|
||||||
text=2))
|
text=2))
|
||||||
|
|
||||||
scrolled_window.add(self.list)
|
scrolled_window.add(self.list)
|
||||||
self.window.add(scrolled_window)
|
self.window.vbox.add(scrolled_window)
|
||||||
|
self.window.connect
|
||||||
self.window.show_all()
|
self.window.show_all()
|
||||||
|
|
||||||
for i in PluginMgr.failmsg_list:
|
for i in PluginMgr.failmsg_list:
|
||||||
err = i[1][0]
|
err = i[1][0]
|
||||||
if err == Errors.UnavailableError:
|
if err == Errors.UnavailableError:
|
||||||
self.model.append(row=['<span color="blue">%s</span>' % _('Unavailable'), i[0], str(i[1][1])])
|
self.model.append(row=[
|
||||||
|
'<span color="blue">%s</span>' % _('Unavailable'),
|
||||||
|
i[0], str(i[1][1])])
|
||||||
else:
|
else:
|
||||||
self.model.append(row=['<span weight="bold" color="red">%s</span>' % _('Fail'), i[0], str(i[1][1])])
|
self.model.append(row=[
|
||||||
|
'<span weight="bold" color="red">%s</span>' % _('Fail'),
|
||||||
|
i[0], str(i[1][1])])
|
||||||
|
|
||||||
for i in PluginMgr.success_list:
|
for i in PluginMgr.success_list:
|
||||||
self.model.append(row=[_("OK"), i[0], ''])
|
self.model.append(row=[
|
||||||
|
'<span weight="bold" color="green">%s</span>' % _("OK"),
|
||||||
# print PluginMgr.expect_list;
|
i[0], ''])
|
||||||
# print PluginMgr.attempt_list;
|
|
||||||
# print PluginMgr.failmsg_list;
|
|
||||||
# print PluginMgr.bkitems_list;
|
|
||||||
# print PluginMgr.cl_list;
|
|
||||||
# print PluginMgr.cli_tool_list;
|
|
||||||
# print PluginMgr._success_list;
|
|
||||||
|
|
||||||
|
def build_menu_names(self,obj):
|
||||||
|
return (self.title,None)
|
||||||
|
Loading…
Reference in New Issue
Block a user