Merge lp://qastaging/~awe/network-manager-applet/ubuntu.0.7.1.key.dialog into lp://qastaging/~network-manager/network-manager-applet/ubuntu.0.7.1

Proposed by Tony Espy
Status: Merged
Merged at revision: not available
Proposed branch: lp://qastaging/~awe/network-manager-applet/ubuntu.0.7.1.key.dialog
Merge into: lp://qastaging/~network-manager/network-manager-applet/ubuntu.0.7.1
Diff against target: None lines
To merge this branch: bzr merge lp://qastaging/~awe/network-manager-applet/ubuntu.0.7.1.key.dialog
Reviewer Review Type Date Requested Status
Network-manager Pending
Review via email: mp+8951@code.qastaging.launchpad.net
To post a comment you must log in.
Revision history for this message
Tony Espy (awe) wrote :

Here's the final patch for lp#392362.

The changes include:

 - for WEP/WPA key/passphrase dialogs, focus is set to key/passphrase; for LEAP, it's set to
   username

 - for all dialogs ( key required, connect to other, create network ), the key, passphrase,
   or password entry field now triggers the default action ( 'Connect' ), on an Enter keystroke

 - Dynamic WEP / WPA Enterprise versions of the dialog don't auto-focus; this will be treated as
   a separate bug

 - WEP/WPA/LEAP testing can be done with a single AP, no hard-coding is necessary unless you don't
   have access to an AP which you have admin rights for ( ie. to switch between WEP & WPA )

Revision history for this message
Tony Espy (awe) wrote :

> - for WEP/WPA key/passphrase dialogs, focus is set to key/passphrase; for
> LEAP, it's set to
> username

One more note, this focus is reset if the user changes the Security combo to another type.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'patches/lp390362_dialog_key_passphrase_focus.patch'
2--- patches/lp390362_dialog_key_passphrase_focus.patch 1970-01-01 00:00:00 +0000
3+++ patches/lp390362_dialog_key_passphrase_focus.patch 2009-07-17 16:43:04 +0000
4@@ -0,0 +1,233 @@
5+Index: network-manager-applet-0.7.1/src/wireless-dialog.c
6+===================================================================
7+--- network-manager-applet-0.7.1.orig/src/wireless-dialog.c 2009-06-02 07:08:40.000000000 -0400
8++++ network-manager-applet-0.7.1/src/wireless-dialog.c 2009-07-16 20:48:19.000000000 -0400
9+@@ -84,6 +84,7 @@
10+
11+ static void security_combo_changed (GtkWidget *combo, gpointer user_data);
12+ static gboolean security_combo_init (NMAWirelessDialog *self);
13++static void focus_on_default_element (NMAWirelessDialog *self, GtkWidget *combo);
14+
15+ void
16+ nma_wireless_dialog_set_nag_ignored (NMAWirelessDialog *self, gboolean ignored)
17+@@ -196,6 +197,8 @@
18+
19+ /* Re-validate */
20+ wireless_security_changed_cb (NULL, sec);
21++
22++ focus_on_default_element (self, priv->sec_combo);
23+ }
24+
25+ static GByteArray *
26+@@ -1016,6 +1019,48 @@
27+ return TRUE;
28+ }
29+
30++static void
31++focus_on_default_element (NMAWirelessDialog *self, GtkWidget *combo)
32++{
33++ NMAWirelessDialogPrivate *priv = NMA_WIRELESS_DIALOG_GET_PRIVATE (self);
34++ GtkTreeIter iter;
35++ GtkTreeModel *model;
36++ GtkWidget *widget;
37++ WirelessSecurity *sec = NULL;
38++
39++ /* Check that network name/SSID doesn't have focus */
40++ widget = glade_xml_get_widget (priv->xml, "network_name_entry");
41++ g_assert(widget);
42++
43++ if (GTK_WIDGET_VISIBLE(widget)) {
44++ g_debug("network name is visible, returning");
45++ return;
46++ }
47++
48++ model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo));
49++ if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter)) {
50++ g_warning ("%s: no active security combo box item.", __func__);
51++ return;
52++ }
53++
54++ gtk_tree_model_get (model, &iter, S_SEC_COLUMN, &sec, -1);
55++ if (!sec) {
56++ g_warning("%s: no model", __func__);
57++ return;
58++ }
59++
60++ if (sec->default_field) {
61++ g_debug("%s: default_field set: %s", __func__, sec->default_field);
62++ widget = glade_xml_get_widget (sec->xml, sec->default_field);
63++ if (widget) {
64++ g_debug("%s: widget found; setting focus", __func__);
65++ gtk_widget_grab_focus (widget);
66++ }
67++ }
68++
69++ wireless_security_unref (sec);
70++}
71++
72+ NMConnection *
73+ nma_wireless_dialog_get_connection (NMAWirelessDialog *self,
74+ NMDevice **device,
75+Index: network-manager-applet-0.7.1/src/wireless-security/wireless-security.c
76+===================================================================
77+--- network-manager-applet-0.7.1.orig/src/wireless-security/wireless-security.c 2009-06-02 07:08:39.000000000 -0400
78++++ network-manager-applet-0.7.1/src/wireless-security/wireless-security.c 2009-07-16 20:38:31.000000000 -0400
79+@@ -139,7 +139,8 @@
80+ WSFillConnectionFunc fill_connection,
81+ WSDestroyFunc destroy,
82+ GladeXML *xml,
83+- GtkWidget *ui_widget)
84++ GtkWidget *ui_widget,
85++ gchar *default_field)
86+ {
87+ sec->refcount = 1;
88+
89+@@ -150,6 +151,7 @@
90+
91+ sec->xml = xml;
92+ sec->ui_widget = ui_widget;
93++ sec->default_field = default_field;
94+ }
95+
96+ GtkWidget *
97+Index: network-manager-applet-0.7.1/src/wireless-security/wireless-security.h
98+===================================================================
99+--- network-manager-applet-0.7.1.orig/src/wireless-security/wireless-security.h 2009-06-02 07:08:39.000000000 -0400
100++++ network-manager-applet-0.7.1/src/wireless-security/wireless-security.h 2009-07-16 20:38:31.000000000 -0400
101+@@ -44,6 +44,7 @@
102+ GtkWidget *ui_widget;
103+ WSChangedFunc changed_notify;
104+ gpointer changed_notify_data;
105++ const gchar *default_field;
106+
107+ WSAddToSizeGroupFunc add_to_size_group;
108+ WSFillConnectionFunc fill_connection;
109+@@ -91,7 +92,8 @@
110+ WSFillConnectionFunc fill_connection,
111+ WSDestroyFunc destroy,
112+ GladeXML *xml,
113+- GtkWidget *ui_widget);
114++ GtkWidget *ui_widget,
115++ gchar *default_field);
116+
117+ void wireless_security_changed_cb (GtkWidget *entry, gpointer user_data);
118+
119+Index: network-manager-applet-0.7.1/src/wireless-security/ws-dynamic-wep.c
120+===================================================================
121+--- network-manager-applet-0.7.1.orig/src/wireless-security/ws-dynamic-wep.c 2009-06-02 07:08:39.000000000 -0400
122++++ network-manager-applet-0.7.1/src/wireless-security/ws-dynamic-wep.c 2009-07-16 20:38:31.000000000 -0400
123+@@ -129,7 +129,8 @@
124+ fill_connection,
125+ destroy,
126+ xml,
127+- widget);
128++ widget,
129++ NULL);
130+
131+ WIRELESS_SECURITY (sec)->nag_user = nag_user;
132+
133+Index: network-manager-applet-0.7.1/src/wireless-security/ws-leap.c
134+===================================================================
135+--- network-manager-applet-0.7.1.orig/src/wireless-security/ws-leap.c 2009-06-02 07:08:39.000000000 -0400
136++++ network-manager-applet-0.7.1/src/wireless-security/ws-leap.c 2009-07-16 20:38:31.000000000 -0400
137+@@ -147,7 +147,8 @@
138+ fill_connection,
139+ destroy,
140+ xml,
141+- widget);
142++ widget,
143++ "leap_username_entry");
144+
145+ if (connection) {
146+ wsec = NM_SETTING_WIRELESS_SECURITY (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY));
147+Index: network-manager-applet-0.7.1/src/wireless-security/ws-wep-key.c
148+===================================================================
149+--- network-manager-applet-0.7.1.orig/src/wireless-security/ws-wep-key.c 2009-06-02 07:08:40.000000000 -0400
150++++ network-manager-applet-0.7.1/src/wireless-security/ws-wep-key.c 2009-07-16 20:38:31.000000000 -0400
151+@@ -341,7 +341,8 @@
152+ fill_connection,
153+ destroy,
154+ xml,
155+- widget);
156++ widget,
157++ "wep_key_entry");
158+ sec->type = type;
159+
160+ widget = glade_xml_get_widget (xml, "wep_key_entry");
161+Index: network-manager-applet-0.7.1/src/wireless-security/ws-wpa-eap.c
162+===================================================================
163+--- network-manager-applet-0.7.1.orig/src/wireless-security/ws-wpa-eap.c 2009-06-02 07:08:40.000000000 -0400
164++++ network-manager-applet-0.7.1/src/wireless-security/ws-wpa-eap.c 2009-07-16 20:38:31.000000000 -0400
165+@@ -124,7 +124,8 @@
166+ fill_connection,
167+ destroy,
168+ xml,
169+- widget);
170++ widget,
171++ NULL);
172+
173+ WIRELESS_SECURITY (sec)->nag_user = nag_user;
174+
175+Index: network-manager-applet-0.7.1/src/wireless-security/ws-wpa-psk.c
176+===================================================================
177+--- network-manager-applet-0.7.1.orig/src/wireless-security/ws-wpa-psk.c 2009-06-02 07:08:40.000000000 -0400
178++++ network-manager-applet-0.7.1/src/wireless-security/ws-wpa-psk.c 2009-07-16 20:38:31.000000000 -0400
179+@@ -191,7 +191,8 @@
180+ fill_connection,
181+ destroy,
182+ xml,
183+- widget);
184++ widget,
185++ "wpa_psk_entry");
186+
187+ widget = glade_xml_get_widget (xml, "wpa_psk_entry");
188+ g_assert (widget);
189+Index: network-manager-applet-0.7.1/src/applet.glade
190+===================================================================
191+--- network-manager-applet-0.7.1.orig/src/applet.glade 2009-06-02 07:08:39.000000000 -0400
192++++ network-manager-applet-0.7.1/src/applet.glade 2009-07-16 20:38:31.000000000 -0400
193+@@ -707,7 +707,7 @@
194+ <property name="max_length">0</property>
195+ <property name="text" translatable="yes"></property>
196+ <property name="has_frame">True</property>
197+- <property name="activates_default">False</property>
198++ <property name="activates_default">True</property>
199+ </widget>
200+ <packing>
201+ <property name="left_attach">1</property>
202+@@ -993,7 +993,7 @@
203+ <property name="max_length">0</property>
204+ <property name="text" translatable="yes"></property>
205+ <property name="has_frame">True</property>
206+- <property name="activates_default">False</property>
207++ <property name="activates_default">True</property>
208+ </widget>
209+ <packing>
210+ <property name="left_attach">1</property>
211+@@ -1658,7 +1658,7 @@
212+ <property name="max_length">0</property>
213+ <property name="text" translatable="yes"></property>
214+ <property name="has_frame">True</property>
215+- <property name="activates_default">False</property>
216++ <property name="activates_default">True</property>
217+ </widget>
218+ <packing>
219+ <property name="left_attach">1</property>
220+@@ -1842,7 +1842,7 @@
221+ <property name="max_length">0</property>
222+ <property name="text" translatable="yes"></property>
223+ <property name="has_frame">True</property>
224+- <property name="activates_default">False</property>
225++ <property name="activates_default">True</property>
226+ </widget>
227+ <packing>
228+ <property name="left_attach">1</property>
229+@@ -2252,7 +2252,7 @@
230+ <property name="max_length">0</property>
231+ <property name="text" translatable="yes"></property>
232+ <property name="has_frame">True</property>
233+- <property name="activates_default">False</property>
234++ <property name="activates_default">True</property>
235+ </widget>
236+ <packing>
237+ <property name="left_attach">1</property>
238
239=== modified file 'patches/series'
240--- patches/series 2009-07-06 21:56:43 +0000
241+++ patches/series 2009-07-17 16:43:04 +0000
242@@ -10,6 +10,7 @@
243 lp341684_device_sensitive_disconnect_notify.patch
244 lp341940_use_ellipsized_menu_entries.patch
245 lp358526_generic_disconnected_notification_icon.patch
246+lp390362_dialog_key_passphrase_focus.patch
247
248 fix_root_without_session_polkit_access.patch
249 gtk210_support.patch

Subscribers

People subscribed via source and target branches