summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2016-05-25 10:45:07 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2016-05-27 15:01:08 +0200
commit093657df1478002f3d616717eb3a0ac4efae87aa (patch)
tree60db2bd5d674028927f497f4cbb4c50c3c375194
parent90c9d7d41cca51d8d142b0334564a45eca5d5902 (diff)
downloadnetwork-manager-applet-093657df1478002f3d616717eb3a0ac4efae87aa.tar.gz
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
-rw-r--r--src/libnma/nma-wifi-dialog.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libnma/nma-wifi-dialog.c b/src/libnma/nma-wifi-dialog.c
index d92fc1c5..19f550f3 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;