summaryrefslogtreecommitdiffstats
path: root/src/Gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/Gui')
-rw-r--r--src/Gui/ABRTExceptions.py8
-rw-r--r--src/Gui/ABRTPlugin.py27
-rw-r--r--src/Gui/CCMainWindow.py16
-rw-r--r--src/Gui/CCReporterDialog.py38
-rw-r--r--src/Gui/CC_gui_functions.py2
-rw-r--r--src/Gui/CellRenderers.py5
-rw-r--r--src/Gui/ConfBackend.py23
-rw-r--r--src/Gui/Makefile.am6
-rw-r--r--src/Gui/PluginsSettingsDialog.py4
-rw-r--r--src/Gui/SettingsDialog.py12
-rw-r--r--src/Gui/abrt.desktop2
-rw-r--r--src/Gui/abrt.pngbin0 -> 2791 bytes
-rw-r--r--src/Gui/report.glade36
-rw-r--r--src/Gui/settings_wizard.glade2
14 files changed, 129 insertions, 52 deletions
diff --git a/src/Gui/ABRTExceptions.py b/src/Gui/ABRTExceptions.py
index 0d357a30..c4d6b594 100644
--- a/src/Gui/ABRTExceptions.py
+++ b/src/Gui/ABRTExceptions.py
@@ -14,11 +14,3 @@ class WrongData(Exception):
def __str__(self):
return self.what
-
-class ConfBackendInitError(Exception):
- def __init__(self, msg):
- Exception.__init__(self)
- self.what = msg
-
- def __str__(self):
- return self.what
diff --git a/src/Gui/ABRTPlugin.py b/src/Gui/ABRTPlugin.py
index 8d687f83..8483be44 100644
--- a/src/Gui/ABRTPlugin.py
+++ b/src/Gui/ABRTPlugin.py
@@ -11,12 +11,17 @@ Email
Description
"""
from abrt_utils import _
-from ConfBackend import ConfBackendGnomeKeyring
+from ConfBackend import ConfBackendGnomeKeyring, ConfBackendInitError
class PluginSettings(dict):
def __init__(self):
dict.__init__(self)
- self.conf = ConfBackendGnomeKeyring()
+ self.conf = None
+ try:
+ self.conf = ConfBackendGnomeKeyring()
+ except ConfBackendInitError, e:
+ print e
+ pass
def check(self):
for key in ["Password", "Login"]:
@@ -32,16 +37,18 @@ class PluginSettings(dict):
for key in default_settings.keys():
self[str(key)] = str(default_settings[key])
- settings = self.conf.load(name)
- # overwrite defaluts with user setting
- for key in settings.keys():
- # only rewrite keys needed by the plugin
- # e.g we don't want a pass field for logger
- if key in default_settings.keys():
- self[str(key)] = str(settings[key])
+ if self.conf:
+ settings = self.conf.load(name)
+ # overwrite defaluts with user setting
+ for key in settings.keys():
+ # only rewrite keys needed by the plugin
+ # e.g we don't want a pass field for logger
+ if key in default_settings.keys():
+ self[str(key)] = str(settings[key])
def save(self, name):
- self.conf.save(name, self)
+ if self.conf:
+ self.conf.save(name, self)
class PluginInfo():
"""Class to represent common plugin info"""
diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py
index eee68844..d3a3abd0 100644
--- a/src/Gui/CCMainWindow.py
+++ b/src/Gui/CCMainWindow.py
@@ -154,9 +154,12 @@ class MainWindow():
def on_miSettings_clicked(self, widget):
dialog = SettingsDialog(self.window, self.ccdaemon)
- dialog.hydrate()
+ try:
+ dialog.hydrate()
+ except Exception, e:
+ gui_error_message(_("Can't show the settings dialog\n%s" % e))
+ return
dialog.show()
- self.ccdaemon.getSettings()
def warning_cb(self, daemon, message=None):
# try to hide the progressbar, we dont really care if it was visible ..
@@ -208,9 +211,10 @@ class MainWindow():
else:
n = self.dumpsListStore.append([icon, entry.getPackage(), entry.getExecutable(),
entry.getTime("%c"), entry.getCount(), entry.isReported(), entry])
- # activate the last row if any..
+ # activate the first row if any..
if n:
- self.dlist.set_cursor(self.dumpsListStore.get_path(n))
+ # we can use (0,) as path for the first row, but what if API changes?
+ self.dlist.set_cursor(self.dumpsListStore.get_path(self.dumpsListStore.get_iter_first()))
def filter_dumps(self, model, miter, data):
# for later..
@@ -232,7 +236,7 @@ class MainWindow():
report_label = _("<b>This crash has been reported, you can find the report(s) at:</b>\n")
for message in dump.getMessage().split('\n'):
if message:
- if "http" in message or "file:///" in message:
+ if "http" in message[0:5] or "file:///"[0:8] in message:
message = "<a href=\"%s\">%s</a>" % (message, message)
report_label += "%s\n" % message
self.wTree.get_widget("lReported").set_markup(report_label)
@@ -291,7 +295,7 @@ class MainWindow():
if not report:
gui_error_message(_("Unable to get report!\nDebuginfo is missing?"))
return
- report_dialog = ReporterDialog(report, self.ccdaemon)
+ report_dialog = ReporterDialog(report, self.ccdaemon, parent=self.window)
# (response, report)
response, result = report_dialog.run()
diff --git a/src/Gui/CCReporterDialog.py b/src/Gui/CCReporterDialog.py
index eb311f73..e1d1c1bb 100644
--- a/src/Gui/CCReporterDialog.py
+++ b/src/Gui/CCReporterDialog.py
@@ -23,7 +23,7 @@ REFRESH = -50
class ReporterDialog():
"""Reporter window"""
- def __init__(self, report, daemon):
+ def __init__(self, report, daemon, parent=None):
self.editable = []
self.row_dict = {}
self.report = report
@@ -35,6 +35,9 @@ class ReporterDialog():
self.window = self.wTree.get_widget("reporter_dialog")
self.window.set_default_size(640, 480)
self.window.connect("response", self.on_response, daemon)
+ if parent:
+ self.window.set_transient_for(parent)
+ self.window.set_modal(True)
# comment textview
self.tvComment = self.wTree.get_widget("tvComment")
@@ -73,6 +76,8 @@ class ReporterDialog():
# connect the signals
self.tvReport.connect_after("size-allocate", self.on_window_resize)
self.wTree.get_widget("bSend").connect("clicked", self.on_send_clicked)
+ # start whit the warning hidden, so it's not visible when there is no rating
+ self.wTree.get_widget("ebErrors").hide()
self.hydrate()
# this callback is called when user press Cancel or Report button in Report dialog
@@ -147,6 +152,7 @@ class ReporterDialog():
vbWrongSettings.pack_start(hbox)
vbWrongSettings.show_all()
dialog.set_transient_for(self.window)
+ dialog.set_modal(True)
response = dialog.run()
dialog.destroy()
if response == gtk.RESPONSE_NO:
@@ -176,6 +182,36 @@ class ReporterDialog():
self.tvComment.set_buffer(buff)
continue
+ # if an backtrace has rating use it
+ if item == "rating":
+ try:
+ package = self.report["package"][CONTENT]
+ # if we don't have package for some reason
+ except:
+ package = None
+ ebErrors = self.wTree.get_widget("ebErrors")
+ lErrors = self.wTree.get_widget("lErrors")
+ bSend = self.wTree.get_widget("bSend")
+ # not usable report
+ if int(self.report[item][CONTENT]) < 3:
+ ebErrors.show()
+ ebErrors.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("red"))
+ if package:
+ lErrors.set_markup(
+ "<span color=\"white\">%s</span>" % _("Reporting disabled because the backtrace is unusable!\nPlease try to install debuginfo manually using command:<span color=\"blue\"> debuginfo-install %s </span>\nthen use Refresh button to regenerate the backtrace." % package[0:package.rfind('-',0,package.rfind('-'))]))
+ else:
+ lErrors.set_markup("<span color=\"white\">%s</span>" % _("The bactrace is unusable, you can't report this!"))
+ bSend.set_sensitive(False)
+ # probably usable 3
+ elif int(self.report[item][CONTENT]) < 4:
+ ebErrors.show()
+ ebErrors.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("yellow"))
+ lErrors.set_markup("<span color=\"black\">%s</span>" % _("The bactrace is incomplete, please make sure you provide good steps to reproduce."))
+ bSend.set_sensitive(True)
+ else:
+ ebErrors.hide()
+ bSend.set_sensitive(True)
+
if self.report[item][TYPE] != 's':
# item name 0| value 1| editable? 2| toggled? 3| visible?(attachment)4
if self.report[item][EDITABLE] == 'y':
diff --git a/src/Gui/CC_gui_functions.py b/src/Gui/CC_gui_functions.py
index 2f860087..a2ad70f6 100644
--- a/src/Gui/CC_gui_functions.py
+++ b/src/Gui/CC_gui_functions.py
@@ -54,7 +54,7 @@ def gui_report_dialog ( report_status_dict, parent_dialog,
if report_status_dict[plugin][0] == '0':
status_label.set_markup("<span foreground='red'>%s</span>" % report_status_dict[plugin][1])
elif report_status_dict[plugin][0] == '1':
- if "http" in report_status_dict[plugin][1] or "file://" in report_status_dict[plugin][1]:
+ if "http" in report_status_dict[plugin][1][0:4] or "file://" in report_status_dict[plugin][1][0:7]:
status_label.set_markup("<a href=\"%s\">%s</a>" % (report_status_dict[plugin][1], report_status_dict[plugin][1]))
# FIXME: make a new branch for rawhide with gtk 2.17 and remove this
if gtk.gtk_version[1] < 17:
diff --git a/src/Gui/CellRenderers.py b/src/Gui/CellRenderers.py
index 0bedf7a0..fe17b3ed 100644
--- a/src/Gui/CellRenderers.py
+++ b/src/Gui/CellRenderers.py
@@ -38,10 +38,7 @@ class MultilineCellRenderer(gtk.CellRendererText):
def _on_editor_key_press_event(self, editor, event):
if event.state & (gtk.gdk.SHIFT_MASK | gtk.gdk.CONTROL_MASK): return
- if event.keyval in (gtk.keysyms.Return, gtk.keysyms.KP_Enter):
- editor.remove_widget()
- self.emit("edited", editor.get_data("path"), editor.get_text())
- elif event.keyval == gtk.keysyms.Escape:
+ if event.keyval == gtk.keysyms.Escape:
editor.set_text(self.old_text)
editor.remove_widget()
self.emit("editing-canceled")
diff --git a/src/Gui/ConfBackend.py b/src/Gui/ConfBackend.py
index eb94b87b..c7b0450d 100644
--- a/src/Gui/ConfBackend.py
+++ b/src/Gui/ConfBackend.py
@@ -1,4 +1,3 @@
-from ABRTExceptions import ConfBackendInitError
from abrt_utils import _
#FIXME: add some backend factory
@@ -8,6 +7,15 @@ try:
except ImportError, e:
gkey = None
+# Exceptions
+class ConfBackendInitError(Exception):
+ def __init__(self, msg):
+ Exception.__init__(self)
+ self.what = msg
+
+ def __str__(self):
+ return self.what
+
class ConfBackend(object):
def __init__(self):
pass
@@ -24,9 +32,14 @@ class ConfBackend(object):
class ConfBackendGnomeKeyring(ConfBackend):
def __init__(self):
ConfBackend.__init__(self)
- self.default_key_ring = gkey.get_default_keyring_sync()
if not gkey.is_available():
- raise ConfBackendInitError(_("Can't connect do Gnome Keyring daemon"))
+ raise ConfBackendInitError(_("Can't connect to Gnome Keyring daemon"))
+ try:
+ self.default_key_ring = gkey.get_default_keyring_sync()
+ except:
+ # could happen if keyring daemon is running, but we run gui under
+ # user who is not owner is the running session - using su
+ raise ConfBackendInitError(_("Can't get default keyring"))
def save(self, name, settings):
settings_tmp = settings.copy()
@@ -36,7 +49,7 @@ class ConfBackendGnomeKeyring(ConfBackend):
item_list = []
try:
item_list = gkey.find_items_sync(gkey.ITEM_GENERIC_SECRET, {"AbrtPluginInfo":str(name)})
- except gkey.NoMatchError, ex:
+ except gkey.NoMatchError:
# nothing found
pass
@@ -59,7 +72,7 @@ class ConfBackendGnomeKeyring(ConfBackend):
item_list = None
try:
item_list = gkey.find_items_sync(gkey.ITEM_GENERIC_SECRET, {"AbrtPluginInfo":str(name)})
- except gkey.NoMatchError, ex:
+ except gkey.NoMatchError:
# nothing found
pass
diff --git a/src/Gui/Makefile.am b/src/Gui/Makefile.am
index ffdace54..87d996ca 100644
--- a/src/Gui/Makefile.am
+++ b/src/Gui/Makefile.am
@@ -10,11 +10,15 @@ PYTHON_FILES = CCDBusBackend.py CCDumpList.py CCDump.py CC_gui_functions.py \
GLADE_FILES = ccgui.glade report.glade settings.glade dialogs.glade settings_wizard.glade
-EXTRA_DIST = $(PYTHON_FILES) $(GLADE_FILES) abrt-gui abrt.desktop
+EXTRA_DIST = $(PYTHON_FILES) $(GLADE_FILES) abrt-gui abrt.desktop abrt.png
#ccguidir = $(pkgdatadir)
+applicationsdir = $(datadir)/applications
+applications_DATA = abrt.desktop
pkgdata_PYTHON = $(PYTHON_FILES)
pkgdata_DATA = $(GLADE_FILES)
+pixmapdir = $(datadir)/pixmaps
+pixmap_DATA = abrt.png
CLEANFILES := $(notdir $(wildcard *~)) $(notdir $(wildcard *\#)) $(notdir $(wildcard \.\#*)) $(notdir $(wildcard *.pyc))
diff --git a/src/Gui/PluginsSettingsDialog.py b/src/Gui/PluginsSettingsDialog.py
index a346455e..d8eac71e 100644
--- a/src/Gui/PluginsSettingsDialog.py
+++ b/src/Gui/PluginsSettingsDialog.py
@@ -79,7 +79,9 @@ class PluginsSettingsDialog:
self.ccdaemon.registerPlugin(plugin.getName())
# FIXME: create class plugin and move this into method Plugin.Enable()
plugin.Enabled = "yes"
- plugin.Settings = PluginSettings(self.ccdaemon.getPluginSettings(plugin.getName()))
+ default_settings = self.ccdaemon.getPluginSettings(plugin.getName())
+ plugin.Settings = PluginSettings()
+ plugin.Settings.load(plugin.getName(), default_settings)
model[path][1] = not model[path][1]
def filter_plugins(self, model, miter, data):
diff --git a/src/Gui/SettingsDialog.py b/src/Gui/SettingsDialog.py
index b3af501f..cf423938 100644
--- a/src/Gui/SettingsDialog.py
+++ b/src/Gui/SettingsDialog.py
@@ -1,9 +1,8 @@
import sys
import gtk
-from PluginList import getPluginInfoList, PluginInfoList
+from PluginList import getPluginInfoList
from CC_gui_functions import *
#from PluginSettingsUI import PluginSettingsUI
-from ABRTPlugin import PluginSettings, PluginInfo
from abrt_utils import _
@@ -75,11 +74,11 @@ class SettingsDialog:
try:
self.pluginlist = getPluginInfoList(self.ccdaemon, refresh=True)
except Exception, e:
- print "SettingsDialog: ", e
+ raise Exception("Comunication with daemon has failed, have you restarted the daemon after update?")
## hydrate cron jobs:
for key,val in self.settings["Cron"].iteritems():
- # actionas are separated by ','
+ # actions are separated by ','
actions = val.split(',')
self.settings["Cron"][key] = actions
for plugin in self.pluginlist.getActionPlugins():
@@ -120,11 +119,9 @@ class SettingsDialog:
self.add_AnalyzerAction(action)
def on_bCancelGPGKeys_clicked(self, button):
- print "cancel"
self.wGPGKeys.hide()
def on_bSaveGPGKeys_clicked(self, button):
- print "save"
self.wGPGKeys.hide()
def on_bAddGPGKey_clicked(self, button):
@@ -233,9 +230,6 @@ class SettingsDialog:
def on_bAddAction_clicked(self, button):
self.add_AnalyzerAction()
- def on_cancel_clicked(self,button):
- self.window.hide()
-
def dehydrate(self):
self.ccdaemon.setSettings(self.settings)
diff --git a/src/Gui/abrt.desktop b/src/Gui/abrt.desktop
index 64aeb207..5498a0aa 100644
--- a/src/Gui/abrt.desktop
+++ b/src/Gui/abrt.desktop
@@ -3,7 +3,7 @@ Encoding=UTF-8
Name=Automatic Bug Reporting Tool
Comment=View and report application crashes
Exec=abrt-gui
-Icon=
+Icon=abrt
Terminal=false
Type=Application
Categories=System;X-Red-Hat-Base;
diff --git a/src/Gui/abrt.png b/src/Gui/abrt.png
new file mode 100644
index 00000000..dc24865e
--- /dev/null
+++ b/src/Gui/abrt.png
Binary files differ
diff --git a/src/Gui/report.glade b/src/Gui/report.glade
index 48fbad0a..2ccf1690 100644
--- a/src/Gui/report.glade
+++ b/src/Gui/report.glade
@@ -5,7 +5,6 @@
<widget class="GtkDialog" id="reporter_dialog">
<property name="border_width">5</property>
<property name="title" translatable="yes">Report</property>
- <property name="modal">True</property>
<property name="window_position">center-on-parent</property>
<property name="default_width">400</property>
<property name="default_height">400</property>
@@ -14,10 +13,12 @@
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox4">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">2</property>
<child>
<widget class="GtkVBox" id="vbox5">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
<widget class="GtkLabel" id="label10">
<property name="visible">True</property>
@@ -45,14 +46,35 @@
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <widget class="GtkEventBox" id="ebErrors">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkLabel" id="lErrors">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"> </property>
+ <property name="use_markup">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
+ <placeholder/>
+ </child>
+ <child>
<widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
<widget class="GtkEventBox" id="eventbox1">
<property name="visible">True</property>
@@ -92,7 +114,7 @@
</widget>
<packing>
<property name="expand">False</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child internal-child="action_area">
@@ -101,7 +123,7 @@
<property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="bCancel">
- <property name="label" translatable="yes">gtk-cancel</property>
+ <property name="label">gtk-cancel</property>
<property name="response_id">-6</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -109,12 +131,14 @@
<property name="use_stock">True</property>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="bRefresh">
- <property name="label" translatable="yes">gtk-refresh</property>
+ <property name="label">gtk-refresh</property>
<property name="response_id">-50</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -122,6 +146,8 @@
<property name="use_stock">True</property>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
@@ -134,6 +160,8 @@
<property name="receives_default">True</property>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
diff --git a/src/Gui/settings_wizard.glade b/src/Gui/settings_wizard.glade
index 2af5d77d..feab4351 100644
--- a/src/Gui/settings_wizard.glade
+++ b/src/Gui/settings_wizard.glade
@@ -19,7 +19,7 @@
<child>
<object class="GtkLabel" id="lWrongSettingsWarning">
<property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;WARNING:&lt;/b&gt; Wrong settings detected for some of the enabled reporter plugins, please use the buttons bellow to open respective configuration and fix it before you proceed, otherwise the reporting process can fail.
+ <property name="label" translatable="yes">&lt;b&gt;WARNING:&lt;/b&gt; Wrong settings detected for some of the enabled reporter plugins, please use the buttons below to open respective configuration and fix it before you proceed, otherwise the reporting process can fail.
</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>