mirror of
https://github.com/gryf/wicd.git
synced 2025-12-26 00:12:29 +01:00
Create an error dialog when we get a DBus access denied error.
This commit is contained in:
@@ -160,6 +160,7 @@ language['cannot_start_daemon'] = _('Unable to connect to wicd daemon DBus inter
|
||||
"This typically means there was a problem starting the daemon. " + \
|
||||
"Check the wicd log for more info')
|
||||
language['lost_dbus'] = _('The wicd daemon has shut down, the UI will not function properly until it is restarted.')
|
||||
language['access_denied'] = _("Unable to contact the wicd dameon due to an access denied error from DBus. Please check your DBus configuration.")
|
||||
language['configuring_wireless'] = _('Configuring preferences for wireless network "$A" ($B)')
|
||||
language['configuring_wired'] = _('Configuring preferences for wired profile "$A"')
|
||||
language['scan'] = _('Scan')
|
||||
|
||||
@@ -79,7 +79,11 @@ def catchdbus(func):
|
||||
try:
|
||||
return func(*args, **kwargs)
|
||||
except DBusException, e:
|
||||
print "warning: ignoring exception %s" % e
|
||||
if "DBus.Error.AccessDenied" in e:
|
||||
error(None, language['access_denied'])
|
||||
raise DBusException(e)
|
||||
else:
|
||||
print "warning: ignoring exception %s" % e
|
||||
return None
|
||||
wrapper.__name__ = func.__name__
|
||||
wrapper.__module__ = func.__module__
|
||||
@@ -693,6 +697,7 @@ def handle_no_dbus():
|
||||
block=False))
|
||||
return False
|
||||
|
||||
@catchdbus
|
||||
def main(argv):
|
||||
""" The main frontend program.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user