diff options
author | Karel Klic <kklic@redhat.com> | 2009-12-02 14:26:52 +0100 |
---|---|---|
committer | Karel Klic <kklic@redhat.com> | 2009-12-02 14:26:52 +0100 |
commit | 8fe948d484d06b24838b83512f2c0d66cf38197c (patch) | |
tree | 0a23ec7cf62fe6abcd90f5306a9302a874e417ef /src | |
parent | b5f3c5516cfb57cdce0f82a03773f57dc974b886 (diff) | |
parent | d4d9e424d0c0773ad926b2d6c10b88c14a6dffcf (diff) | |
download | abrt-8fe948d484d06b24838b83512f2c0d66cf38197c.tar.gz abrt-8fe948d484d06b24838b83512f2c0d66cf38197c.tar.xz abrt-8fe948d484d06b24838b83512f2c0d66cf38197c.zip |
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'src')
-rw-r--r-- | src/Gui/CCReporterDialog.py | 5 | ||||
-rw-r--r-- | src/Gui/ConfBackend.py | 27 | ||||
-rw-r--r-- | src/Gui/PluginsSettingsDialog.py | 2 |
3 files changed, 25 insertions, 9 deletions
diff --git a/src/Gui/CCReporterDialog.py b/src/Gui/CCReporterDialog.py index 84254846..8e86ee4c 100644 --- a/src/Gui/CCReporterDialog.py +++ b/src/Gui/CCReporterDialog.py @@ -121,8 +121,11 @@ class ReporterDialog(): response = ui.run() if response == gtk.RESPONSE_APPLY: ui.dehydrate() - plugin.save_settings() if plugin.Settings.check(): + try: + plugin.save_settings() + except Exception, e: + gui_error_message(_("Can't save plugin settings:\n %s" % e)) box = image.get_parent() im = gtk.Image() im.set_from_stock(gtk.STOCK_APPLY, gtk.ICON_SIZE_MENU) diff --git a/src/Gui/ConfBackend.py b/src/Gui/ConfBackend.py index c5ec597f..72657f5c 100644 --- a/src/Gui/ConfBackend.py +++ b/src/Gui/ConfBackend.py @@ -15,6 +15,15 @@ class ConfBackendInitError(Exception): def __str__(self): return self.what + +class ConfBackendSaveError(Exception): + def __init__(self, msg): + Exception.__init__(self) + self.what = msg + + def __str__(self): + return self.what + class ConfBackend(object): def __init__(self): @@ -53,7 +62,7 @@ class ConfBackendGnomeKeyring(ConfBackend): # nothing found pass except gkey.DeniedError: - print _("Acces to gnome-keyring has been denied, plugins settings won't be saved.") + raise ConfBackendSaveError(_("Acces to gnome-keyring has been denied, plugins settings won't be saved.")) # delete all items containg "AbrtPluginInfo":<plugin_name>, so we always have only 1 item per plugin for item in item_list: @@ -62,13 +71,15 @@ class ConfBackendGnomeKeyring(ConfBackend): if "Password" in settings_tmp: password = settings_tmp["Password"] del settings_tmp["Password"] - gkey.item_create_sync(self.default_key_ring, - gkey.ITEM_GENERIC_SECRET, - "abrt:%s" % name, - settings_tmp, - password, - True) - + try: + gkey.item_create_sync(self.default_key_ring, + gkey.ITEM_GENERIC_SECRET, + "abrt:%s" % name, + settings_tmp, + password, + True) + except gkey.DeniedError, e: + raise ConfBackendSaveError(_("Acces to gnome-keyring has been denied, plugins settings won't be saved.")) def load(self, name): item_list = None diff --git a/src/Gui/PluginsSettingsDialog.py b/src/Gui/PluginsSettingsDialog.py index 48e55bf0..39fc7a6f 100644 --- a/src/Gui/PluginsSettingsDialog.py +++ b/src/Gui/PluginsSettingsDialog.py @@ -135,6 +135,8 @@ class PluginsSettingsDialog: if pluginfo.Settings: try: pluginfo.save_settings() + # FIXME: do we need to call this? all reporters set their settings + # when Report() is called self.ccdaemon.setPluginSettings(pluginfo.getName(), pluginfo.Settings) except Exception, e: gui_error_message(_("Can't save plugin settings:\n %s" % e)) |