1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-19 20:38:00 +01:00

Make pinging wireless access points when using static gateways optional.

This commit is contained in:
Dan O'Reilly
2009-11-24 00:27:41 -05:00
parent 6164b59691
commit 51f8637d95
7 changed files with 108 additions and 231 deletions

View File

@@ -118,6 +118,7 @@ class PrefsDialog(urwid.WidgetWrap):
wless_cat_t = ('header', language['wireless_interface']) wless_cat_t = ('header', language['wireless_interface'])
use_dbm_t = language['display_type_dialog'] use_dbm_t = language['display_type_dialog']
verify_ap_t = language['verify_ap_dialog']
@@ -225,6 +226,7 @@ class PrefsDialog(urwid.WidgetWrap):
self.wless_cat = urwid.Text(wless_cat_t) self.wless_cat = urwid.Text(wless_cat_t)
self.use_dbm_checkb = urwid.CheckBox(use_dbm_t) self.use_dbm_checkb = urwid.CheckBox(use_dbm_t)
self.verify_ap_checkb = urwid.CheckBox(verify_ap_t)
advancedLB = urwid.ListBox([self.wpa_cat, advancedLB = urwid.ListBox([self.wpa_cat,
@@ -234,7 +236,8 @@ class PrefsDialog(urwid.WidgetWrap):
self.debug_cat, self.debug_cat,
self.debug_mode_checkb, _blank, self.debug_mode_checkb, _blank,
self.wless_cat, self.wless_cat,
self.use_dbm_checkb, _blank self.use_dbm_checkb, _blank,
self.verify_ap_checkb, _blank
]) ])
@@ -314,9 +317,10 @@ class PrefsDialog(urwid.WidgetWrap):
except ValueError: except ValueError:
self.backend_cbox.set_focus(0) self.backend_cbox.set_focus(0)
# Two last checkboxes # Three last checkboxes
self.debug_mode_checkb.set_state(daemon.GetDebugMode()) self.debug_mode_checkb.set_state(daemon.GetDebugMode())
self.use_dbm_checkb.set_state(daemon.GetSignalDisplayType()) self.use_dbm_checkb.set_state(daemon.GetSignalDisplayType())
self.verify_ap_checkb.set_state(daemon.GetShouldVerifyAp())
def save_settings(self): def save_settings(self):
""" Pushes the selected settings to the daemon. """ Pushes the selected settings to the daemon.
@@ -337,6 +341,7 @@ class PrefsDialog(urwid.WidgetWrap):
daemon.SetAutoReconnect(self.auto_reconn_checkb.get_state()) daemon.SetAutoReconnect(self.auto_reconn_checkb.get_state())
daemon.SetDebugMode(self.debug_mode_checkb.get_state()) daemon.SetDebugMode(self.debug_mode_checkb.get_state())
daemon.SetSignalDisplayType(int(self.use_dbm_checkb.get_state())) daemon.SetSignalDisplayType(int(self.use_dbm_checkb.get_state()))
daemon.SetShouldVerifyAp(int(self.verify_ap_checkb.get_state()))
daemon.SetPreferWiredNetwork(bool(self.prefer_wired_chkbx.get_state())) daemon.SetPreferWiredNetwork(bool(self.prefer_wired_chkbx.get_state()))
if self.wired_auto_2.get_state(): if self.wired_auto_2.get_state():
daemon.SetWiredAutoConnectMethod(2) daemon.SetWiredAutoConnectMethod(2)

View File

@@ -1160,20 +1160,6 @@ is already active.</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkRadioButton" id="dhclient_radio">
<property name="label" translatable="yes">dhclient</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">3</property>
</packing>
</child>
<child> <child>
<widget class="GtkRadioButton" id="dhcpcd_radio"> <widget class="GtkRadioButton" id="dhcpcd_radio">
<property name="label" translatable="yes">dhcpcd</property> <property name="label" translatable="yes">dhcpcd</property>
@@ -1204,6 +1190,20 @@ is already active.</property>
<property name="position">2</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkRadioButton" id="dhclient_radio">
<property name="label" translatable="yes">dhclient</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">3</property>
</packing>
</child>
<child> <child>
<widget class="GtkRadioButton" id="udhcpc_radio"> <widget class="GtkRadioButton" id="udhcpc_radio">
<property name="label" translatable="yes">udhcpc</property> <property name="label" translatable="yes">udhcpc</property>
@@ -1358,7 +1358,7 @@ is already active.</property>
<child> <child>
<widget class="GtkTable" id="table3"> <widget class="GtkTable" id="table3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="n_rows">10</property> <property name="n_rows">11</property>
<property name="n_columns">2</property> <property name="n_columns">2</property>
<child> <child>
<widget class="GtkLabel" id="pref_backend_label"> <widget class="GtkLabel" id="pref_backend_label">
@@ -1580,6 +1580,27 @@ WPA supplicant driver.</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkAlignment" id="alignment27">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
<widget class="GtkCheckButton" id="pref_verify_ap_check">
<property name="label" translatable="yes">Ping static gateways after connecting to verify association</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
</child>
</widget>
<packing>
<property name="right_attach">2</property>
<property name="top_attach">10</property>
<property name="bottom_attach">11</property>
<property name="y_options"></property>
</packing>
</child>
</widget> </widget>
</child> </child>
</widget> </widget>

View File

@@ -739,7 +739,7 @@ class appGui(object):
widget.hide() widget.hide()
networkentry.connect_button.show() networkentry.connect_button.show()
daemon.SetForcedDisconnect(True) daemon.SetForcedDisconnect(True)
self.network_list.all_set_sensitive(False) self.network_list.set_sensitive(False)
if nettype == "wired": if nettype == "wired":
wired.DisconnectWired(reply_handler=handler, error_handler=handler) wired.DisconnectWired(reply_handler=handler, error_handler=handler)
else: else:

View File

@@ -455,35 +455,6 @@ class ConnectThread(threading.Thread):
self.abort_connection(dhcp_status) self.abort_connection(dhcp_status)
return return
@abortable
def verify_association(self, iface):
""" Verify that our association the AP is valid.
Try to ping the gateway we have set to see if we're
really associated with it. This is only done if
we're using a static IP.
"""
if self.network.get('gateway'):
self.SetStatus('verifying_association')
print "Verifying AP association..."
for tries in range(1, 11):
print "Attempt %d of 10..." % tries
retcode = self.iface.VerifyAPAssociation(self.network['gateway'])
if retcode == 0:
print "Successfully associated."
break
time.sleep(1)
#TODO this should be in wnettools.py
if retcode:
print "Connection Failed: Failed to ping the access point!"
# Clean up before aborting.
iface.SetAddress('0.0.0.0')
iface.FlushRoutes()
if hasattr(iface, "StopWPA"):
iface.StopWPA()
self.abort_connection("association_failed")
@abortable @abortable
def set_dns_addresses(self, iface): def set_dns_addresses(self, iface):
""" Set the DNS address(es). """ Set the DNS address(es).
@@ -563,6 +534,7 @@ class Wireless(Controller):
self._wpa_driver = None self._wpa_driver = None
self._wireless_interface = None self._wireless_interface = None
self.wiface = None self.wiface = None
self.should_verify_ap = True
def set_wireless_iface(self, value): def set_wireless_iface(self, value):
self._wireless_interface = value self._wireless_interface = value
@@ -645,7 +617,7 @@ class Wireless(Controller):
self.after_script, self.pre_disconnect_script, self.after_script, self.pre_disconnect_script,
self.post_disconnect_script, self.global_dns_1, self.post_disconnect_script, self.global_dns_1,
self.global_dns_2, self.global_dns_3, self.global_dns_dom, self.global_dns_2, self.global_dns_3, self.global_dns_dom,
self.global_search_dom, self.wiface, debug) self.global_search_dom, self.wiface, self.should_verify_ap, debug)
self.connecting_thread.setDaemon(True) self.connecting_thread.setDaemon(True)
self.connecting_thread.start() self.connecting_thread.start()
return True return True
@@ -816,7 +788,7 @@ class WirelessConnectThread(ConnectThread):
def __init__(self, network, wireless, wpa_driver, before_script, def __init__(self, network, wireless, wpa_driver, before_script,
after_script, pre_disconnect_script, post_disconnect_script, after_script, pre_disconnect_script, post_disconnect_script,
gdns1, gdns2, gdns3, gdns_dom, gsearch_dom, wiface, gdns1, gdns2, gdns3, gdns_dom, gsearch_dom, wiface,
debug=False): should_verify_ap, debug=False):
""" Initialise the thread with network information. """ Initialise the thread with network information.
Keyword arguments: Keyword arguments:
@@ -837,6 +809,7 @@ class WirelessConnectThread(ConnectThread):
post_disconnect_script, gdns1, gdns2, post_disconnect_script, gdns1, gdns2,
gdns3, gdns_dom, gsearch_dom, wiface, debug) gdns3, gdns_dom, gsearch_dom, wiface, debug)
self.wpa_driver = wpa_driver self.wpa_driver = wpa_driver
self.should_verify_ap = should_verify_ap
def _connect(self): def _connect(self):
@@ -921,6 +894,38 @@ class WirelessConnectThread(ConnectThread):
self.connect_result = "Success" self.connect_result = "Success"
self.is_connecting = False self.is_connecting = False
@abortable
def verify_association(self, iface):
""" Verify that our association the AP is valid.
Try to ping the gateway we have set to see if we're
really associated with it. This is only done if
we're using a static IP.
"""
if self.network.get('gateway') and self.should_verify_ap:
self.SetStatus('verifying_association')
print "Verifying AP association..."
for tries in range(1, 11):
print "Attempt %d of 10..." % tries
retcode = self.iface.VerifyAPAssociation(self.network['gateway'])
if retcode == 0:
print "Successfully associated."
break
time.sleep(1)
#TODO this should be in wnettools.py
if retcode:
print "Connection Failed: Failed to ping the access point!"
# Clean up before aborting.
iface.SetAddress('0.0.0.0')
iface.FlushRoutes()
if hasattr(iface, "StopWPA"):
iface.StopWPA()
self.abort_connection("association_failed")
else:
print 'not verifying'
@abortable @abortable
def stop_wpa(self, wiface): def stop_wpa(self, wiface):
""" Stops wpa_supplicant. """ """ Stops wpa_supplicant. """

View File

@@ -79,6 +79,7 @@ class PreferencesDialog(object):
self.reconnectcheckbox.set_active(daemon.GetAutoReconnect()) self.reconnectcheckbox.set_active(daemon.GetAutoReconnect())
self.debugmodecheckbox.set_active(daemon.GetDebugMode()) self.debugmodecheckbox.set_active(daemon.GetDebugMode())
self.displaytypecheckbox.set_active(daemon.GetSignalDisplayType()) self.displaytypecheckbox.set_active(daemon.GetSignalDisplayType())
self.verifyapcheckbox.set_active(daemon.GetShouldVerifyAp())
self.preferwiredcheckbox.set_active(daemon.GetPreferWiredNetwork()) self.preferwiredcheckbox.set_active(daemon.GetPreferWiredNetwork())
dhcp_list = [self.dhcpautoradio, self.dhclientradio, self.dhcpcdradio, dhcp_list = [self.dhcpautoradio, self.dhclientradio, self.dhcpcdradio,
@@ -197,6 +198,7 @@ class PreferencesDialog(object):
daemon.SetAutoReconnect(self.reconnectcheckbox.get_active()) daemon.SetAutoReconnect(self.reconnectcheckbox.get_active())
daemon.SetDebugMode(self.debugmodecheckbox.get_active()) daemon.SetDebugMode(self.debugmodecheckbox.get_active())
daemon.SetSignalDisplayType(int(self.displaytypecheckbox.get_active())) daemon.SetSignalDisplayType(int(self.displaytypecheckbox.get_active()))
daemon.SetShouldVerifyAp(bool(self.verifyapcheckbox.get_active()))
daemon.SetPreferWiredNetwork(bool(self.preferwiredcheckbox.get_active())) daemon.SetPreferWiredNetwork(bool(self.preferwiredcheckbox.get_active()))
if self.showlistradiobutton.get_active(): if self.showlistradiobutton.get_active():
daemon.SetWiredAutoConnectMethod(2) daemon.SetWiredAutoConnectMethod(2)
@@ -337,6 +339,8 @@ class PreferencesDialog(object):
'use_debug_mode') 'use_debug_mode')
self.displaytypecheckbox = setup_label("pref_dbm_check", self.displaytypecheckbox = setup_label("pref_dbm_check",
'display_type_dialog') 'display_type_dialog')
self.verifyapcheckbox = setup_label("pref_verify_ap_check",
'verify_ap_dialog')
self.usedefaultradiobutton = setup_label("pref_use_def_radio", self.usedefaultradiobutton = setup_label("pref_use_def_radio",
'use_default_profile') 'use_default_profile')
self.showlistradiobutton = setup_label("pref_prompt_radio", self.showlistradiobutton = setup_label("pref_prompt_radio",

View File

@@ -55,187 +55,9 @@ def get_gettext():
_ = lang.gettext _ = lang.gettext
return _ return _
# Generated automatically on Thu, 13 Aug 2009 12:10:26 CDT # Generated automatically on Mon, 23 Nov 2009 23:06:31 CST
_ = get_gettext() _ = get_gettext()
language = {} language = {}
language['connect'] = _('Connect')
language['ip'] = _('IP')
language['netmask'] = _('Netmask')
language['gateway'] = _('Gateway')
language['dns'] = _('DNS')
language['use_static_ip'] = _('Use Static IPs')
language['use_static_dns'] = _('Use Static DNS')
language['use_encryption'] = _('Use Encryption')
language['advanced_settings'] = _('Advanced Settings')
language['properties'] = _('Properties')
language['wired_network'] = _('Wired Network')
language['wired_network_instructions'] = _('To connect to a wired network,'
' you must create a network profile. To create a network profile, type a'
' name that describes this network, and press Add.')
language['automatic_connect'] = _('Automatically connect to this network')
language['secured'] = _('Secured')
language['unsecured'] = _('Unsecured')
language['channel'] = _('Channel')
language['preferences'] = _('Preferences')
language['wpa_supplicant_driver'] = _('WPA Supplicant Driver')
language['wireless_interface'] = _('Wireless Interface')
language['wired_interface'] = _('Wired Interface')
language['hidden_network'] = _('Hidden Network')
language['hidden_network_essid'] = _('Hidden Network ESSID')
language['connected_to_wireless'] = _('Connected to $A at $B (IP: $C)')
language['tray_connected_to_wireless'] = _('Wireless Network\n$A at $B\nSpeed: $C\nIP $D')
language['connected_to_wired'] = _('Connected to wired network (IP: $A)')
language['tray_connected_to_wired'] = _('Wired Network\nIP: $A')
language['not_connected'] = _('Not connected')
language['conn_info_wired_labels'] = _('Wired\nIP:\nRX:\nTX:\n\n\n')
language['conn_info_wireless_labels'] = _('Wireless\nSSID:\nSpeed:\nIP:\nStrength:\nRX:\nTX:')
language['conn_info_wired'] = _('\n$A\n$B KB/s\n$C KB/s\n\n\n')
language['conn_info_wireless'] = _('\n$A\n$B\n$C\n$D\n$E KB/s\n$F KB/s')
language['conn_info_not_connected'] = _('\n\nNot Connected\n\n\n\n')
language['conn_info_connecting'] = _('\n\nConnecting...\n\n\n\n')
language['no_wireless_networks_found'] = _('No wireless networks found.')
language['killswitch_enabled'] = _('Wireless Kill Switch Enabled')
language['key'] = _('Key')
language['username'] = _('Username')
language['password'] = _('Password')
language['anonymous_identity'] = _('Anonymous Identity')
language['identity'] = _('Identity')
language['authentication'] = _('Authentication')
language['path_to_pac_file'] = _('Path to PAC File')
language['select_a_network'] = _('Choose from the networks below:')
#language['connecting...'] = _('Connecting...')
language['wired_always_on'] = _('Always show wired interface')
language['auto_reconnect'] = _('Automatically reconnect on connection loss')
language['create_adhoc_network'] = _('Create an Ad-Hoc Network')
language['essid'] = _('ESSID')
language['use_wep_encryption'] = _('Use Encryption (WEP only)')
language['before_script'] = _('Run script before connect')
language['after_script'] = _('Run script after connect')
language['disconnect_script'] = _('Run disconnect script')
language['script_settings'] = _('Scripts')
language['use_ics'] = _('Activate Internet Connection Sharing')
language['madwifi_for_adhoc'] = _('Check if using madwifi/atheros drivers')
language['default_wired'] = _('Use as default profile (overwrites any previous default)')
language['use_debug_mode'] = _('Enable debug mode')
language['use_global_dns'] = _('Use global DNS servers')
language['use_default_profile'] = _('Use default profile on wired autoconnect')
language['show_wired_list'] = _('Prompt for profile on wired autoconnect')
language['use_last_used_profile'] = _('Use last used profile on wired autoconnect')
language['choose_wired_profile'] = _('Select or create a wired profile to connect with')
language['wired_network_found'] = _('Wired connection detected')
language['stop_showing_chooser'] = _('Stop Showing Autoconnect pop-up temporarily')
language['display_type_dialog'] = _('Use dBm to measure signal strength')
language['scripts'] = _('Scripts')
language['invalid_address'] = _('Invalid address in $A entry.')
language['global_settings'] = _('Use these settings for all networks sharing this essid')
language['encrypt_info_missing'] = _('Required encryption information is missing.')
language['enable_encryption'] = _('This network requires encryption to be enabled.')
language['wicd_auto_config'] = _('Automatic (recommended)')
language["gen_settings"] = _('General Settings')
language["ext_programs"] = _('External Programs')
language["dhcp_client"] = _('DHCP Client')
language["wired_detect"] = _('Wired Link Detection')
language["route_flush"] = _('Route Table Flushing')
language["backend"] = _('Backend')
language["backend_alert"] = _('Changes to your backend won\'t occur until the daemon is restarted.')
language['dns_domain'] = _('DNS domain')
language['search_domain'] = _('Search domain')
language['global_dns_not_enabled'] = _('Global DNS has not been enabled in general preferences.')
language['scripts_need_pass'] = _('You must enter your password to configure scripts')
language['no_sudo_prog'] = _('Could not find a graphical sudo program. The script editor could not be launched.' +
' You\'ll have to edit scripts directly your configuration file.')
language['interface_down'] = _('Putting interface down...')
language['resetting_ip_address'] = _('Resetting IP address...')
language['interface_up'] = _('Putting interface up...')
language['setting_encryption_info'] = _('Setting encryption info')
language['removing_old_connection'] = _('Removing old connection...')
language['generating_psk'] = _('Generating PSK...')
language['generating_wpa_config'] = _('Generating WPA configuration file...')
language['flushing_routing_table'] = _('Flushing the routing table...')
language['configuring_interface'] = _('Configuring wireless interface...')
language['validating_authentication'] = _('Validating authentication...')
language['setting_broadcast_address'] = _('Setting broadcast address...')
language['setting_static_dns'] = _('Setting static DNS servers...')
language['setting_static_ip'] = _('Setting static IP addresses...')
language['running_dhcp'] = _('Obtaining IP address...')
language['dhcp_failed'] = _('Connection Failed: Unable to Get IP Address')
language['no_dhcp_offers'] = _('Connection Failed: No DHCP offers received.')
language['aborted'] = _('Connection Cancelled')
language['bad_pass'] = _('Connection Failed: Could not authenticate (bad password?)')
language['verifying_association'] = _("Verifying access point association...")
language['association_failed'] = _("Connection Failed: Could not contact the wireless access point.")
language['done'] = _('Done connecting...')
language['scanning'] = _('Scanning')
language['scanning_stand_by'] = _('Scanning networks... stand by...')
language['cannot_start_daemon'] = _('Unable to connect to wicd daemon DBus interface. " + \
"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')
language['always_switch_to_wired'] = _('Always switch to wired connection when available')
language['wired_autoconnect_settings'] = _('Wired Autoconnect Settings')
language['always_use_wext'] = _('You should almost always use wext as the WPA supplicant driver')
language['debugging'] = _('Debugging')
language['wpa_supplicant'] = _('WPA Supplicant')
language['automatic_reconnection'] = _('Automatic Reconnection')
language['global_dns_servers'] = _('Global DNS servers')
language['network_interfaces'] = _('Network Interfaces')
language['connecting_to_daemon'] = _('Connecting to daemon...')
language['cannot_connect_to_daemon'] = _('Can\'t connect to the daemon, trying to start it automatically...')
language['could_not_connect'] = _('Could not connect to wicd\'s D-Bus interface. Check the wicd log for error messages.')
language["exception"] = _('EXCEPTION! Please report this to the maintainer and file a bug report with the backtrace below:')
language["brought_to_you"] = _('Brought to you by:')
language["add_new_profile"] = _('Add a new profile')
language["add_new_wired_profile"] = _('Add a new wired profile')
language["no_delete_last_profile"] = _('wicd-curses does not support deleting the last wired profile. Try renaming it (\'F2\')')
language["rename_wired_profile"] = _('Rename wired profile')
language["select_hidden_essid"] = _('Select Hidden Network ESSID')
language["esc_to_cancel"] = _('Press ESC to cancel')
language["press_to_quit"] = _('Press F8 or Q to quit.')
language['terminated'] = _('Terminated by user')
language['wicd_curses'] = _('Wicd Curses Interface')
language['dbus_fail'] = _('DBus failure! This is most likely caused by the wicd daemon stopping while wicd-curses is running. Please restart the daemon, and then restart wicd-curses.')
# These are in the tray list, but not in the non-tray list
language['connecting'] = _('Connecting')
language['daemon_unavailable'] = _('The wicd daemon is unavailable, so your request cannot be completed')
language['no_daemon_tooltip'] = _('Wicd daemon unreachable')
# Translations added on Wed Mar 4 03:36:24 UTC 2009
language['make_wired_profile'] = _('To connect to a wired network, you must create a network profile. To create a network profile, type a name that describes this network, and press Add.')
language['access_cards'] = _('Wicd needs to access your computer\'s network cards.')
#language['CHANGE_ME'] = _('Create Ad-Hoc network')
#language['CHANGE_ME'] = _('Wired Autoconnect Setting:')
language['bad_pass'] = _('Connection Failed: Bad password')
language['cannot_edit_scripts_1'] = _('To avoid various complications, wicd-curses does not support directly editing the scripts directly. However, you can edit them manually. First, (as root)", open the "$A" config file, and look for the section labeled by the $B in question. In this case, this is:')
language['cannot_edit_scripts_2'] = _('Once there, you can adjust (or add) the "beforescript", "afterscript", and "disconnectscript" variables as needed, to change the preconnect, postconnect, and disconnect scripts respectively. Note that you will be specifying the full path to the scripts - not the actual script contents. You will need to add/edit the script contents separately. Refer to the wicd manual page for more information.')
language['cannot_edit_scripts_3'] = _('You can also configure the wireless networks by looking for the "[<ESSID>]" field in the config file.')
language['wired_networks'] = _('Wired Networks')
language['wireless_networks'] = _('Wireless Networks')
language['about'] = _('About Wicd')
language['more_help'] = _('For more detailed help, consult the wicd-curses(8) man page.')
language['case_sensitive'] = _('All controls are case sensitive')
language['help_help'] = _('Display this help dialog')
language['connect_help'] = _('Connect to selected network')
language['disconn_help'] = _('Disconnect from all networks')
language['about_help'] = _('Stop a network connection in progress')
language['refresh_help'] = _('Refresh network list')
language['prefs_help'] = _('Preferences dialog')
language['scan_help'] = _('Scan for hidden networks')
language['scripts_help'] = _('Select scripts')
language['adhoc_help'] = _('Set up Ad-hoc network')
language['config_help'] = _('Configure Selected Network')
#language[''] = _('Press H or ? for help') # Defunct in curses-uimod
language['raw_screen_arg'] = _('use urwid\'s raw screen controller')
language['ok'] = _('OK')
language['cancel'] = _('Cancel')
language['resetting_ip_address'] = _('''Resetting IP address...''') language['resetting_ip_address'] = _('''Resetting IP address...''')
language['prefs_help'] = _('''Preferences dialog''') language['prefs_help'] = _('''Preferences dialog''')
language['no_dhcp_offers'] = _('''Connection Failed: No DHCP offers received.''') language['no_dhcp_offers'] = _('''Connection Failed: No DHCP offers received.''')
@@ -399,3 +221,4 @@ language['post_disconnect_script'] = _('''Run post-disconnect script''')
language['resume_script'] = _('''Resume script''') language['resume_script'] = _('''Resume script''')
language['suspend_script'] = _('''Suspend script''') language['suspend_script'] = _('''Suspend script''')
language['invalid_ip_address'] = _('''Invalid IP address entered.''') language['invalid_ip_address'] = _('''Invalid IP address entered.''')
language['verify_ap_dialog'] = _('''Ping static gateways after connecting to verify association''')

View File

@@ -524,6 +524,23 @@ class WicdDaemon(dbus.service.Object):
self.wired_connect_mode = int(method) self.wired_connect_mode = int(method)
self.wired_bus.connect_mode = int(method) self.wired_bus.connect_mode = int(method)
@dbus.service.method('org.wicd.daemon')
def SetShouldVerifyAp(self, value):
""" Enable/disable wireless AP verification.
If this is True, wicd will try to verify that we are associated
with the Wireless AP after a connection attempt appears to
succeed.
"""
self.config.set("Settings", "should_verify_ap", int(value), write=True)
self.wifi.should_verify_ap = misc.to_bool(value)
@dbus.service.method('org.wicd.daemon')
def GetShouldVerifyAp(self):
""" Returns current value for WAP connection verification. """
return bool(self.wifi.should_verify_ap)
@dbus.service.method('org.wicd.daemon') @dbus.service.method('org.wicd.daemon')
def GetWiredAutoConnectMethod(self): def GetWiredAutoConnectMethod(self):
""" Returns the wired autoconnect method. """ """ Returns the wired autoconnect method. """
@@ -894,6 +911,8 @@ class WicdDaemon(dbus.service.Object):
self.SetSignalDisplayType(app_conf.get("Settings", self.SetSignalDisplayType(app_conf.get("Settings",
"signal_display_type", "signal_display_type",
default=0)) default=0))
self.SetShouldVerifyAp(app_conf.get("Settings", "should_verify_ap",
default=1))
self.SetDHCPClient(app_conf.get("Settings", "dhcp_client", default=0)) self.SetDHCPClient(app_conf.get("Settings", "dhcp_client", default=0))
self.SetLinkDetectionTool(app_conf.get("Settings", "link_detect_tool", self.SetLinkDetectionTool(app_conf.get("Settings", "link_detect_tool",
default=0)) default=0))