wifi: Show the "Wi-Fi disabled" page if it is disabled
Rather than an empty "Visible Networks" table. https://bugzilla.gnome.org/show_bug.cgi?id=793647
This commit is contained in:
parent
84279c4aaa
commit
e047753ea6
1 changed files with 15 additions and 1 deletions
|
@ -125,7 +125,8 @@ check_main_stack_page (CcWifiPanel *self)
|
|||
|
||||
if (!nm_version)
|
||||
gtk_stack_set_visible_child_name (self->main_stack, "nm-not-running");
|
||||
else if (self->devices->len == 0)
|
||||
else if (self->devices->len == 0 ||
|
||||
!nm_client_wireless_get_enabled (self->client))
|
||||
gtk_stack_set_visible_child_name (self->main_stack, "no-wifi-devices");
|
||||
else
|
||||
gtk_stack_set_visible_child_name (self->main_stack, "wifi-connections");
|
||||
|
@ -402,6 +403,14 @@ device_removed_cb (NMClient *client,
|
|||
check_main_stack_page (self);
|
||||
}
|
||||
|
||||
static void
|
||||
wireless_enabled_cb (NMClient *client,
|
||||
NMDevice *device,
|
||||
CcWifiPanel *self)
|
||||
{
|
||||
check_main_stack_page (self);
|
||||
}
|
||||
|
||||
static void
|
||||
rfkill_proxy_acquired_cb (GObject *source_object,
|
||||
GAsyncResult *res,
|
||||
|
@ -622,6 +631,11 @@ cc_wifi_panel_init (CcWifiPanel *self)
|
|||
G_CALLBACK (device_removed_cb),
|
||||
self);
|
||||
|
||||
g_signal_connect (self->client,
|
||||
"notify::wireless-enabled",
|
||||
G_CALLBACK (wireless_enabled_cb),
|
||||
self);
|
||||
|
||||
/* Load Wi-Fi devices */
|
||||
load_wifi_devices (self);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue