network: Remove constant password_flags_name property

This commit is contained in:
Robert Ancell 2019-12-03 15:18:11 +13:00 committed by Georges Basile Stavracas Neto
parent a99cafbdb4
commit 099b58a8c9
4 changed files with 7 additions and 19 deletions

View file

@ -44,7 +44,6 @@ struct _EAPMethodTLS {
GtkFileChooserButton *user_cert_button;
GtkLabel *user_cert_label;
const gchar *password_flags_name;
gchar *username;
gchar *password;
gboolean show_password;

View file

@ -36,8 +36,6 @@ struct _WirelessSecurityLEAP {
GtkCheckButton *show_password_check;
GtkEntry *username_entry;
GtkLabel *username_label;
const char *password_flags_name;
};
static void wireless_security_iface_init (WirelessSecurityInterface *);
@ -114,12 +112,12 @@ fill_connection (WirelessSecurity *security, NMConnection *connection)
/* Save LEAP_PASSWORD_FLAGS to the connection */
secret_flags = nma_utils_menu_to_secret_flags (GTK_WIDGET (self->password_entry));
nm_setting_set_secret_flags (NM_SETTING (s_wireless_sec), self->password_flags_name,
nm_setting_set_secret_flags (NM_SETTING (s_wireless_sec), NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD,
secret_flags, NULL);
/* Update secret flags and popup when editing the connection */
nma_utils_update_password_storage (GTK_WIDGET (self->password_entry), secret_flags,
NM_SETTING (s_wireless_sec), self->password_flags_name);
NM_SETTING (s_wireless_sec), NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD);
}
static gboolean
@ -183,12 +181,10 @@ ws_leap_new (NMConnection *connection)
}
}
self->password_flags_name = NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD;
g_signal_connect_swapped (self->password_entry, "changed", G_CALLBACK (changed_cb), self);
/* Create password-storage popup menu for password entry under entry's secondary icon */
nma_utils_setup_password_storage (GTK_WIDGET (self->password_entry), 0, (NMSetting *) wsec, self->password_flags_name,
nma_utils_setup_password_storage (GTK_WIDGET (self->password_entry), 0, (NMSetting *) wsec, NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD,
FALSE, FALSE);
if (wsec)

View file

@ -39,8 +39,6 @@ struct _WirelessSecurityWEPKey {
GtkLabel *key_label;
GtkCheckButton *show_key_check;
const char *password_flags_name;
NMWepKeyType type;
char keys[4][65];
guint8 cur_index;
@ -193,7 +191,7 @@ fill_connection (WirelessSecurity *security, NMConnection *connection)
/* Update secret flags and popup when editing the connection */
nma_utils_update_password_storage (GTK_WIDGET (self->key_entry), secret_flags,
NM_SETTING (s_wsec), self->password_flags_name);
NM_SETTING (s_wsec), NM_SETTING_WIRELESS_SECURITY_WEP_KEY0);
}
static void
@ -291,7 +289,6 @@ ws_wep_key_new (NMConnection *connection,
self = g_object_new (ws_wep_key_get_type (), NULL);
self->password_flags_name = NM_SETTING_WIRELESS_SECURITY_WEP_KEY0;
self->type = type;
gtk_entry_set_width_chars (self->key_entry, 28);
@ -299,7 +296,7 @@ ws_wep_key_new (NMConnection *connection,
/* Create password-storage popup menu for password entry under entry's secondary icon */
if (connection)
setting = (NMSetting *) nm_connection_get_setting_wireless_security (connection);
nma_utils_setup_password_storage (GTK_WIDGET (self->key_entry), 0, setting, self->password_flags_name,
nma_utils_setup_password_storage (GTK_WIDGET (self->key_entry), 0, setting, NM_SETTING_WIRELESS_SECURITY_WEP_KEY0,
FALSE, FALSE);
if (connection) {

View file

@ -39,8 +39,6 @@ struct _WirelessSecurityWPAPSK {
GtkCheckButton *show_password_check;
GtkComboBox *type_combo;
GtkLabel *type_label;
const char *password_flags_name;
};
static void wireless_security_iface_init (WirelessSecurityInterface *);
@ -130,7 +128,7 @@ fill_connection (WirelessSecurity *security, NMConnection *connection)
/* Update secret flags and popup when editing the connection */
nma_utils_update_password_storage (GTK_WIDGET (self->password_entry), secret_flags,
NM_SETTING (s_wireless_sec), self->password_flags_name);
NM_SETTING (s_wireless_sec), NM_SETTING_WIRELESS_SECURITY_PSK);
wireless_security_clear_ciphers (connection);
if (is_adhoc) {
@ -201,15 +199,13 @@ ws_wpa_psk_new (NMConnection *connection)
self = g_object_new (ws_wpa_psk_get_type (), NULL);
self->password_flags_name = NM_SETTING_WIRELESS_SECURITY_PSK;
g_signal_connect_swapped (self->password_entry, "changed", G_CALLBACK (changed_cb), self);
gtk_entry_set_width_chars (self->password_entry, 28);
/* Create password-storage popup menu for password entry under entry's secondary icon */
if (connection)
setting = (NMSetting *) nm_connection_get_setting_wireless_security (connection);
nma_utils_setup_password_storage (GTK_WIDGET (self->password_entry), 0, setting, self->password_flags_name,
nma_utils_setup_password_storage (GTK_WIDGET (self->password_entry), 0, setting, NM_SETTING_WIRELESS_SECURITY_PSK,
FALSE, FALSE);
/* Fill secrets, if any */