File control-center-network-fix-ce-apply-button.patch of Package gnome-control-center.10840

From 21606b186dfdbc4c8c7fa47909606d05f405a592 Mon Sep 17 00:00:00 2001
From: Jonathan Kang <jonathankang@gnome.org>
Date: Wed, 20 Feb 2019 15:45:02 +0800
Subject: [PATCH] network: disable the "Apply" button until a change has been
 made

---
 panels/network/wireless-security/eap-method-simple.c | 1 -
 1 file changed, 1 deletion(-)

Index: gnome-control-center-3.20.1/panels/network/connection-editor/firewall-helpers.c
===================================================================
--- gnome-control-center-3.20.1.orig/panels/network/connection-editor/firewall-helpers.c
+++ gnome-control-center-3.20.1/panels/network/connection-editor/firewall-helpers.c
@@ -30,20 +30,38 @@ typedef struct {
         GtkWidget *label;
 } GetZonesReplyData;
 
-static void
-get_zones_reply (GObject      *source,
-                 GAsyncResult *res,
-                 gpointer      user_data)
+void
+firewall_ui_setup (NMSettingConnection *setting,
+                   GtkWidget           *combo,
+                   GtkWidget           *label,
+                   GCancellable        *cancellable)
 {
-        GDBusConnection *bus = G_DBUS_CONNECTION (source);
-        GetZonesReplyData *d = user_data;
-        GVariant *ret;
-        GError *error = NULL;
         const gchar **zones;
         gint idx;
         gint i;
+        GDBusConnection *bus;
+        GetZonesReplyData *d;
+        GError *error = NULL;
+        GVariant *variant;
 
-        ret = g_dbus_connection_call_finish (bus, res, &error);
+        bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL);
+
+        d = g_new0 (GetZonesReplyData, 1);
+        d->zone = g_strdup (nm_setting_connection_get_zone (setting));
+        d->combo = combo;
+        d->label = label;
+
+        variant = g_dbus_connection_call_sync (bus,
+                                               "org.fedoraproject.FirewallD1",
+                                               "/org/fedoraproject/FirewallD1",
+                                               "org.fedoraproject.FirewallD1.zone",
+                                               "getZones",
+                                               NULL,
+                                               NULL,
+                                               0,
+                                               G_MAXINT,
+                                               cancellable,
+                                               &error);
 
         gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (d->combo),
                                         C_("Firewall zone", "Default"));
@@ -58,7 +76,7 @@ get_zones_reply (GObject      *source,
         else {
                 gtk_widget_show (d->combo);
                 gtk_widget_show (d->label);
-                g_variant_get (ret, "(^a&s)", &zones);
+                g_variant_get (variant, "(^a&s)", &zones);
 
                 for (i = 0; zones[i]; i++) {
                         gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (d->combo),
@@ -71,41 +89,12 @@ get_zones_reply (GObject      *source,
                                                         d->zone);
                         idx = i + 1;
                 }
-                g_variant_unref (ret);
+                g_variant_unref (variant);
         }
         gtk_combo_box_set_active (GTK_COMBO_BOX (d->combo), idx);
 
         g_free (d->zone);
         g_free (d);
-}
-
-void
-firewall_ui_setup (NMSettingConnection *setting,
-                   GtkWidget           *combo,
-                   GtkWidget           *label,
-                   GCancellable        *cancellable)
-{
-        GDBusConnection *bus;
-        GetZonesReplyData *d;
-
-        bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL);
-
-        d = g_new0 (GetZonesReplyData, 1);
-        d->zone = g_strdup (nm_setting_connection_get_zone (setting));
-        d->combo = combo;
-        d->label = label;
-
-        g_dbus_connection_call (bus,
-                                "org.fedoraproject.FirewallD1",
-                                "/org/fedoraproject/FirewallD1",
-                                "org.fedoraproject.FirewallD1.zone",
-                                "getZones",
-                                NULL,
-                                NULL,
-                                0,
-                                G_MAXINT,
-                                cancellable,
-                                get_zones_reply, d);
         g_object_unref (bus);
 }
 
openSUSE Build Service is sponsored by