mirror of
https://github.com/gryf/wicd.git
synced 2025-12-29 01:42:33 +01:00
Merged with r260 of the mainline 1.6 branch.
This commit is contained in:
1085
data/wicd.glade
1085
data/wicd.glade
File diff suppressed because it is too large
Load Diff
@@ -536,10 +536,13 @@ def get_language_list_gui():
|
|||||||
language['bad_pass'] = _('Connection Failed: Could not authenticate (bad password?)')
|
language['bad_pass'] = _('Connection Failed: Could not authenticate (bad password?)')
|
||||||
language['done'] = _('Done connecting...')
|
language['done'] = _('Done connecting...')
|
||||||
language['scanning'] = _('Scanning')
|
language['scanning'] = _('Scanning')
|
||||||
|
language['scanning_stand_by'] = _('Scanning networks... stand by...')
|
||||||
language['cannot_start_daemon'] = _("Unable to connect to wicd daemon DBus interface. " + \
|
language['cannot_start_daemon'] = _("Unable to connect to wicd daemon DBus interface. " + \
|
||||||
"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['configuring_wireless'] = ("Configuring preferences for wireless network \"$A\" ($B)")
|
||||||
|
language['configuring_wired'] = ("Configuring preferences for wired profile \"$A\"")
|
||||||
|
|
||||||
return language
|
return language
|
||||||
|
|
||||||
|
|||||||
@@ -551,21 +551,7 @@ class WiredNetworkEntry(NetworkEntry):
|
|||||||
self.button_delete = gtk.Button(stock=gtk.STOCK_DELETE)
|
self.button_delete = gtk.Button(stock=gtk.STOCK_DELETE)
|
||||||
self.profile_help = gtk.Label(language['wired_network_instructions'])
|
self.profile_help = gtk.Label(language['wired_network_instructions'])
|
||||||
self.chkbox_default_profile = gtk.CheckButton(language['default_wired'])
|
self.chkbox_default_profile = gtk.CheckButton(language['default_wired'])
|
||||||
|
|
||||||
# Build the profile list.
|
|
||||||
self.combo_profile_names = gtk.combo_box_new_text()
|
self.combo_profile_names = gtk.combo_box_new_text()
|
||||||
self.profile_list = wired.GetWiredProfileList()
|
|
||||||
default_prof = wired.GetDefaultWiredNetwork()
|
|
||||||
if self.profile_list:
|
|
||||||
starting_index = 0
|
|
||||||
for x, prof in enumerate(self.profile_list):
|
|
||||||
self.combo_profile_names.append_text(prof)
|
|
||||||
if default_prof == prof:
|
|
||||||
starting_index = x
|
|
||||||
self.combo_profile_names.set_active(starting_index)
|
|
||||||
else:
|
|
||||||
print "no wired profiles found"
|
|
||||||
self.profile_help.show()
|
|
||||||
|
|
||||||
# Format the profile help label.
|
# Format the profile help label.
|
||||||
self.profile_help.set_justify(gtk.JUSTIFY_LEFT)
|
self.profile_help.set_justify(gtk.JUSTIFY_LEFT)
|
||||||
@@ -588,11 +574,26 @@ class WiredNetworkEntry(NetworkEntry):
|
|||||||
self.chkbox_default_profile.connect("toggled",
|
self.chkbox_default_profile.connect("toggled",
|
||||||
self.toggle_default_profile)
|
self.toggle_default_profile)
|
||||||
self.combo_profile_names.connect("changed", self.change_profile)
|
self.combo_profile_names.connect("changed", self.change_profile)
|
||||||
|
|
||||||
|
# Build profile list.
|
||||||
|
self.profile_list = wired.GetWiredProfileList()
|
||||||
|
default_prof = wired.GetDefaultWiredNetwork()
|
||||||
|
if self.profile_list:
|
||||||
|
starting_index = 0
|
||||||
|
for x, prof in enumerate(self.profile_list):
|
||||||
|
self.combo_profile_names.append_text(prof)
|
||||||
|
if default_prof == prof:
|
||||||
|
starting_index = x
|
||||||
|
self.combo_profile_names.set_active(starting_index)
|
||||||
|
else:
|
||||||
|
print "no wired profiles found"
|
||||||
|
self.profile_help.show()
|
||||||
|
|
||||||
|
self.advanced_dialog = WiredSettingsDialog(self.combo_profile_names.get_active_text())
|
||||||
|
|
||||||
# Show everything, but hide the profile help label.
|
# Show everything, but hide the profile help label.
|
||||||
self.show_all()
|
self.show_all()
|
||||||
self.profile_help.hide()
|
self.profile_help.hide()
|
||||||
self.advanced_dialog = WiredSettingsDialog(self.combo_profile_names.get_active_text())
|
|
||||||
|
|
||||||
# Toggle the default profile checkbox to the correct state.
|
# Toggle the default profile checkbox to the correct state.
|
||||||
if to_bool(wired.GetWiredProperty("default")):
|
if to_bool(wired.GetWiredProperty("default")):
|
||||||
@@ -700,17 +701,12 @@ class WiredNetworkEntry(NetworkEntry):
|
|||||||
return
|
return
|
||||||
|
|
||||||
profile_name = self.combo_profile_names.get_active_text()
|
profile_name = self.combo_profile_names.get_active_text()
|
||||||
self.advanced_dialog.prof_name = profile_name
|
|
||||||
wired.ReadWiredNetworkProfile(profile_name)
|
wired.ReadWiredNetworkProfile(profile_name)
|
||||||
|
|
||||||
self.advanced_dialog.txt_ip.set_text(self.format_entry("ip"))
|
if hasattr(self, 'advanced_dialog'):
|
||||||
self.advanced_dialog.txt_netmask.set_text(self.format_entry("netmask"))
|
self.advanced_dialog.prof_name = profile_name
|
||||||
self.advanced_dialog.txt_gateway.set_text(self.format_entry("gateway"))
|
self.advanced_dialog.set_values()
|
||||||
self.advanced_dialog.txt_dns_1.set_text(self.format_entry("dns1"))
|
|
||||||
self.advanced_dialog.txt_dns_2.set_text(self.format_entry("dns2"))
|
|
||||||
self.advanced_dialog.txt_dns_3.set_text(self.format_entry("dns3"))
|
|
||||||
self.advanced_dialog.prof_name = profile_name
|
|
||||||
|
|
||||||
is_default = wired.GetWiredProperty("default")
|
is_default = wired.GetWiredProperty("default")
|
||||||
self.chkbox_default_profile.set_active(to_bool(is_default))
|
self.chkbox_default_profile.set_active(to_bool(is_default))
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ import os
|
|||||||
import pango
|
import pango
|
||||||
import time
|
import time
|
||||||
import atexit
|
import atexit
|
||||||
|
from dbus import DBusException
|
||||||
|
|
||||||
# Wicd specific imports
|
# Wicd specific imports
|
||||||
from wicd import wpath
|
from wicd import wpath
|
||||||
|
|||||||
@@ -1147,7 +1147,7 @@ class WirelessDaemon(dbus.service.Object):
|
|||||||
# Read the essid because we need to name those hidden
|
# Read the essid because we need to name those hidden
|
||||||
# wireless networks now - but only read it if it is hidden.
|
# wireless networks now - but only read it if it is hidden.
|
||||||
if cur_network["hidden"]:
|
if cur_network["hidden"]:
|
||||||
cur_network["essid"] = config.get(section, x)
|
cur_network["essid"] = self.config.get(section, "essid")
|
||||||
if cur_network["essid"] in ["", "Hidden", "<hidden>"]:
|
if cur_network["essid"] in ["", "Hidden", "<hidden>"]:
|
||||||
cur_network["essid"] = "<hidden>"
|
cur_network["essid"] = "<hidden>"
|
||||||
for x in self.config.options(section):
|
for x in self.config.options(section):
|
||||||
@@ -1416,8 +1416,9 @@ class WiredDaemon(dbus.service.Object):
|
|||||||
if self.config.has_section(profilename):
|
if self.config.has_section(profilename):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
for option in ["ip", "broadcast", "netmask","gateway", "dns1", "dns2",
|
for option in ["ip", "broadcast", "netmask","gateway", "search_domain",
|
||||||
"dns3", "beforescript", "afterscript", "disconnectscript"]:
|
"dns_domain", "dns1", "dns2", "dns3", "beforescript",
|
||||||
|
"afterscript", "disconnectscript"]:
|
||||||
self.config.set(profilename, option, None)
|
self.config.set(profilename, option, None)
|
||||||
self.config.set(profilename, "default", default)
|
self.config.set(profilename, "default", default)
|
||||||
self.config.write()
|
self.config.write()
|
||||||
@@ -1428,29 +1429,24 @@ class WiredDaemon(dbus.service.Object):
|
|||||||
""" Finds the previous lastused network, and sets lastused to False. """
|
""" Finds the previous lastused network, and sets lastused to False. """
|
||||||
profileList = self.config.sections()
|
profileList = self.config.sections()
|
||||||
for profile in profileList:
|
for profile in profileList:
|
||||||
if self.config.has_option(profile, "lastused"):
|
if misc.to_bool(self.config.get(profile, "lastused")):
|
||||||
if misc.to_bool(self.config.get(profile, "lastused")):
|
self.config.set(profile, "lastused", False, write=True)
|
||||||
self.config.set(profile, "lastused", False)
|
|
||||||
self.SaveWiredNetworkProfile(profile)
|
|
||||||
|
|
||||||
@dbus.service.method('org.wicd.daemon.wired')
|
@dbus.service.method('org.wicd.daemon.wired')
|
||||||
def UnsetWiredDefault(self):
|
def UnsetWiredDefault(self):
|
||||||
""" Unsets the default option in the current default wired profile. """
|
""" Unsets the default option in the current default wired profile. """
|
||||||
profileList = self.config.sections()
|
profileList = self.config.sections()
|
||||||
for profile in profileList:
|
for profile in profileList:
|
||||||
if self.config.has_option(profile, "default"):
|
if misc.to_bool(self.config.get(profile, "default")):
|
||||||
if misc.to_bool(self.config.get(profile, "default")):
|
self.config.set(profile, "default", False, write=True)
|
||||||
self.config.set(profile, "default", False)
|
|
||||||
self.SaveWiredNetworkProfile(profile)
|
|
||||||
|
|
||||||
@dbus.service.method('org.wicd.daemon.wired')
|
@dbus.service.method('org.wicd.daemon.wired')
|
||||||
def GetDefaultWiredNetwork(self):
|
def GetDefaultWiredNetwork(self):
|
||||||
""" Returns the current default wired network. """
|
""" Returns the current default wired network. """
|
||||||
profileList = self.config.sections()
|
profileList = self.config.sections()
|
||||||
for profile in profileList:
|
for profile in profileList:
|
||||||
if self.config.has_option(profile, "default"):
|
if misc.to_bool(self.config.get(profile, "default")):
|
||||||
if misc.to_bool(self.config.get(profile, "default")):
|
return profile
|
||||||
return profile
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@dbus.service.method('org.wicd.daemon.wired')
|
@dbus.service.method('org.wicd.daemon.wired')
|
||||||
@@ -1458,9 +1454,8 @@ class WiredDaemon(dbus.service.Object):
|
|||||||
""" Returns the profile of the last used wired network. """
|
""" Returns the profile of the last used wired network. """
|
||||||
profileList = self.config.sections()
|
profileList = self.config.sections()
|
||||||
for profile in profileList:
|
for profile in profileList:
|
||||||
if self.config.has_option(profile, "lastused"):
|
if misc.to_bool(self.config.get(profile, "lastused")):
|
||||||
if misc.to_bool(self.config.get(profile, "lastused")):
|
return profile
|
||||||
return profile
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@dbus.service.method('org.wicd.daemon.wired')
|
@dbus.service.method('org.wicd.daemon.wired')
|
||||||
@@ -1481,6 +1476,8 @@ class WiredDaemon(dbus.service.Object):
|
|||||||
if profilename == "":
|
if profilename == "":
|
||||||
self.config.write()
|
self.config.write()
|
||||||
return "500: Bad Profile name"
|
return "500: Bad Profile name"
|
||||||
|
if self.debug_mode:
|
||||||
|
print "saving wired profile %s" % profilename
|
||||||
profilename = misc.to_unicode(profilename)
|
profilename = misc.to_unicode(profilename)
|
||||||
self.config.remove_section(profilename)
|
self.config.remove_section(profilename)
|
||||||
self.config.add_section(profilename)
|
self.config.add_section(profilename)
|
||||||
@@ -1499,6 +1496,8 @@ class WiredDaemon(dbus.service.Object):
|
|||||||
profile = {}
|
profile = {}
|
||||||
profilename = misc.to_unicode(profilename)
|
profilename = misc.to_unicode(profilename)
|
||||||
if self.config.has_section(profilename):
|
if self.config.has_section(profilename):
|
||||||
|
if self.debug_mode:
|
||||||
|
print "Reading wired profile %s" % profilename
|
||||||
for x in self.config.options(profilename):
|
for x in self.config.options(profilename):
|
||||||
profile[x] = misc.Noneify(self.config.get(profilename, x))
|
profile[x] = misc.Noneify(self.config.get(profilename, x))
|
||||||
profile['use_global_dns'] = bool(profile.get('use_global_dns'))
|
profile['use_global_dns'] = bool(profile.get('use_global_dns'))
|
||||||
|
|||||||
Reference in New Issue
Block a user