api: add NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED reason and use that

This commit is contained in:
Jiří Klimeš
2012-09-21 14:36:46 +02:00
parent ece5e209cd
commit 07fc3dcb90
5 changed files with 16 additions and 2 deletions

View File

@@ -557,6 +557,9 @@ nmc_device_reason_to_string (NMDeviceStateReason reason)
case NM_DEVICE_STATE_REASON_SSID_NOT_FOUND: case NM_DEVICE_STATE_REASON_SSID_NOT_FOUND:
return _("The Wi-Fi network could not be found"); return _("The Wi-Fi network could not be found");
case NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED:
return _("A seconadary connection of the base connection failed");
default: default:
return _("Unknown"); return _("Unknown");
} }

View File

@@ -498,6 +498,9 @@ typedef enum {
/* The WiFi network could not be found */ /* The WiFi network could not be found */
NM_DEVICE_STATE_REASON_SSID_NOT_FOUND = 53, NM_DEVICE_STATE_REASON_SSID_NOT_FOUND = 53,
/* A seconadary connection of the base connection failed */
NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED = 54,
/* Unused */ /* Unused */
NM_DEVICE_STATE_REASON_LAST = 0xFFFF NM_DEVICE_STATE_REASON_LAST = 0xFFFF
} NMDeviceStateReason; } NMDeviceStateReason;

View File

@@ -569,6 +569,11 @@
The 802.11 Wi-Fi network could not be found. The 802.11 Wi-Fi network could not be found.
</tp:docstring> </tp:docstring>
</tp:enumvalue> </tp:enumvalue>
<tp:enumvalue suffix="SECONDARY_CONNECTION_FAILED" value="54">
<tp:docstring>
A secondary connection of the base connection failed.
</tp:docstring>
</tp:enumvalue>
</tp:enum> </tp:enum>
<tp:struct name="NM_DEVICE_STATE_REASON_STRUCT"> <tp:struct name="NM_DEVICE_STATE_REASON_STRUCT">

View File

@@ -4513,6 +4513,8 @@ reason_to_string (NMDeviceStateReason reason)
return "modem-manager-unavailable"; return "modem-manager-unavailable";
case NM_DEVICE_STATE_REASON_SSID_NOT_FOUND: case NM_DEVICE_STATE_REASON_SSID_NOT_FOUND:
return "SSID not found"; return "SSID not found";
case NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED:
return "secondary-connection-failed";
default: default:
break; break;
} }

View File

@@ -1003,7 +1003,8 @@ process_secondaries (NMPolicy *policy,
/* Secondary connection failed -> do not watch other connections */ /* Secondary connection failed -> do not watch other connections */
policy->pending_secondaries = g_slist_remove (policy->pending_secondaries, secondary_data); policy->pending_secondaries = g_slist_remove (policy->pending_secondaries, secondary_data);
pending_secondary_data_free (secondary_data); pending_secondary_data_free (secondary_data);
nm_device_state_changed (item_device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED); nm_device_state_changed (item_device, NM_DEVICE_STATE_FAILED,
NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED);
return; return;
} }
} }
@@ -1454,7 +1455,7 @@ device_state_changed (NMDevice *device,
/* Activate secondary (VPN) connections */ /* Activate secondary (VPN) connections */
if (!activate_secondary_connections (policy, connection, device)) if (!activate_secondary_connections (policy, connection, device))
nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, nm_device_state_changed (device, NM_DEVICE_STATE_FAILED,
NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED); NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED);
} else } else
nm_device_state_changed (device, NM_DEVICE_STATE_ACTIVATED, nm_device_state_changed (device, NM_DEVICE_STATE_ACTIVATED,
NM_DEVICE_STATE_REASON_NONE); NM_DEVICE_STATE_REASON_NONE);