[network-manager-applet: 2/3] nma-ui-utils: disable password storage chooser in ask mode



commit ac2adab8e1f99417a4b3c32f13d629302fc6aaab
Author: Thomas Haller <thaller redhat com>
Date:   Thu Dec 8 13:03:09 2016 +0100

    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.

 src/libnm-gtk/nm-ui-utils.c |    2 ++
 src/libnma/nma-ui-utils.c   |    2 ++
 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 ea63fde..e92ff80 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 5933220..7649ee5 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 */


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