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"] = _("Backend")
|
||||||
language["backend_alert"] = _("Changes to your backend won't occur until the daemon is restarted.")
|
language["backend_alert"] = _("Changes to your backend won't occur until the daemon is restarted.")
|
||||||
language['search_domain'] = _("Search Domain")
|
language['search_domain'] = _("Search Domain")
|
||||||
|
language['scripts_need_pass'] = _('You must enter your password to configure scripts')
|
||||||
|
|
||||||
language['0'] = _('0')
|
language['0'] = _('0')
|
||||||
language['1'] = _('1')
|
language['1'] = _('1')
|
||||||
|
|||||||
@@ -636,19 +636,20 @@ class WiredNetworkEntry(NetworkEntry):
|
|||||||
if os.getuid() != 0:
|
if os.getuid() != 0:
|
||||||
try:
|
try:
|
||||||
sudo_prog = misc.choose_sudo_prog()
|
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"):
|
if sudo_prog.endswith("gksu") or sudo_prog.endswith("ktsuss"):
|
||||||
msg_flag = "-m"
|
msg_flag = "-m"
|
||||||
else:
|
else:
|
||||||
msg_flag = "--caption"
|
msg_flag = "--caption"
|
||||||
misc.LaunchAndWait([sudo_prog, msg_flag, msg,
|
misc.LaunchAndWait(' '.join([sudo_prog, msg_flag, msg,
|
||||||
wpath.lib + "configscript.py", profile,
|
os.path.join(wpath.lib, "configscript.py"),
|
||||||
"wired"])
|
profile, "wired"]))
|
||||||
except misc.WicdError:
|
except misc.WicdError:
|
||||||
error(None, "Could not find a graphical sudo program." + \
|
error(None, "Could not find a graphical sudo program." + \
|
||||||
" Script editor could not be launched.")
|
" Script editor could not be launched.")
|
||||||
else:
|
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):
|
def check_enable(self):
|
||||||
""" Disable objects if the profile list is empty. """
|
""" Disable objects if the profile list is empty. """
|
||||||
@@ -923,20 +924,20 @@ class WirelessNetworkEntry(NetworkEntry):
|
|||||||
if os.getuid() != 0:
|
if os.getuid() != 0:
|
||||||
try:
|
try:
|
||||||
sudo_prog = misc.choose_sudo_prog()
|
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"):
|
if sudo_prog.endswith("gksu") or sudo_prog.endswith("ktsuss"):
|
||||||
msg_flag = "-m"
|
msg_flag = "-m"
|
||||||
else:
|
else:
|
||||||
msg_flag = "--caption"
|
msg_flag = "--caption"
|
||||||
misc.LaunchAndWait([sudo_prog, msg_flag, msg,
|
misc.LaunchAndWait(' '.join([sudo_prog, msg_flag, msg,
|
||||||
wpath.lib + "configscript.py",
|
os.path.join(wpath.lib, "configscript.py"),
|
||||||
str(self.networkID), "wireless"])
|
str(self.networkID), "wireless"]))
|
||||||
except misc.WicdError:
|
except misc.WicdError:
|
||||||
error(None, "Could not find a graphical sudo program." + \
|
error(None, "Could not find a graphical sudo program." + \
|
||||||
" Script editor could no be launched.")
|
" Script editor could no be launched.")
|
||||||
else:
|
else:
|
||||||
misc.LaunchAndWait(["./configscript.py", str(self.networkID),
|
misc.LaunchAndWait(' '.join([os.path.join(wpath.lib, "configscript.py"),
|
||||||
"wireless"])
|
str(self.networkID), "wireless"]))
|
||||||
|
|
||||||
def update_autoconnect(self, widget=None):
|
def update_autoconnect(self, widget=None):
|
||||||
""" Called when the autoconnect checkbox is toggled. """
|
""" Called when the autoconnect checkbox is toggled. """
|
||||||
|
|||||||
Reference in New Issue
Block a user