1
0
gnome-control-center/gnome-control-center-disable-error-message-for-NM.patch
Bjørn Lie 3d061f7618 Accepting request 1079088 from home:JonathanKang:branches:GNOME:Factory
- Rebase gnome-control-center-disable-error-message-for-NM.patch
- Add gnome-control-center-fix-6f1567f23.patch:
  network/connection-editor: fix crash when removing a connection
  (glgo#GNOME/gnome-control-center/commit/8cb77b4d3, bsc#1210377).

OBS-URL: https://build.opensuse.org/request/show/1079088
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-control-center?expand=0&rev=508
2023-04-13 16:47:51 +00:00

173 lines
7.7 KiB
Diff

diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c
index 6a3074ce..40fb0283 100644
--- a/panels/network/cc-network-panel.c
+++ b/panels/network/cc-network-panel.c
@@ -659,10 +659,24 @@ static void
panel_check_network_manager_version (CcNetworkPanel *self)
{
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 */
version = nm_client_get_version (self->client);
- if (version == NULL) {
+ if (version == NULL && g_strcmp0 (state, "inactive") == 0) {
GtkWidget *status_page;
status_page = adw_status_page_new ();
@@ -674,9 +688,23 @@ panel_check_network_manager_version (CcNetworkPanel *self)
_("NetworkManager needs to be running to view or make "
"connections. Contact a system administrator or the "
"software vendor."));
+ } else if (version == NULL && g_strcmp0 (state, "active") == 0) {
+ GtkWidget *status_page;
+
+ status_page = adw_status_page_new ();
+ cc_panel_set_content (CC_PANEL (self), status_page);
+
+ adw_status_page_set_icon_name (ADW_STATUS_PAGE (status_page), "network-error-symbolic");
+ adw_status_page_set_title (ADW_STATUS_PAGE (status_page), _("Wicked is running"));
+ adw_status_page_set_description (ADW_STATUS_PAGE (status_page),
+ _("Please use YaST2 to configure your network."));
} else {
manager_running (self);
}
+
+ g_object_unref (connection);
+ g_object_unref (proxy);
+ g_variant_unref (variant);
}
static void
diff --git a/panels/network/cc-wifi-panel.c b/panels/network/cc-wifi-panel.c
index 8e0b17b0..495b5616 100644
--- a/panels/network/cc-wifi-panel.c
+++ b/panels/network/cc-wifi-panel.c
@@ -302,21 +302,41 @@ static void
check_main_stack_page (CcWifiPanel *self)
{
const gchar *nm_version;
+ const gchar *state;
gboolean airplane_mode_active;
gboolean wireless_enabled;
+ 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);
nm_version = nm_client_get_version (self->client);
wireless_enabled = nm_client_wireless_get_enabled (self->client);
airplane_mode_active = cc_list_row_get_active (self->rfkill_row);
- if (!nm_version)
+ if (!nm_version && g_strcmp0 (state, "inactive") == 0)
gtk_stack_set_visible_child_name (self->main_stack, "nm-not-running");
+ else if (!nm_version && g_strcmp0 (state, "active") == 0)
+ gtk_stack_set_visible_child_name (self->main_stack, "wicked-running");
else if (!wireless_enabled && airplane_mode_active)
gtk_stack_set_visible_child_name (self->main_stack, "airplane-mode");
else if (!wireless_enabled || self->devices->len == 0)
gtk_stack_set_visible_child_name (self->main_stack, "no-wifi-devices");
else
gtk_stack_set_visible_child_name (self->main_stack, "wifi-connections");
+
+ g_object_unref (connection);
+ g_object_unref (proxy);
+ g_variant_unref (variant);
}
static void
diff --git a/panels/network/cc-wifi-panel.ui b/panels/network/cc-wifi-panel.ui
index 722ca3d4..c196f984 100644
--- a/panels/network/cc-wifi-panel.ui
+++ b/panels/network/cc-wifi-panel.ui
@@ -226,6 +226,50 @@ Error details: NetworkManager not running.</property>
</object>
</child>
+ <!-- "Wicked Running" page -->
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">wicked-running</property>
+ <property name="child">
+ <object class="GtkCenterBox">
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="orientation">vertical</property>
+ <property name="margin-top">18</property>
+ <property name="margin-bottom">18</property>
+ <property name="margin-start">18</property>
+ <property name="margin-end">18</property>
+ <child type="center">
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">face-sad-symbolic</property>
+ <property name="pixel_size">128</property>
+ <style>
+ <class name="dim-label" />
+ </style>
+ </object>
+ </child>
+ <child type="end">
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="wrap">True</property>
+ <property name="label" translatable="yes">Please use YaST2 to configure your network.</property>
+ <attributes>
+ <attribute name="scale" value="1.42" />
+ </attributes>
+ </object>
+ </child>
+ </object>
+ </property>
+ </object>
+ </child>
+
</object>
</child>
diff --git a/tests/meson.build b/tests/meson.build
index 69667acb..5f6a932d 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,8 +1,11 @@
subdir('common')
#subdir('datetime')
+# Disable tests for network panel, boo#1128195
+if false
if host_is_linux
subdir('network')
endif
+endif
subdir('interactive-panels')