2017-08-31 09:41:33 +02:00
|
|
|
diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c
|
|
|
|
index ad019a380..9b5119b77 100644
|
|
|
|
--- a/panels/network/cc-network-panel.c
|
|
|
|
+++ b/panels/network/cc-network-panel.c
|
|
|
|
@@ -64,8 +64,10 @@ struct _CcNetworkPanel
|
|
|
|
/* widgets */
|
|
|
|
GtkWidget *box_proxy;
|
|
|
|
GtkWidget *box_vpn;
|
|
|
|
+ GtkWidget *box_vpn1;
|
|
|
|
GtkWidget *box_wired;
|
|
|
|
GtkWidget *empty_listbox;
|
|
|
|
+ GtkWidget *label_NM_warning;
|
|
|
|
|
|
|
|
/* wireless dialog stuff */
|
|
|
|
CmdlineOperation arg_operation;
|
|
|
|
@@ -734,10 +736,23 @@ panel_check_network_manager_version (CcNetworkPanel *panel)
|
2016-08-03 11:06:23 +02:00
|
|
|
GtkWidget *label;
|
|
|
|
gchar *markup;
|
|
|
|
const gchar *version;
|
|
|
|
+ const gchar *state;
|
|
|
|
+ GDBusConnection *connection;
|
|
|
|
+ GDBusProxy *proxy;
|
|
|
|
+ GVariant *variant;
|
|
|
|
+
|
|
|
|
+ connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL);
|
|
|
|
+ proxy = g_dbus_proxy_new_sync (connection, G_DBUS_PROXY_FLAGS_NONE, NULL,
|
|
|
|
+ "org.freedesktop.systemd1",
|
|
|
|
+ "/org/freedesktop/systemd1/unit/wickedd_2ddhcp6_2eservice",
|
|
|
|
+ "org.freedesktop.systemd1.Unit",
|
|
|
|
+ NULL, NULL);
|
|
|
|
+ variant = g_dbus_proxy_get_cached_property (proxy, "ActiveState");
|
|
|
|
+ state = g_variant_get_string (variant, NULL);
|
|
|
|
|
|
|
|
/* parse running version */
|
2017-08-31 09:41:33 +02:00
|
|
|
version = nm_client_get_version (panel->client);
|
2016-08-03 11:06:23 +02:00
|
|
|
- if (version == NULL) {
|
|
|
|
+ if (version == NULL && g_strcmp0 (state, "inactive") == 0) {
|
|
|
|
gtk_container_remove (GTK_CONTAINER (panel), gtk_bin_get_child (GTK_BIN (panel)));
|
|
|
|
|
|
|
|
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 20);
|
2017-08-31 09:41:33 +02:00
|
|
|
@@ -760,9 +775,17 @@ panel_check_network_manager_version (CcNetworkPanel *panel)
|
2016-08-03 11:06:23 +02:00
|
|
|
|
|
|
|
gtk_widget_show_all (box);
|
|
|
|
g_free (markup);
|
|
|
|
+ } else if (g_strcmp0 (state, "active") == 0) {
|
2017-08-31 09:41:33 +02:00
|
|
|
+ gtk_widget_hide (panel->box_vpn1);
|
|
|
|
+ gtk_widget_hide (panel->box_wired);
|
|
|
|
+ gtk_widget_show (panel->label_NM_warning);
|
2016-08-03 11:06:23 +02:00
|
|
|
} else {
|
2017-08-31 09:41:33 +02:00
|
|
|
manager_running (panel->client, NULL, panel);
|
2016-08-03 11:06:23 +02:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ g_object_unref (connection);
|
|
|
|
+ g_object_unref (proxy);
|
|
|
|
+ g_variant_unref (variant);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2017-08-31 09:41:33 +02:00
|
|
|
@@ -816,9 +839,11 @@ cc_network_panel_class_init (CcNetworkPanelClass *klass)
|
|
|
|
|
|
|
|
gtk_widget_class_bind_template_child (widget_class, CcNetworkPanel, box_proxy);
|
|
|
|
gtk_widget_class_bind_template_child (widget_class, CcNetworkPanel, box_vpn);
|
|
|
|
+ gtk_widget_class_bind_template_child (widget_class, CcNetworkPanel, box_vpn1);
|
|
|
|
gtk_widget_class_bind_template_child (widget_class, CcNetworkPanel, box_wired);
|
|
|
|
gtk_widget_class_bind_template_child (widget_class, CcNetworkPanel, empty_listbox);
|
|
|
|
gtk_widget_class_bind_template_child (widget_class, CcNetworkPanel, sizegroup);
|
|
|
|
+ gtk_widget_class_bind_template_child (widget_class, CcNetworkPanel, label_NM_warning);
|
|
|
|
|
|
|
|
gtk_widget_class_bind_template_callback (widget_class, create_connection_cb);
|
|
|
|
}
|
|
|
|
diff --git a/panels/network/network.ui b/panels/network/network.ui
|
|
|
|
index 93b770d0d..0a35c3270 100644
|
|
|
|
--- a/panels/network/network.ui
|
|
|
|
+++ b/panels/network/network.ui
|
|
|
|
@@ -79,7 +79,7 @@
|
|
|
|
</object>
|
|
|
|
</child>
|
|
|
|
<child>
|
|
|
|
- <object class="GtkBox">
|
|
|
|
+ <object class="GtkBox" id="box_vpn1">
|
|
|
|
<property name="visible">True</property>
|
|
|
|
<property name="can_focus">False</property>
|
|
|
|
<property name="orientation">vertical</property>
|
|
|
|
@@ -168,6 +168,14 @@
|
|
|
|
<property name="orientation">vertical</property>
|
|
|
|
</object>
|
|
|
|
</child>
|
|
|
|
+ <child>
|
|
|
|
+ <object class="GtkLabel" id="label_NM_warning">
|
|
|
|
+ <property name="visible">False</property>
|
|
|
|
+ <property name="can_focus">False</property>
|
|
|
|
+ <property name="xalign">0</property>
|
|
|
|
+ <property name="label" translatable="yes">Please use YaST2 to configure your network.</property>
|
|
|
|
+ </object>
|
|
|
|
+ </child>
|
|
|
|
</object>
|
2016-08-03 11:06:23 +02:00
|
|
|
</child>
|
|
|
|
</object>
|
2017-08-31 09:41:33 +02:00
|
|
|
--
|
|
|
|
2.13.4
|
|
|
|
|