diff options
author | Jonathan Kang <jonathan121537@gmail.com> | 2016-10-13 10:05:03 +0800 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2017-04-13 16:00:01 +0200 |
commit | bdba78c86d4896e3a9584ccd8854d3c9551cd970 (patch) | |
tree | ebff6e2f0e14f0f9ff75175ecc55bad8a7d001c4 | |
parent | 379757e15516609d787a27df5ba1a359ed80f45d (diff) | |
download | gnome-control-center-bdba78c86d4896e3a9584ccd8854d3c9551cd970.tar.gz |
network: Fix mobile broadband switch state
The switch was only reflecting the value of the WWAN killswitch instead
of both the WWAN killswitch and the state of the connection itself.
https://bugzilla.gnome.org/show_bug.cgi?id=690361
-rw-r--r-- | panels/network/net-device-mobile.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/panels/network/net-device-mobile.c b/panels/network/net-device-mobile.c index 408b2dc99..fe83bffe8 100644 --- a/panels/network/net-device-mobile.c +++ b/panels/network/net-device-mobile.c @@ -171,7 +171,22 @@ mobilebb_enabled_toggled (NMClient *client, if (nm_device_get_device_type (device) != NM_DEVICE_TYPE_MODEM) return; - enabled = nm_client_wwan_get_enabled (client); + if (nm_client_wwan_get_enabled (client)) { + NMDeviceState state; + + state = nm_device_get_state (device); + if (state == NM_DEVICE_STATE_UNKNOWN || + state == NM_DEVICE_STATE_UNMANAGED || + state == NM_DEVICE_STATE_UNAVAILABLE || + state == NM_DEVICE_STATE_DISCONNECTED || + state == NM_DEVICE_STATE_DEACTIVATING || + state == NM_DEVICE_STATE_FAILED) { + enabled = FALSE; + } else { + enabled = TRUE; + } + } + sw = GTK_SWITCH (gtk_builder_get_object (device_mobile->priv->builder, "device_off_switch")); |