summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-12-08 13:03:09 +0100
committerThomas Haller <thaller@redhat.com>2016-12-16 14:47:04 +0100
commitac2adab8e1f99417a4b3c32f13d629302fc6aaab (patch)
treed6c7594a02ed87b223b8a6314c9d302074345835
parentae85220834ace82a2f2663afff7efa60d0999c34 (diff)
downloadnetwork-manager-applet-ac2adab8e1f99417a4b3c32f13d629302fc6aaab.tar.gz
nma-ui-utils: disable password storage chooser in ask mode
When asking for a password, we cannot modify the password flags. Which means we cannot modify the password location. The UI gives the wrong impression that this was possible, while it was not. Fix that, by disabling the popup menu on the password-storage icon. We still want to show it so that the user sees it.
-rw-r--r--src/libnm-gtk/nm-ui-utils.c2
-rw-r--r--src/libnma/nma-ui-utils.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/libnm-gtk/nm-ui-utils.c b/src/libnm-gtk/nm-ui-utils.c
index ea63fde7..e92ff80a 100644
--- a/src/libnm-gtk/nm-ui-utils.c
+++ b/src/libnm-gtk/nm-ui-utils.c
@@ -863,6 +863,8 @@ nma_utils_setup_password_storage (GtkWidget *passwd_entry,
popup_menu_item_info_register (item[3], setting, password_flags_name, ITEM_STORAGE_UNUSED, passwd_entry);
g_signal_connect (passwd_entry, "icon-release", G_CALLBACK (icon_release_cb), popup_menu);
+ gtk_entry_set_icon_activatable (GTK_ENTRY (passwd_entry), GTK_ENTRY_ICON_SECONDARY,
+ !ask_mode);
gtk_menu_attach_to_widget (GTK_MENU (popup_menu), passwd_entry, NULL);
/* Initialize active item for password-storage popup menu */
diff --git a/src/libnma/nma-ui-utils.c b/src/libnma/nma-ui-utils.c
index 59332200..7649ee54 100644
--- a/src/libnma/nma-ui-utils.c
+++ b/src/libnma/nma-ui-utils.c
@@ -297,6 +297,8 @@ nma_utils_setup_password_storage (GtkWidget *passwd_entry,
popup_menu_item_info_register (item[3], setting, password_flags_name, ITEM_STORAGE_UNUSED, passwd_entry);
g_signal_connect (passwd_entry, "icon-release", G_CALLBACK (icon_release_cb), popup_menu);
+ gtk_entry_set_icon_activatable (GTK_ENTRY (passwd_entry), GTK_ENTRY_ICON_SECONDARY,
+ !ask_mode);
gtk_menu_attach_to_widget (GTK_MENU (popup_menu), passwd_entry, NULL);
/* Initialize active item for password-storage popup menu */