diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-08-17 11:48:18 +0200 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-08-17 11:48:18 +0200 |
commit | 19329569c399e944d24d293c5ee90c945ed482a1 (patch) | |
tree | ed90a82a85a36e614b397a784bda46b91cb7a6e3 /src/Gui/CCDBusBackend.py | |
parent | 3c226c987f5015e8184bfc4293ee9f9b2f7b8f67 (diff) | |
download | abrt-19329569c399e944d24d293c5ee90c945ed482a1.tar.gz abrt-19329569c399e944d24d293c5ee90c945ed482a1.tar.xz abrt-19329569c399e944d24d293c5ee90c945ed482a1.zip |
GUI now show the status window after report to let user know how did it go.
Diffstat (limited to 'src/Gui/CCDBusBackend.py')
-rw-r--r-- | src/Gui/CCDBusBackend.py | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/Gui/CCDBusBackend.py b/src/Gui/CCDBusBackend.py index d440627b..ee99e3d6 100644 --- a/src/Gui/CCDBusBackend.py +++ b/src/Gui/CCDBusBackend.py @@ -56,12 +56,14 @@ class DBusManager(gobject.GObject): 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,)) + gobject.signal_new ("warning", self ,gobject.SIGNAL_RUN_FIRST,gobject.TYPE_NONE,(gobject.TYPE_PYOBJECT,)) # signal emited to update gui with current status gobject.signal_new ("update", self ,gobject.SIGNAL_RUN_FIRST,gobject.TYPE_NONE,(gobject.TYPE_PYOBJECT,)) # signal emited to show gui if user try to run it again gobject.signal_new ("show", self ,gobject.SIGNAL_RUN_FIRST,gobject.TYPE_NONE,()) # signal emited to show gui if user try to run it again gobject.signal_new ("daemon-state-changed", self ,gobject.SIGNAL_RUN_FIRST,gobject.TYPE_NONE,(gobject.TYPE_PYOBJECT,)) + gobject.signal_new ("report-done", self ,gobject.SIGNAL_RUN_FIRST,gobject.TYPE_NONE,(gobject.TYPE_PYOBJECT,)) # export the app dbus interface if session: @@ -76,6 +78,9 @@ class DBusManager(gobject.GObject): def error_handler_cb(self,arg): self.emit("error",arg) + + def warning_handler_cb(self,arg): + self.emit("warning",arg) def error_handler(self,arg): # used to silently ingore dbus timeouts @@ -98,6 +103,11 @@ class DBusManager(gobject.GObject): #if self.uniq_name == dest: self.emit("update", message) + def warning_cb(self, message, dest=None): + # FIXME: use dest instead of 0 once we implement it in daemon + #if self.uniq_name == dest: + self.emit("warning", message) + def analyze_complete_cb(self,dump): #for arg in args: # print "Analyze complete for: %s" % arg @@ -138,6 +148,8 @@ class DBusManager(gobject.GObject): self.acconnection = self.proxy.connect_to_signal("Error",self.error_handler_cb,dbus_interface=CC_IFACE) # watch for updates self.acconnection = self.proxy.connect_to_signal("Update",self.update_cb,dbus_interface=CC_IFACE) + # watch for warnings + self.acconnection = self.proxy.connect_to_signal("Warning",self.warning_cb,dbus_interface=CC_IFACE) # watch for job-done signals self.acconnection = self.proxy.connect_to_signal("JobDone",self.jobdone_cb,dbus_interface=CC_IFACE) else: @@ -154,6 +166,9 @@ class DBusManager(gobject.GObject): self.emit("analyze-complete", dump) else: self.emit("error","Daemon did't return valid report info\nDebuginfo is missing?") + + def report_done(self, result): + self.emit("report-done", result) def getReport(self, UUID): try: @@ -165,8 +180,8 @@ class DBusManager(gobject.GObject): raise Exception(e) def Report(self,report): - # FIXME async - return self.cc.Report(report) + # map < Plguin_name vec <status, message> > + self.cc.Report(report, reply_handler=self.report_done, error_handler=self.error_handler_cb, timeout=60) def DeleteDebugDump(self,UUID): return self.cc.DeleteDebugDump(UUID) @@ -186,7 +201,10 @@ class DBusManager(gobject.GObject): return self.cc.GetPluginsInfo() def getPluginSettings(self, plugin_name): - return self.cc.GetPluginSettings(plugin_name) + settings = self.cc.GetPluginSettings(plugin_name) + #for i in settings.keys(): + # print i + return settings def registerPlugin(self, plugin_name): return self.cc.RegisterPlugin(plugin_name) |