Merge lp:~pete-woods/indicator-network/wapi-lp1597681 into lp:indicator-network
- wapi-lp1597681
- Merge into trunk
Proposed by
Pete Woods
Status: | Approved | ||||
---|---|---|---|---|---|
Approved by: | Pete Woods | ||||
Approved revision: | 609 | ||||
Proposed branch: | lp:~pete-woods/indicator-network/wapi-lp1597681 | ||||
Merge into: | lp:indicator-network | ||||
Diff against target: |
531 lines (+187/-139) 12 files modified
po/indicator-network.pot (+126/-122) src/agent/SecretAgent.h (+1/-0) src/agent/SecretRequest.cpp (+5/-2) src/indicator/menuitems/access-point-item.cpp (+1/-1) src/indicator/nmofono/wifi/access-point-impl.cpp (+18/-2) src/indicator/nmofono/wifi/access-point-impl.h (+1/-1) src/indicator/nmofono/wifi/access-point.h (+10/-1) src/indicator/nmofono/wifi/grouped-access-point.cpp (+3/-3) src/indicator/nmofono/wifi/grouped-access-point.h (+1/-1) src/indicator/nmofono/wifi/wifi-link-impl.cpp (+18/-4) tests/integration/test-indicator.cpp (+1/-1) tests/unit/indicator/menuitems/test-access-point-item.cpp (+2/-1) |
||||
To merge this branch: | bzr merge lp:~pete-woods/indicator-network/wapi-lp1597681 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Indicator Applet Developers | Pending | ||
Review via email: mp+299577@code.launchpad.net |
Commit message
Add support for new WAPI settings keys
Description of the change
Add support for new WAPI settings keys
To post a comment you must log in.
- 610. By Pete Woods
-
Log which URLs are dispatched to USS
Unmerged revisions
- 610. By Pete Woods
-
Log which URLs are dispatched to USS
- 609. By Pete Woods
-
Add support for new WAPI settings keys
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'po/indicator-network.pot' | |||
2 | --- po/indicator-network.pot 2016-04-29 14:08:19 +0000 | |||
3 | +++ po/indicator-network.pot 2016-07-14 10:02:10 +0000 | |||
4 | @@ -8,7 +8,7 @@ | |||
5 | 8 | msgstr "" | 8 | msgstr "" |
6 | 9 | "Project-Id-Version: PACKAGE VERSION\n" | 9 | "Project-Id-Version: PACKAGE VERSION\n" |
7 | 10 | "Report-Msgid-Bugs-To: \n" | 10 | "Report-Msgid-Bugs-To: \n" |
9 | 11 | "POT-Creation-Date: 2016-04-29 12:38+0300\n" | 11 | "POT-Creation-Date: 2016-07-11 09:50+0100\n" |
10 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
11 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
12 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
13 | @@ -30,72 +30,63 @@ | |||
14 | 30 | msgid "WEP" | 30 | msgid "WEP" |
15 | 31 | msgstr "" | 31 | msgstr "" |
16 | 32 | 32 | ||
18 | 33 | #: ../src/agent/SecretRequest.cpp:74 | 33 | #: ../src/agent/SecretRequest.cpp:70 |
19 | 34 | msgid "WAPI" | ||
20 | 35 | msgstr "" | ||
21 | 36 | |||
22 | 37 | #: ../src/agent/SecretRequest.cpp:76 | ||
23 | 34 | msgid "Connect" | 38 | msgid "Connect" |
24 | 35 | msgstr "" | 39 | msgstr "" |
25 | 36 | 40 | ||
27 | 37 | #: ../src/agent/SecretRequest.cpp:75 | 41 | #: ../src/agent/SecretRequest.cpp:77 |
28 | 38 | msgid "Cancel" | 42 | msgid "Cancel" |
29 | 39 | msgstr "" | 43 | msgstr "" |
30 | 40 | 44 | ||
89 | 41 | #: ../src/indicator/menuitems/wifi-link-item.cpp:109 | 45 | #: ../src/indicator/vpn-status-notifier.cpp:48 |
90 | 42 | msgid "Other network…" | 46 | msgid "The VPN connection '%1' failed." |
91 | 43 | msgstr "" | 47 | msgstr "" |
92 | 44 | 48 | ||
93 | 45 | #: ../src/indicator/menuitems/wwan-link-item.cpp:90 | 49 | #: ../src/indicator/vpn-status-notifier.cpp:50 |
94 | 46 | msgid "No SIM" | 50 | msgid "" |
95 | 47 | msgstr "" | 51 | "The VPN connection '%1' failed because the network connection was " |
96 | 48 | 52 | "interrupted." | |
97 | 49 | #: ../src/indicator/menuitems/wwan-link-item.cpp:97 | 53 | msgstr "" |
98 | 50 | msgid "SIM Error" | 54 | |
99 | 51 | msgstr "" | 55 | #: ../src/indicator/vpn-status-notifier.cpp:51 |
100 | 52 | 56 | msgid "" | |
101 | 53 | #: ../src/indicator/menuitems/wwan-link-item.cpp:105 | 57 | "The VPN connection '%1' failed because the VPN service stopped unexpectedly." |
102 | 54 | msgid "SIM Locked" | 58 | msgstr "" |
103 | 55 | msgstr "" | 59 | |
104 | 56 | 60 | #: ../src/indicator/vpn-status-notifier.cpp:52 | |
105 | 57 | #: ../src/indicator/menuitems/wwan-link-item.cpp:118 | 61 | msgid "" |
106 | 58 | msgid "Unregistered" | 62 | "The VPN connection '%1' failed because the VPN service returned invalid " |
107 | 59 | msgstr "" | 63 | "configuration." |
108 | 60 | 64 | msgstr "" | |
109 | 61 | #: ../src/indicator/menuitems/wwan-link-item.cpp:123 | 65 | |
110 | 62 | msgid "Unknown" | 66 | #: ../src/indicator/vpn-status-notifier.cpp:53 |
111 | 63 | msgstr "" | 67 | msgid "" |
112 | 64 | 68 | "The VPN connection '%1' failed because the connection attempt timed out." | |
113 | 65 | #: ../src/indicator/menuitems/wwan-link-item.cpp:128 | 69 | msgstr "" |
114 | 66 | msgid "Denied" | 70 | |
115 | 67 | msgstr "" | 71 | #: ../src/indicator/vpn-status-notifier.cpp:54 |
116 | 68 | 72 | msgid "" | |
117 | 69 | #: ../src/indicator/menuitems/wwan-link-item.cpp:133 | 73 | "The VPN connection '%1' failed because the VPN service did not start in time." |
118 | 70 | msgid "Searching" | 74 | msgstr "" |
119 | 71 | msgstr "" | 75 | |
120 | 72 | 76 | #: ../src/indicator/vpn-status-notifier.cpp:55 | |
121 | 73 | #: ../src/indicator/menuitems/wwan-link-item.cpp:145 | 77 | msgid "The VPN connection '%1' failed because the VPN service failed to start." |
122 | 74 | msgid "No Signal" | 78 | msgstr "" |
123 | 75 | msgstr "" | 79 | |
124 | 76 | 80 | #: ../src/indicator/vpn-status-notifier.cpp:56 | |
125 | 77 | #: ../src/indicator/menuitems/wwan-link-item.cpp:157 | 81 | msgid "The VPN connection '%1' failed because there were no valid VPN secrets." |
126 | 78 | #: ../src/indicator/menuitems/wwan-link-item.cpp:164 | 82 | msgstr "" |
127 | 79 | msgid "Offline" | 83 | |
128 | 80 | msgstr "" | 84 | #: ../src/indicator/vpn-status-notifier.cpp:57 |
129 | 81 | 85 | msgid "The VPN connection '%1' failed because of invalid VPN secrets." | |
130 | 82 | #. TODO Move this into a new class | 86 | msgstr "" |
131 | 83 | #: ../src/indicator/factory.cpp:187 | 87 | |
132 | 84 | msgid "Wi-Fi" | 88 | #: ../src/indicator/vpn-status-notifier.cpp:68 |
133 | 85 | msgstr "" | 89 | msgid "VPN Connection Failed" |
76 | 86 | |||
77 | 87 | #. TODO Move this into a new class | ||
78 | 88 | #: ../src/indicator/factory.cpp:198 | ||
79 | 89 | msgid "Flight Mode" | ||
80 | 90 | msgstr "" | ||
81 | 91 | |||
82 | 92 | #: ../src/indicator/factory.cpp:208 | ||
83 | 93 | msgid "Cellular data" | ||
84 | 94 | msgstr "" | ||
85 | 95 | |||
86 | 96 | #. TODO Move this into a new class | ||
87 | 97 | #: ../src/indicator/factory.cpp:219 | ||
88 | 98 | msgid "Hotspot" | ||
134 | 99 | msgstr "" | 90 | msgstr "" |
135 | 100 | 91 | ||
136 | 101 | #: ../src/indicator/sim-unlock-dialog.cpp:144 | 92 | #: ../src/indicator/sim-unlock-dialog.cpp:144 |
137 | @@ -186,70 +177,83 @@ | |||
138 | 186 | msgid "PIN codes did not match." | 177 | msgid "PIN codes did not match." |
139 | 187 | msgstr "" | 178 | msgstr "" |
140 | 188 | 179 | ||
189 | 189 | #: ../src/indicator/vpn-status-notifier.cpp:48 | 180 | #: ../src/indicator/nmofono/vpn/vpn-manager.cpp:81 |
190 | 190 | msgid "The VPN connection '%1' failed." | 181 | msgid "VPN connection %1" |
191 | 191 | msgstr "" | 182 | msgstr "" |
192 | 192 | 183 | ||
193 | 193 | #: ../src/indicator/vpn-status-notifier.cpp:50 | 184 | #: ../src/indicator/menuitems/wifi-link-item.cpp:109 |
194 | 194 | msgid "" | 185 | msgid "Other network…" |
195 | 195 | "The VPN connection '%1' failed because the network connection was " | 186 | msgstr "" |
196 | 196 | "interrupted." | 187 | |
197 | 197 | msgstr "" | 188 | #: ../src/indicator/menuitems/wwan-link-item.cpp:90 |
198 | 198 | 189 | msgid "No SIM" | |
199 | 199 | #: ../src/indicator/vpn-status-notifier.cpp:51 | 190 | msgstr "" |
200 | 200 | msgid "" | 191 | |
201 | 201 | "The VPN connection '%1' failed because the VPN service stopped unexpectedly." | 192 | #: ../src/indicator/menuitems/wwan-link-item.cpp:97 |
202 | 202 | msgstr "" | 193 | msgid "SIM Error" |
203 | 203 | 194 | msgstr "" | |
204 | 204 | #: ../src/indicator/vpn-status-notifier.cpp:52 | 195 | |
205 | 205 | msgid "" | 196 | #: ../src/indicator/menuitems/wwan-link-item.cpp:105 |
206 | 206 | "The VPN connection '%1' failed because the VPN service returned invalid " | 197 | msgid "SIM Locked" |
207 | 207 | "configuration." | 198 | msgstr "" |
208 | 208 | msgstr "" | 199 | |
209 | 209 | 200 | #: ../src/indicator/menuitems/wwan-link-item.cpp:118 | |
210 | 210 | #: ../src/indicator/vpn-status-notifier.cpp:53 | 201 | msgid "Unregistered" |
211 | 211 | msgid "" | 202 | msgstr "" |
212 | 212 | "The VPN connection '%1' failed because the connection attempt timed out." | 203 | |
213 | 213 | msgstr "" | 204 | #: ../src/indicator/menuitems/wwan-link-item.cpp:123 |
214 | 214 | 205 | msgid "Unknown" | |
215 | 215 | #: ../src/indicator/vpn-status-notifier.cpp:54 | 206 | msgstr "" |
216 | 216 | msgid "" | 207 | |
217 | 217 | "The VPN connection '%1' failed because the VPN service did not start in time." | 208 | #: ../src/indicator/menuitems/wwan-link-item.cpp:128 |
218 | 218 | msgstr "" | 209 | msgid "Denied" |
219 | 219 | 210 | msgstr "" | |
220 | 220 | #: ../src/indicator/vpn-status-notifier.cpp:55 | 211 | |
221 | 221 | msgid "The VPN connection '%1' failed because the VPN service failed to start." | 212 | #: ../src/indicator/menuitems/wwan-link-item.cpp:133 |
222 | 222 | msgstr "" | 213 | msgid "Searching" |
223 | 223 | 214 | msgstr "" | |
224 | 224 | #: ../src/indicator/vpn-status-notifier.cpp:56 | 215 | |
225 | 225 | msgid "The VPN connection '%1' failed because there were no valid VPN secrets." | 216 | #: ../src/indicator/menuitems/wwan-link-item.cpp:145 |
226 | 226 | msgstr "" | 217 | msgid "No Signal" |
227 | 227 | 218 | msgstr "" | |
228 | 228 | #: ../src/indicator/vpn-status-notifier.cpp:57 | 219 | |
229 | 229 | msgid "The VPN connection '%1' failed because of invalid VPN secrets." | 220 | #: ../src/indicator/menuitems/wwan-link-item.cpp:157 |
230 | 230 | msgstr "" | 221 | #: ../src/indicator/menuitems/wwan-link-item.cpp:164 |
231 | 231 | 222 | msgid "Offline" | |
232 | 232 | #: ../src/indicator/vpn-status-notifier.cpp:68 | 223 | msgstr "" |
233 | 233 | msgid "VPN Connection Failed" | 224 | |
234 | 234 | msgstr "" | 225 | #. TRANSLATORS: this is the indicator title shown on the top header of the indicator area |
235 | 235 | 226 | #: ../src/indicator/root-state.cpp:306 | |
236 | 236 | #: ../src/indicator/sections/wwan-section.cpp:99 | 227 | msgid "Network" |
237 | 228 | msgstr "" | ||
238 | 229 | |||
239 | 230 | #. TODO Move this into a new class | ||
240 | 231 | #: ../src/indicator/factory.cpp:187 | ||
241 | 232 | msgid "Wi-Fi" | ||
242 | 233 | msgstr "" | ||
243 | 234 | |||
244 | 235 | #. TODO Move this into a new class | ||
245 | 236 | #: ../src/indicator/factory.cpp:198 | ||
246 | 237 | msgid "Flight Mode" | ||
247 | 238 | msgstr "" | ||
248 | 239 | |||
249 | 240 | #: ../src/indicator/factory.cpp:208 | ||
250 | 241 | msgid "Cellular data" | ||
251 | 242 | msgstr "" | ||
252 | 243 | |||
253 | 244 | #. TODO Move this into a new class | ||
254 | 245 | #: ../src/indicator/factory.cpp:221 | ||
255 | 246 | msgid "Hotspot" | ||
256 | 247 | msgstr "" | ||
257 | 248 | |||
258 | 249 | #: ../src/indicator/sections/wwan-section.cpp:102 | ||
259 | 237 | msgid "Cellular settings…" | 250 | msgid "Cellular settings…" |
260 | 238 | msgstr "" | 251 | msgstr "" |
261 | 239 | 252 | ||
262 | 253 | #: ../src/indicator/sections/wifi-section.cpp:65 | ||
263 | 254 | msgid "Wi-Fi settings…" | ||
264 | 255 | msgstr "" | ||
265 | 256 | |||
266 | 240 | #: ../src/indicator/sections/vpn-section.cpp:140 | 257 | #: ../src/indicator/sections/vpn-section.cpp:140 |
267 | 241 | msgid "VPN settings…" | 258 | msgid "VPN settings…" |
268 | 242 | msgstr "" | 259 | msgstr "" |
269 | 243 | |||
270 | 244 | #: ../src/indicator/sections/wifi-section.cpp:65 | ||
271 | 245 | msgid "Wi-Fi settings…" | ||
272 | 246 | msgstr "" | ||
273 | 247 | |||
274 | 248 | #. TRANSLATORS: this is the indicator title shown on the top header of the indicator area | ||
275 | 249 | #: ../src/indicator/root-state.cpp:306 | ||
276 | 250 | msgid "Network" | ||
277 | 251 | msgstr "" | ||
278 | 252 | |||
279 | 253 | #: ../src/indicator/nmofono/vpn/vpn-manager.cpp:81 | ||
280 | 254 | msgid "VPN connection %1" | ||
281 | 255 | msgstr "" | ||
282 | 256 | 260 | ||
283 | === modified file 'src/agent/SecretAgent.h' | |||
284 | --- src/agent/SecretAgent.h 2016-02-15 09:31:38 +0000 | |||
285 | +++ src/agent/SecretAgent.h 2016-07-14 10:02:10 +0000 | |||
286 | @@ -90,6 +90,7 @@ | |||
287 | 90 | static constexpr char const* NM_KEY_MGMT_WPA_NONE = "wpa-none"; | 90 | static constexpr char const* NM_KEY_MGMT_WPA_NONE = "wpa-none"; |
288 | 91 | static constexpr char const* NM_KEY_MGMT_WPA_PSK = "wpa-psk"; | 91 | static constexpr char const* NM_KEY_MGMT_WPA_PSK = "wpa-psk"; |
289 | 92 | static constexpr char const* NM_KEY_MGMT_NONE = "none"; | 92 | static constexpr char const* NM_KEY_MGMT_NONE = "none"; |
290 | 93 | static constexpr char const* NM_KEY_MGMT_WAPI_PSK = "wapi-psk"; | ||
291 | 93 | 94 | ||
292 | 94 | explicit SecretAgent(std::shared_ptr<notify::NotificationManager> notificationManager, | 95 | explicit SecretAgent(std::shared_ptr<notify::NotificationManager> notificationManager, |
293 | 95 | CredentialStore::SPtr credentialStore, | 96 | CredentialStore::SPtr credentialStore, |
294 | 96 | 97 | ||
295 | === modified file 'src/agent/SecretRequest.cpp' | |||
296 | --- src/agent/SecretRequest.cpp 2016-02-15 09:31:38 +0000 | |||
297 | +++ src/agent/SecretRequest.cpp 2016-07-14 10:02:10 +0000 | |||
298 | @@ -66,7 +66,9 @@ | |||
299 | 66 | subject = _("WPA"); | 66 | subject = _("WPA"); |
300 | 67 | } else if (keyMgmt == SecretAgent::NM_KEY_MGMT_NONE) { | 67 | } else if (keyMgmt == SecretAgent::NM_KEY_MGMT_NONE) { |
301 | 68 | subject = _("WEP"); | 68 | subject = _("WEP"); |
303 | 69 | } | 69 | } else if (keyMgmt == SecretAgent::NM_KEY_MGMT_WAPI_PSK) { |
304 | 70 | subject = _("WAPI"); | ||
305 | 71 | } | ||
306 | 70 | 72 | ||
307 | 71 | m_notification = m_secretAgent.notifications()->notify( | 73 | m_notification = m_secretAgent.notifications()->notify( |
308 | 72 | title.arg(conn[SecretAgent::NM_CONNECTION_ID].toString()), subject, | 74 | title.arg(conn[SecretAgent::NM_CONNECTION_ID].toString()), subject, |
309 | @@ -104,7 +106,8 @@ | |||
310 | 104 | wirelessSecurity->value(SecretAgent::NM_WIRELESS_SECURITY_KEY_MGMT).toString()); | 106 | wirelessSecurity->value(SecretAgent::NM_WIRELESS_SECURITY_KEY_MGMT).toString()); |
311 | 105 | 107 | ||
312 | 106 | if (keyMgmt == SecretAgent::NM_KEY_MGMT_WPA_NONE | 108 | if (keyMgmt == SecretAgent::NM_KEY_MGMT_WPA_NONE |
314 | 107 | || keyMgmt == SecretAgent::NM_KEY_MGMT_WPA_PSK) { | 109 | || keyMgmt == SecretAgent::NM_KEY_MGMT_WPA_PSK |
315 | 110 | || keyMgmt == SecretAgent::NM_KEY_MGMT_WAPI_PSK) { | ||
316 | 108 | wirelessSecurity->insert(SecretAgent::NM_WIRELESS_SECURITY_PSK, key); | 111 | wirelessSecurity->insert(SecretAgent::NM_WIRELESS_SECURITY_PSK, key); |
317 | 109 | } else if (keyMgmt == SecretAgent::NM_KEY_MGMT_NONE) { | 112 | } else if (keyMgmt == SecretAgent::NM_KEY_MGMT_NONE) { |
318 | 110 | wirelessSecurity->insert(SecretAgent::NM_WIRELESS_SECURITY_WEP_KEY0, key); | 113 | wirelessSecurity->insert(SecretAgent::NM_WIRELESS_SECURITY_WEP_KEY0, key); |
319 | 111 | 114 | ||
320 | === modified file 'src/indicator/menuitems/access-point-item.cpp' | |||
321 | --- src/indicator/menuitems/access-point-item.cpp 2015-10-06 10:14:57 +0000 | |||
322 | +++ src/indicator/menuitems/access-point-item.cpp 2016-07-14 10:02:10 +0000 | |||
323 | @@ -61,7 +61,7 @@ | |||
324 | 61 | m_item->setAttribute("x-canonical-type", TypedVariant<std::string>("unity.widgets.systemsettings.tablet.accesspoint")); | 61 | m_item->setAttribute("x-canonical-type", TypedVariant<std::string>("unity.widgets.systemsettings.tablet.accesspoint")); |
325 | 62 | m_item->setAttribute("x-canonical-wifi-ap-is-adhoc", TypedVariant<bool>(m_accessPoint->adhoc())); | 62 | m_item->setAttribute("x-canonical-wifi-ap-is-adhoc", TypedVariant<bool>(m_accessPoint->adhoc())); |
326 | 63 | m_item->setAttribute("x-canonical-wifi-ap-is-secure", TypedVariant<bool>(m_accessPoint->secured())); | 63 | m_item->setAttribute("x-canonical-wifi-ap-is-secure", TypedVariant<bool>(m_accessPoint->secured())); |
328 | 64 | m_item->setAttribute("x-canonical-wifi-ap-is-enterprise", TypedVariant<bool>(m_accessPoint->enterprise())); | 64 | m_item->setAttribute("x-canonical-wifi-ap-is-enterprise", TypedVariant<bool>(m_accessPoint->keyManagementType() != wifi::AccessPoint::KeyManagementType::psk)); |
329 | 65 | m_item->setAttribute("x-canonical-wifi-ap-strength-action", TypedVariant<std::string>(("indicator." + strengthActionId).toStdString())); | 65 | m_item->setAttribute("x-canonical-wifi-ap-strength-action", TypedVariant<std::string>(("indicator." + strengthActionId).toStdString())); |
330 | 66 | 66 | ||
331 | 67 | m_actionStrength = std::make_shared<Action>(strengthActionId, | 67 | m_actionStrength = std::make_shared<Action>(strengthActionId, |
332 | 68 | 68 | ||
333 | === modified file 'src/indicator/nmofono/wifi/access-point-impl.cpp' | |||
334 | --- src/indicator/nmofono/wifi/access-point-impl.cpp 2015-07-06 12:59:21 +0000 | |||
335 | +++ src/indicator/nmofono/wifi/access-point-impl.cpp 2016-07-14 10:02:10 +0000 | |||
336 | @@ -22,6 +22,10 @@ | |||
337 | 22 | #include <QTextCodec> | 22 | #include <QTextCodec> |
338 | 23 | #include <NetworkManager.h> | 23 | #include <NetworkManager.h> |
339 | 24 | 24 | ||
340 | 25 | #ifndef NM_802_11_AP_SEC_KEY_MGMT_WAPI_CERT | ||
341 | 26 | #define NM_802_11_AP_SEC_KEY_MGMT_WAPI_CERT 0x00002000 | ||
342 | 27 | #endif | ||
343 | 28 | |||
344 | 25 | namespace nmofono { | 29 | namespace nmofono { |
345 | 26 | namespace wifi { | 30 | namespace wifi { |
346 | 27 | 31 | ||
347 | @@ -116,9 +120,21 @@ | |||
348 | 116 | return m_raw_ssid; | 120 | return m_raw_ssid; |
349 | 117 | } | 121 | } |
350 | 118 | 122 | ||
352 | 119 | bool AccessPointImpl::enterprise() const | 123 | AccessPoint::KeyManagementType AccessPointImpl::keyManagementType() const |
353 | 120 | { | 124 | { |
355 | 121 | return (m_secflags & NM_802_11_AP_SEC_KEY_MGMT_802_1X) > 0; | 125 | if ((m_secflags & NM_802_11_AP_SEC_KEY_MGMT_802_1X) > 0) |
356 | 126 | { | ||
357 | 127 | return KeyManagementType::ieee8021x; | ||
358 | 128 | } | ||
359 | 129 | else if ((m_secflags & NM_802_11_AP_SEC_KEY_MGMT_802_1X) > 0) | ||
360 | 130 | { | ||
361 | 131 | return KeyManagementType::wpa_eap; | ||
362 | 132 | } | ||
363 | 133 | else if ((m_secflags & NM_802_11_AP_SEC_KEY_MGMT_WAPI_CERT) > 0) | ||
364 | 134 | { | ||
365 | 135 | return KeyManagementType::wapi_cert; | ||
366 | 136 | } | ||
367 | 137 | return KeyManagementType::psk; | ||
368 | 122 | } | 138 | } |
369 | 123 | 139 | ||
370 | 124 | bool AccessPointImpl::secured() const | 140 | bool AccessPointImpl::secured() const |
371 | 125 | 141 | ||
372 | === modified file 'src/indicator/nmofono/wifi/access-point-impl.h' | |||
373 | --- src/indicator/nmofono/wifi/access-point-impl.h 2015-07-06 12:59:21 +0000 | |||
374 | +++ src/indicator/nmofono/wifi/access-point-impl.h 2016-07-14 10:02:10 +0000 | |||
375 | @@ -90,7 +90,7 @@ | |||
376 | 90 | std::uint32_t mode() const; | 90 | std::uint32_t mode() const; |
377 | 91 | 91 | ||
378 | 92 | bool secured() const override; | 92 | bool secured() const override; |
380 | 93 | bool enterprise() const override; | 93 | KeyManagementType keyManagementType() const override; |
381 | 94 | bool adhoc() const override; | 94 | bool adhoc() const override; |
382 | 95 | 95 | ||
383 | 96 | QDBusObjectPath object_path() const override; | 96 | QDBusObjectPath object_path() const override; |
384 | 97 | 97 | ||
385 | === modified file 'src/indicator/nmofono/wifi/access-point.h' | |||
386 | --- src/indicator/nmofono/wifi/access-point.h 2015-07-06 12:59:21 +0000 | |||
387 | +++ src/indicator/nmofono/wifi/access-point.h 2016-07-14 10:02:10 +0000 | |||
388 | @@ -37,8 +37,17 @@ | |||
389 | 37 | AccessPoint: public QObject | 37 | AccessPoint: public QObject |
390 | 38 | { | 38 | { |
391 | 39 | Q_OBJECT | 39 | Q_OBJECT |
392 | 40 | Q_ENUMS(EnterpriseType) | ||
393 | 40 | 41 | ||
394 | 41 | public: | 42 | public: |
395 | 43 | enum KeyManagementType | ||
396 | 44 | { | ||
397 | 45 | psk, | ||
398 | 46 | ieee8021x, | ||
399 | 47 | wpa_eap, | ||
400 | 48 | wapi_cert | ||
401 | 49 | }; | ||
402 | 50 | |||
403 | 42 | typedef std::shared_ptr<AccessPoint> Ptr; | 51 | typedef std::shared_ptr<AccessPoint> Ptr; |
404 | 43 | AccessPoint(); | 52 | AccessPoint(); |
405 | 44 | virtual ~AccessPoint(); | 53 | virtual ~AccessPoint(); |
406 | @@ -54,7 +63,7 @@ | |||
407 | 54 | virtual QByteArray raw_ssid() const = 0; | 63 | virtual QByteArray raw_ssid() const = 0; |
408 | 55 | virtual QDBusObjectPath object_path() const = 0; | 64 | virtual QDBusObjectPath object_path() const = 0; |
409 | 56 | virtual bool secured() const = 0; | 65 | virtual bool secured() const = 0; |
411 | 57 | virtual bool enterprise() const = 0; | 66 | virtual KeyManagementType keyManagementType() const = 0; |
412 | 58 | virtual bool adhoc() const = 0; | 67 | virtual bool adhoc() const = 0; |
413 | 59 | 68 | ||
414 | 60 | Q_SIGNALS: | 69 | Q_SIGNALS: |
415 | 61 | 70 | ||
416 | === modified file 'src/indicator/nmofono/wifi/grouped-access-point.cpp' | |||
417 | --- src/indicator/nmofono/wifi/grouped-access-point.cpp 2015-07-06 12:59:21 +0000 | |||
418 | +++ src/indicator/nmofono/wifi/grouped-access-point.cpp 2016-07-14 10:02:10 +0000 | |||
419 | @@ -199,14 +199,14 @@ | |||
420 | 199 | return p->aplist.at(0)->secured(); | 199 | return p->aplist.at(0)->secured(); |
421 | 200 | } | 200 | } |
422 | 201 | 201 | ||
424 | 202 | bool GroupedAccessPoint::enterprise() const | 202 | AccessPoint::KeyManagementType GroupedAccessPoint::keyManagementType() const |
425 | 203 | { | 203 | { |
426 | 204 | if (p->aplist.empty()) | 204 | if (p->aplist.empty()) |
427 | 205 | { | 205 | { |
429 | 206 | return false; | 206 | return KeyManagementType::psk; |
430 | 207 | } | 207 | } |
431 | 208 | 208 | ||
433 | 209 | return p->aplist.at(0)->enterprise(); | 209 | return p->aplist.at(0)->keyManagementType(); |
434 | 210 | } | 210 | } |
435 | 211 | 211 | ||
436 | 212 | bool GroupedAccessPoint::adhoc() const | 212 | bool GroupedAccessPoint::adhoc() const |
437 | 213 | 213 | ||
438 | === modified file 'src/indicator/nmofono/wifi/grouped-access-point.h' | |||
439 | --- src/indicator/nmofono/wifi/grouped-access-point.h 2015-07-06 12:59:21 +0000 | |||
440 | +++ src/indicator/nmofono/wifi/grouped-access-point.h 2016-07-14 10:02:10 +0000 | |||
441 | @@ -54,7 +54,7 @@ | |||
442 | 54 | QByteArray raw_ssid() const override; | 54 | QByteArray raw_ssid() const override; |
443 | 55 | 55 | ||
444 | 56 | bool secured() const override; | 56 | bool secured() const override; |
446 | 57 | bool enterprise() const override; | 57 | KeyManagementType keyManagementType() const override; |
447 | 58 | bool adhoc() const override; | 58 | bool adhoc() const override; |
448 | 59 | 59 | ||
449 | 60 | QDBusObjectPath object_path() const override; | 60 | QDBusObjectPath object_path() const override; |
450 | 61 | 61 | ||
451 | === modified file 'src/indicator/nmofono/wifi/wifi-link-impl.cpp' | |||
452 | --- src/indicator/nmofono/wifi/wifi-link-impl.cpp 2016-05-26 13:51:39 +0000 | |||
453 | +++ src/indicator/nmofono/wifi/wifi-link-impl.cpp 2016-07-14 10:02:10 +0000 | |||
454 | @@ -486,17 +486,31 @@ | |||
455 | 486 | QDBusObjectPath(d->m_dev->path()), | 486 | QDBusObjectPath(d->m_dev->path()), |
456 | 487 | accessPoint->object_path()); | 487 | accessPoint->object_path()); |
457 | 488 | } else { | 488 | } else { |
459 | 489 | if (accessPoint->enterprise()) { | 489 | auto keyManagementType = accessPoint->keyManagementType(); |
460 | 490 | if (keyManagementType != AccessPoint::KeyManagementType::psk) { | ||
461 | 490 | qDebug() << "New connection to enterprise access point"; | 491 | qDebug() << "New connection to enterprise access point"; |
462 | 492 | |||
463 | 493 | const static QMap<AccessPoint::KeyManagementType, QString> typeMap { | ||
464 | 494 | {AccessPoint::KeyManagementType::ieee8021x, "ieee8021x"}, | ||
465 | 495 | {AccessPoint::KeyManagementType::wpa_eap, "wpa-eap"}, | ||
466 | 496 | {AccessPoint::KeyManagementType::wapi_cert, "wapi-cert"}, | ||
467 | 497 | }; | ||
468 | 498 | |||
469 | 491 | // activate system settings URI | 499 | // activate system settings URI |
470 | 492 | QUrlQuery q; | 500 | QUrlQuery q; |
471 | 493 | q.addQueryItem("ssid", accessPoint->raw_ssid()); | 501 | q.addQueryItem("ssid", accessPoint->raw_ssid()); |
472 | 494 | q.addQueryItem("bssid", accessPoint->bssid()); | 502 | q.addQueryItem("bssid", accessPoint->bssid()); |
473 | 503 | q.addQueryItem("key-mgmt", typeMap[keyManagementType]); | ||
474 | 495 | QString url = "settings:///system/wifi?" + q.query(QUrl::FullyEncoded); | 504 | QString url = "settings:///system/wifi?" + q.query(QUrl::FullyEncoded); |
475 | 496 | 505 | ||
476 | 497 | UrlDispatcher::send(url.toStdString(), [](string url, bool success) { | 506 | UrlDispatcher::send(url.toStdString(), [](string url, bool success) { |
479 | 498 | if (!success) { | 507 | if (success) |
480 | 499 | cerr << "URL Dispatcher failed on " << url << endl; | 508 | { |
481 | 509 | qDebug() << "Activated URL for USS" << QString::fromStdString(url); | ||
482 | 510 | } | ||
483 | 511 | else | ||
484 | 512 | { | ||
485 | 513 | qDebug() << "URL Dispatcher failed on" << QString::fromStdString(url); | ||
486 | 500 | } | 514 | } |
487 | 501 | }); | 515 | }); |
488 | 502 | } else { | 516 | } else { |
489 | @@ -516,7 +530,7 @@ | |||
490 | 516 | } | 530 | } |
491 | 517 | } | 531 | } |
492 | 518 | // For enterprise access points, the system settings app will perform the connection | 532 | // For enterprise access points, the system settings app will perform the connection |
494 | 519 | if (!accessPoint->enterprise()) { | 533 | if (accessPoint->keyManagementType() == AccessPoint::KeyManagementType::psk) { |
495 | 520 | d->updateActiveConnection(ac); | 534 | d->updateActiveConnection(ac); |
496 | 521 | } | 535 | } |
497 | 522 | d->m_connecting = false; | 536 | d->m_connecting = false; |
498 | 523 | 537 | ||
499 | === modified file 'tests/integration/test-indicator.cpp' | |||
500 | --- tests/integration/test-indicator.cpp 2016-06-13 10:57:46 +0000 | |||
501 | +++ tests/integration/test-indicator.cpp 2016-07-14 10:02:10 +0000 | |||
502 | @@ -2006,7 +2006,7 @@ | |||
503 | 2006 | << QVariant("DispatchURL") | 2006 | << QVariant("DispatchURL") |
504 | 2007 | << QVariant( | 2007 | << QVariant( |
505 | 2008 | QVariantList() | 2008 | QVariantList() |
507 | 2009 | << QVariant("settings:///system/wifi?ssid=ABC&bssid=11:22:33:44:55:66") | 2009 | << QVariant("settings:///system/wifi?ssid=ABC&bssid=11:22:33:44:55:66&key-mgmt=wpa-eap") |
508 | 2010 | << QVariant("") | 2010 | << QVariant("") |
509 | 2011 | ) | 2011 | ) |
510 | 2012 | ); | 2012 | ); |
511 | 2013 | 2013 | ||
512 | === modified file 'tests/unit/indicator/menuitems/test-access-point-item.cpp' | |||
513 | --- tests/unit/indicator/menuitems/test-access-point-item.cpp 2015-10-06 10:14:57 +0000 | |||
514 | +++ tests/unit/indicator/menuitems/test-access-point-item.cpp 2016-07-14 10:02:10 +0000 | |||
515 | @@ -48,7 +48,7 @@ | |||
516 | 48 | 48 | ||
517 | 49 | MOCK_CONST_METHOD0(secured, bool()); | 49 | MOCK_CONST_METHOD0(secured, bool()); |
518 | 50 | 50 | ||
520 | 51 | MOCK_CONST_METHOD0(enterprise, bool()); | 51 | MOCK_CONST_METHOD0(keyManagementType, KeyManagementType()); |
521 | 52 | 52 | ||
522 | 53 | MOCK_CONST_METHOD0(adhoc, bool()); | 53 | MOCK_CONST_METHOD0(adhoc, bool()); |
523 | 54 | 54 | ||
524 | @@ -68,6 +68,7 @@ | |||
525 | 68 | ON_CALL(*accessPoint, ssid()).WillByDefault(Return(QString("the ssid"))); | 68 | ON_CALL(*accessPoint, ssid()).WillByDefault(Return(QString("the ssid"))); |
526 | 69 | ON_CALL(*accessPoint, secured()).WillByDefault(Return(true)); | 69 | ON_CALL(*accessPoint, secured()).WillByDefault(Return(true)); |
527 | 70 | ON_CALL(*accessPoint, adhoc()).WillByDefault(Return(false)); | 70 | ON_CALL(*accessPoint, adhoc()).WillByDefault(Return(false)); |
528 | 71 | ON_CALL(*accessPoint, keyManagementType()).WillByDefault(Return(wifi::AccessPoint::KeyManagementType::psk)); | ||
529 | 71 | ON_CALL(*accessPoint, strength()).WillByDefault(Return(70.0)); | 72 | ON_CALL(*accessPoint, strength()).WillByDefault(Return(70.0)); |
530 | 72 | 73 | ||
531 | 73 | auto accessPointItem = make_shared<AccessPointItem>(accessPoint); | 74 | auto accessPointItem = make_shared<AccessPointItem>(accessPoint); |