From a972a2aba8dc240eec4eccbff1e660a6dabfa86f Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Wed, 16 Jun 2010 11:05:37 +0200 Subject: GUI: fixed exception when there is no configure dialog for plugin rhbz#603745 - gui now complains about the missing dialog and won't throw and exception --- src/Gui/CC_gui_functions.py | 5 ++--- src/Gui/CReporterAssistant.py | 7 ++++++- src/Gui/PluginSettingsUI.py | 5 +++++ 3 files changed, 13 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Gui/CC_gui_functions.py b/src/Gui/CC_gui_functions.py index 2365720a..e0d68db3 100644 --- a/src/Gui/CC_gui_functions.py +++ b/src/Gui/CC_gui_functions.py @@ -144,9 +144,8 @@ def gui_error_message ( message, parent_dialog=None, dialog = gtk.MessageDialog( parent_dialog, gtk.DIALOG_MODAL|gtk.DIALOG_DESTROY_WITH_PARENT, - message_type, gtk.BUTTONS_OK, - message ) - + message_type, gtk.BUTTONS_OK, message ) + dialog.set_markup(message) if parent_dialog: dialog.set_position (gtk.WIN_POS_CENTER_ON_PARENT) dialog.set_transient_for(parent_dialog) diff --git a/src/Gui/CReporterAssistant.py b/src/Gui/CReporterAssistant.py index ae392a46..10d68662 100644 --- a/src/Gui/CReporterAssistant.py +++ b/src/Gui/CReporterAssistant.py @@ -181,7 +181,12 @@ class ReporterAssistant(): self.pBarWindow.hide() def on_config_plugin_clicked(self, button, parent, plugin, image): - ui = PluginSettingsUI(plugin, parent=parent) + try: + ui = PluginSettingsUI(plugin, parent=parent) + except Exception, ex: + gui_error_message(str(ex)) + return + ui.hydrate() response = ui.run() if response == gtk.RESPONSE_APPLY: diff --git a/src/Gui/PluginSettingsUI.py b/src/Gui/PluginSettingsUI.py index 8c24fde3..aa8f5310 100644 --- a/src/Gui/PluginSettingsUI.py +++ b/src/Gui/PluginSettingsUI.py @@ -21,6 +21,11 @@ class PluginSettingsUI(): else: # we shouldn't get here, but just to be safe log1("No UI for plugin %s" % pluginfo) + raise Exception(_("No UI for the plugin %s, this is probably a bug.\n" + "Please report it at " + "" + "https://fedorahosted.org/abrt/newticket") % pluginfo) + return if parent: self.dialog.set_position(gtk.WIN_POS_CENTER_ON_PARENT) -- cgit