diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-08-24 17:37:03 +0200 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-08-24 17:37:03 +0200 |
commit | d4a40899c270d825ff5d602fcdd5941b3fd7bd77 (patch) | |
tree | ab945262a1b16faa9f687978e0d85d85c3a6668b | |
parent | 4aa26f7373ccaadfd0a47198975afe6bbef5cd1d (diff) | |
download | abrt-d4a40899c270d825ff5d602fcdd5941b3fd7bd77.tar.gz abrt-d4a40899c270d825ff5d602fcdd5941b3fd7bd77.tar.xz abrt-d4a40899c270d825ff5d602fcdd5941b3fd7bd77.zip |
GUI: few improvements, to be more userfriendly
-rw-r--r-- | src/Gui/CCDump.py | 7 | ||||
-rw-r--r-- | src/Gui/CCMainWindow.py | 12 | ||||
-rw-r--r-- | src/Gui/CC_gui_functions.py | 9 | ||||
-rw-r--r-- | src/Gui/ccgui.glade | 212 |
4 files changed, 235 insertions, 5 deletions
diff --git a/src/Gui/CCDump.py b/src/Gui/CCDump.py index feb294a4..6993598e 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 7ae31775..e96db2bf 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 = "<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: + message = "<a href=\"%s\">%s</a>" % (message, message) + report_label += "%s\n" % message + self.wTree.get_widget("lReported").set_markup(report_label) + else: + self.wTree.get_widget("lReported").set_markup("<b>Not reported!</b>") 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 6e44160f..5a1d3541 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("<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 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("<a href=\"%s\">%s</a>" % (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 e063ec4d..80655ff5 100644 --- a/src/Gui/ccgui.glade +++ b/src/Gui/ccgui.glade @@ -1,6 +1,6 @@ <?xml version="1.0"?> <glade-interface> - <!-- interface-requires gtk+ 2.16 --> + <!-- interface-requires gtk+ 2.14 --> <!-- interface-naming-policy toplevel-contextual --> <widget class="GtkWindow" id="main_window2"> <property name="title" translatable="yes">Automatic Bug Reporting Tool</property> @@ -292,4 +292,214 @@ Zdenek Prikryl <zprikryl@redhat.com></property> </widget> </child> </widget> + <widget class="GtkWindow" id="main_window3"> + <property name="title" translatable="yes">Automatic Bug Reporting Tool</property> + <property name="window_position">center</property> + <child> + <widget class="GtkVBox" id="vbox4"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <child> + <widget class="GtkMenuBar" id="menubar2"> + <property name="visible">True</property> + <child> + <widget class="GtkMenuItem" id="menuitem5"> + <property name="visible">True</property> + <property name="label" translatable="yes">_File</property> + <property name="use_underline">True</property> + <child> + <widget class="GtkMenu" id="menu4"> + <property name="visible">True</property> + <child> + <widget class="GtkImageMenuItem" id="miQuit"> + <property name="label">gtk-quit</property> + <property name="visible">True</property> + <property name="use_underline">True</property> + <property name="use_stock">True</property> + </widget> + </child> + </widget> + </child> + </widget> + </child> + <child> + <widget class="GtkMenuItem" id="edit"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Edit</property> + <property name="use_underline">True</property> + <child> + <widget class="GtkMenu" id="menu1"> + <property name="visible">True</property> + <child> + <widget class="GtkImageMenuItem" id="miPreferences"> + <property name="label">gtk-preferences</property> + <property name="visible">True</property> + <property name="use_underline">True</property> + <property name="use_stock">True</property> + </widget> + </child> + </widget> + </child> + </widget> + </child> + <child> + <widget class="GtkMenuItem" id="menuitem8"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Help</property> + <property name="use_underline">True</property> + <child> + <widget class="GtkMenu" id="menu6"> + <property name="visible">True</property> + <child> + <widget class="GtkImageMenuItem" id="miAbout"> + <property name="label">gtk-about</property> + <property name="visible">True</property> + <property name="use_underline">True</property> + <property name="use_stock">True</property> + </widget> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <widget class="GtkToolbar" id="toolbar1"> + <property name="visible">True</property> + <child> + <widget class="GtkToolButton" id="bDelete"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="label" translatable="yes">Delete</property> + <property name="stock_id">gtk-delete</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <widget class="GtkToolButton" id="bReport"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="label" translatable="yes">Report</property> + <property name="stock_id">gtk-save</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <widget class="GtkSeparatorToolItem" id="toolbutton1"> + <property name="visible">True</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <widget class="GtkScrolledWindow" id="swDumps"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">automatic</property> + <property name="vscrollbar_policy">automatic</property> + <child> + <widget class="GtkTreeView" id="tvDumps"> + <property name="visible">True</property> + <property name="can_focus">True</property> + </widget> + </child> + </widget> + <packing> + <property name="position">2</property> + </packing> + </child> + <child> + <widget class="GtkEventBox" id="evDescription"> + <property name="visible">True</property> + <child> + <widget class="GtkLabel" id="Description"> + <property name="visible">True</property> + <property name="xalign">0.05000000074505806</property> + <property name="label" translatable="yes"><span color="white">Description</span></property> + <property name="use_markup">True</property> + </widget> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="position">3</property> + </packing> + </child> + <child> + <widget class="GtkVBox" id="vbox2"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">automatic</property> + <property name="vscrollbar_policy">automatic</property> + <child> + <widget class="GtkViewport" id="viewport1"> + <property name="visible">True</property> + <property name="resize_mode">queue</property> + <child> + <widget class="GtkLabel" id="lDescription"> + <property name="visible">True</property> + <property name="xalign">0.10000000149011612</property> + <property name="yalign">0.20000000298023224</property> + <property name="selectable">True</property> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="lReported"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Not reported!</b></property> + <property name="use_markup">True</property> + <property name="justify">fill</property> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + </widget> + <packing> + <property name="position">4</property> + </packing> + </child> + <child> + <widget class="GtkStatusbar" id="statusbar1"> + <property name="visible">True</property> + <property name="spacing">2</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="position">5</property> + </packing> + </child> + </widget> + </child> + </widget> </glade-interface> |