network: Remove constant password_flags_name property
This commit is contained in:
parent
a99cafbdb4
commit
099b58a8c9
4 changed files with 7 additions and 19 deletions
|
@ -44,7 +44,6 @@ struct _EAPMethodTLS {
|
||||||
GtkFileChooserButton *user_cert_button;
|
GtkFileChooserButton *user_cert_button;
|
||||||
GtkLabel *user_cert_label;
|
GtkLabel *user_cert_label;
|
||||||
|
|
||||||
const gchar *password_flags_name;
|
|
||||||
gchar *username;
|
gchar *username;
|
||||||
gchar *password;
|
gchar *password;
|
||||||
gboolean show_password;
|
gboolean show_password;
|
||||||
|
|
|
@ -36,8 +36,6 @@ struct _WirelessSecurityLEAP {
|
||||||
GtkCheckButton *show_password_check;
|
GtkCheckButton *show_password_check;
|
||||||
GtkEntry *username_entry;
|
GtkEntry *username_entry;
|
||||||
GtkLabel *username_label;
|
GtkLabel *username_label;
|
||||||
|
|
||||||
const char *password_flags_name;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void wireless_security_iface_init (WirelessSecurityInterface *);
|
static void wireless_security_iface_init (WirelessSecurityInterface *);
|
||||||
|
@ -114,12 +112,12 @@ fill_connection (WirelessSecurity *security, NMConnection *connection)
|
||||||
|
|
||||||
/* Save LEAP_PASSWORD_FLAGS to the connection */
|
/* Save LEAP_PASSWORD_FLAGS to the connection */
|
||||||
secret_flags = nma_utils_menu_to_secret_flags (GTK_WIDGET (self->password_entry));
|
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);
|
secret_flags, NULL);
|
||||||
|
|
||||||
/* Update secret flags and popup when editing the connection */
|
/* Update secret flags and popup when editing the connection */
|
||||||
nma_utils_update_password_storage (GTK_WIDGET (self->password_entry), secret_flags,
|
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
|
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);
|
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 */
|
/* 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);
|
FALSE, FALSE);
|
||||||
|
|
||||||
if (wsec)
|
if (wsec)
|
||||||
|
|
|
@ -39,8 +39,6 @@ struct _WirelessSecurityWEPKey {
|
||||||
GtkLabel *key_label;
|
GtkLabel *key_label;
|
||||||
GtkCheckButton *show_key_check;
|
GtkCheckButton *show_key_check;
|
||||||
|
|
||||||
const char *password_flags_name;
|
|
||||||
|
|
||||||
NMWepKeyType type;
|
NMWepKeyType type;
|
||||||
char keys[4][65];
|
char keys[4][65];
|
||||||
guint8 cur_index;
|
guint8 cur_index;
|
||||||
|
@ -193,7 +191,7 @@ fill_connection (WirelessSecurity *security, NMConnection *connection)
|
||||||
|
|
||||||
/* Update secret flags and popup when editing the connection */
|
/* Update secret flags and popup when editing the connection */
|
||||||
nma_utils_update_password_storage (GTK_WIDGET (self->key_entry), secret_flags,
|
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
|
static void
|
||||||
|
@ -291,7 +289,6 @@ ws_wep_key_new (NMConnection *connection,
|
||||||
|
|
||||||
self = g_object_new (ws_wep_key_get_type (), NULL);
|
self = g_object_new (ws_wep_key_get_type (), NULL);
|
||||||
|
|
||||||
self->password_flags_name = NM_SETTING_WIRELESS_SECURITY_WEP_KEY0;
|
|
||||||
self->type = type;
|
self->type = type;
|
||||||
|
|
||||||
gtk_entry_set_width_chars (self->key_entry, 28);
|
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 */
|
/* Create password-storage popup menu for password entry under entry's secondary icon */
|
||||||
if (connection)
|
if (connection)
|
||||||
setting = (NMSetting *) nm_connection_get_setting_wireless_security (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);
|
FALSE, FALSE);
|
||||||
|
|
||||||
if (connection) {
|
if (connection) {
|
||||||
|
|
|
@ -39,8 +39,6 @@ struct _WirelessSecurityWPAPSK {
|
||||||
GtkCheckButton *show_password_check;
|
GtkCheckButton *show_password_check;
|
||||||
GtkComboBox *type_combo;
|
GtkComboBox *type_combo;
|
||||||
GtkLabel *type_label;
|
GtkLabel *type_label;
|
||||||
|
|
||||||
const char *password_flags_name;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void wireless_security_iface_init (WirelessSecurityInterface *);
|
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 */
|
/* Update secret flags and popup when editing the connection */
|
||||||
nma_utils_update_password_storage (GTK_WIDGET (self->password_entry), secret_flags,
|
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);
|
wireless_security_clear_ciphers (connection);
|
||||||
if (is_adhoc) {
|
if (is_adhoc) {
|
||||||
|
@ -201,15 +199,13 @@ ws_wpa_psk_new (NMConnection *connection)
|
||||||
|
|
||||||
self = g_object_new (ws_wpa_psk_get_type (), NULL);
|
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);
|
g_signal_connect_swapped (self->password_entry, "changed", G_CALLBACK (changed_cb), self);
|
||||||
gtk_entry_set_width_chars (self->password_entry, 28);
|
gtk_entry_set_width_chars (self->password_entry, 28);
|
||||||
|
|
||||||
/* Create password-storage popup menu for password entry under entry's secondary icon */
|
/* Create password-storage popup menu for password entry under entry's secondary icon */
|
||||||
if (connection)
|
if (connection)
|
||||||
setting = (NMSetting *) nm_connection_get_setting_wireless_security (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);
|
FALSE, FALSE);
|
||||||
|
|
||||||
/* Fill secrets, if any */
|
/* Fill secrets, if any */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue