summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-29 15:34:07 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-29 15:34:07 +0100
commit06c6f9b26676af2c05cea700c2eac145a77bbf9b (patch)
treee1cb884a117eddf8fd733ddbfe3039fffe9c3e8c /src
parent37f47955eae6998f61da280f3e4da601e4aea6c0 (diff)
parente8641f0bc6a3db34f517477d10a94923b4b3cc7a (diff)
downloadabrt-06c6f9b26676af2c05cea700c2eac145a77bbf9b.tar.gz
abrt-06c6f9b26676af2c05cea700c2eac145a77bbf9b.tar.xz
abrt-06c6f9b26676af2c05cea700c2eac145a77bbf9b.zip
Merge branch 'master' into rhel6
Diffstat (limited to 'src')
-rw-r--r--src/Gui/ABRTPlugin.py10
-rw-r--r--src/Gui/CCReporterDialog.py2
-rw-r--r--src/Gui/CC_gui_functions.py10
-rw-r--r--src/Gui/ConfBackend.py63
-rw-r--r--src/Gui/report.glade10
5 files changed, 69 insertions, 26 deletions
diff --git a/src/Gui/ABRTPlugin.py b/src/Gui/ABRTPlugin.py
index 320c81ca..f32a5935 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/CCReporterDialog.py b/src/Gui/CCReporterDialog.py
index b5f57d74..8e90ef9f 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/CC_gui_functions.py b/src/Gui/CC_gui_functions.py
index 708a1510..1a23db1a 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:
diff --git a/src/Gui/ConfBackend.py b/src/Gui/ConfBackend.py
index 0d47760d..741f2009 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
diff --git a/src/Gui/report.glade b/src/Gui/report.glade
index 9927c18f..13e4c14e 100644
--- a/src/Gui/report.glade
+++ b/src/Gui/report.glade
@@ -96,6 +96,7 @@
<property name="xalign">0</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">N/A</property>
+ <property name="selectable">True</property>
<property name="max_width_chars">40</property>
</object>
<packing>
@@ -108,6 +109,7 @@
<property name="xalign">0</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">N/A</property>
+ <property name="selectable">True</property>
<property name="max_width_chars">40</property>
</object>
<packing>
@@ -120,6 +122,7 @@
<property name="xalign">0</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">N/A</property>
+ <property name="selectable">True</property>
<property name="max_width_chars">40</property>
</object>
<packing>
@@ -132,6 +135,7 @@
<property name="xalign">0</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">N/A</property>
+ <property name="selectable">True</property>
<property name="max_width_chars">40</property>
</object>
<packing>
@@ -209,6 +213,7 @@
<property name="xalign">0</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">N/A</property>
+ <property name="selectable">True</property>
<property name="max_width_chars">40</property>
</object>
<packing>
@@ -221,6 +226,7 @@
<property name="xalign">0</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">N/A</property>
+ <property name="selectable">True</property>
<property name="max_width_chars">40</property>
</object>
<packing>
@@ -233,6 +239,7 @@
<property name="xalign">0</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">N/A</property>
+ <property name="selectable">True</property>
<property name="max_width_chars">40</property>
</object>
<packing>
@@ -245,6 +252,7 @@
<property name="xalign">0</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">N/A</property>
+ <property name="selectable">True</property>
<property name="max_width_chars">40</property>
</object>
<packing>
@@ -304,7 +312,7 @@
</child>
<child>
<object class="GtkCheckButton" id="cbSendBacktrace">
- <property name="label" translatable="yes">I agree to submit this backtrace, which could contain sensitive data</property>
+ <property name="label" translatable="yes">I checked backtrace and removed sensitive data (passwords, etc)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>