## nma-ui-utils

nma-ui-utils

## Functions

void | nma_utils_setup_password_storage ()
NMSettingSecretFlags | nma_utils_menu_to_secret_flags ()
void | nma_utils_update_password_storage ()

## Description

## Functions

### nma_utils_setup_password_storage ()

    void
    nma_utils_setup_password_storage (GtkWidget *passwd_entry,
                                      NMSettingSecretFlags initial_flags,
                                      NMSetting *setting,
                                      const char *password_flags_name,
                                      gboolean with_not_required,
                                      gboolean ask_mode);

Adds a secondary icon and creates a popup menu for password entry. The active menu item is set up according to initial_flags, or from `setting` /`password_flags_name` (if they are not NULL). If the `setting` /`password_flags_name` are not NULL, secret flags will be automatically updated in the setting when menu is changed.

#### Parameters

passwd_entry | password GtkEntry which the icon is attached to |
initial_flags | initial secret flags to setup password menu from |
setting | NMSetting containing the password, or NULL |
password_flags_name | name of the secret flags (like psk-flags), or NULL |
with_not_required | whether to include "Not required" menu item |

ask_mode

`TRUE` if the entry is shown in ASK mode. That means, while prompting for a password, contrary to being inside the editor mode. If `TRUE`, the entry should be sensivive on selected "always-ask" icon (this is e.f. for nm-applet asking for password), otherwise not. If `FALSE`, it shall not be possible to select a different storage, because we only prompt for a password, we cannot change the password location.

### nma_utils_menu_to_secret_flags ()

    NMSettingSecretFlags
    nma_utils_menu_to_secret_flags (GtkWidget *passwd_entry);

Returns secret flags corresponding to the selected password storage menu in the attached icon

#### Parameters

passwd_entry | password GtkEntry which the password icon/menu is attached to |

#### Returns

secret flags corresponding to the active item in password menu

### nma_utils_update_password_storage ()

    void
    nma_utils_update_password_storage (GtkWidget *passwd_entry,
                                       NMSettingSecretFlags secret_flags,
                                       NMSetting *setting,
                                       const char *password_flags_name);

Updates secret flags in the password storage popup menu and also in the `setting` (if `setting` and `password_flags_name` are not NULL).

#### Parameters

passwd_entry | GtkEntry with the password |
secret_flags | secret flags to set |
setting | NMSetting containing the password, or NULL |
password_flags_name | name of the secret flags (like psk-flags), or NULL |