mirror of
https://github.com/gryf/wicd.git
synced 2025-12-20 04:48:00 +01:00
Handle wicd-daemon not running when client starts, thanks to David Cantrell
This commit is contained in:
@@ -43,6 +43,10 @@ except dbus.DBusException:
|
|||||||
print 'Error: Could not connect to the daemon. Please make sure it is running.'
|
print 'Error: Could not connect to the daemon. Please make sure it is running.'
|
||||||
sys.exit(3)
|
sys.exit(3)
|
||||||
|
|
||||||
|
if not daemon:
|
||||||
|
print 'Error connecting to wicd via D-Bus. Please make sure the wicd service is running.'
|
||||||
|
sys.exit(3)
|
||||||
|
|
||||||
parser = optparse.OptionParser()
|
parser = optparse.OptionParser()
|
||||||
|
|
||||||
parser.add_option('--network', '-n', type='int', default=-1)
|
parser.add_option('--network', '-n', type='int', default=-1)
|
||||||
|
|||||||
@@ -1018,6 +1018,10 @@ def setup_dbus(force=True):
|
|||||||
wireless = dbus_ifaces['wireless']
|
wireless = dbus_ifaces['wireless']
|
||||||
wired = dbus_ifaces['wired']
|
wired = dbus_ifaces['wired']
|
||||||
|
|
||||||
|
if not daemon:
|
||||||
|
print 'Error connecting to wicd via D-Bus. Please make sure the wicd service is running.'
|
||||||
|
sys.exit(3)
|
||||||
|
|
||||||
netentry_curses.dbus_init(dbus_ifaces)
|
netentry_curses.dbus_init(dbus_ifaces)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
11
gtk/gui.py
11
gtk/gui.py
@@ -145,6 +145,17 @@ class appGui(object):
|
|||||||
""" Initializes everything needed for the GUI. """
|
""" Initializes everything needed for the GUI. """
|
||||||
setup_dbus()
|
setup_dbus()
|
||||||
|
|
||||||
|
if not daemon:
|
||||||
|
errmsg = "Error connecting to wicd service via D-Bus." + \
|
||||||
|
"Please ensure the wicd service is running."
|
||||||
|
d = gtk.MessageDialog(parent=None,
|
||||||
|
flags=gtk.DIALOG_MODAL,
|
||||||
|
type=gtk.MESSAGE_ERROR,
|
||||||
|
buttons=gtk.BUTTONS_OK,
|
||||||
|
message_format=errmsg)
|
||||||
|
d.run()
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
self.tray = tray
|
self.tray = tray
|
||||||
|
|
||||||
gladefile = os.path.join(wpath.gtk, "wicd.ui")
|
gladefile = os.path.join(wpath.gtk, "wicd.ui")
|
||||||
|
|||||||
Reference in New Issue
Block a user