mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-20 12:30:27 +01:00
2006-01-25 Dan Williams <dcbw@redhat.com>
* gnome/applet/wireless-applet.glade - Remove WPA2 Checkbox * gnome/applet/wireless-security-manager.c - (wsm_set_capabilities): split up sections for wpa and wpa2. This means the Wireless Security menu now has two WPA options, one for "WPA Personal" and one for "WPA2 Personal" * gnome/applet/wso-wpa-psk.[ch] - (wso_wpa_psk_new): remove stuff for WPA2 checkbox, and use 'wpa2' argument to determine WPA version to use - (append_dbus_params_func): pass stored WPA version to cipher rather than using the (removed) checkbox git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1388 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
61de833c93
commit
907c305159
5 changed files with 54 additions and 55 deletions
16
ChangeLog
16
ChangeLog
|
|
@ -1,3 +1,19 @@
|
|||
2006-01-25 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* gnome/applet/wireless-applet.glade
|
||||
- Remove WPA2 Checkbox
|
||||
|
||||
* gnome/applet/wireless-security-manager.c
|
||||
- (wsm_set_capabilities): split up sections for wpa and wpa2.
|
||||
This means the Wireless Security menu now has two WPA options,
|
||||
one for "WPA Personal" and one for "WPA2 Personal"
|
||||
|
||||
* gnome/applet/wso-wpa-psk.[ch]
|
||||
- (wso_wpa_psk_new): remove stuff for WPA2 checkbox, and use
|
||||
'wpa2' argument to determine WPA version to use
|
||||
- (append_dbus_params_func): pass stored WPA version to cipher
|
||||
rather than using the (removed) checkbox
|
||||
|
||||
2006-01-24 Robert Love <rml@novell.com>
|
||||
|
||||
* src/dhcp-manager/nm-dhcp-manager.c: Null-out the original byte array
|
||||
|
|
|
|||
|
|
@ -2016,7 +2016,7 @@ Shared Key</property>
|
|||
<widget class="GtkTable" id="table8">
|
||||
<property name="border_width">8</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="n_rows">3</property>
|
||||
<property name="n_rows">2</property>
|
||||
<property name="n_columns">2</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="row_spacing">4</property>
|
||||
|
|
@ -2115,28 +2115,6 @@ Shared Key</property>
|
|||
<property name="y_options">fill</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="wpa2_checkbutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Connect using WPA2</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="tab_expand">False</property>
|
||||
|
|
|
|||
|
|
@ -75,24 +75,25 @@ void wsm_set_capabilities (WirelessSecurityManager *wsm, guint32 capabilities)
|
|||
|
||||
if (capabilities & NM_802_11_CAP_PROTO_WEP)
|
||||
{
|
||||
opt = wso_wep_passphrase_new (wsm->glade_file);
|
||||
if (opt)
|
||||
if ((opt = wso_wep_passphrase_new (wsm->glade_file)))
|
||||
wsm->options = g_slist_append (wsm->options, opt);
|
||||
|
||||
opt = wso_wep_hex_new (wsm->glade_file);
|
||||
if (opt)
|
||||
if ((opt = wso_wep_hex_new (wsm->glade_file)))
|
||||
wsm->options = g_slist_append (wsm->options, opt);
|
||||
|
||||
opt = wso_wep_ascii_new (wsm->glade_file);
|
||||
if (opt)
|
||||
if ((opt = wso_wep_ascii_new (wsm->glade_file)))
|
||||
wsm->options = g_slist_append (wsm->options, opt);
|
||||
}
|
||||
|
||||
if ( (capabilities & NM_802_11_CAP_PROTO_WPA)
|
||||
|| (capabilities & NM_802_11_CAP_PROTO_WPA2))
|
||||
if (capabilities & NM_802_11_CAP_PROTO_WPA)
|
||||
{
|
||||
opt = wso_wpa_psk_new (wsm->glade_file, capabilities);
|
||||
if (opt)
|
||||
if ((opt = wso_wpa_psk_new (wsm->glade_file, capabilities, FALSE)))
|
||||
wsm->options = g_slist_append (wsm->options, opt);
|
||||
}
|
||||
|
||||
if (capabilities & NM_802_11_CAP_PROTO_WPA2)
|
||||
{
|
||||
if ((opt = wso_wpa_psk_new (wsm->glade_file, capabilities, TRUE)))
|
||||
wsm->options = g_slist_append (wsm->options, opt);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,14 +38,15 @@
|
|||
|
||||
struct OptData
|
||||
{
|
||||
gboolean wpa2;
|
||||
const char * entry_name;
|
||||
const char * wpa2_checkbox_name;
|
||||
const char * key_type_combo_name;
|
||||
IEEE_802_11_Cipher * hex_cipher;
|
||||
IEEE_802_11_Cipher * passphrase_cipher;
|
||||
};
|
||||
|
||||
static void data_free_func (WirelessSecurityOption *opt)
|
||||
static void
|
||||
data_free_func (WirelessSecurityOption *opt)
|
||||
{
|
||||
g_return_if_fail (opt != NULL);
|
||||
g_return_if_fail (opt->data != NULL);
|
||||
|
|
@ -57,7 +58,10 @@ static void data_free_func (WirelessSecurityOption *opt)
|
|||
}
|
||||
|
||||
|
||||
static GtkWidget * widget_create_func (WirelessSecurityOption *opt, GtkSignalFunc validate_cb, gpointer user_data)
|
||||
static GtkWidget *
|
||||
widget_create_func (WirelessSecurityOption *opt,
|
||||
GtkSignalFunc validate_cb,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWidget * entry;
|
||||
GtkWidget * widget;
|
||||
|
|
@ -73,7 +77,10 @@ static GtkWidget * widget_create_func (WirelessSecurityOption *opt, GtkSignalFun
|
|||
}
|
||||
|
||||
|
||||
static gboolean validate_input_func (WirelessSecurityOption *opt, const char *ssid, IEEE_802_11_Cipher **out_cipher)
|
||||
static gboolean
|
||||
validate_input_func (WirelessSecurityOption *opt,
|
||||
const char *ssid,
|
||||
IEEE_802_11_Cipher **out_cipher)
|
||||
{
|
||||
GtkWidget * entry;
|
||||
const char * input;
|
||||
|
|
@ -86,15 +93,16 @@ static gboolean validate_input_func (WirelessSecurityOption *opt, const char *ss
|
|||
}
|
||||
|
||||
|
||||
static gboolean append_dbus_params_func (WirelessSecurityOption *opt, const char *ssid, DBusMessage *message)
|
||||
static gboolean
|
||||
append_dbus_params_func (WirelessSecurityOption *opt,
|
||||
const char *ssid,
|
||||
DBusMessage *message)
|
||||
{
|
||||
IEEE_802_11_Cipher * cipher = NULL;
|
||||
GtkWidget * auth_combo;
|
||||
int auth_alg = -1;
|
||||
GtkWidget * entry;
|
||||
const char * input;
|
||||
GtkWidget * wpa2_checkbox;
|
||||
int wpa_version = IW_AUTH_WPA_VERSION_WPA;
|
||||
|
||||
g_return_val_if_fail (opt != NULL, FALSE);
|
||||
g_return_val_if_fail (opt->data != NULL, FALSE);
|
||||
|
|
@ -105,12 +113,9 @@ static gboolean append_dbus_params_func (WirelessSecurityOption *opt, const char
|
|||
if (!wso_validate_helper (opt, ssid, input, &cipher) || !cipher)
|
||||
return FALSE;
|
||||
|
||||
wpa2_checkbox = glade_xml_get_widget (opt->uixml, opt->data->wpa2_checkbox_name);
|
||||
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (wpa2_checkbox)))
|
||||
wpa_version = IW_AUTH_WPA_VERSION_WPA2;
|
||||
|
||||
nmu_security_serialize_wpa_psk_with_cipher (message, cipher, ssid, input,
|
||||
wpa_version, IW_AUTH_KEY_MGMT_PSK);
|
||||
opt->data->wpa2 ? IW_AUTH_WPA_VERSION_WPA2 : IW_AUTH_WPA_VERSION_WPA,
|
||||
IW_AUTH_KEY_MGMT_PSK);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -118,7 +123,7 @@ static gboolean append_dbus_params_func (WirelessSecurityOption *opt, const char
|
|||
|
||||
static void
|
||||
key_type_combo_changed_cb (GtkComboBox *combo,
|
||||
gpointer user_data)
|
||||
gpointer user_data)
|
||||
{
|
||||
WirelessSecurityOption * opt = (WirelessSecurityOption *) user_data;
|
||||
int we_cipher;
|
||||
|
|
@ -148,12 +153,12 @@ key_type_combo_changed_cb (GtkComboBox *combo,
|
|||
|
||||
WirelessSecurityOption *
|
||||
wso_wpa_psk_new (const char *glade_file,
|
||||
int capabilities)
|
||||
int capabilities,
|
||||
gboolean wpa2)
|
||||
{
|
||||
WirelessSecurityOption * opt = NULL;
|
||||
GladeXML * xml = NULL;
|
||||
OptData * data = NULL;
|
||||
GtkWidget * wpa2_checkbox;
|
||||
GtkWidget * key_type_combo;
|
||||
int num_added;
|
||||
GtkTreeModel * model;
|
||||
|
|
@ -162,7 +167,10 @@ wso_wpa_psk_new (const char *glade_file,
|
|||
g_return_val_if_fail (glade_file != NULL, NULL);
|
||||
|
||||
opt = g_malloc0 (sizeof (WirelessSecurityOption));
|
||||
opt->name = g_strdup (_("WPA/WPA2 Personal"));
|
||||
if (wpa2)
|
||||
opt->name = g_strdup (_("WPA2 Personal"));
|
||||
else
|
||||
opt->name = g_strdup (_("WPA Personal"));
|
||||
opt->widget_name = "wpa_psk_notebook";
|
||||
opt->data_free_func = data_free_func;
|
||||
opt->validate_input_func = validate_input_func;
|
||||
|
|
@ -177,8 +185,8 @@ wso_wpa_psk_new (const char *glade_file,
|
|||
|
||||
/* Option-specific data */
|
||||
opt->data = data = g_malloc0 (sizeof (OptData));
|
||||
data->wpa2 = wpa2;
|
||||
data->entry_name = "wpa_psk_entry";
|
||||
data->wpa2_checkbox_name = "wpa2_checkbutton";
|
||||
data->key_type_combo_name = "wpa_psk_type_combo";
|
||||
|
||||
/* Set up our ciphers */
|
||||
|
|
@ -189,10 +197,6 @@ wso_wpa_psk_new (const char *glade_file,
|
|||
ieee_802_11_cipher_ref (data->hex_cipher);
|
||||
opt->ciphers = g_slist_append (opt->ciphers, data->hex_cipher);
|
||||
|
||||
wpa2_checkbox = glade_xml_get_widget (opt->uixml, data->wpa2_checkbox_name);
|
||||
if (!(capabilities & NM_802_11_CAP_PROTO_WPA2))
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (wpa2_checkbox), FALSE);
|
||||
|
||||
key_type_combo = glade_xml_get_widget (opt->uixml, data->key_type_combo_name);
|
||||
g_signal_connect (G_OBJECT (key_type_combo), "changed", (GCallback) key_type_combo_changed_cb, opt);
|
||||
model = wso_wpa_create_key_type_model (capabilities, &num_added);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
#ifndef WSO_WPA_PSK_H
|
||||
#define WSO_WPA_PSK_H
|
||||
|
||||
WirelessSecurityOption * wso_wpa_psk_new (const char *glade_file, int capabilities);
|
||||
WirelessSecurityOption * wso_wpa_psk_new (const char *glade_file, int capabilities, gboolean wpa2);
|
||||
|
||||
|
||||
#endif /* WSO_WPA_PSK_HEX_H */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue