diff --git a/wicd/backends/be-ioctl.py b/wicd/backends/be-ioctl.py index 1a1c1e4..4314054 100644 --- a/wicd/backends/be-ioctl.py +++ b/wicd/backends/be-ioctl.py @@ -131,8 +131,8 @@ class Interface(BaseInterface): def CheckWirelessTools(self): """ Check for the existence needed wireless tools """ - # We don't need any external apps so just return - pass + if not WPACTRL_AVAIL: + BaseInterface.CheckWirelessTools(self) @neediface("") def GetIP(self, ifconfig=""): diff --git a/wicd/gui.py b/wicd/gui.py index 61b0b5b..2a2e174 100644 --- a/wicd/gui.py +++ b/wicd/gui.py @@ -57,7 +57,9 @@ def setup_dbus(force=True): except DBusException: if force: print "Can't connect to the daemon, trying to start it automatically..." - misc.PromptToStartDaemon() + if not misc.PromptToStartDaemon(): + print "Failed to find a graphical sudo program, cannot continue." + return False try: dbusmanager.connect_to_dbus() except DBusException: diff --git a/wicd/misc.py b/wicd/misc.py index 3b66f2f..202c9a4 100644 --- a/wicd/misc.py +++ b/wicd/misc.py @@ -155,6 +155,8 @@ def PromptToStartDaemon(): """ Prompt the user to start the daemon """ daemonloc = wpath.sbin + 'wicd' sudo_prog = choose_sudo_prog() + if not sudo_prog: + return False if "gksu" in sudo_prog or "ktsuss" in sudo_prog: msg = '--message' else: @@ -163,6 +165,7 @@ def PromptToStartDaemon(): 'Wicd needs to access your computer\'s network cards.', daemonloc] os.spawnvpe(os.P_WAIT, sudo_prog, sudo_args, os.environ) + return True def RunRegex(regex, string): """ runs a regex search on a string """ @@ -453,8 +456,7 @@ def choose_sudo_prog(prog_num=0): for path in paths: if os.path.exists(path): return path - - return None + return "" def find_path(cmd): """ Try to find a full path for a given file name.