summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-09-30 13:10:22 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-09-30 13:10:22 +0200
commit0a901ba3e651a70984e980f61619b005031a71f0 (patch)
treeb3634ed25b6548f412840aa1750ac1759de137aa
parent9eadd8057f73fc8ed6aa32134d4e9acfd3fd4fc5 (diff)
downloadabrt-0a901ba3e651a70984e980f61619b005031a71f0.tar.gz
abrt-0a901ba3e651a70984e980f61619b005031a71f0.tar.xz
abrt-0a901ba3e651a70984e980f61619b005031a71f0.zip
abrt-gui: make "report" toolbar button work even if abrtd is not running
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--src/Gui/CCDBusBackend.py23
-rw-r--r--src/Gui/CCMainWindow.py9
2 files changed, 21 insertions, 11 deletions
diff --git a/src/Gui/CCDBusBackend.py b/src/Gui/CCDBusBackend.py
index c1134882..32310203 100644
--- a/src/Gui/CCDBusBackend.py
+++ b/src/Gui/CCDBusBackend.py
@@ -125,12 +125,17 @@ class DBusManager(gobject.GObject):
# when abrtd is autostarted by dbus-daemon: connect_to_daemon() would install
# duplicate signal handlers!
def owner_changed_cb(self,name, old_owner, new_owner):
- if(name == CC_NAME and new_owner):
- #self.proxy = self.connect_to_daemon()
- self.emit("daemon-state-changed", "up")
- if(name == CC_NAME and not(new_owner)):
- #self.proxy = None
- self.emit("daemon-state-changed", "down")
+ if name == CC_NAME:
+ # No need to connect at once, we can do it when we need it
+ # (and this "connect on demand" mode of operation is needed
+ # anyway if abrtd is autostarted by dbus: before we call it,
+ # there is no abrtd to connect to!)
+ if new_owner:
+ #self.proxy = self.connect_to_daemon()
+ self.emit("daemon-state-changed", "up")
+ else:
+ #self.proxy = None
+ self.emit("daemon-state-changed", "down")
def connect_to_daemon(self):
@@ -176,7 +181,11 @@ class DBusManager(gobject.GObject):
# we don't need the return value, as the job_id is sent via JobStarted signal
self.cc.CreateReport(UUID, timeout=60)
except dbus.exceptions.DBusException, e:
- raise Exception(e)
+ # One case when it fails is if abrtd exited and needs to be
+ # autostarted by dbus again. (This is a first stab
+ # at making it work in this case, I want to find a better way)
+ self.connect_to_daemon()
+ self.cc.CreateReport(UUID, timeout=60)
def Report(self, report, reporters_settings = None):
# map < Plguin_name vec <status, message> >
diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py
index a9976a37..9bfc9500 100644
--- a/src/Gui/CCMainWindow.py
+++ b/src/Gui/CCMainWindow.py
@@ -130,10 +130,11 @@ class MainWindow():
def on_daemon_state_changed_cb(self, widget, state):
if state == "up":
- self.hydrate()
- self.window.set_sensitive(True)
- elif state == "down":
- self.window.set_sensitive(False)
+ self.hydrate() # refresh crash list
+ #self.window.set_sensitive(True)
+ # abrtd might just die on timeout, it's not fatal
+ #elif state == "down":
+ # self.window.set_sensitive(False)
def on_popupActivate(self, widget, event):
menu = self.wTree.get_widget("popup_menu")