[network-manager-applet/jk/rh879566-secret-flags: 4/4] utils: move *_password_storage() functions to utils



commit 6439ee74ac432c35ca4b4edb0babf6a327eca65e
Author: Jiří Klimeš <jklimes redhat com>
Date:   Wed Dec 4 17:14:58 2013 +0100

    utils: move *_password_storage() functions to utils
    
    Thus they can also be used on other places, like VPN plugins.

 src/utils/utils.c                         |  173 +++++++++++++++++++++++++++++
 src/utils/utils.h                         |    9 ++
 src/wireless-security/eap-method-leap.c   |    5 +-
 src/wireless-security/eap-method-simple.c |    5 +-
 src/wireless-security/eap-method-tls.c    |    5 +-
 src/wireless-security/wireless-security.c |  168 ----------------------------
 src/wireless-security/wireless-security.h |   10 --
 src/wireless-security/ws-leap.c           |    5 +-
 src/wireless-security/ws-wep-key.c        |    4 +-
 src/wireless-security/ws-wpa-psk.c        |    5 +-
 10 files changed, 199 insertions(+), 190 deletions(-)
---
diff --git a/src/utils/utils.c b/src/utils/utils.c
index 298ffe5..a499758 100644
--- a/src/utils/utils.c
+++ b/src/utils/utils.c
@@ -286,3 +286,176 @@ utils_filter_editable_on_insert_text (GtkEditable *editable,
        return count > 0;
 }
 
+static void
+change_password_storage_icon (GtkWidget *passwd_entry, int number)
+{
+       char *icon_name = "document-save";
+
+       if (number == 1)
+               icon_name = "document-save";
+       else if (number == 2)
+               icon_name = "document-save-as";
+
+       gtk_entry_set_icon_from_icon_name (GTK_ENTRY (passwd_entry), GTK_ENTRY_ICON_SECONDARY, icon_name);
+}
+
+typedef struct {
+       NMConnection *connection;
+       const char *setting_name;
+       const char *password_flags_name;
+       int item_number;
+       GtkWidget *passwd_entry;
+} PopupMenuItemInfo;
+
+static void
+popup_menu_item_info_destroy (gpointer data)
+{
+       g_slice_free (PopupMenuItemInfo, data);
+}
+
+static void
+activate_menu_item_cb (GtkMenuItem *menuitem, gpointer user_data)
+{
+       PopupMenuItemInfo *info = (PopupMenuItemInfo *) user_data;
+       NMSetting *setting;
+       NMSettingSecretFlags secret_flags = NM_SETTING_SECRET_FLAG_NONE;
+
+       /* Get current secret flags */
+       setting = nm_connection_get_setting_by_name (info->connection, info->setting_name);
+       if (setting)
+               nm_setting_get_secret_flags (setting, info->password_flags_name, &secret_flags, NULL);
+
+       /* Update password flags according to the password-storage popup menu */
+       if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menuitem))) {
+               if (info->item_number == 1)
+                       secret_flags |= NM_SETTING_SECRET_FLAG_AGENT_OWNED;
+               else
+                       secret_flags &= ~NM_SETTING_SECRET_FLAG_AGENT_OWNED;
+
+               /* Update the secret flags */
+               if (setting)
+                       nm_setting_set_secret_flags (setting, info->password_flags_name, secret_flags, NULL);
+
+               /* Change icon */
+               change_password_storage_icon (info->passwd_entry, info->item_number);
+       }
+}
+
+static void
+icon_release_cb (GtkEntry *entry,
+                 GtkEntryIconPosition position,
+                 GdkEventButton *event,
+                 gpointer data)
+{
+       GtkMenu *menu = GTK_MENU (data);
+       if (position == GTK_ENTRY_ICON_SECONDARY) {
+               gtk_widget_show_all (GTK_WIDGET (data));
+               gtk_menu_popup (menu, NULL, NULL, NULL, NULL,
+                               event->button, event->time);
+       }
+}
+
+/**
+ * Add secondary icon and create popup menu for password entry.
+ **/
+void
+utils_setup_password_storage (NMConnection *connection,
+                              const char *setting_name,
+                              GtkWidget *passwd_entry,
+                              const char *password_flags_name)
+{
+       GtkWidget *popup_menu;
+       GtkWidget *item1, *item2;
+       GSList *group;
+       PopupMenuItemInfo *info;
+       NMSetting *setting;
+
+       gtk_entry_set_icon_from_icon_name (GTK_ENTRY (passwd_entry), GTK_ENTRY_ICON_SECONDARY, 
"document-save");
+       popup_menu = gtk_menu_new ();
+       group = NULL;
+       item1 = gtk_radio_menu_item_new_with_mnemonic (group, _("Store the password only for this _user"));
+       group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item1));
+       item2 = gtk_radio_menu_item_new_with_mnemonic (group, _("Store the password for _all users"));
+
+       gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), item1);
+       gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), item2);
+
+       info = g_slice_new0 (PopupMenuItemInfo);
+       info->connection = connection;
+       info->setting_name = setting_name;
+       info->password_flags_name = password_flags_name;
+       info->item_number = 1;
+       info->passwd_entry = passwd_entry;
+       g_signal_connect_data (item1, "activate",
+                              G_CALLBACK (activate_menu_item_cb),
+                              info,
+                              (GClosureNotify) popup_menu_item_info_destroy, 0);
+
+       info = g_slice_new0 (PopupMenuItemInfo);
+       info->connection = connection;
+       info->setting_name = setting_name;
+       info->password_flags_name = password_flags_name;
+       info->item_number = 2;
+       info->passwd_entry = passwd_entry;
+       g_signal_connect_data (item2, "activate",
+                              G_CALLBACK (activate_menu_item_cb),
+                              info,
+                              (GClosureNotify) popup_menu_item_info_destroy, 0);
+
+       g_signal_connect (passwd_entry, "icon-release", G_CALLBACK (icon_release_cb), popup_menu);
+       gtk_menu_attach_to_widget (GTK_MENU (popup_menu), passwd_entry, NULL);
+
+       /* Initialize active item for password-storage popup menu */
+       setting = nm_connection_get_setting_by_name (connection, setting_name);
+       if (setting) {
+               NMSettingSecretFlags secret_flags = NM_SETTING_SECRET_FLAG_NONE;
+               nm_setting_get_secret_flags (setting, password_flags_name, &secret_flags, NULL);
+
+               if (secret_flags & NM_SETTING_SECRET_FLAG_AGENT_OWNED)
+                       gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item1), TRUE);
+               else {
+                       gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item2), TRUE);
+                       /* Use different icon for system-storage */
+                       change_password_storage_icon (passwd_entry, 2);
+               }
+       } else {
+               gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item1), TRUE);
+       }
+}
+
+/**
+ * Updates secret flags and the storage popup menu.
+ **/
+void
+utils_update_password_storage (NMSetting *setting,
+                               NMSettingSecretFlags secret_flags,
+                               GtkWidget *passwd_entry,
+                               const char *password_flags_name)
+{
+       GList *menu;
+
+       /* Update secret flags (WEP_KEY_FLAGS, PSK_FLAGS, ...) in the security setting */
+       nm_setting_set_secret_flags (setting, password_flags_name, secret_flags, NULL);
+
+       /* Update password-storage popup menu to reflect secret flags */
+       menu = gtk_menu_get_for_attach_widget (passwd_entry);
+       if (menu && menu->data) {
+               GtkRadioMenuItem *item, *item_user, *item_system;
+               GSList *group;
+
+               /* radio menu group list contains the menu items in reverse order */
+               item = (GtkRadioMenuItem *) gtk_menu_get_active (GTK_MENU (menu->data));
+               group = gtk_radio_menu_item_get_group (item);
+               item_system = group->data;
+               item_user = group->next->data;
+
+               if (secret_flags & NM_SETTING_SECRET_FLAG_AGENT_OWNED) {
+                       gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item_user), TRUE);
+                       change_password_storage_icon (passwd_entry, 1);
+               } else {
+                       gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item_system), TRUE);
+                       change_password_storage_icon (passwd_entry, 2);
+               }
+       }
+}
+
diff --git a/src/utils/utils.h b/src/utils/utils.h
index 8ad3e55..3cd0408 100644
--- a/src/utils/utils.h
+++ b/src/utils/utils.h
@@ -75,5 +75,14 @@ gboolean utils_filter_editable_on_insert_text (GtkEditable *editable,
                                                UtilsFilterGtkEditableFunc validate_character,
                                                gpointer block_func);
 
+void utils_setup_password_storage (NMConnection *connection,
+                                   const char *setting_name,
+                                   GtkWidget *passwd_entry,
+                                   const char *password_flags_name);
+void utils_update_password_storage (NMSetting *setting,
+                                    NMSettingSecretFlags secret_flags,
+                                    GtkWidget *passwd_entry,
+                                    const char *password_flags_name);
+
 #endif /* UTILS_H */
 
diff --git a/src/wireless-security/eap-method-leap.c b/src/wireless-security/eap-method-leap.c
index 6f0fa9d..3f0b446 100644
--- a/src/wireless-security/eap-method-leap.c
+++ b/src/wireless-security/eap-method-leap.c
@@ -27,6 +27,7 @@
 #include "eap-method.h"
 #include "wireless-security.h"
 #include "helpers.h"
+#include "utils.h"
 
 struct _EAPMethodLEAP {
        EAPMethod parent;
@@ -99,7 +100,7 @@ fill_connection (EAPMethod *parent, NMConnection *connection, NMSettingSecretFla
                GtkWidget *passwd_entry = GTK_WIDGET (gtk_builder_get_object (parent->builder, 
"eap_leap_password_entry"));
                g_assert (passwd_entry);
 
-               ws_update_password_storage (NM_SETTING (s_8021x), flags, passwd_entry, 
parent->password_flags_name);
+               utils_update_password_storage (NM_SETTING (s_8021x), flags, passwd_entry, 
parent->password_flags_name);
        }
 }
 
@@ -220,7 +221,7 @@ eap_method_leap_new (WirelessSecurity *ws_parent,
                          ws_parent);
 
        /* Create password-storage popup menu for password entry under entry's secondary icon */
-       ws_setup_password_storage (connection, NM_SETTING_802_1X_SETTING_NAME, widget, 
parent->password_flags_name);
+       utils_setup_password_storage (connection, NM_SETTING_802_1X_SETTING_NAME, widget, 
parent->password_flags_name);
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "show_checkbutton_eapleap"));
        g_assert (widget);
diff --git a/src/wireless-security/eap-method-simple.c b/src/wireless-security/eap-method-simple.c
index e302e39..e23affd 100644
--- a/src/wireless-security/eap-method-simple.c
+++ b/src/wireless-security/eap-method-simple.c
@@ -28,6 +28,7 @@
 #include "eap-method.h"
 #include "wireless-security.h"
 #include "helpers.h"
+#include "utils.h"
 
 struct _EAPMethodSimple {
        EAPMethod parent;
@@ -162,7 +163,7 @@ fill_connection (EAPMethod *parent, NMConnection *connection, NMSettingSecretFla
                GtkWidget *passwd_entry = GTK_WIDGET (gtk_builder_get_object (parent->builder, 
"eap_simple_password_entry"));
                g_assert (passwd_entry);
 
-               ws_update_password_storage (NM_SETTING (s_8021x), flags, passwd_entry, 
parent->password_flags_name);
+               utils_update_password_storage (NM_SETTING (s_8021x), flags, passwd_entry, 
parent->password_flags_name);
        }
 }
 
@@ -331,7 +332,7 @@ eap_method_simple_new (WirelessSecurity *ws_parent,
                          ws_parent);
 
        /* Create password-storage popup menu for password entry under entry's secondary icon */
-       ws_setup_password_storage (connection, NM_SETTING_802_1X_SETTING_NAME, widget, 
parent->password_flags_name);
+       utils_setup_password_storage (connection, NM_SETTING_802_1X_SETTING_NAME, widget, 
parent->password_flags_name);
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_password_always_ask"));
        g_assert (widget);
diff --git a/src/wireless-security/eap-method-tls.c b/src/wireless-security/eap-method-tls.c
index eb48ed6..9d68e0c 100644
--- a/src/wireless-security/eap-method-tls.c
+++ b/src/wireless-security/eap-method-tls.c
@@ -32,6 +32,7 @@
 #include "eap-method.h"
 #include "wireless-security.h"
 #include "helpers.h"
+#include "utils.h"
 
 struct _EAPMethodTLS {
        EAPMethod parent;
@@ -185,7 +186,7 @@ fill_connection (EAPMethod *parent, NMConnection *connection, NMSettingSecretFla
 
        /* Update secret flags and popup when editing the connection */
        if (method->editing_connection) {
-               ws_update_password_storage (NM_SETTING (s_8021x), flags, passwd_entry, 
parent->password_flags_name);
+               utils_update_password_storage (NM_SETTING (s_8021x), flags, passwd_entry, 
parent->password_flags_name);
        }
 
        /* TLS client certificate */
@@ -490,7 +491,7 @@ eap_method_tls_new (WirelessSecurity *ws_parent,
                          ws_parent);
 
        /* Create password-storage popup menu for password entry under entry's secondary icon */
-       ws_setup_password_storage (connection, NM_SETTING_802_1X_SETTING_NAME, widget, 
parent->password_flags_name);
+       utils_setup_password_storage (connection, NM_SETTING_802_1X_SETTING_NAME, widget, 
parent->password_flags_name);
 
        widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "show_checkbutton_eaptls"));
        g_assert (widget);
diff --git a/src/wireless-security/wireless-security.c b/src/wireless-security/wireless-security.c
index 6bad327..d64fe1d 100644
--- a/src/wireless-security/wireless-security.c
+++ b/src/wireless-security/wireless-security.c
@@ -579,171 +579,3 @@ ws_802_1x_update_secrets (WirelessSecurity *sec,
        }
 }
 
-static void
-change_password_storage_icon (GtkWidget *passwd_entry, int number)
-{
-       char *icon_name = "document-save";
-
-       if (number == 1)
-               icon_name = "document-save";
-       else if (number == 2)
-               icon_name = "document-save-as";
-
-       gtk_entry_set_icon_from_icon_name (GTK_ENTRY (passwd_entry), GTK_ENTRY_ICON_SECONDARY, icon_name);
-}
-
-typedef struct {
-       NMConnection *connection;
-       const char *setting_name;
-       const char *password_flags_name;
-       int item_number;
-       GtkWidget *passwd_entry;
-} PopupMenuItemInfo;
-
-static void
-popup_menu_item_info_destroy (gpointer data)
-{
-       g_slice_free (PopupMenuItemInfo, data);
-}
-
-static void
-activate_menu_item_cb (GtkMenuItem *menuitem, gpointer user_data)
-{
-       PopupMenuItemInfo *info = (PopupMenuItemInfo *) user_data;
-       NMSetting *setting;
-       NMSettingSecretFlags secret_flags = NM_SETTING_SECRET_FLAG_NONE;
-
-       /* Get current secret flags */
-       setting = nm_connection_get_setting_by_name (info->connection, info->setting_name);
-       if (setting)
-               nm_setting_get_secret_flags (setting, info->password_flags_name, &secret_flags, NULL);
-
-       /* Update password flags according to the password-storage popup menu */
-       if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menuitem))) {
-               if (info->item_number == 1)
-                       secret_flags |= NM_SETTING_SECRET_FLAG_AGENT_OWNED;
-               else
-                       secret_flags &= ~NM_SETTING_SECRET_FLAG_AGENT_OWNED;
-
-               /* Update the secret flags */
-               if (setting)
-                       nm_setting_set_secret_flags (setting, info->password_flags_name, secret_flags, NULL);
-
-               /* Change icon */
-               change_password_storage_icon (info->passwd_entry, info->item_number);
-       }
-}
-
-static void
-icon_release_cb (GtkEntry *entry,
-                 GtkEntryIconPosition position,
-                 GdkEventButton *event,
-                 gpointer data)
-{
-       GtkMenu *menu = GTK_MENU (data);
-       if (position == GTK_ENTRY_ICON_SECONDARY) {
-               gtk_widget_show_all (GTK_WIDGET (data));
-               gtk_menu_popup (menu, NULL, NULL, NULL, NULL,
-                               event->button, event->time);
-       }
-}
-
-/* Add secondary icon and create popup menu for password entry */
-void
-ws_setup_password_storage (NMConnection *connection,
-                           const char *setting_name,
-                           GtkWidget *passwd_entry,
-                           const char *password_flags_name)
-{
-       GtkWidget *popup_menu;
-       GtkWidget *item1, *item2;
-       GSList *group;
-       PopupMenuItemInfo *info;
-       NMSetting *setting;
-
-       gtk_entry_set_icon_from_icon_name (GTK_ENTRY (passwd_entry), GTK_ENTRY_ICON_SECONDARY, 
"document-save");
-       popup_menu = gtk_menu_new ();
-       group = NULL;
-       item1 = gtk_radio_menu_item_new_with_mnemonic (group, _("Store the password only for this _user"));
-       group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item1));
-       item2 = gtk_radio_menu_item_new_with_mnemonic (group, _("Store the password for _all users"));
-
-       gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), item1);
-       gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), item2);
-
-       info = g_slice_new0 (PopupMenuItemInfo);
-       info->connection = connection;
-       info->setting_name = setting_name;
-       info->password_flags_name = password_flags_name;
-       info->item_number = 1;
-       info->passwd_entry = passwd_entry;
-       g_signal_connect_data (item1, "activate",
-                              G_CALLBACK (activate_menu_item_cb),
-                              info,
-                              (GClosureNotify) popup_menu_item_info_destroy, 0);
-
-       info = g_slice_new0 (PopupMenuItemInfo);
-       info->connection = connection;
-       info->setting_name = setting_name;
-       info->password_flags_name = password_flags_name;
-       info->item_number = 2;
-       info->passwd_entry = passwd_entry;
-       g_signal_connect_data (item2, "activate",
-                              G_CALLBACK (activate_menu_item_cb),
-                              info,
-                              (GClosureNotify) popup_menu_item_info_destroy, 0);
-
-       g_signal_connect (passwd_entry, "icon-release", G_CALLBACK (icon_release_cb), popup_menu);
-       gtk_menu_attach_to_widget (GTK_MENU (popup_menu), passwd_entry, NULL);
-
-       /* Initialize active item for password-storage popup menu */
-       setting = nm_connection_get_setting_by_name (connection, setting_name);
-       if (setting) {
-               NMSettingSecretFlags secret_flags = NM_SETTING_SECRET_FLAG_NONE;
-               nm_setting_get_secret_flags (setting, password_flags_name, &secret_flags, NULL);
-
-               if (secret_flags & NM_SETTING_SECRET_FLAG_AGENT_OWNED)
-                       gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item1), TRUE);
-               else {
-                       gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item2), TRUE);
-                       /* Use different icon for system-storage */
-                       change_password_storage_icon (passwd_entry, 2);
-               }
-       } else {
-               gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item1), TRUE);
-       }
-}
-
-void
-ws_update_password_storage (NMSetting *setting,
-                            NMSettingSecretFlags secret_flags,
-                            GtkWidget *passwd_entry,
-                            const char *password_flags_name)
-{
-       GList *menu;
-
-       /* Update secret flags (WEP_KEY_FLAGS, PSK_FLAGS, ...) in the security setting */
-       nm_setting_set_secret_flags (setting, password_flags_name, secret_flags, NULL);
-
-       /* Update password-storage popup menu to reflect secret flags */
-       menu = gtk_menu_get_for_attach_widget (passwd_entry);
-       if (menu && menu->data) {
-               GtkRadioMenuItem *item, *item_user, *item_system;
-               GSList *group;
-
-               /* radio menu group list contains the menu items in reverse order */
-               item = (GtkRadioMenuItem *) gtk_menu_get_active (GTK_MENU (menu->data));
-               group = gtk_radio_menu_item_get_group (item);
-               item_system = group->data;
-               item_user = group->next->data;
-
-               if (secret_flags & NM_SETTING_SECRET_FLAG_AGENT_OWNED) {
-                       gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item_user), TRUE);
-                       change_password_storage_icon (passwd_entry, 1);
-               } else {
-                       gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item_system), TRUE);
-                       change_password_storage_icon (passwd_entry, 2);
-               }
-       }
-}
-
diff --git a/src/wireless-security/wireless-security.h b/src/wireless-security/wireless-security.h
index f100a67..4a1a4fe 100644
--- a/src/wireless-security/wireless-security.h
+++ b/src/wireless-security/wireless-security.h
@@ -148,15 +148,5 @@ void ws_802_1x_update_secrets (WirelessSecurity *sec,
                                const char *combo_name,
                                NMConnection *connection);
 
-void ws_setup_password_storage (NMConnection *connection,
-                                const char *setting_name,
-                                GtkWidget *passwd_entry,
-                                const char *password_flags_name);
-
-void ws_update_password_storage (NMSetting *setting,
-                                 NMSettingSecretFlags secret_flags,
-                                 GtkWidget *passwd_entry,
-                                 const char *password_flags_name);
-
 #endif /* WIRELESS_SECURITY_H */
 
diff --git a/src/wireless-security/ws-leap.c b/src/wireless-security/ws-leap.c
index 72894e8..bfb913f 100644
--- a/src/wireless-security/ws-leap.c
+++ b/src/wireless-security/ws-leap.c
@@ -25,6 +25,7 @@
 
 #include "wireless-security.h"
 #include "helpers.h"
+#include "utils.h"
 
 struct _WirelessSecurityLEAP {
        WirelessSecurity parent;
@@ -116,7 +117,7 @@ fill_connection (WirelessSecurity *parent, NMConnection *connection)
 
        /* Update secret flags and popup when editing the connection */
        if (sec->editing_connection)
-               ws_update_password_storage (NM_SETTING (s_wireless_sec), secret_flags, passwd_entry, 
sec->password_flags_name);
+               utils_update_password_storage (NM_SETTING (s_wireless_sec), secret_flags, passwd_entry, 
sec->password_flags_name);
 }
 
 static void
@@ -173,7 +174,7 @@ ws_leap_new (NMConnection *connection, gboolean secrets_only)
                          sec);
 
        /* Create password-storage popup menu for password entry under entry's secondary icon */
-       ws_setup_password_storage (connection, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, widget, 
sec->password_flags_name);
+       utils_setup_password_storage (connection, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, widget, 
sec->password_flags_name);
 
        if (wsec)
                update_secrets (WIRELESS_SECURITY (sec), connection);
diff --git a/src/wireless-security/ws-wep-key.c b/src/wireless-security/ws-wep-key.c
index a865f20..f2ac042 100644
--- a/src/wireless-security/ws-wep-key.c
+++ b/src/wireless-security/ws-wep-key.c
@@ -188,7 +188,7 @@ fill_connection (WirelessSecurity *parent, NMConnection *connection)
 
        /* Update secret flags and popup when editing the connection */
        if (sec->editing_connection)
-               ws_update_password_storage (NM_SETTING (s_wsec), secret_flags, passwd_entry, 
sec->password_flags_name);
+               utils_update_password_storage (NM_SETTING (s_wsec), secret_flags, passwd_entry, 
sec->password_flags_name);
 }
 
 static void
@@ -265,7 +265,7 @@ ws_wep_key_new (NMConnection *connection,
        gtk_entry_set_width_chars (GTK_ENTRY (widget), 28);
 
        /* Create password-storage popup menu for password entry under entry's secondary icon */
-       ws_setup_password_storage (connection, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, widget, 
sec->password_flags_name);
+       utils_setup_password_storage (connection, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, widget, 
sec->password_flags_name);
 
        if (connection) {
                NMSettingWireless *s_wireless;
diff --git a/src/wireless-security/ws-wpa-psk.c b/src/wireless-security/ws-wpa-psk.c
index e33fcf4..aa50c9c 100644
--- a/src/wireless-security/ws-wpa-psk.c
+++ b/src/wireless-security/ws-wpa-psk.c
@@ -26,6 +26,7 @@
 
 #include "wireless-security.h"
 #include "helpers.h"
+#include "utils.h"
 
 #define WPA_PMK_LEN 32
 
@@ -129,7 +130,7 @@ fill_connection (WirelessSecurity *parent, NMConnection *connection)
 
        /* Update secret flags and popup when editing the connection */
        if (wpa_psk->editing_connection)
-               ws_update_password_storage (NM_SETTING (s_wireless_sec), secret_flags, passwd_entry, 
wpa_psk->password_flags_name);
+               utils_update_password_storage (NM_SETTING (s_wireless_sec), secret_flags, passwd_entry, 
wpa_psk->password_flags_name);
 
        wireless_security_clear_ciphers (connection);
        if (is_adhoc) {
@@ -193,7 +194,7 @@ ws_wpa_psk_new (NMConnection *connection, gboolean secrets_only)
        gtk_entry_set_width_chars (GTK_ENTRY (widget), 28);
 
        /* Create password-storage popup menu for password entry under entry's secondary icon */
-       ws_setup_password_storage (connection, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, widget, 
sec->password_flags_name);
+       utils_setup_password_storage (connection, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, widget, 
sec->password_flags_name);
 
        /* Fill secrets, if any */
        if (connection)


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