diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-03-13 13:50:07 +0100 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-03-13 13:50:07 +0100 |
commit | bc02aab93e78089ff48e381c0ced0a6dbb116efa (patch) | |
tree | 7660b0c7760232e8d76f0133ee993cf0b2320029 /src/Gui | |
parent | f1c7c25720243cb260410a57fef0c03f330dad68 (diff) | |
download | abrt-bc02aab93e78089ff48e381c0ced0a6dbb116efa.tar.gz abrt-bc02aab93e78089ff48e381c0ced0a6dbb116efa.tar.xz abrt-bc02aab93e78089ff48e381c0ced0a6dbb116efa.zip |
Added error reporting over dbus to daemon, error handling in gui, about dialog
Diffstat (limited to 'src/Gui')
-rw-r--r-- | src/Gui/CCDBusBackend.py | 14 | ||||
-rw-r--r-- | src/Gui/CCMainWindow.py | 18 | ||||
-rw-r--r-- | src/Gui/ccgui.glade | 42 |
3 files changed, 68 insertions, 6 deletions
diff --git a/src/Gui/CCDBusBackend.py b/src/Gui/CCDBusBackend.py index 1966dfda..fe0e3f5a 100644 --- a/src/Gui/CCDBusBackend.py +++ b/src/Gui/CCDBusBackend.py @@ -16,6 +16,8 @@ class DBusManager(gobject.GObject): gobject.signal_new ("crash", self ,gobject.SIGNAL_RUN_FIRST,gobject.TYPE_NONE,()) # signal emited when new analyze is complete gobject.signal_new ("analyze-complete", self ,gobject.SIGNAL_RUN_FIRST,gobject.TYPE_NONE,(gobject.TYPE_PYOBJECT,)) + # signal emited when smth fails + gobject.signal_new ("error", self ,gobject.SIGNAL_RUN_FIRST,gobject.TYPE_NONE,(gobject.TYPE_PYOBJECT,)) # binds the dbus to glib mainloop DBusGMainLoop(set_as_default=True) self.proxy = None @@ -27,6 +29,8 @@ class DBusManager(gobject.GObject): self.proxy.connect_to_signal("Crash",self.crash_cb,dbus_interface=CC_IFACE) # BT extracting complete self.acconnection = self.proxy.connect_to_signal("AnalyzeComplete",self.analyze_complete_cb,dbus_interface=CC_IFACE) + # Catch Errors + self.acconnection = self.proxy.connect_to_signal("Error",self.error_handler_cb,dbus_interface=CC_IFACE) else: raise Exception("Proxy object doesn't exist!") @@ -34,10 +38,12 @@ class DBusManager(gobject.GObject): def disconnected(*args): print "disconnect" - def error_handler(self,*args): - print "Error" - #for arg in args: - # print "error %s" % arg + def error_handler_cb(self,arg): + self.emit("error",arg) + + def error_handler(self,arg): + # used to silently ingore dbus timeouts + pass def dummy(*args): # dummy function for async method call to workaround the timeout diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py index 0e73cf13..440bd3c5 100644 --- a/src/Gui/CCMainWindow.py +++ b/src/Gui/CCMainWindow.py @@ -81,11 +81,29 @@ class MainWindow(): self.wTree.get_widget("bDelete").connect("clicked", self.on_bDelete_clicked, self.dlist) self.wTree.get_widget("bReport").connect("clicked", self.on_bReport_clicked) self.wTree.get_widget("miQuit").connect("activate", self.on_bQuit_clicked) + self.wTree.get_widget("miAbout").connect("activate", self.on_miAbout_clicked) + # connect handlers for daemon signals self.ccdaemon.connect("crash", self.on_data_changed_cb, None) self.ccdaemon.connect("analyze-complete", self.on_analyze_complete_cb, self.pBarWindow) + self.ccdaemon.connect("error", self.error_cb) # load data #self.load() + + def on_miAbout_clicked(self, widget): + dialog = self.wTree.get_widget("about") + result = dialog.run() + dialog.hide() + + + def error_cb(self, daemon, message=None): + # try to hide the progressbar, we dont really care if it was visible .. + try: + gobject.source_remove(self.timer) + self.pBarWindow.hide() + except Exception, e: + pass + gui_error_message("Unable to get report!\n%s" % message) # call to update the progressbar def progress_update_cb(self, *args): diff --git a/src/Gui/ccgui.glade b/src/Gui/ccgui.glade index a2093d1d..8a8c2a75 100644 --- a/src/Gui/ccgui.glade +++ b/src/Gui/ccgui.glade @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> -<!--Generated with glade3 3.4.5 on Wed Mar 11 11:27:03 2009 --> +<!--Generated with glade3 3.4.5 on Fri Mar 13 13:37:58 2009 --> <glade-interface> <widget class="GtkWindow" id="main_window2"> <property name="title" translatable="yes">Automatic Bug Reporting Tool</property> @@ -40,7 +40,7 @@ <widget class="GtkMenu" id="menu6"> <property name="visible">True</property> <child> - <widget class="GtkImageMenuItem" id="imagemenuitem20"> + <widget class="GtkImageMenuItem" id="miAbout"> <property name="visible">True</property> <property name="label" translatable="yes">gtk-about</property> <property name="use_underline">True</property> @@ -205,4 +205,42 @@ </widget> </child> </widget> + <widget class="GtkAboutDialog" id="about"> + <property name="border_width">5</property> + <property name="title" translatable="yes">About ABRT</property> + <property name="resizable">False</property> + <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> + <property name="has_separator">False</property> + <property name="program_name">ABRT</property> + <property name="copyright" translatable="yes">(C) 2009 Red Hat, Inc.</property> + <property name="license" translatable="yes">This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.</property> + <property name="authors">Anton Arapov <aarapov@redhat.com> +Jiri Moskovcak <jmoskovc@redhat.com> +Zdenek Prikryl <zprikryl@redhat.com></property> + <property name="wrap_license">True</property> + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox3"> + <property name="visible">True</property> + <property name="spacing">2</property> + <child> + <placeholder/> + </child> + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="dialog-action_area3"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + </widget> + </child> + </widget> </glade-interface> |