mirror of
https://github.com/gryf/wicd.git
synced 2025-12-21 21:38:06 +01:00
branches/experimental:
- Fix scripts dialog not appearing.
This commit is contained in:
@@ -453,6 +453,7 @@ def get_language_list_gui():
|
||||
language["backend"] = _("Backend")
|
||||
language["backend_alert"] = _("Changes to your backend won't occur until the daemon is restarted.")
|
||||
language['search_domain'] = _("Search Domain")
|
||||
language['scripts_need_pass'] = _('You must enter your password to configure scripts')
|
||||
|
||||
language['0'] = _('0')
|
||||
language['1'] = _('1')
|
||||
|
||||
@@ -636,19 +636,20 @@ class WiredNetworkEntry(NetworkEntry):
|
||||
if os.getuid() != 0:
|
||||
try:
|
||||
sudo_prog = misc.choose_sudo_prog()
|
||||
msg = "You must enter your password to configure scripts"
|
||||
msg = msg = "'%s'" % language["scripts_need_pass"]
|
||||
if sudo_prog.endswith("gksu") or sudo_prog.endswith("ktsuss"):
|
||||
msg_flag = "-m"
|
||||
else:
|
||||
msg_flag = "--caption"
|
||||
misc.LaunchAndWait([sudo_prog, msg_flag, msg,
|
||||
wpath.lib + "configscript.py", profile,
|
||||
"wired"])
|
||||
misc.LaunchAndWait(' '.join([sudo_prog, msg_flag, msg,
|
||||
os.path.join(wpath.lib, "configscript.py"),
|
||||
profile, "wired"]))
|
||||
except misc.WicdError:
|
||||
error(None, "Could not find a graphical sudo program." + \
|
||||
" Script editor could not be launched.")
|
||||
else:
|
||||
misc.LaunchAndWait([wpath.lib + "configscript.py", profile, "wired"])
|
||||
misc.LaunchAndWait(' '.join([os.path.join(wpath.lib, "configscript.py"),
|
||||
profile, "wired"]))
|
||||
|
||||
def check_enable(self):
|
||||
""" Disable objects if the profile list is empty. """
|
||||
@@ -923,20 +924,20 @@ class WirelessNetworkEntry(NetworkEntry):
|
||||
if os.getuid() != 0:
|
||||
try:
|
||||
sudo_prog = misc.choose_sudo_prog()
|
||||
msg = "You must enter your password to configure scripts"
|
||||
msg = "'%s'" % language["scripts_need_pass"]
|
||||
if sudo_prog.endswith("gksu") or sudo_prog.endswith("ktsuss"):
|
||||
msg_flag = "-m"
|
||||
else:
|
||||
msg_flag = "--caption"
|
||||
misc.LaunchAndWait([sudo_prog, msg_flag, msg,
|
||||
wpath.lib + "configscript.py",
|
||||
str(self.networkID), "wireless"])
|
||||
misc.LaunchAndWait(' '.join([sudo_prog, msg_flag, msg,
|
||||
os.path.join(wpath.lib, "configscript.py"),
|
||||
str(self.networkID), "wireless"]))
|
||||
except misc.WicdError:
|
||||
error(None, "Could not find a graphical sudo program." + \
|
||||
" Script editor could no be launched.")
|
||||
else:
|
||||
misc.LaunchAndWait(["./configscript.py", str(self.networkID),
|
||||
"wireless"])
|
||||
misc.LaunchAndWait(' '.join([os.path.join(wpath.lib, "configscript.py"),
|
||||
str(self.networkID), "wireless"]))
|
||||
|
||||
def update_autoconnect(self, widget=None):
|
||||
""" Called when the autoconnect checkbox is toggled. """
|
||||
|
||||
Reference in New Issue
Block a user