From 6c4d70bf2ae149e272adb83cbb7e127215564513 Mon Sep 17 00:00:00 2001 From: Martin Hawlisch Date: Fri, 6 Oct 2006 19:10:15 +0000 Subject: [PATCH] * src/PluginUtils/_Plugins.py: ignore pressing apply without a plugin being selected * src/plugins/SoundGen.py: Dont fail with empty database svn: r7359 --- gramps2/ChangeLog | 5 +++++ gramps2/src/PluginUtils/_Plugins.py | 24 +++++++++++++----------- gramps2/src/plugins/SoundGen.py | 1 + 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index ce232f253..e50db76a0 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,8 @@ +2006-10-06 Martin Hawlisch + * src/PluginUtils/_Plugins.py: ignore pressing apply without + a plugin being selected + * src/plugins/SoundGen.py: Dont fail with empty database + 2006-10-06 Alex Roitman * src/GrampsDb/_GrampsBSDDB.py (GrampsBSDDB.load): Do not create logs when TXN is disabled. diff --git a/gramps2/src/PluginUtils/_Plugins.py b/gramps2/src/PluginUtils/_Plugins.py index 04f9d6900..84eb3eb2b 100644 --- a/gramps2/src/PluginUtils/_Plugins.py +++ b/gramps2/src/PluginUtils/_Plugins.py @@ -144,17 +144,19 @@ class PluginDialog(ManagedWindow.ManagedWindow): def on_apply_clicked(self,obj): """Execute the selected report""" - - (item_class,options_class,title,category, - name,require_active) = self.item - if self.content == REPORTS: - report(self.state,self.uistate,self.state.active, - item_class,options_class,title,name,category,require_active) - else: - _Tool.gui_tool(self.state,self.uistate, - item_class,options_class,title,name,category, - self.state.db.request_rebuild) - + try: + (item_class,options_class,title,category, + name,require_active) = self.item + if self.content == REPORTS: + report(self.state,self.uistate,self.state.active, + item_class,options_class,title,name,category,require_active) + else: + _Tool.gui_tool(self.state,self.uistate, + item_class,options_class,title,name,category, + self.state.db.request_rebuild) + except TypeError: + pass # ignore pressing apply without a plugin being selected + def on_node_selected(self,obj): """Updates the informational display on the right hand side of the dialog box with the description of the selected report""" diff --git a/gramps2/src/plugins/SoundGen.py b/gramps2/src/plugins/SoundGen.py index be3544dc2..3343f7a9b 100644 --- a/gramps2/src/plugins/SoundGen.py +++ b/gramps2/src/plugins/SoundGen.py @@ -79,6 +79,7 @@ class SoundGen(Tool.Tool, ManagedWindow.ManagedWindow): self.name.connect('changed',self.on_apply_clicked) names = [] + person = None for person_handle in self.db.get_person_handles(sort_handles=False): person = self.db.get_person_from_handle(person_handle) lastname = person.get_primary_name().get_surname()