hplip/hplip-systray-dbus-exception.patch

19 lines
693 B
Diff

diff -up hplip-3.11.10/ui4/systemtray.py.dbus-exception hplip-3.11.10/ui4/systemtray.py
--- hplip-3.11.10/ui4/systemtray.py.dbus-exception 2011-10-25 15:59:53.360181865 +0100
+++ hplip-3.11.10/ui4/systemtray.py 2011-10-25 16:03:55.294815114 +0100
@@ -707,7 +707,13 @@ def run(read_pipe):
log.set_module("hp-systray(qt4)")
log.debug("PID=%d" % os.getpid())
- app = SystemTrayApp(sys.argv, read_pipe)
+ try:
+ app = SystemTrayApp(sys.argv, read_pipe)
+ except DBusException, e:
+ # No session bus
+ log.debug("Caught exception: %s" % e)
+ sys.exit(1)
+
app.setQuitOnLastWindowClosed(False) # If not set, settings dlg closes app
i = 0