2005-05-04 Dan Williams <dcbw@redhat.com>

* Remove NM_STATE_SCANNING from NetworkManager.h and applet code

	* Fix some holes in device activation and retaining the currently connected
		access point


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@602 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2005-05-04 18:11:40 +00:00
parent 993d39035b
commit 276e0a4d30
11 changed files with 149 additions and 110 deletions

View File

@@ -178,6 +178,8 @@ void nm_policy_schedule_activation_failed (NMActRequest *req)
dev = nm_act_request_get_dev (req);
g_assert (dev);
nm_act_request_set_stage (req, ACT_STAGE_FAILED);
source = g_idle_source_new ();
g_source_set_priority (source, G_PRIORITY_HIGH_IDLE);
g_source_set_callback (source, (GSourceFunc) nm_policy_activation_failed, req, NULL);
@@ -223,7 +225,7 @@ static NMDevice * nm_policy_auto_get_best_device (NMData *data, NMAccessPoint **
dev_type = nm_device_get_type (dev);
link_active = nm_device_has_active_link (dev);
if (dev_type == DEVICE_TYPE_WIRED_ETHERNET)
if (nm_device_is_wired (dev))
{
/* We never automatically choose devices that don't support carrier detect */
if (!nm_device_get_supports_carrier_detect (dev))
@@ -241,7 +243,7 @@ static NMDevice * nm_policy_auto_get_best_device (NMData *data, NMAccessPoint **
best_wired_prio = prio;
}
}
else if ((dev_type == DEVICE_TYPE_WIRELESS_ETHERNET) && data->wireless_enabled)
else if (nm_device_is_wireless (dev) && data->wireless_enabled)
{
if (link_active)
prio += 1;
@@ -254,6 +256,10 @@ static NMDevice * nm_policy_auto_get_best_device (NMData *data, NMAccessPoint **
if (nm_device_get_act_request (dev) && link_active)
prio += 3;
/* Stick with an already active non-scanning device if the user chose one */
if (!nm_device_get_supports_wireless_scan (dev) && nm_device_get_act_request (dev))
prio += 2;
if (prio > best_wireless_prio)
{
best_wireless_dev = dev;
@@ -612,7 +618,7 @@ void nm_policy_schedule_device_ap_lists_update_from_allowed (NMData *app_data)
/* We want this idle source to run before any other idle source */
g_source_set_priority (source, G_PRIORITY_HIGH_IDLE);
g_source_set_callback (source, nm_policy_allowed_ap_list_update, app_data, NULL);
g_source_set_callback (source, (GSourceFunc) nm_policy_device_list_update_from_allowed_list, app_data, NULL);
g_source_attach (source, app_data->main_context);
g_source_unref (source);