[network-manager-applet] wifi-dialog: fix enabling of "Connect" button



commit 093657df1478002f3d616717eb3a0ac4efae87aa
Author: Beniamino Galvani <bgalvani redhat com>
Date:   Wed May 25 10:45:07 2016 +0200

    wifi-dialog: fix enabling of "Connect" button
    
    When secrets for a connection become available we update all the
    WirelessSecurity items, triggering multiple calls to
    stuff_changed_cb() (since it is registered as a callback for changed
    events). But only the currently selected security item should cause a
    change in the activation of the "Connect" button.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=597839

 src/libnma/nma-wifi-dialog.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/libnma/nma-wifi-dialog.c b/src/libnma/nma-wifi-dialog.c
index d92fc1c..19f550f 100644
--- a/src/libnma/nma-wifi-dialog.c
+++ b/src/libnma/nma-wifi-dialog.c
@@ -261,6 +261,16 @@ stuff_changed_cb (WirelessSecurity *sec, gpointer user_data)
        GBytes *ssid = NULL;
        gboolean free_ssid = TRUE;
        gboolean valid = FALSE;
+       GtkTreeModel *model;
+       GtkTreeIter iter;
+       WirelessSecurity *sel_sec = NULL;
+
+       model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->sec_combo));
+       if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->sec_combo), &iter))
+               gtk_tree_model_get (model, &iter, S_SEC_COLUMN, &sel_sec, -1);
+
+       if (sel_sec != sec)
+               return;
 
        if (priv->connection) {
                NMSettingWireless *s_wireless;


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