2006-04-27 Alex Roitman <shura@gramps-project.org>
* src/ViewManager.py (reports_clicked, tools_clicked): handle exception. * src/PluginUtils/_Plugins.py (PluginDialog.on_apply_clicked): Correctly call gui_tool, fix wm. svn: r6475
This commit is contained in:
parent
e8b97cb8da
commit
abfb1ec422
@ -1,3 +1,9 @@
|
|||||||
|
2006-04-27 Alex Roitman <shura@gramps-project.org>
|
||||||
|
* src/ViewManager.py (reports_clicked, tools_clicked): handle
|
||||||
|
exception.
|
||||||
|
* src/PluginUtils/_Plugins.py (PluginDialog.on_apply_clicked):
|
||||||
|
Correctly call gui_tool, fix wm.
|
||||||
|
|
||||||
2006-04-27 Don Allingham <don@gramps-project.org>
|
2006-04-27 Don Allingham <don@gramps-project.org>
|
||||||
* src/ViewManager.py: fix top on Config.set calls
|
* src/ViewManager.py: fix top on Config.set calls
|
||||||
* data/gramps.schemas.in: remove toolbar, now unused
|
* data/gramps.schemas.in: remove toolbar, now unused
|
||||||
|
@ -83,8 +83,8 @@ class PluginDialog(ManagedWindow.ManagedWindow):
|
|||||||
"""Displays the dialog box that allows the user to select the
|
"""Displays the dialog box that allows the user to select the
|
||||||
report that is desired."""
|
report that is desired."""
|
||||||
|
|
||||||
def __init__(self,state, uistate, track, item_list,categories,msg,label=None,
|
def __init__(self,state, uistate, track, item_list,categories,msg,
|
||||||
button_label=None,tool_tip=None,content=REPORTS):
|
label=None,button_label=None,tool_tip=None,content=REPORTS):
|
||||||
"""Display the dialog box, and build up the list of available
|
"""Display the dialog box, and build up the list of available
|
||||||
reports. This is used to build the selection tree on the left
|
reports. This is used to build the selection tree on the left
|
||||||
hand side of the dailog box."""
|
hand side of the dailog box."""
|
||||||
@ -94,7 +94,7 @@ class PluginDialog(ManagedWindow.ManagedWindow):
|
|||||||
self.msg = msg
|
self.msg = msg
|
||||||
self.content = content
|
self.content = content
|
||||||
|
|
||||||
ManagedWindow.ManagedWindow.__init__(self, uistate, [], None)
|
ManagedWindow.ManagedWindow.__init__(self,uistate,[],self.__class__)
|
||||||
|
|
||||||
self.state = state
|
self.state = state
|
||||||
self.uistate = uistate
|
self.uistate = uistate
|
||||||
@ -102,14 +102,14 @@ class PluginDialog(ManagedWindow.ManagedWindow):
|
|||||||
self.dialog = gtk.glade.XML(const.plugins_glade,"report","gramps")
|
self.dialog = gtk.glade.XML(const.plugins_glade,"report","gramps")
|
||||||
self.dialog.signal_autoconnect({
|
self.dialog.signal_autoconnect({
|
||||||
"on_report_apply_clicked" : self.on_apply_clicked,
|
"on_report_apply_clicked" : self.on_apply_clicked,
|
||||||
"destroy_passed_object" : self.close_window,
|
"destroy_passed_object" : self.close,
|
||||||
})
|
})
|
||||||
|
|
||||||
self.tree = self.dialog.get_widget("tree")
|
self.tree = self.dialog.get_widget("tree")
|
||||||
self.window = self.dialog.get_widget("report")
|
window = self.dialog.get_widget("report")
|
||||||
self.title = self.dialog.get_widget("title")
|
self.title = self.dialog.get_widget("title")
|
||||||
|
|
||||||
Utils.set_titles(self.window, self.title, msg )
|
self.set_window(window, self.title, msg )
|
||||||
|
|
||||||
self.store = gtk.TreeStore(gobject.TYPE_STRING)
|
self.store = gtk.TreeStore(gobject.TYPE_STRING)
|
||||||
self.selection = self.tree.get_selection()
|
self.selection = self.tree.get_selection()
|
||||||
@ -122,8 +122,6 @@ class PluginDialog(ManagedWindow.ManagedWindow):
|
|||||||
if label:
|
if label:
|
||||||
self.description.set_text(label)
|
self.description.set_text(label)
|
||||||
self.status = self.dialog.get_widget("report_status")
|
self.status = self.dialog.get_widget("report_status")
|
||||||
|
|
||||||
Utils.set_title_label(self.dialog,msg)
|
|
||||||
|
|
||||||
self.author_name = self.dialog.get_widget("author_name")
|
self.author_name = self.dialog.get_widget("author_name")
|
||||||
self.author_email = self.dialog.get_widget("author_email")
|
self.author_email = self.dialog.get_widget("author_email")
|
||||||
@ -144,10 +142,10 @@ class PluginDialog(ManagedWindow.ManagedWindow):
|
|||||||
|
|
||||||
self.item = None
|
self.item = None
|
||||||
self.build_plugin_tree(item_list,categories)
|
self.build_plugin_tree(item_list,categories)
|
||||||
self.window.show()
|
self.show()
|
||||||
|
|
||||||
def close_window(self, obj):
|
def build_menu_names(self,obj):
|
||||||
self.close()
|
return (self.msg,None)
|
||||||
|
|
||||||
def on_apply_clicked(self,obj):
|
def on_apply_clicked(self,obj):
|
||||||
"""Execute the selected report"""
|
"""Execute the selected report"""
|
||||||
@ -157,9 +155,9 @@ class PluginDialog(ManagedWindow.ManagedWindow):
|
|||||||
_Report.report(self.state.db,self.state.active,
|
_Report.report(self.state.db,self.state.active,
|
||||||
item_class,options_class,title,name,category)
|
item_class,options_class,title,name,category)
|
||||||
else:
|
else:
|
||||||
_Tool.gui_tool(self.state.db,self.state.active,
|
_Tool.gui_tool(self.state,self.uistate,
|
||||||
item_class,options_class,title,name,category,
|
item_class,options_class,title,name,category,
|
||||||
self.state.db.request_rebuild,self.parent)
|
self.state.db.request_rebuild)
|
||||||
|
|
||||||
def on_node_selected(self,obj):
|
def on_node_selected(self,obj):
|
||||||
"""Updates the informational display on the right hand side of
|
"""Updates the informational display on the right hand side of
|
||||||
@ -255,6 +253,7 @@ class ReportPlugins(PluginDialog):
|
|||||||
"""Display the dialog box, and build up the list of available
|
"""Display the dialog box, and build up the list of available
|
||||||
reports. This is used to build the selection tree on the left
|
reports. This is used to build the selection tree on the left
|
||||||
hand side of the dailog box."""
|
hand side of the dailog box."""
|
||||||
|
|
||||||
PluginDialog.__init__(
|
PluginDialog.__init__(
|
||||||
self,
|
self,
|
||||||
dbstate,
|
dbstate,
|
||||||
|
@ -945,10 +945,16 @@ class ViewManager:
|
|||||||
self.bookmarks.edit()
|
self.bookmarks.edit()
|
||||||
|
|
||||||
def reports_clicked(self, obj):
|
def reports_clicked(self, obj):
|
||||||
Plugins.ReportPlugins(self.state, self.uistate, [])
|
try:
|
||||||
|
Plugins.ReportPlugins(self.state, self.uistate, [])
|
||||||
|
except Errors.WindowActiveError:
|
||||||
|
pass
|
||||||
|
|
||||||
def tools_clicked(self, obj):
|
def tools_clicked(self, obj):
|
||||||
Plugins.ToolPlugins(self.state, self.uistate, [])
|
try:
|
||||||
|
Plugins.ToolPlugins(self.state, self.uistate, [])
|
||||||
|
except Errors.WindowActiveError:
|
||||||
|
pass
|
||||||
|
|
||||||
def scratchpad(self, obj):
|
def scratchpad(self, obj):
|
||||||
import ScratchPad
|
import ScratchPad
|
||||||
@ -1133,7 +1139,7 @@ class ViewManager:
|
|||||||
f.write('</menu>')
|
f.write('</menu>')
|
||||||
|
|
||||||
f.write('</menu></menubar></ui>')
|
f.write('</menu></menubar></ui>')
|
||||||
return (unicode(f.getvalue()), actions)
|
return (f.getvalue(), actions)
|
||||||
|
|
||||||
def by_menu_name(a, b):
|
def by_menu_name(a, b):
|
||||||
return cmp(a[2], b[2])
|
return cmp(a[2], b[2])
|
||||||
|
Loading…
Reference in New Issue
Block a user