summaryrefslogtreecommitdiffstats
path: root/src/Gui
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@localhost.localdomain>2009-12-02 12:41:17 +0100
committerJiri Moskovcak <jmoskovc@localhost.localdomain>2009-12-02 12:41:17 +0100
commitd4d9e424d0c0773ad926b2d6c10b88c14a6dffcf (patch)
treec624f35103174a735b626681e1fc0eee5c6defa9 /src/Gui
parent48c38c2de05b5e918269eeb45939708821d51d97 (diff)
downloadabrt-d4d9e424d0c0773ad926b2d6c10b88c14a6dffcf.tar.gz
abrt-d4d9e424d0c0773ad926b2d6c10b88c14a6dffcf.tar.xz
abrt-d4d9e424d0c0773ad926b2d6c10b88c14a6dffcf.zip
GUI: survive gnome-keyring access denial rhbz#543200
Diffstat (limited to 'src/Gui')
-rw-r--r--src/Gui/CCReporterDialog.py5
-rw-r--r--src/Gui/ConfBackend.py27
-rw-r--r--src/Gui/PluginsSettingsDialog.py2
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))