Merge lp:~saviq/unity8/drop-network-agents into lp:unity8

Proposed by Michał Sawicz
Status: Merged
Approved by: Francis Ginther
Approved revision: 254
Merged at revision: 390
Proposed branch: lp:~saviq/unity8/drop-network-agents
Merge into: lp:unity8
Prerequisite: lp:~saviq/unity8/bump-to-7.82
Diff against target: 1325 lines (+11/-1144)
17 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/control (+2/-6)
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
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Nick Dedekind (community) Approve
Review via email: mp+189063@code.launchpad.net

This proposal supersedes a proposal from 2013-10-03.

Commit message

Drop network agents now that they're in indicator-network instead.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:249
http://jenkins.qa.ubuntu.com/job/unity8-ci/1205/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/4307
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/2015
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/1981
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/228
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1205
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1205/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1204
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/597
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/176
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/176/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2017
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2017/artifact/work/output/*zip*/output.zip
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/1705
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/1722

Click here to trigger a rebuild:
http://s-jenkins:8080/job/unity8-ci/1205/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

PASSED: Continuous integration, rev:250
http://jenkins.qa.ubuntu.com/job/unity8-ci/1242/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/4450
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/2205
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/2048
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/265
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1242
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1242/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1241
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/732
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/325
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/325/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2207
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2207/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/1881
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/1898

Click here to trigger a rebuild:
http://s-jenkins:8080/job/unity8-ci/1242/rebuild

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

PASSED: Continuous integration, rev:251
http://jenkins.qa.ubuntu.com/job/unity8-ci/1243/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/4454
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/2211
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/2050
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/266
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1243
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1243/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1242
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/736
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/329
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/329/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2213
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2213/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/1885
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/1902

Click here to trigger a rebuild:
http://s-jenkins:8080/job/unity8-ci/1243/rebuild

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

PASSED: Continuous integration, rev:252
http://jenkins.qa.ubuntu.com/job/unity8-ci/1244/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/4459
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/2218
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/2052
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/267
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1244
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1244/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1243
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/741
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/334
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/334/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2220
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2220/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/1891
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/1908

Click here to trigger a rebuild:
http://s-jenkins:8080/job/unity8-ci/1244/rebuild

review: Approve (continuous-integration)
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:254
http://jenkins.qa.ubuntu.com/job/unity8-ci/1247/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/4466/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/2226/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/2056
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/270
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1247
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1247/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1246
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/748/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/341
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/341/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2228
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2228/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/1898/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/1916

Click here to trigger a rebuild:
http://s-jenkins:8080/job/unity8-ci/1247/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/unity8-autolanding/562/
Executed test runs:
    SUCCESS: http://s-jenkins:8080/job/generic-cleanup-mbs/2674
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/4503
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/2278/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/2072
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-autolanding/147
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-autolanding/566
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-autolanding/566/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-autolanding/566
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/787
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/378
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/378/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2280
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2280/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/1953/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/1967

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/unity8-autolanding/566/
Executed test runs:
    SUCCESS: http://s-jenkins:8080/job/generic-cleanup-mbs/2682
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/4511
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/2286/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/2076
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-autolanding/151
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-autolanding/570
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-autolanding/570/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-autolanding/570
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/795
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/386
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/386/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2288
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2288/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/1961
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/1975/console

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

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

Subscribers

People subscribed via source and target branches