network: hide airplane switch when g-s-d says so
https://bugzilla.gnome.org/show_bug.cgi?id=736291
This commit is contained in:
parent
b36685f9a8
commit
436d220f88
1 changed files with 6 additions and 3 deletions
|
@ -291,14 +291,17 @@ static void
|
||||||
sync_airplane_mode_switch (CcNetworkPanel *panel)
|
sync_airplane_mode_switch (CcNetworkPanel *panel)
|
||||||
{
|
{
|
||||||
GVariant *result;
|
GVariant *result;
|
||||||
gboolean enabled;
|
gboolean enabled, should_show;
|
||||||
gboolean hw_enabled;
|
gboolean hw_enabled;
|
||||||
|
|
||||||
result = g_dbus_proxy_get_cached_property (panel->priv->rfkill_proxy, "HasAirplaneMode");
|
result = g_dbus_proxy_get_cached_property (panel->priv->rfkill_proxy, "HasAirplaneMode");
|
||||||
enabled = g_variant_get_boolean (result);
|
enabled = g_variant_get_boolean (result);
|
||||||
|
|
||||||
gtk_widget_set_visible (GTK_WIDGET (panel->priv->kill_switch_header), enabled);
|
result = g_dbus_proxy_get_cached_property (panel->priv->rfkill_proxy, "ShouldShowAirplaneMode");
|
||||||
if (!enabled)
|
should_show = g_variant_get_boolean (result);
|
||||||
|
|
||||||
|
gtk_widget_set_visible (GTK_WIDGET (panel->priv->kill_switch_header), enabled && should_show);
|
||||||
|
if (!enabled || !should_show)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
result = g_dbus_proxy_get_cached_property (panel->priv->rfkill_proxy, "AirplaneMode");
|
result = g_dbus_proxy_get_cached_property (panel->priv->rfkill_proxy, "AirplaneMode");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue