Functions

mobile_providers_split_3gpp_mcc_mnc (mccmnc)

utils_menu_to_secret_flags (passwd_entry)

utils_setup_password_storage (passwd_entry, initial_flags, setting, password_flags_name, with_not_required, ask_mode)

utils_update_password_storage (passwd_entry, secret_flags, setting, password_flags_name)

Details

NMA.mobile_providers_split_3gpp_mcc_mnc(mccmnc)
Parameters:

mccmnc (str) – input MCCMNC string.

Returns:

True if correctly split and mcc and mnc are set; False otherwise.

mcc:

the MCC.

mnc:

the MNC.

Return type:

(bool, mcc: str, mnc: str)

Splits the input MCCMNC string into separate MCC and MNC strings.

NMA.utils_menu_to_secret_flags(passwd_entry)
Parameters:

passwd_entry (Gtk.Widget) – password Gtk.Entry which the password icon/menu is attached to

Returns:

secret flags corresponding to the active item in password menu

Return type:

NM.SettingSecretFlags

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

NMA.utils_setup_password_storage(passwd_entry, initial_flags, setting, password_flags_name, with_not_required, ask_mode)
Parameters:
  • passwd_entry (Gtk.Widget) – password Gtk.Entry which the icon is attached to

  • initial_flags (NM.SettingSecretFlags) – initial secret flags to setup password menu from

  • setting (NM.Setting) – NM.Setting containing the password, or None

  • password_flags_name (str) – name of the secret flags (like psk-flags), or None

  • with_not_required (bool) – whether to include “Not required” menu item

  • ask_mode (bool) – 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.

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 None). If the setting/password_flags_name are not None, secret flags will be automatically updated in the setting when menu is changed.

NMA.utils_update_password_storage(passwd_entry, secret_flags, setting, password_flags_name)
Parameters:

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