mirror of
https://github.com/gryf/wicd.git
synced 2026-03-27 14:33:32 +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. " + \
|
"This typically means there was a problem starting the daemon. " + \
|
||||||
"Check the wicd log for more info')
|
"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['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_wireless'] = _('Configuring preferences for wireless network "$A" ($B)')
|
||||||
language['configuring_wired'] = _('Configuring preferences for wired profile "$A"')
|
language['configuring_wired'] = _('Configuring preferences for wired profile "$A"')
|
||||||
language['scan'] = _('Scan')
|
language['scan'] = _('Scan')
|
||||||
|
|||||||
@@ -79,7 +79,11 @@ def catchdbus(func):
|
|||||||
try:
|
try:
|
||||||
return func(*args, **kwargs)
|
return func(*args, **kwargs)
|
||||||
except DBusException, e:
|
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
|
return None
|
||||||
wrapper.__name__ = func.__name__
|
wrapper.__name__ = func.__name__
|
||||||
wrapper.__module__ = func.__module__
|
wrapper.__module__ = func.__module__
|
||||||
@@ -693,6 +697,7 @@ def handle_no_dbus():
|
|||||||
block=False))
|
block=False))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@catchdbus
|
||||||
def main(argv):
|
def main(argv):
|
||||||
""" The main frontend program.
|
""" The main frontend program.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user