Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Widgets/WifiInterface.vala
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public class Network.WifiInterface : Network.WidgetNMInterface {
case NM.DeviceState.FAILED:
state = State.FAILED_WIFI;
if (active_wifi_item != null) {
active_wifi_item.state = state;
active_wifi_item.state = wifi_device.state;
}
cancel_scan ();
break;
Expand Down Expand Up @@ -445,8 +445,8 @@ public class Network.WifiInterface : Network.WidgetNMInterface {
active_ap = wifi_device.get_active_access_point ();

if (active_wifi_item != null) {
if (active_wifi_item.state == Network.State.CONNECTING_WIFI) {
active_wifi_item.state = Network.State.DISCONNECTED;
if (active_wifi_item.state == NM.DeviceState.CONFIG) {
active_wifi_item.state = NM.DeviceState.DISCONNECTED;
}
active_wifi_item = null;
}
Expand All @@ -467,7 +467,7 @@ public class Network.WifiInterface : Network.WidgetNMInterface {
found = true;
menu_item.set_active (true);
active_wifi_item = menu_item;
active_wifi_item.state = state;
active_wifi_item.state = device.state;
}
}

Expand Down
25 changes: 15 additions & 10 deletions src/common/Widgets/WifiMenuItem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class Network.WifiMenuItem : Gtk.ListBoxRow {
}
}

public Network.State state { get; set; default=Network.State.DISCONNECTED; }
public NM.DeviceState state { get; set; default = NM.DeviceState.DISCONNECTED; }

public uint8 strength {
get {
Expand Down Expand Up @@ -163,15 +163,20 @@ public class Network.WifiMenuItem : Gtk.ListBoxRow {
hide_item (spinner);

switch (state) {
case State.FAILED_WIFI:
show_item (error_img);
break;
case State.CONNECTING_WIFI:
show_item (spinner);
if (!radio_button.active) {
critical ("An access point is being connected but not active.");
}
break;
case NM.DeviceState.FAILED:
show_item (error_img);
break;
case NM.DeviceState.PREPARE:
case NM.DeviceState.CONFIG:
case NM.DeviceState.NEED_AUTH:
case NM.DeviceState.IP_CONFIG:
case NM.DeviceState.IP_CHECK:
case NM.DeviceState.SECONDARIES:
show_item (spinner);
if (!radio_button.active) {
critical ("An access point is being connected but not active.");
}
break;
}
}

Expand Down