[gnome-control-center] network: Hide edit connection buttons if nm-connection-editor not installed



commit d61d13d4e3c673f3f73c549fe8698007ac8fcc12
Author: Robert Ancell <robert ancell canonical com>
Date:   Mon Sep 30 11:25:01 2019 +1300

    network: Hide edit connection buttons if nm-connection-editor not installed

 panels/network/net-device-mobile.c | 1 +
 panels/network/net-device-simple.c | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/panels/network/net-device-mobile.c b/panels/network/net-device-mobile.c
index 4079a2347..41a1eac36 100644
--- a/panels/network/net-device-mobile.c
+++ b/panels/network/net-device-mobile.c
@@ -979,4 +979,5 @@ net_device_mobile_init (NetDeviceMobile *self)
 
         g_signal_connect_swapped (self->options_button, "clicked",
                                   G_CALLBACK (edit_connection), self);
+        gtk_widget_set_visible (self->options_button, g_find_program_in_path ("nm-connection-editor") != 
NULL);
 }
diff --git a/panels/network/net-device-simple.c b/panels/network/net-device-simple.c
index f30767033..ab1785d10 100644
--- a/panels/network/net-device-simple.c
+++ b/panels/network/net-device-simple.c
@@ -112,7 +112,7 @@ nm_device_simple_refresh_ui (NetDeviceSimple *self)
         update_off_switch_from_device_state (priv->device_off_switch, state, self);
 
         /* set up the Options button */
-        gtk_widget_set_visible (GTK_WIDGET (priv->options_button), state != NM_DEVICE_STATE_UNMANAGED);
+        gtk_widget_set_visible (GTK_WIDGET (priv->options_button), state != NM_DEVICE_STATE_UNMANAGED && 
g_find_program_in_path ("nm-connection-editor") != NULL);
 }
 
 static void
@@ -250,6 +250,7 @@ net_device_simple_init (NetDeviceSimple *self)
 
         g_signal_connect_swapped (priv->options_button, "clicked",
                                   G_CALLBACK (edit_connection), self);
+        gtk_widget_set_visible (priv->options_button, g_find_program_in_path ("nm-connection-editor") != 
NULL);
 }
 
 char *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]