From 36e3715dc7d1048b14f492efdb83e2bd0e19990f Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Fri, 29 Jan 2010 13:44:56 +0100 Subject: GUI: wrap the reporter message if it's longer than 360px - and make this work dynamically!!! making 360px the hard border is not very nice --- src/Gui/CC_gui_functions.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Gui/CC_gui_functions.py b/src/Gui/CC_gui_functions.py index 708a151..1a23db1 100644 --- a/src/Gui/CC_gui_functions.py +++ b/src/Gui/CC_gui_functions.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- import gtk +import pango import subprocess import sys # url markup is supported from gtk 2.17 so we need to use libsexy @@ -34,7 +35,7 @@ def gui_report_dialog ( report_status_dict, parent_dialog, builderfile = "%s%sdialogs.glade" % (sys.path[0],"/") builder.add_from_file(builderfile) dialog = builder.get_object("ReportDialog") - dialog.set_default_size(200, 50) + dialog.set_default_size(360, 50) dialog.set_resizable(False) main_hbox = builder.get_object("main_hbox") @@ -50,11 +51,13 @@ def gui_report_dialog ( report_status_dict, parent_dialog, plugin_label.set_alignment(0, 0) status_label = gtk.Label() status_label.set_max_width_chars(MAX_WIDTH) + status_label.set_size_request(360,-1) status_label.set_selectable(True) status_label.set_line_wrap(True) + status_label.set_line_wrap_mode(pango.WRAP_CHAR) status_label.set_alignment(0, 0) plugin_status_vbox.pack_start(plugin_label, expand=False) - plugin_status_vbox.pack_start(status_label, expand=False) + plugin_status_vbox.pack_start(status_label, fill=True, expand=True) # 0 means not succesfull #if report_status_dict[plugin][0] == '0': # this first one is actually a fallback to set at least @@ -72,8 +75,9 @@ def gui_report_dialog ( report_status_dict, parent_dialog, else: status_label.set_text("%s" % report_status_dict[plugin][1]) if len(report_status_dict[plugin][1]) > MAX_WIDTH: + print "setting tooltip for %s" % report_status_dict[plugin][1] status_label.set_tooltip_text(report_status_dict[plugin][1]) - status_vbox.pack_start(plugin_status_vbox, expand=False) + status_vbox.pack_start(plugin_status_vbox, fill=True, expand=False) main_hbox.pack_start(status_vbox) if widget != None: -- cgit From fb20fdafe489a369a3c76142c0028fae7860cc74 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Fri, 29 Jan 2010 15:00:49 +0100 Subject: GUI: fixed bug caused by failed gk-authorization - if user enters a wrong password to gk and doesn't unlock it, the GUI would throw an exception, this patch makes GUI to ask twice per every plugin, ignore the exception is it fails and it will use defaults from /etc/abrt/plugins --- src/Gui/ABRTPlugin.py | 10 +++++++- src/Gui/ConfBackend.py | 63 ++++++++++++++++++++++++++++++++++---------------- 2 files changed, 52 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/Gui/ABRTPlugin.py b/src/Gui/ABRTPlugin.py index 320c81c..f32a593 100644 --- a/src/Gui/ABRTPlugin.py +++ b/src/Gui/ABRTPlugin.py @@ -39,7 +39,15 @@ class PluginSettings(dict): self[str(key)] = str(daemon_settings[key]) if self.client_side_conf: - settings = self.client_side_conf.load(name) + # FIXME: this fails when gk-authoriaztion fails + # we need to show a dialog to user and let him know + # for now just silently ignore it to avoid rhbz#559342 + settings = {} + try: + settings = self.client_side_conf.load(name) + except Exception, e: + print e + pass # overwrite daemon data with user setting for key in settings.keys(): # only rewrite keys which exist in plugin's keys. diff --git a/src/Gui/ConfBackend.py b/src/Gui/ConfBackend.py index 0d47760..741f200 100644 --- a/src/Gui/ConfBackend.py +++ b/src/Gui/ConfBackend.py @@ -26,6 +26,14 @@ class ConfBackendSaveError(Exception): def __str__(self): return self.what +class ConfBackendLoadError(Exception): + def __init__(self, msg): + Exception.__init__(self) + self.what = msg + + def __str__(self): + return self.what + class ConfBackend(object): def __init__(self): @@ -111,26 +119,41 @@ class ConfBackendGnomeKeyring(ConfBackend): def load(self, name): item_list = None - try: - log2("looking for keyring items with 'AbrtPluginInfo:%s' attr", str(name)) - item_list = gkey.find_items_sync(gkey.ITEM_GENERIC_SECRET, {"AbrtPluginInfo":str(name)}) - for item in item_list: - # gnome keyring is weeeeird. why display_name, type, mtime, ctime - # aren't available in find_items_sync() results? why we need to - # get them via additional call, item_get_info_sync()? - # internally, item has GNOME_KEYRING_TYPE_FOUND type, - # and info has GNOME_KEYRING_TYPE_ITEM_INFO type. - # why not use the same type for both? - # - # and worst of all, this information took four hours of googling... - # - #info = gkey.item_get_info_sync(item.keyring, item.item_id) - log2("found keyring item: ring:'%s' item_id:%s attrs:%s", # "secret:'%s' display_name:'%s'" - item.keyring, item.item_id, str(item.attributes) #, item.secret, info.get_display_name() - ) - except gkey.NoMatchError: - # nothing found - pass + #FIXME: make this configurable + # this actually makes GUI to ask twice per every plugin + # which have it's settings stored in keyring + attempts = 2 + while attempts: + try: + log2("looking for keyring items with 'AbrtPluginInfo:%s' attr", str(name)) + item_list = gkey.find_items_sync(gkey.ITEM_GENERIC_SECRET, {"AbrtPluginInfo":str(name)}) + for item in item_list: + # gnome keyring is weeeeird. why display_name, type, mtime, ctime + # aren't available in find_items_sync() results? why we need to + # get them via additional call, item_get_info_sync()? + # internally, item has GNOME_KEYRING_TYPE_FOUND type, + # and info has GNOME_KEYRING_TYPE_ITEM_INFO type. + # why not use the same type for both? + # + # and worst of all, this information took four hours of googling... + # + #info = gkey.item_get_info_sync(item.keyring, item.item_id) + log2("found keyring item: ring:'%s' item_id:%s attrs:%s", # "secret:'%s' display_name:'%s'" + item.keyring, item.item_id, str(item.attributes) #, item.secret, info.get_display_name() + ) + except gkey.NoMatchError: + # nothing found + pass + except gkey.DeniedError, e: + attempts -= 1 + log2("gk-authorization has failed %i time(s)", 2-attempts) + if attempts == 0: + # we tried 2 times, so giving up the authorization + print "raising exception" + raise ConfBackendLoadError(_("Access to gnome-keyring has been denied, can't load the settings for %s!" % name)) + continue + break + if item_list: retval = item_list[0].attributes.copy() retval["Password"] = item_list[0].secret -- cgit From e8641f0bc6a3db34f517477d10a94923b4b3cc7a Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 29 Jan 2010 15:32:47 +0100 Subject: Report GUI: made more fields copyable - closed rhbz#526209; tweaked wording Signed-off-by: Denys Vlasenko --- src/Gui/CCReporterDialog.py | 2 +- src/Gui/report.glade | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Gui/CCReporterDialog.py b/src/Gui/CCReporterDialog.py index b5f57d7..8e90ef9 100644 --- a/src/Gui/CCReporterDialog.py +++ b/src/Gui/CCReporterDialog.py @@ -96,7 +96,7 @@ class ReporterDialog(): # if an backtrace has rating use it if not SendBacktrace: send = False - error_msgs.append(_("You must agree with submitting the backtrace.")) + error_msgs.append(_("You must check backtrace for sensitive data")) # we have both SendBacktrace and rating if rating: try: diff --git a/src/Gui/report.glade b/src/Gui/report.glade index 9927c18..13e4c14 100644 --- a/src/Gui/report.glade +++ b/src/Gui/report.glade @@ -96,6 +96,7 @@ 0 5 N/A + True 40 @@ -108,6 +109,7 @@ 0 5 N/A + True 40 @@ -120,6 +122,7 @@ 0 5 N/A + True 40 @@ -132,6 +135,7 @@ 0 5 N/A + True 40 @@ -209,6 +213,7 @@ 0 5 N/A + True 40 @@ -221,6 +226,7 @@ 0 5 N/A + True 40 @@ -233,6 +239,7 @@ 0 5 N/A + True 40 @@ -245,6 +252,7 @@ 0 5 N/A + True 40 @@ -304,7 +312,7 @@ - I agree to submit this backtrace, which could contain sensitive data + I checked backtrace and removed sensitive data (passwords, etc) True True False -- cgit