Merge lp:~saviq/unity8/drop-network-agents into lp:unity8
- drop-network-agents
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~saviq/unity8/drop-network-agents |
Merge into: | lp:unity8 |
Diff against target: |
1346 lines (+18/-1145) 18 files modified
Panel/Indicators.qml (+4/-1) Panel/Indicators/NetworkIndicatorPage.qml (+0/-82) Panel/Indicators/client/IndicatorsList.qml (+3/-1) Panel/IndicatorsDataModel.qml (+0/-34) debian/changelog (+6/-0) debian/control (+3/-7) plugins/Unity/Indicators/Network/CMakeLists.txt (+0/-44) plugins/Unity/Indicators/Network/networkagent.cpp (+0/-146) plugins/Unity/Indicators/Network/networkagent.h (+0/-65) plugins/Unity/Indicators/Network/plugin.cpp (+0/-31) plugins/Unity/Indicators/Network/plugin.h (+0/-32) plugins/Unity/Indicators/Network/qml/PasswordPage.qml (+0/-88) plugins/Unity/Indicators/Network/qml/PasswordTextField.qml (+0/-68) plugins/Unity/Indicators/Network/qml/qmldir (+0/-5) plugins/Unity/Indicators/Network/secret-agent.c (+0/-382) plugins/Unity/Indicators/Network/secret-agent.h (+0/-102) plugins/Unity/Indicators/indicatorsmodel.cpp (+2/-49) plugins/Unity/Indicators/indicatorsmodel.h (+0/-8) |
To merge this branch: | bzr merge lp:~saviq/unity8/drop-network-agents |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Nick Dedekind | Pending | ||
Review via email: mp+189009@code.launchpad.net |
This proposal supersedes a proposal from 2013-10-01.
This proposal has been superseded by a proposal from 2013-10-03.
Commit message
Drop network agents now that they're in indicator-network instead.
Description of the change
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
- 250. By Michał Sawicz
-
merge trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:249
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 251. By Michał Sawicz
-
One more cleanup.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:250
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 252. By Michał Sawicz
-
One more unneeded line.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:251
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:252
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 253. By Michał Sawicz
-
Add Breaks: for indicator-network, so that we don't end up with no password agent on upgrade.
- 254. By Michał Sawicz
-
merge version bump
Unmerged revisions
Preview Diff
1 | === modified file 'Panel/Indicators.qml' |
2 | --- Panel/Indicators.qml 2013-09-16 16:42:24 +0000 |
3 | +++ Panel/Indicators.qml 2013-10-03 12:34:55 +0000 |
4 | @@ -17,6 +17,7 @@ |
5 | import QtQuick 2.0 |
6 | import Ubuntu.Components 0.1 |
7 | import Ubuntu.Gestures 0.1 |
8 | +import Unity.Indicators 0.1 as Indicators |
9 | |
10 | import "../Components" |
11 | import "../Components/ListItems" |
12 | @@ -249,8 +250,10 @@ |
13 | anchors.fill: indicatorRow |
14 | } |
15 | |
16 | - IndicatorsDataModel { |
17 | + Indicators.IndicatorsModel { |
18 | id: indicatorsModel |
19 | + |
20 | + Component.onCompleted: load() |
21 | } |
22 | |
23 | IndicatorRow { |
24 | |
25 | === removed file 'Panel/Indicators/NetworkIndicatorPage.qml' |
26 | --- Panel/Indicators/NetworkIndicatorPage.qml 2013-10-02 16:07:39 +0000 |
27 | +++ Panel/Indicators/NetworkIndicatorPage.qml 1970-01-01 00:00:00 +0000 |
28 | @@ -1,82 +0,0 @@ |
29 | -/* |
30 | - * Copyright 2013 Canonical Ltd. |
31 | - * |
32 | - * This program is free software; you can redistribute it and/or modify |
33 | - * it under the terms of the GNU Lesser General Public License as published by |
34 | - * the Free Software Foundation; version 3. |
35 | - * |
36 | - * This program is distributed in the hope that it will be useful, |
37 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
38 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
39 | - * GNU Lesser General Public License for more details. |
40 | - * |
41 | - * You should have received a copy of the GNU Lesser General Public License |
42 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
43 | - * |
44 | - * Authors: |
45 | - * Renato Araujo Oliveira Filho <renato@canonical.com> |
46 | - */ |
47 | - |
48 | -import QtQuick 2.0 |
49 | -import Unity.Indicators 0.1 as Indicators |
50 | -import Unity.Indicators.Network 0.1 as ICNetwork |
51 | -import Ubuntu.Components 0.1 |
52 | - |
53 | -PageStack { |
54 | - id: networkPage |
55 | - // Stops the search for a parent tree node. |
56 | - // We don't want it going up to the indicator tabs. |
57 | - // FIXME: need a better way of doing this. |
58 | - // https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1211704 |
59 | - __propagated: null |
60 | - |
61 | - property alias title: pluginItem.title |
62 | - property alias emptyText: pluginItem.emptyText |
63 | - property alias busName: pluginItem.busName |
64 | - property alias actionsObjectPath : pluginItem.actionsObjectPath |
65 | - property alias menuObjectPaths : pluginItem.menuObjectPaths |
66 | - |
67 | - anchors.fill: parent |
68 | - |
69 | - Page { |
70 | - id: _mainPage |
71 | - |
72 | - Indicators.IndicatorPage { |
73 | - id: pluginItem |
74 | - anchors.fill: parent |
75 | - } |
76 | - } |
77 | - |
78 | - Component { |
79 | - id: passwordPageComponent |
80 | - |
81 | - ICNetwork.PasswordPage { |
82 | - agent: networkAgent |
83 | - } |
84 | - } |
85 | - |
86 | - ICNetwork.NetworkAgent { |
87 | - id: networkAgent |
88 | - |
89 | - onSecretRequested: { |
90 | - networkPage.push(passwordPageComponent, {"token": token}); |
91 | - } |
92 | - } |
93 | - |
94 | - function start() |
95 | - { |
96 | - push(_mainPage); |
97 | - pluginItem.start(); |
98 | - } |
99 | - |
100 | - function stop() |
101 | - { |
102 | - clear(); |
103 | - pluginItem.stop(); |
104 | - } |
105 | - |
106 | - function reset() |
107 | - { |
108 | - pluginItem.reset(); |
109 | - } |
110 | -} |
111 | |
112 | === modified file 'Panel/Indicators/client/IndicatorsList.qml' |
113 | --- Panel/Indicators/client/IndicatorsList.qml 2013-10-02 09:38:06 +0000 |
114 | +++ Panel/Indicators/client/IndicatorsList.qml 2013-10-03 12:34:55 +0000 |
115 | @@ -28,8 +28,10 @@ |
116 | anchors.fill: parent |
117 | title: "Plugin list" |
118 | |
119 | - IndicatorsDataModel { |
120 | + Indicators.IndicatorsModel { |
121 | id: indicatorsModel |
122 | + |
123 | + Component.onCompleted: load() |
124 | } |
125 | |
126 | ListView { |
127 | |
128 | === removed file 'Panel/IndicatorsDataModel.qml' |
129 | --- Panel/IndicatorsDataModel.qml 2013-10-02 16:07:39 +0000 |
130 | +++ Panel/IndicatorsDataModel.qml 1970-01-01 00:00:00 +0000 |
131 | @@ -1,34 +0,0 @@ |
132 | -/* |
133 | - * Copyright 2013 Canonical Ltd. |
134 | - * |
135 | - * This program is free software; you can redistribute it and/or modify |
136 | - * it under the terms of the GNU Lesser General Public License as published by |
137 | - * the Free Software Foundation; version 3. |
138 | - * |
139 | - * This program is distributed in the hope that it will be useful, |
140 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
141 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
142 | - * GNU Lesser General Public License for more details. |
143 | - * |
144 | - * You should have received a copy of the GNU Lesser General Public License |
145 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
146 | - * |
147 | - * Authors: |
148 | - * Renato Araujo Oliveira Filho <renato@canonical.com> |
149 | - */ |
150 | - |
151 | -import QtQuick 2.0 |
152 | -import Unity.Indicators 0.1 as Indicators |
153 | -import Utils 0.1 |
154 | - |
155 | -Indicators.IndicatorsModel { |
156 | - id: ic_model |
157 | - |
158 | - Component.onCompleted: load() |
159 | - |
160 | - indicatorData : { |
161 | - 'indicator-network' : { |
162 | - 'pageSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/NetworkIndicatorPage.qml' |
163 | - }, |
164 | - } |
165 | -} |
166 | |
167 | === modified file 'debian/changelog' |
168 | --- debian/changelog 2013-09-27 14:13:22 +0000 |
169 | +++ debian/changelog 2013-10-03 12:34:55 +0000 |
170 | @@ -1,3 +1,9 @@ |
171 | +unity8 (7.82) UNRELEASED; urgency=low |
172 | + |
173 | + * Bump to indicate support for extended snap decisions. |
174 | + |
175 | + -- Michał Sawicz <michal.sawicz@canonical.com> Thu, 03 Oct 2013 14:20:23 +0200 |
176 | + |
177 | unity8 (7.81.3+13.10.20130927.3-0ubuntu1) saucy; urgency=low |
178 | |
179 | [ Michal Hruby ] |
180 | |
181 | === modified file 'debian/control' |
182 | --- debian/control 2013-09-26 15:23:37 +0000 |
183 | +++ debian/control 2013-10-03 12:34:55 +0000 |
184 | @@ -14,8 +14,6 @@ |
185 | libjson-perl, |
186 | libnih-dbus-dev, |
187 | libnih-dev, |
188 | - libnm-glib-dev, |
189 | - libnm-util-dev, |
190 | libpulse-dev, |
191 | libqmenumodel-dev (>= 0.2.7), |
192 | libqt5v8-5-private-dev, |
193 | @@ -74,16 +72,14 @@ |
194 | qtdeclarative5-unity-notifications-plugin | unity-notifications-impl, |
195 | qtdeclarative5-xmllistmodel-plugin, |
196 | unity-launcher-impl-3, |
197 | - unity-notifications-impl-1, |
198 | + unity-notifications-impl-2, |
199 | unity8-fake-env | qtubuntu-shell, |
200 | unity8-private (= ${binary:Version}), |
201 | unity8-private | unity-launcher-impl, |
202 | ${misc:Depends}, |
203 | ${shlibs:Depends}, |
204 | -Recommends: indicator-battery, |
205 | - indicator-messages, |
206 | - indicator-time, |
207 | - ${unity-default-masterscopes}, |
208 | +Recommends: ${unity-default-masterscopes}, |
209 | +Breaks: indicator-network (<< 0.5.1) |
210 | Description: Unity 8 shell |
211 | The Unity 8 shell is the primary user interface for Ubuntu devices. |
212 | |
213 | |
214 | === modified file 'plugins/Unity/Indicators/Network/CMakeLists.txt' |
215 | --- plugins/Unity/Indicators/Network/CMakeLists.txt 2013-08-20 19:50:07 +0000 |
216 | +++ plugins/Unity/Indicators/Network/CMakeLists.txt 2013-10-03 12:34:55 +0000 |
217 | @@ -1,45 +1,1 @@ |
218 | -# export_qmlplugin macro |
219 | -include(Plugins) |
220 | - |
221 | -project(IndicatorsNetworkQml) |
222 | - |
223 | -pkg_check_modules(GLIB glib-2.0>=2.32) |
224 | -pkg_check_modules(LIBNM_GLIB libnm-glib>=0.9.6) |
225 | -pkg_check_modules(LIBNM_UTIL libnm-util>=0.9.6) |
226 | - |
227 | -if(LIBNM_GLIB_FOUND AND LIBNM_UTIL_FOUND AND GLIB_FOUND) |
228 | - set(INDICATORS_NETWORK_SRC |
229 | - networkagent.cpp |
230 | - plugin.cpp |
231 | - secret-agent.c |
232 | - ) |
233 | - |
234 | - add_library(IndicatorsNetworkQml MODULE |
235 | - ${INDICATORS_NETWORK_SRC} |
236 | - ) |
237 | - |
238 | - qt5_use_modules(IndicatorsNetworkQml Core Qml Widgets) |
239 | - |
240 | - set_target_properties(IndicatorsNetworkQml PROPERTIES COMPILE_FLAGS -fPIC) |
241 | - |
242 | - include_directories( |
243 | - ${CMAKE_CURRENT_SOURCE_DIR} |
244 | - ${GLIB_INCLUDE_DIRS} |
245 | - ${LIBNM_GLIB_INCLUDE_DIRS} |
246 | - ${LIBNM_UTIL_INCLUDE_DIRS} |
247 | - ) |
248 | - |
249 | - target_link_libraries(IndicatorsNetworkQml |
250 | - ${GLIB_LIBRARIES} |
251 | - ${LIBNM_GLIB_LIBRARIES} |
252 | - ${LIBNM_UTIL_LIBRARIES} |
253 | - ) |
254 | - |
255 | - # export the qmltypes and plugin files |
256 | - export_qmlplugin(Unity.Indicators.Network 0.1 Unity/Indicators/Network TARGETS IndicatorsNetworkQml) |
257 | - |
258 | -else() |
259 | - message(WARNING "Missing glib or libnm dependency for the network plugin, not building") |
260 | -endif() |
261 | - |
262 | add_subdirectory(qml) |
263 | |
264 | === removed file 'plugins/Unity/Indicators/Network/networkagent.cpp' |
265 | --- plugins/Unity/Indicators/Network/networkagent.cpp 2013-06-07 12:51:16 +0000 |
266 | +++ plugins/Unity/Indicators/Network/networkagent.cpp 1970-01-01 00:00:00 +0000 |
267 | @@ -1,146 +0,0 @@ |
268 | -/* |
269 | - * Copyright 2013 Canonical Ltd. |
270 | - * |
271 | - * This program is free software; you can redistribute it and/or modify |
272 | - * it under the terms of the GNU Lesser General Public License as published by |
273 | - * the Free Software Foundation; version 3. |
274 | - * |
275 | - * This program is distributed in the hope that it will be useful, |
276 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
277 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
278 | - * GNU Lesser General Public License for more details. |
279 | - * |
280 | - * You should have received a copy of the GNU Lesser General Public License |
281 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
282 | - * |
283 | - * Authors: |
284 | - * Alberto Ruiz <alberto.ruiz@canonical.com> |
285 | - * Renato Araujo Oliveira Filho <renato@canonical.com> |
286 | - */ |
287 | - |
288 | -#include "networkagent.h" |
289 | - |
290 | -#include <QVariant> |
291 | -#include <QApplication> |
292 | -#include <QDebug> |
293 | - |
294 | -class NetworkAgentToken |
295 | -{ |
296 | -public: |
297 | - NMConnection *connection; |
298 | - NMSettingWirelessSecurity *wisec; |
299 | - guint id; |
300 | - QByteArray keyMgmt; |
301 | - |
302 | - NetworkAgentToken(NMConnection *connection, |
303 | - NMSettingWirelessSecurity *wisec, |
304 | - guint id, |
305 | - QByteArray keyMgmt) |
306 | - : connection(connection), |
307 | - wisec(wisec), |
308 | - id(id), |
309 | - keyMgmt(keyMgmt) |
310 | - { |
311 | - if (connection) { |
312 | - g_object_ref(connection); |
313 | - } else { |
314 | - qWarning() << "invalid connection object"; |
315 | - } |
316 | - } |
317 | - |
318 | - ~NetworkAgentToken() |
319 | - { |
320 | - if (connection) { |
321 | - g_object_unref(connection); |
322 | - } |
323 | - } |
324 | -}; |
325 | - |
326 | -NetworkAgent::NetworkAgent(QObject *parent) |
327 | - : QObject(parent) |
328 | -{ |
329 | - m_agent = unity_settings_secret_agent_new(); |
330 | - g_signal_connect(G_OBJECT(m_agent), |
331 | - UNITY_SETTINGS_SECRET_AGENT_SECRET_REQUESTED, |
332 | - G_CALLBACK(onSecretRequested), |
333 | - this); |
334 | - |
335 | - g_signal_connect(G_OBJECT(m_agent), |
336 | - UNITY_SETTINGS_SECRET_AGENT_REQUEST_CANCELLED, |
337 | - G_CALLBACK(onSecretRequestCancelled), |
338 | - this); |
339 | -} |
340 | - |
341 | -NetworkAgent::~NetworkAgent() |
342 | -{ |
343 | - nm_secret_agent_unregister(NM_SECRET_AGENT(m_agent)); |
344 | - g_object_unref(m_agent); |
345 | -} |
346 | - |
347 | -void NetworkAgent::authenticate(const QVariant &token, const QString &key) |
348 | -{ |
349 | - NetworkAgentToken *pToken = (NetworkAgentToken *) token.value<void *>(); |
350 | - if (pToken == NULL) { |
351 | - return; |
352 | - } |
353 | - |
354 | - if ((pToken->keyMgmt == "wpa-none") || (pToken->keyMgmt == "wpa-psk")) { |
355 | - g_object_set(G_OBJECT(pToken->wisec), |
356 | - NM_SETTING_WIRELESS_SECURITY_PSK, qPrintable(key), |
357 | - NULL); |
358 | - } else if (pToken->keyMgmt == "none") { |
359 | - g_object_set(G_OBJECT(pToken->wisec), |
360 | - NM_SETTING_WIRELESS_SECURITY_WEP_KEY0, qPrintable(key), |
361 | - NULL); |
362 | - } |
363 | - |
364 | - GHashTable *settings = nm_connection_to_hash(pToken->connection, |
365 | - NM_SETTING_HASH_FLAG_ALL); |
366 | - |
367 | - unity_settings_secret_agent_provide_secret(m_agent, |
368 | - pToken->id, settings); |
369 | - g_hash_table_unref(settings); |
370 | - delete pToken; |
371 | -} |
372 | - |
373 | -void NetworkAgent::cancel(const QVariant &token) |
374 | -{ |
375 | - NetworkAgentToken *pToken = (NetworkAgentToken *) token.value<void *>(); |
376 | - if (pToken != NULL) { |
377 | - unity_settings_secret_agent_cancel_request(m_agent, pToken->id); |
378 | - delete pToken; |
379 | - } |
380 | -} |
381 | - |
382 | -void NetworkAgent::onSecretRequested(UnitySettingsSecretAgent* /*agent*/, |
383 | - guint id, |
384 | - NMConnection* connection, |
385 | - const char* /*setting_name*/, |
386 | - const char** /*hints*/, |
387 | - NMSecretAgentGetSecretsFlags /*flags*/, |
388 | - NetworkAgent* self) |
389 | -{ |
390 | - NetworkAgentToken *token = new NetworkAgentToken(connection, |
391 | - NULL, |
392 | - id, |
393 | - NULL); |
394 | - |
395 | - token->wisec = nm_connection_get_setting_wireless_security(connection); |
396 | - if (token->wisec) { |
397 | - token->keyMgmt = nm_setting_wireless_security_get_key_mgmt(token->wisec); |
398 | - } |
399 | - |
400 | - QVariant varToken = qVariantFromValue((void *) token); |
401 | - Q_EMIT self->secretRequested(varToken); |
402 | -} |
403 | - |
404 | -void NetworkAgent::onSecretRequestCancelled(UnitySettingsSecretAgent* /*agent*/, |
405 | - guint /*id*/, |
406 | - NMConnection* /*connection*/, |
407 | - const char* /*setting_name*/, |
408 | - const char** /*hints*/, |
409 | - NMSecretAgentGetSecretsFlags /*flags*/, |
410 | - NetworkAgent* /*self*/) |
411 | -{ |
412 | - //Do nothing for now |
413 | -} |
414 | |
415 | === removed file 'plugins/Unity/Indicators/Network/networkagent.h' |
416 | --- plugins/Unity/Indicators/Network/networkagent.h 2013-06-07 12:51:16 +0000 |
417 | +++ plugins/Unity/Indicators/Network/networkagent.h 1970-01-01 00:00:00 +0000 |
418 | @@ -1,65 +0,0 @@ |
419 | -/* |
420 | - * Copyright 2013 Canonical Ltd. |
421 | - * |
422 | - * This program is free software; you can redistribute it and/or modify |
423 | - * it under the terms of the GNU Lesser General Public License as published by |
424 | - * the Free Software Foundation; version 3. |
425 | - * |
426 | - * This program is distributed in the hope that it will be useful, |
427 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
428 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
429 | - * GNU Lesser General Public License for more details. |
430 | - * |
431 | - * You should have received a copy of the GNU Lesser General Public License |
432 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
433 | - * |
434 | - * Authors: |
435 | - * Alberto Ruiz <alberto.ruiz@canonical.com> |
436 | - * Renato Araujo Oliveira Filho <renato@canonical.com> |
437 | - */ |
438 | - |
439 | -#ifndef NETWORKAGENT_H |
440 | -#define NETWORKAGENT_H |
441 | - |
442 | -#include "secret-agent.h" |
443 | - |
444 | -#include <QObject> |
445 | - |
446 | -class NetworkAgentToken; |
447 | - |
448 | -class NetworkAgent : public QObject |
449 | -{ |
450 | - Q_OBJECT |
451 | -public: |
452 | - NetworkAgent(QObject *parent=0); |
453 | - ~NetworkAgent(); |
454 | - |
455 | - Q_INVOKABLE void authenticate(const QVariant &token, const QString &key); |
456 | - Q_INVOKABLE void cancel(const QVariant &token); |
457 | - |
458 | -Q_SIGNALS: |
459 | - void secretRequested(const QVariant &token); |
460 | - void secretRequestCancelled(); |
461 | - |
462 | -private: |
463 | - UnitySettingsSecretAgent *m_agent; |
464 | - |
465 | - static void onSecretRequested(UnitySettingsSecretAgent *agent, |
466 | - guint id, |
467 | - NMConnection *connection, |
468 | - const char *setting_name, |
469 | - const char **hints, |
470 | - NMSecretAgentGetSecretsFlags flags, |
471 | - NetworkAgent *self); |
472 | - |
473 | - static void onSecretRequestCancelled(UnitySettingsSecretAgent *agent, |
474 | - guint id, |
475 | - NMConnection *connection, |
476 | - const char *setting_name, |
477 | - const char **hints, |
478 | - NMSecretAgentGetSecretsFlags flags, |
479 | - NetworkAgent *self); |
480 | - |
481 | -}; |
482 | - |
483 | -#endif |
484 | |
485 | === removed file 'plugins/Unity/Indicators/Network/plugin.cpp' |
486 | --- plugins/Unity/Indicators/Network/plugin.cpp 2013-08-23 11:56:44 +0000 |
487 | +++ plugins/Unity/Indicators/Network/plugin.cpp 1970-01-01 00:00:00 +0000 |
488 | @@ -1,31 +0,0 @@ |
489 | -/* |
490 | - * Copyright (C) 2012 Canonical, Ltd. |
491 | - * |
492 | - * This program is free software; you can redistribute it and/or modify |
493 | - * it under the terms of the GNU General Public License as published by |
494 | - * the Free Software Foundation; version 3. |
495 | - * |
496 | - * This program is distributed in the hope that it will be useful, |
497 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
498 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
499 | - * GNU General Public License for more details. |
500 | - * |
501 | - * You should have received a copy of the GNU General Public License |
502 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
503 | - * |
504 | - * Author: Nick Dedekind <nick.dedekind@canonical.com> |
505 | - */ |
506 | - |
507 | -// Qt |
508 | -#include <QtQml/qqml.h> |
509 | - |
510 | -// self |
511 | -#include "plugin.h" |
512 | - |
513 | -// local |
514 | -#include "networkagent.h" |
515 | - |
516 | -void IndicatorsNetworkPlugin::registerTypes(const char *uri) |
517 | -{ |
518 | - qmlRegisterType<NetworkAgent>(uri, 0, 1, "NetworkAgent"); |
519 | -} |
520 | |
521 | === removed file 'plugins/Unity/Indicators/Network/plugin.h' |
522 | --- plugins/Unity/Indicators/Network/plugin.h 2013-06-17 08:14:24 +0000 |
523 | +++ plugins/Unity/Indicators/Network/plugin.h 1970-01-01 00:00:00 +0000 |
524 | @@ -1,32 +0,0 @@ |
525 | -/* |
526 | - * Copyright (C) 2012 Canonical, Ltd. |
527 | - * |
528 | - * This program is free software; you can redistribute it and/or modify |
529 | - * it under the terms of the GNU General Public License as published by |
530 | - * the Free Software Foundation; version 3. |
531 | - * |
532 | - * This program is distributed in the hope that it will be useful, |
533 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
534 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
535 | - * GNU General Public License for more details. |
536 | - * |
537 | - * You should have received a copy of the GNU General Public License |
538 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
539 | - * |
540 | - * Author: Nick Dedekind <nick.dedekind@canonical.com> |
541 | - */ |
542 | - |
543 | -#ifndef INDICATORS_NETWORK_PLUGIN_H |
544 | -#define INDICATORS_NETWORK_PLUGIN_H |
545 | - |
546 | -#include <QtQml/QQmlExtensionPlugin> |
547 | - |
548 | -class IndicatorsNetworkPlugin : public QQmlExtensionPlugin |
549 | -{ |
550 | - Q_OBJECT |
551 | - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") |
552 | -public: |
553 | - void registerTypes(const char *uri); |
554 | -}; |
555 | - |
556 | -#endif // INDICATORS_NETWORK_PLUGIN_H |
557 | |
558 | === removed file 'plugins/Unity/Indicators/Network/qml/PasswordPage.qml' |
559 | --- plugins/Unity/Indicators/Network/qml/PasswordPage.qml 2013-08-21 21:00:17 +0000 |
560 | +++ plugins/Unity/Indicators/Network/qml/PasswordPage.qml 1970-01-01 00:00:00 +0000 |
561 | @@ -1,88 +0,0 @@ |
562 | -/* |
563 | - * Copyright 2013 Canonical Ltd. |
564 | - * |
565 | - * This program is free software; you can redistribute it and/or modify |
566 | - * it under the terms of the GNU Lesser General Public License as published by |
567 | - * the Free Software Foundation; version 3. |
568 | - * |
569 | - * This program is distributed in the hope that it will be useful, |
570 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
571 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
572 | - * GNU Lesser General Public License for more details. |
573 | - * |
574 | - * You should have received a copy of the GNU Lesser General Public License |
575 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
576 | - * |
577 | - * Authors: |
578 | - * Renato Araujo Oliveira Filho <renato@canonical.com> |
579 | - */ |
580 | - |
581 | -import QtQuick 2.0 |
582 | -import Ubuntu.Components 0.1 |
583 | -import Ubuntu.Components.ListItems 0.1 as ListItem |
584 | -import Unity.Indicators 0.1 as Indicators |
585 | - |
586 | -Page { |
587 | - id: pagePassword |
588 | - |
589 | - property variant agent |
590 | - property variant token |
591 | - |
592 | - anchors.fill: parent |
593 | - title: "Network Authentication" |
594 | - |
595 | - Column { |
596 | - anchors { |
597 | - left: parent.left |
598 | - right: parent.right |
599 | - } |
600 | - |
601 | - Indicators.SectionMenuItem { |
602 | - text: "Authentication" |
603 | - } |
604 | - |
605 | - Indicators.FramedMenuItem { |
606 | - implicitHeight: password.height + units.gu(1) |
607 | - |
608 | - PasswordTextField { |
609 | - id: password |
610 | - anchors { |
611 | - left: parent.left |
612 | - right: parent.right |
613 | - margins: units.gu(3) |
614 | - verticalCenter: parent.verticalCenter |
615 | - } |
616 | - } |
617 | - } |
618 | - |
619 | - Indicators.FramedMenuItem { |
620 | - Row { |
621 | - anchors { |
622 | - right: parent.right |
623 | - verticalCenter: parent.verticalCenter |
624 | - margins: units.gu(3) |
625 | - } |
626 | - |
627 | - spacing: units.gu(1) |
628 | - |
629 | - Button { |
630 | - text: "Cancel" |
631 | - width: units.gu(10) |
632 | - onClicked: { |
633 | - agent.cancel(token); |
634 | - pageStack.pop(); |
635 | - } |
636 | - } |
637 | - |
638 | - Button { |
639 | - text: "OK" |
640 | - width: units.gu(10) |
641 | - onClicked: { |
642 | - agent.authenticate(token, password.text); |
643 | - pageStack.pop(); |
644 | - } |
645 | - } |
646 | - } |
647 | - } |
648 | - } |
649 | -} |
650 | |
651 | === removed file 'plugins/Unity/Indicators/Network/qml/PasswordTextField.qml' |
652 | --- plugins/Unity/Indicators/Network/qml/PasswordTextField.qml 2013-07-05 15:05:28 +0000 |
653 | +++ plugins/Unity/Indicators/Network/qml/PasswordTextField.qml 1970-01-01 00:00:00 +0000 |
654 | @@ -1,68 +0,0 @@ |
655 | -/* |
656 | - * Copyright 2013 Canonical Ltd. |
657 | - * |
658 | - * This program is free software; you can redistribute it and/or modify |
659 | - * it under the terms of the GNU Lesser General Public License as published by |
660 | - * the Free Software Foundation; version 3. |
661 | - * |
662 | - * This program is distributed in the hope that it will be useful, |
663 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
664 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
665 | - * GNU Lesser General Public License for more details. |
666 | - * |
667 | - * You should have received a copy of the GNU Lesser General Public License |
668 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
669 | - * |
670 | - * Authors: |
671 | - * Renato Araujo Oliveira Filho <renato@canonical.com> |
672 | - */ |
673 | - |
674 | -import QtQuick 2.0 |
675 | -import Ubuntu.Components 0.1 |
676 | - |
677 | -Item { |
678 | - id: textMenu |
679 | - |
680 | - property alias text: textField.text |
681 | - |
682 | - height: contentColumn.height |
683 | - |
684 | - Column { |
685 | - id: contentColumn |
686 | - spacing: units.gu(0.5) |
687 | - anchors { |
688 | - left: parent.left |
689 | - right: parent.right |
690 | - } |
691 | - |
692 | - TextField { |
693 | - id: textField |
694 | - |
695 | - anchors { |
696 | - left: parent.left |
697 | - right: parent.right |
698 | - } |
699 | - |
700 | - placeholderText: "Password" |
701 | - echoMode: showPassword.checked ? TextInput.Normal : TextInput.Password |
702 | - } |
703 | - |
704 | - Row { |
705 | - anchors { |
706 | - left: parent.left |
707 | - right: parent.right |
708 | - } |
709 | - |
710 | - spacing: units.gu(1) |
711 | - |
712 | - CheckBox { |
713 | - id: showPassword |
714 | - } |
715 | - |
716 | - Label { |
717 | - text: "Show password" |
718 | - anchors.verticalCenter: showPassword.verticalCenter |
719 | - } |
720 | - } |
721 | - } |
722 | -} |
723 | |
724 | === modified file 'plugins/Unity/Indicators/Network/qml/qmldir' |
725 | --- plugins/Unity/Indicators/Network/qml/qmldir 2013-08-21 21:00:17 +0000 |
726 | +++ plugins/Unity/Indicators/Network/qml/qmldir 2013-10-03 12:34:55 +0000 |
727 | @@ -1,8 +1,3 @@ |
728 | module Unity.Indicators.Network |
729 | -plugin IndicatorsNetworkQml |
730 | -typeinfo plugin.qmltypes |
731 | |
732 | -NetworkPage 0.1 NetworkPage.qml |
733 | AccessPoint 0.1 AccessPoint.qml |
734 | -PasswordPage 0.1 PasswordPage.qml |
735 | -PasswordTextField 0.1 PasswordTextField.qml |
736 | \ No newline at end of file |
737 | |
738 | === removed file 'plugins/Unity/Indicators/Network/secret-agent.c' |
739 | --- plugins/Unity/Indicators/Network/secret-agent.c 2013-06-07 12:51:16 +0000 |
740 | +++ plugins/Unity/Indicators/Network/secret-agent.c 1970-01-01 00:00:00 +0000 |
741 | @@ -1,382 +0,0 @@ |
742 | -/* |
743 | - * Copyright 2013 Canonical Ltd. |
744 | - * |
745 | - * This program is free software; you can redistribute it and/or modify |
746 | - * it under the terms of the GNU Lesser General Public License as published by |
747 | - * the Free Software Foundation; version 3. |
748 | - * |
749 | - * This program is distributed in the hope that it will be useful, |
750 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
751 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
752 | - * GNU Lesser General Public License for more details. |
753 | - * |
754 | - * You should have received a copy of the GNU Lesser General Public License |
755 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
756 | - * |
757 | - * Authors: |
758 | - * Alberto Ruiz <alberto.ruiz@canonical.com> |
759 | - * Renato Araujo Oliveira Filho <renato@canonical.com> |
760 | - */ |
761 | - |
762 | - |
763 | -#include <glib.h> |
764 | -#include <glib-object.h> |
765 | -#include <nm-secret-agent.h> |
766 | -#include "secret-agent.h" |
767 | - |
768 | -#define UNITY_SETTINGS_TYPE_SECRET_AGENT (unity_settings_secret_agent_get_type ()) |
769 | -#define UNITY_SETTINGS_SECRET_AGENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_SETTINGS_TYPE_SECRET_AGENT, UnitySettingsSecretAgent)) |
770 | -#define UNITY_SETTINGS_SECRET_AGENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_SETTINGS_TYPE_SECRET_AGENT, UnitySettingsSecretAgentClass)) |
771 | -#define UNITY_SETTINGS_IS_SECRET_AGENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_SETTINGS_TYPE_SECRET_AGENT)) |
772 | -#define UNITY_SETTINGS_IS_SECRET_AGENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_SETTINGS_TYPE_SECRET_AGENT)) |
773 | -#define UNITY_SETTINGS_SECRET_AGENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_SETTINGS_TYPE_SECRET_AGENT, UnitySettingsSecretAgentClass)) |
774 | -#define UNITY_SETTINGS_SECRET_AGENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_SETTINGS_TYPE_SECRET_AGENT, UnitySettingsSecretAgentPrivate)) |
775 | - |
776 | -#define AGENT_ID "com.canonical.settings.network.nm-agent" |
777 | - |
778 | -static gpointer unity_settings_secret_agent_parent_class = NULL; |
779 | - |
780 | -typedef struct _UnitySettingsSecretAgentPrivate UnitySettingsSecretAgentPrivate; |
781 | - |
782 | -struct _UnitySettingsSecretAgentPrivate { |
783 | - GQueue *requests; |
784 | -}; |
785 | - |
786 | -typedef struct _SecretRequest { |
787 | - gint id; |
788 | - NMSecretAgent *agent; |
789 | - NMConnection *connection; |
790 | - const char *connection_path; |
791 | - const char *setting_name; |
792 | - const char **hints; |
793 | - NMSecretAgentGetSecretsFlags flags; |
794 | - NMSecretAgentGetSecretsFunc callback; |
795 | - gpointer callback_data; |
796 | -} SecretRequest; |
797 | - |
798 | -GType unity_settings_secret_agent_get_type (void) G_GNUC_CONST; |
799 | -enum { |
800 | - UNITY_SETTINGS_SECRET_AGENT_DUMMY_PROPERTY |
801 | -}; |
802 | - |
803 | -enum { |
804 | - SECRET_REQUESTED, |
805 | - REQUEST_CANCELLED, |
806 | - LAST_SIGNAL |
807 | -}; |
808 | - |
809 | -static guint signals[LAST_SIGNAL] = { 0 }; |
810 | - |
811 | -UnitySettingsSecretAgent* unity_settings_secret_agent_new (void); |
812 | -UnitySettingsSecretAgent* unity_settings_secret_agent_construct (GType object_type); |
813 | - |
814 | -int |
815 | -secret_request_find (SecretRequest *req, |
816 | - guint *id) |
817 | -{ |
818 | - if (req->id > *id) |
819 | - return -1; |
820 | - |
821 | - if (req->id < *id) |
822 | - return 1; |
823 | - |
824 | - return 0; |
825 | -} |
826 | - |
827 | -void |
828 | -unity_settings_secret_agent_provide_secret (UnitySettingsSecretAgent *agent, |
829 | - guint request, |
830 | - GHashTable *secrets) |
831 | -{ |
832 | - GList *iter; |
833 | - SecretRequest *req; |
834 | - UnitySettingsSecretAgentPrivate *priv = agent->priv; |
835 | - |
836 | - iter = g_queue_find_custom (priv->requests, |
837 | - &request, |
838 | - (GCompareFunc)secret_request_find); |
839 | - |
840 | - if (iter == NULL || iter->data == NULL) |
841 | - { |
842 | - g_warning ("Secret request with id <%d> was not found", (int)request); |
843 | - return; |
844 | - } |
845 | - |
846 | - req = iter->data; |
847 | - |
848 | - req->callback (NM_SECRET_AGENT (agent), |
849 | - req->connection, |
850 | - secrets, |
851 | - NULL, |
852 | - req->callback_data); |
853 | - |
854 | - g_queue_remove_all (priv->requests, req); |
855 | - g_free (req); |
856 | - return; |
857 | -} |
858 | - |
859 | -void |
860 | -free_request (SecretRequest *req) |
861 | -{ |
862 | - g_object_unref (req->connection); |
863 | - g_free (req); |
864 | -} |
865 | - |
866 | -void |
867 | -unity_settings_secret_agent_cancel_request (UnitySettingsSecretAgent *agent, |
868 | - guint request) |
869 | -{ |
870 | - GList *iter; |
871 | - SecretRequest *req; |
872 | - UnitySettingsSecretAgentPrivate *priv = agent->priv; |
873 | - GError *error; |
874 | - |
875 | - iter = g_queue_find_custom (priv->requests, |
876 | - &request, |
877 | - (GCompareFunc)secret_request_find); |
878 | - |
879 | - if (iter == NULL || iter->data == NULL) |
880 | - { |
881 | - g_warning ("Secret request with id <%d> was not found", (int)request); |
882 | - return; |
883 | - } |
884 | - |
885 | - req = iter->data; |
886 | - error = g_error_new (NM_SECRET_AGENT_ERROR, |
887 | - NM_SECRET_AGENT_ERROR_INTERNAL_ERROR, |
888 | - "This secret request was canceled by the user."); |
889 | - |
890 | - req->callback (NM_SECRET_AGENT (agent), |
891 | - req->connection, |
892 | - NULL, |
893 | - error, |
894 | - req->callback_data); |
895 | - |
896 | - g_queue_remove_all (priv->requests, req); |
897 | - free_request (req); |
898 | - return; |
899 | -} |
900 | - |
901 | -static void |
902 | -delete_secrets (NMSecretAgent *agent, |
903 | - NMConnection *connection, |
904 | - const char *connection_path, |
905 | - NMSecretAgentDeleteSecretsFunc callback, |
906 | - gpointer callback_data) |
907 | -{ |
908 | - g_debug ("delete secrets"); |
909 | -} |
910 | - |
911 | -/* If it returns G_MAXUINT it's considered an error */ |
912 | -static guint |
913 | -find_available_id (UnitySettingsSecretAgentPrivate *priv) |
914 | -{ |
915 | - guint i = 0; |
916 | - guint candidate = 0; |
917 | - |
918 | - if (g_queue_get_length (priv->requests) == G_MAXUINT) |
919 | - return G_MAXUINT; |
920 | - |
921 | - while (i < g_queue_get_length (priv->requests)) |
922 | - { |
923 | - SecretRequest *req = (SecretRequest*)g_queue_peek_nth (priv->requests, i); |
924 | - |
925 | - if (req->id == candidate) |
926 | - { |
927 | - candidate++; |
928 | - i = 0; |
929 | - } |
930 | - else |
931 | - { |
932 | - i++; |
933 | - } |
934 | - } |
935 | - |
936 | - return i; |
937 | -} |
938 | - |
939 | -static void |
940 | -get_secrets (NMSecretAgent *agent, |
941 | - NMConnection *connection, |
942 | - const char *connection_path, |
943 | - const char *setting_name, |
944 | - const char **hints, |
945 | - NMSecretAgentGetSecretsFlags flags, |
946 | - NMSecretAgentGetSecretsFunc callback, |
947 | - gpointer callback_data) |
948 | -{ |
949 | - guint id; |
950 | - UnitySettingsSecretAgentPrivate *priv = UNITY_SETTINGS_SECRET_AGENT_GET_PRIVATE (agent); |
951 | - SecretRequest *req = NULL; |
952 | - |
953 | - if (flags == NM_SECRET_AGENT_GET_SECRETS_FLAG_NONE) |
954 | - { |
955 | - GError *error = g_error_new (NM_SECRET_AGENT_ERROR, |
956 | - NM_SECRET_AGENT_ERROR_INTERNAL_ERROR, |
957 | - "No password found for this connection."); |
958 | - callback (agent, connection, NULL, error, callback_data); |
959 | - g_error_free (error); |
960 | - return; |
961 | - } |
962 | - |
963 | - id = find_available_id (priv); |
964 | - if (id == G_MAXUINT) |
965 | - { |
966 | - GError *error = g_error_new (NM_SECRET_AGENT_ERROR, |
967 | - NM_SECRET_AGENT_ERROR_INTERNAL_ERROR, |
968 | - "Reached maximum number of requests."); |
969 | - callback (agent, connection, NULL, error, callback_data); |
970 | - g_error_free (error); |
971 | - return; |
972 | - } |
973 | - |
974 | - /* Adding a request */ |
975 | - req = (SecretRequest*) g_malloc0 (sizeof (SecretRequest)); |
976 | - *req = ((SecretRequest) |
977 | - { id, |
978 | - agent, |
979 | - connection, |
980 | - connection_path, |
981 | - setting_name, |
982 | - hints, |
983 | - flags, |
984 | - callback, |
985 | - callback_data }); |
986 | - |
987 | - g_object_ref (connection); |
988 | - |
989 | - g_queue_push_tail (priv->requests, req); |
990 | - |
991 | - g_signal_emit_by_name (agent, |
992 | - UNITY_SETTINGS_SECRET_AGENT_SECRET_REQUESTED, |
993 | - id, |
994 | - connection, |
995 | - setting_name, |
996 | - hints, |
997 | - flags); |
998 | -} |
999 | - |
1000 | -static void |
1001 | -save_secrets (NMSecretAgent *agent, |
1002 | - NMConnection *connection, |
1003 | - const char *connection_path, |
1004 | - NMSecretAgentSaveSecretsFunc callback, |
1005 | - gpointer callback_data) |
1006 | -{ |
1007 | - g_debug ("save secrets"); |
1008 | -} |
1009 | - |
1010 | -static void |
1011 | -cancel_get_secrets (NMSecretAgent *agent, |
1012 | - const char *connection_path, |
1013 | - const char *setting_name) |
1014 | -{ |
1015 | - g_debug ("cancel get secrets"); |
1016 | -} |
1017 | - |
1018 | -UnitySettingsSecretAgent* |
1019 | -unity_settings_secret_agent_construct (GType object_type) |
1020 | -{ |
1021 | - UnitySettingsSecretAgent * self = NULL; |
1022 | - self = (UnitySettingsSecretAgent*) g_object_new (object_type, |
1023 | - NM_SECRET_AGENT_IDENTIFIER, AGENT_ID, |
1024 | - NULL); |
1025 | - return self; |
1026 | -} |
1027 | - |
1028 | - |
1029 | -UnitySettingsSecretAgent* |
1030 | -unity_settings_secret_agent_new (void) |
1031 | -{ |
1032 | - return unity_settings_secret_agent_construct (UNITY_SETTINGS_TYPE_SECRET_AGENT); |
1033 | -} |
1034 | - |
1035 | -static void |
1036 | -destroy_pending_request (gpointer data) |
1037 | -{ |
1038 | - SecretRequest* req = (SecretRequest*)data; |
1039 | - /* Reporting the cancellation of all pending requests */ |
1040 | - g_signal_emit_by_name (req->agent, |
1041 | - UNITY_SETTINGS_SECRET_AGENT_REQUEST_CANCELLED, |
1042 | - req->id); |
1043 | - |
1044 | - free_request (req); |
1045 | -} |
1046 | - |
1047 | -static void |
1048 | -unity_settings_secret_agent_finalize (GObject *agent) |
1049 | -{ |
1050 | - UnitySettingsSecretAgentPrivate *priv = UNITY_SETTINGS_SECRET_AGENT_GET_PRIVATE (agent); |
1051 | - |
1052 | - g_queue_free_full (priv->requests, destroy_pending_request); |
1053 | -} |
1054 | - |
1055 | -static void |
1056 | -unity_settings_secret_agent_class_init (UnitySettingsSecretAgentClass *klass) |
1057 | -{ |
1058 | - unity_settings_secret_agent_parent_class = g_type_class_peek_parent (klass); |
1059 | - NMSecretAgentClass *parent_class = NM_SECRET_AGENT_CLASS (klass); |
1060 | - parent_class->get_secrets = get_secrets; |
1061 | - parent_class->save_secrets = save_secrets; |
1062 | - parent_class->delete_secrets = delete_secrets; |
1063 | - parent_class->cancel_get_secrets = cancel_get_secrets; |
1064 | - |
1065 | - g_type_class_add_private (klass, sizeof(UnitySettingsSecretAgentPrivate)); |
1066 | - G_OBJECT_CLASS (klass)->finalize = unity_settings_secret_agent_finalize; |
1067 | - |
1068 | - |
1069 | - signals[SECRET_REQUESTED] = g_signal_new (UNITY_SETTINGS_SECRET_AGENT_SECRET_REQUESTED, |
1070 | - G_OBJECT_CLASS_TYPE (G_OBJECT_CLASS (klass)), |
1071 | - G_SIGNAL_RUN_FIRST, |
1072 | - G_STRUCT_OFFSET (UnitySettingsSecretAgentClass, secret_requested), |
1073 | - NULL, NULL, NULL, |
1074 | - G_TYPE_NONE, 5, |
1075 | - G_TYPE_UINT, G_TYPE_POINTER, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_UINT); |
1076 | - |
1077 | - signals[REQUEST_CANCELLED] = g_signal_new (UNITY_SETTINGS_SECRET_AGENT_REQUEST_CANCELLED, |
1078 | - G_OBJECT_CLASS_TYPE (G_OBJECT_CLASS (klass)), |
1079 | - G_SIGNAL_RUN_FIRST, |
1080 | - G_STRUCT_OFFSET (UnitySettingsSecretAgentClass, request_cancelled), |
1081 | - NULL, NULL, NULL, |
1082 | - G_TYPE_NONE, 1, |
1083 | - G_TYPE_UINT); |
1084 | -} |
1085 | - |
1086 | - |
1087 | -static void |
1088 | -unity_settings_secret_agent_instance_init (UnitySettingsSecretAgent *self) |
1089 | -{ |
1090 | - self->priv = UNITY_SETTINGS_SECRET_AGENT_GET_PRIVATE (self); |
1091 | - self->priv->requests = g_queue_new (); |
1092 | -} |
1093 | - |
1094 | -GType |
1095 | -unity_settings_secret_agent_get_type (void) |
1096 | -{ |
1097 | - static volatile gsize unity_settings_secret_agent_type_id__volatile = 0; |
1098 | - if (g_once_init_enter (&unity_settings_secret_agent_type_id__volatile)) |
1099 | - { |
1100 | - static const GTypeInfo g_define_type_info = |
1101 | - { |
1102 | - sizeof (UnitySettingsSecretAgentClass), |
1103 | - (GBaseInitFunc) NULL, |
1104 | - (GBaseFinalizeFunc) NULL, |
1105 | - (GClassInitFunc) unity_settings_secret_agent_class_init, |
1106 | - (GClassFinalizeFunc) NULL, |
1107 | - NULL, |
1108 | - sizeof (UnitySettingsSecretAgent), |
1109 | - 0, |
1110 | - (GInstanceInitFunc) unity_settings_secret_agent_instance_init, |
1111 | - NULL |
1112 | - }; |
1113 | - GType unity_settings_secret_agent_type_id; |
1114 | - unity_settings_secret_agent_type_id = g_type_register_static (NM_TYPE_SECRET_AGENT, |
1115 | - "UnitySettingsSecretAgent", |
1116 | - &g_define_type_info, |
1117 | - 0); |
1118 | - g_once_init_leave (&unity_settings_secret_agent_type_id__volatile, |
1119 | - unity_settings_secret_agent_type_id); |
1120 | - } |
1121 | - |
1122 | - return unity_settings_secret_agent_type_id__volatile; |
1123 | -} |
1124 | |
1125 | === removed file 'plugins/Unity/Indicators/Network/secret-agent.h' |
1126 | --- plugins/Unity/Indicators/Network/secret-agent.h 2013-06-07 12:51:16 +0000 |
1127 | +++ plugins/Unity/Indicators/Network/secret-agent.h 1970-01-01 00:00:00 +0000 |
1128 | @@ -1,102 +0,0 @@ |
1129 | -/* |
1130 | - * Copyright 2013 Canonical Ltd. |
1131 | - * |
1132 | - * This program is free software; you can redistribute it and/or modify |
1133 | - * it under the terms of the GNU Lesser General Public License as published by |
1134 | - * the Free Software Foundation; version 3. |
1135 | - * |
1136 | - * This program is distributed in the hope that it will be useful, |
1137 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1138 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1139 | - * GNU Lesser General Public License for more details. |
1140 | - * |
1141 | - * You should have received a copy of the GNU Lesser General Public License |
1142 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1143 | - * |
1144 | - * Authors: |
1145 | - * Alberto Ruiz <alberto.ruiz@canonical.com> |
1146 | - * Renato Araujo Oliveira Filho <renato@canonical.com> |
1147 | - */ |
1148 | - |
1149 | -#ifndef __SECRET_AGENT_H__ |
1150 | -#define __SECRET_AGENT_H__ |
1151 | - |
1152 | -#include <glib.h> |
1153 | -#include <glib-object.h> |
1154 | -#include <nm-secret-agent.h> |
1155 | - |
1156 | -/* |
1157 | - * This class is a basic implementation of the NetworkManager SecretAgent base class. |
1158 | - * |
1159 | - * The purpose of this class is to handle credential requests from the network, |
1160 | - * for example, from a WiFi hotspot or a VPN network. |
1161 | - * |
1162 | - * It queues requests objects (SecretRequest) on a GQueue in the private struct |
1163 | - * of the class. And notifies the consumer of the class through the "secret-request" |
1164 | - * and the "request-cancelled" signals with the following callback prototypes: |
1165 | - * |
1166 | - * void (*secret_requested) (UnitySettingsSecretAgent *self, |
1167 | - * guint id, |
1168 | - * NMConnection *connection, |
1169 | - * const char *setting_name, |
1170 | - * const char **hints, |
1171 | - * NMSecretAgentGetSecretsFlags flags, |
1172 | - * gpointer user_data); |
1173 | - * |
1174 | - * void (*request_cancelled) (UnitySettingsSecretAgent *self, |
1175 | - * guint id, |
1176 | - * gpointer user_data); |
1177 | - * |
1178 | - */ |
1179 | - |
1180 | - |
1181 | -G_BEGIN_DECLS |
1182 | - |
1183 | - |
1184 | -#define UNITY_SETTINGS_TYPE_SECRET_AGENT (unity_settings_secret_agent_get_type ()) |
1185 | -#define UNITY_SETTINGS_SECRET_AGENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_SETTINGS_TYPE_SECRET_AGENT, UnitySettingsSecretAgent)) |
1186 | -#define UNITY_SETTINGS_SECRET_AGENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_SETTINGS_TYPE_SECRET_AGENT, UnitySettingsSecretAgentClass)) |
1187 | -#define UNITY_SETTINGS_IS_SECRET_AGENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_SETTINGS_TYPE_SECRET_AGENT)) |
1188 | -#define UNITY_SETTINGS_IS_SECRET_AGENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_SETTINGS_TYPE_SECRET_AGENT)) |
1189 | -#define UNITY_SETTINGS_SECRET_AGENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_SETTINGS_TYPE_SECRET_AGENT, UnitySettingsSecretAgentClass)) |
1190 | - |
1191 | -#define UNITY_SETTINGS_SECRET_AGENT_SECRET_REQUESTED "secret-requested" |
1192 | -#define UNITY_SETTINGS_SECRET_AGENT_REQUEST_CANCELLED "request-cancelled" |
1193 | - |
1194 | -typedef struct _UnitySettingsSecretAgent UnitySettingsSecretAgent; |
1195 | -typedef struct _UnitySettingsSecretAgentClass UnitySettingsSecretAgentClass; |
1196 | -typedef struct _UnitySettingsSecretAgentPrivate UnitySettingsSecretAgentPrivate; |
1197 | - |
1198 | -struct _UnitySettingsSecretAgent { |
1199 | - NMSecretAgent parent_instance; |
1200 | - UnitySettingsSecretAgentPrivate * priv; |
1201 | -}; |
1202 | - |
1203 | -struct _UnitySettingsSecretAgentClass { |
1204 | - NMSecretAgentClass parent_class; |
1205 | - |
1206 | - void (*secret_requested) (UnitySettingsSecretAgent *self, |
1207 | - guint id, |
1208 | - NMConnection *connection, |
1209 | - const char *setting_name, |
1210 | - const char **hints, |
1211 | - NMSecretAgentGetSecretsFlags flags); |
1212 | - |
1213 | - void (*request_cancelled) (UnitySettingsSecretAgent *self, |
1214 | - guint id); |
1215 | -}; |
1216 | - |
1217 | - |
1218 | -GType unity_settings_secret_agent_get_type (void) G_GNUC_CONST; |
1219 | -UnitySettingsSecretAgent* unity_settings_secret_agent_new (void); |
1220 | -UnitySettingsSecretAgent* unity_settings_secret_agent_construct (GType object_type); |
1221 | - |
1222 | -void unity_settings_secret_agent_provide_secret (UnitySettingsSecretAgent *agent, |
1223 | - guint request, |
1224 | - GHashTable *secrets); |
1225 | -void unity_settings_secret_agent_cancel_request (UnitySettingsSecretAgent *agent, |
1226 | - guint request); |
1227 | - |
1228 | -G_END_DECLS |
1229 | - |
1230 | -#endif |
1231 | |
1232 | === modified file 'plugins/Unity/Indicators/indicatorsmodel.cpp' |
1233 | --- plugins/Unity/Indicators/indicatorsmodel.cpp 2013-10-02 16:07:39 +0000 |
1234 | +++ plugins/Unity/Indicators/indicatorsmodel.cpp 2013-10-03 12:34:55 +0000 |
1235 | @@ -214,21 +214,6 @@ |
1236 | return 1; |
1237 | } |
1238 | |
1239 | -/*! \internal */ |
1240 | -QVariant IndicatorsModel::defaultData(Indicator::Ptr indicator, int role) |
1241 | -{ |
1242 | - switch (role) |
1243 | - { |
1244 | - case IndicatorsModelRole::Position: |
1245 | - return 0; |
1246 | - case IndicatorsModelRole::WidgetSource: |
1247 | - return shellAppDirectory()+"/Panel/Indicators/DefaultIndicatorWidget.qml"; |
1248 | - case IndicatorsModelRole::PageSource: |
1249 | - return shellAppDirectory()+"/Panel/Indicators/DefaultIndicatorPage.qml"; |
1250 | - } |
1251 | - return QVariant(); |
1252 | -} |
1253 | - |
1254 | Q_INVOKABLE QVariant IndicatorsModel::data(int row, int role) const |
1255 | { |
1256 | return data(index(row, 0), role); |
1257 | @@ -263,26 +248,15 @@ |
1258 | } |
1259 | break; |
1260 | case IndicatorsModelRole::WidgetSource: |
1261 | + return shellAppDirectory()+"/Panel/Indicators/DefaultIndicatorWidget.qml"; |
1262 | case IndicatorsModelRole::PageSource: |
1263 | - return indicatorData(indicator, role); |
1264 | + return shellAppDirectory()+"/Panel/Indicators/DefaultIndicatorPage.qml"; |
1265 | default: |
1266 | break; |
1267 | } |
1268 | return QVariant(); |
1269 | } |
1270 | |
1271 | -QVariant IndicatorsModel::indicatorData(const Indicator::Ptr& indicator, int role) const |
1272 | -{ |
1273 | - if (indicator && m_parsed_indicator_data.contains(indicator->identifier())) |
1274 | - { |
1275 | - QVariantMap data = m_parsed_indicator_data[indicator->identifier()]; |
1276 | - if (data.contains(roleNames()[role])) { |
1277 | - return data[roleNames()[role]]; |
1278 | - } |
1279 | - } |
1280 | - return defaultData(indicator, role); |
1281 | -} |
1282 | - |
1283 | /*! \internal */ |
1284 | QModelIndex IndicatorsModel::parent(const QModelIndex&) const |
1285 | { |
1286 | @@ -294,24 +268,3 @@ |
1287 | { |
1288 | return m_indicators.count(); |
1289 | } |
1290 | - |
1291 | -void IndicatorsModel::setIndicatorData(const QVariant& data) |
1292 | -{ |
1293 | - m_indicator_data = data; |
1294 | - |
1295 | - m_parsed_indicator_data.clear(); |
1296 | - QMap<QString, QVariant> map = data.toMap(); |
1297 | - QMapIterator<QString, QVariant> iter(map); |
1298 | - while(iter.hasNext()) |
1299 | - { |
1300 | - iter.next(); |
1301 | - m_parsed_indicator_data[iter.key()] = iter.value().toMap(); |
1302 | - } |
1303 | - |
1304 | - Q_EMIT indicatorDataChanged(m_indicator_data); |
1305 | -} |
1306 | - |
1307 | -QVariant IndicatorsModel::indicatorData() const |
1308 | -{ |
1309 | - return m_indicator_data; |
1310 | -} |
1311 | |
1312 | === modified file 'plugins/Unity/Indicators/indicatorsmodel.h' |
1313 | --- plugins/Unity/Indicators/indicatorsmodel.h 2013-09-02 07:39:53 +0000 |
1314 | +++ plugins/Unity/Indicators/indicatorsmodel.h 2013-10-03 12:34:55 +0000 |
1315 | @@ -34,7 +34,6 @@ |
1316 | Q_OBJECT |
1317 | Q_ENUMS(Roles) |
1318 | Q_PROPERTY(int count READ count NOTIFY countChanged) |
1319 | - Q_PROPERTY(QVariant indicatorData READ indicatorData WRITE setIndicatorData NOTIFY indicatorDataChanged) |
1320 | |
1321 | public: |
1322 | |
1323 | @@ -53,9 +52,6 @@ |
1324 | QModelIndex parent (const QModelIndex &index) const; |
1325 | int rowCount(const QModelIndex &parent = QModelIndex()) const; |
1326 | |
1327 | - void setIndicatorData(const QVariant& data); |
1328 | - QVariant indicatorData() const; |
1329 | - |
1330 | |
1331 | Q_SIGNALS: |
1332 | void countChanged(); |
1333 | @@ -71,13 +67,9 @@ |
1334 | IndicatorsManager *m_manager; |
1335 | |
1336 | QList<Indicator::Ptr> m_indicators; |
1337 | - QVariant m_indicator_data; |
1338 | - QMap<QString, QVariantMap> m_parsed_indicator_data; |
1339 | |
1340 | void notifyDataChanged(QObject *sender, int role); |
1341 | int count() const; |
1342 | - QVariant indicatorData(const Indicator::Ptr& indicator, int role) const; |
1343 | - static QVariant defaultData(Indicator::Ptr indicator, int role); |
1344 | }; |
1345 | |
1346 | #endif // INDICATORSMODEL_H |
FAILED: Continuous integration, rev:249 jenkins. qa.ubuntu. com/job/ unity8- ci/1205/ jenkins. qa.ubuntu. com/job/ generic- mediumtests- saucy/4307 jenkins. qa.ubuntu. com/job/ generic- mediumtests- touch/2015 jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- saucy/1981 jenkins. qa.ubuntu. com/job/ unity8- saucy-amd64- ci/228 jenkins. qa.ubuntu. com/job/ unity8- saucy-armhf- ci/1205 jenkins. qa.ubuntu. com/job/ unity8- saucy-armhf- ci/1205/ artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ unity8- saucy-i386- ci/1204 jenkins. qa.ubuntu. com/job/ autopilot- testrunner- otto-saucy/ 597 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy-amd64/ 176 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy-amd64/ 176/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy-armhf/ 2017 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy-armhf/ 2017/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ generic- mediumtests- runner- maguro/ 1705 jenkins. qa.ubuntu. com/job/ generic- mediumtests- runner- mako/1722
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
UNSTABLE: http://
Click here to trigger a rebuild: s-jenkins: 8080/job/ unity8- ci/1205/ rebuild
http://