From d4a40899c270d825ff5d602fcdd5941b3fd7bd77 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Mon, 24 Aug 2009 17:37:03 +0200 Subject: GUI: few improvements, to be more userfriendly --- src/Gui/CCDump.py | 7 ++ src/Gui/CCMainWindow.py | 12 ++- src/Gui/CC_gui_functions.py | 9 +- src/Gui/ccgui.glade | 212 +++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 235 insertions(+), 5 deletions(-) (limited to 'src/Gui') diff --git a/src/Gui/CCDump.py b/src/Gui/CCDump.py index feb294a..6993598 100644 --- a/src/Gui/CCDump.py +++ b/src/Gui/CCDump.py @@ -15,6 +15,7 @@ class Dump(): self.Package = None self.Time = None self.Description = None + self.Message = None self.Reported = None def getUUID(self): @@ -34,6 +35,12 @@ class Dump(): def isReported(self): return self.Reported[CONTENT] == "1" + + def getMessage(self): + if not self.Message: + return [] + #return self.Message[CONTENT].split('\n') + return self.Message[CONTENT] def getTime(self,format): #print format diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py index 7ae3177..e96db2b 100644 --- a/src/Gui/CCMainWindow.py +++ b/src/Gui/CCMainWindow.py @@ -42,7 +42,7 @@ class MainWindow(): self.wTree = gtk.glade.XML(self.gladefile) #Get the Main Window, and connect the "destroy" event - self.window = self.wTree.get_widget("main_window2") + self.window = self.wTree.get_widget("main_window3") self.window.set_default_size(700, 480) if (self.window): self.window.connect("delete_event", self.delete_event_cb) @@ -203,6 +203,16 @@ class MainWindow(): # this should work until we keep the row object in the last position dump = dumpsListStore.get_value(dumpsListStore.get_iter(path[0]), dumpsListStore.get_n_columns()-1) #move this to Dump class + if dump.isReported(): + report_label = "This crash has been reported, you can find the report(s) at:\n" + for message in dump.getMessage().split('\n'): + if message: + if "http" in message or "file:///" in message: + message = "%s" % (message, message) + report_label += "%s\n" % message + self.wTree.get_widget("lReported").set_markup(report_label) + else: + self.wTree.get_widget("lReported").set_markup("Not reported!") lPackage = self.wTree.get_widget("lPackage") self.wTree.get_widget("lDescription").set_label(dump.getDescription()) diff --git a/src/Gui/CC_gui_functions.py b/src/Gui/CC_gui_functions.py index 6e44160..5a1d354 100644 --- a/src/Gui/CC_gui_functions.py +++ b/src/Gui/CC_gui_functions.py @@ -2,7 +2,8 @@ import gtk import subprocess import sys -# url markup is supported from gtk 2.18 so we need to use libsexy +# url markup is supported from gtk 2.17 so we need to use libsexy +# FIXME: make a new branch for rawhide with gtk 2.17 and remove this if gtk.gtk_version[1] < 17: from sexy import UrlLabel as Label on_url_clicked_signal = "url-activated" @@ -51,9 +52,11 @@ def gui_report_dialog ( report_status_dict, parent_dialog, if report_status_dict[plugin][0] == '0': status_label.set_markup("%s" % report_status_dict[plugin][1]) elif report_status_dict[plugin][0] == '1': - if "http" in report_status_dict[plugin][1] or report_status_dict[plugin][1][0] == '/': + if "http" in report_status_dict[plugin][1] or "file://" in report_status_dict[plugin][1]: status_label.set_markup("%s" % (report_status_dict[plugin][1], report_status_dict[plugin][1])) - status_label.connect(on_url_clicked_signal, on_url_clicked) + # FIXME: make a new branch for rawhide with gtk 2.17 and remove this + if gtk.gtk_version[1] < 17: + status_label.connect(on_url_clicked_signal, on_url_clicked) else: status_label.set_text("%s" % report_status_dict[plugin][1]) status_vbox.pack_start(status_hbox, expand=False) diff --git a/src/Gui/ccgui.glade b/src/Gui/ccgui.glade index e063ec4..80655ff 100644 --- a/src/Gui/ccgui.glade +++ b/src/Gui/ccgui.glade @@ -1,6 +1,6 @@ - + Automatic Bug Reporting Tool @@ -292,4 +292,214 @@ Zdenek Prikryl <zprikryl@redhat.com> + + Automatic Bug Reporting Tool + center + + + True + vertical + + + True + + + True + _File + True + + + True + + + gtk-quit + True + True + True + + + + + + + + + True + _Edit + True + + + True + + + gtk-preferences + True + True + True + + + + + + + + + True + _Help + True + + + True + + + gtk-about + True + True + True + + + + + + + + + False + 0 + + + + + True + + + True + False + Delete + gtk-delete + + + False + True + + + + + True + False + Report + gtk-save + + + False + True + + + + + True + + + False + True + + + + + False + 1 + + + + + True + True + automatic + automatic + + + True + True + + + + + 2 + + + + + True + + + True + 0.05000000074505806 + <span color="white">Description</span> + True + + + + + False + 3 + + + + + True + vertical + + + True + True + automatic + automatic + + + True + queue + + + True + 0.10000000149011612 + 0.20000000298023224 + True + + + + + + + 0 + + + + + True + <b>Not reported!</b> + True + fill + + + 1 + + + + + 4 + + + + + True + 2 + + + False + 5 + + + + + -- cgit