Merge lp:~aacid/ubuntu-settings-components/remove_StatusIcon into lp:ubuntu-settings-components

Proposed by Albert Astals Cid
Status: Merged
Approved by: Andrea Cimitan
Approved revision: 156
Merged at revision: 158
Proposed branch: lp:~aacid/ubuntu-settings-components/remove_StatusIcon
Merge into: lp:ubuntu-settings-components
Diff against target: 279 lines (+0/-239)
5 files modified
examples/OtherComponents.qml (+0/-29)
plugins/Ubuntu/Settings/Components/StatusIcon.qml (+0/-129)
plugins/Ubuntu/Settings/Components/qmldir (+0/-1)
tests/qmltests/CMakeLists.txt (+0/-1)
tests/qmltests/Components/tst_StatusIcon.qml (+0/-79)
To merge this branch: bzr merge lp:~aacid/ubuntu-settings-components/remove_StatusIcon
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Approve
Andrea Cimitan (community) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+298800@code.launchpad.net

Commit message

Remove StatusIcon, we've moved to SDK Icon

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

 * If you changed localized strings, has the POT file been updated?
N/A

To post a comment you must log in.
Revision history for this message
Andrea Cimitan (cimi) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
also checked no other StatusIcon strings present in the code
 * Did CI run pass? If not, please explain why.
waiting

review: Approve
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:156
https://unity8-jenkins.ubuntu.com/job/lp-ubuntu-settings-components-ci/43/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2197
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2225
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2131
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2131
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2131
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2122
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2122/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2122
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2122/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2122
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2122/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2122
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2122/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2122
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2122/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2122
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2122/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2122
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2122/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2122
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2122/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2122
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2122/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-ubuntu-settings-components-ci/43/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/OtherComponents.qml'
2--- examples/OtherComponents.qml 2016-02-11 11:23:02 +0000
3+++ examples/OtherComponents.qml 2016-06-30 15:45:36 +0000
4@@ -225,35 +225,6 @@
5 }
6 }
7 }
8-
9- Row {
10- anchors {
11- left: parent.left
12- right: parent.right
13- }
14-
15- spacing: units.gu(1)
16-
17- Label {
18- text: "StatusIcon"
19- anchors.verticalCenter: parent.verticalCenter
20- }
21-
22- StatusIcon {
23- height: units.gu(5)
24- source: "image://theme/gps"
25- }
26-
27- StatusIcon {
28- height: units.gu(5)
29- source: "image://theme/battery-caution"
30- }
31-
32- StatusIcon {
33- height: units.gu(5)
34- source: "image://theme/missing,gpm-battery-000-charging"
35- }
36- }
37 }
38 }
39 }
40
41=== removed file 'plugins/Ubuntu/Settings/Components/StatusIcon.qml'
42--- plugins/Ubuntu/Settings/Components/StatusIcon.qml 2016-02-11 11:23:02 +0000
43+++ plugins/Ubuntu/Settings/Components/StatusIcon.qml 1970-01-01 00:00:00 +0000
44@@ -1,129 +0,0 @@
45-/*
46- * Copyright 2014 Canonical Ltd.
47- *
48- * This program is free software; you can redistribute it and/or modify
49- * it under the terms of the GNU General Public License as published by
50- * the Free Software Foundation; version 3.
51- *
52- * This program is distributed in the hope that it will be useful,
53- * but WITHOUT ANY WARRANTY; without even the implied warranty of
54- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
55- * GNU General Public License for more details.
56- *
57- * You should have received a copy of the GNU General Public License
58- * along with this program. If not, see <http://www.gnu.org/licenses/>.
59- */
60-
61-import QtQuick 2.4
62-
63-Item {
64- id: root
65-
66- /*!
67- The source of the icon to display.
68- \qmlproperty url source
69- */
70- property url source
71-
72- /*!
73- The color that all pixels that originally are of color \l keyColor should take.
74- \qmlproperty color color
75- */
76- property alias color: colorizedImage.keyColorOut
77-
78- /*!
79- The color of the pixels that should be colorized.
80- By default it is set to #808080.
81- \qmlproperty color keyColor
82- */
83- property alias keyColor: colorizedImage.keyColorIn
84-
85- // FIXME: should only be "status", but overriding in settings app doesn't work.
86- property var sets: ["status","apps"]
87-
88- implicitWidth: image.width
89-
90- Image {
91- id: image
92- objectName: "image"
93- anchors { top: parent.top; bottom: parent.bottom }
94- sourceSize.height: height
95-
96- visible: !colorizedImage.active
97-
98- property string iconPath: "/usr/share/icons/suru/%1/scalable/%2.svg"
99- property var icons: {
100- if (String(root.source).match(/^image:\/\/theme/)) {
101- return String(root.source).replace("image://theme/", "").split(",");
102- } else return null;
103- }
104- property int fallback: 0
105- property int setFallback: 0
106-
107- Component.onCompleted: updateSource()
108- onStatusChanged: if (status == Image.Error) bump();
109- onIconsChanged: reset()
110-
111- Connections {
112- target: root
113- onSetsChanged: image.reset()
114- }
115-
116- function reset() {
117- fallback = 0;
118- setFallback = 0;
119-
120- updateSource();
121- }
122-
123- function bump() {
124- if (icons === null) return;
125- if (fallback < icons.length - 1) fallback += 1;
126- else if (setFallback < root.sets.length - 1) {
127- setFallback += 1;
128- fallback = 0;
129- } else {
130- console.warn("Could not load StatusIcon with source \"%1\" and sets %2.".arg(root.source).arg(root.sets));
131- return;
132- }
133-
134- updateSource();
135- }
136-
137- function updateSource() {
138- if (icons === null) {
139- source = root.source;
140- } else {
141- source = (root.sets && root.sets.length > setFallback) && (icons && icons.length > fallback) ?
142- iconPath.arg(root.sets[setFallback]).arg(icons[fallback]) : "";
143- }
144- }
145- }
146-
147- ShaderEffect {
148- id: colorizedImage
149-
150- anchors.fill: parent
151- visible: active && image.status == Image.Ready
152-
153- // Whether or not a color has been set.
154- property bool active: keyColorOut != Qt.rgba(0.0, 0.0, 0.0, 0.0)
155-
156- property Image source: visible ? image : null
157- property color keyColorOut: Qt.rgba(0.0, 0.0, 0.0, 0.0)
158- property color keyColorIn: "#808080"
159- property real threshold: 0.1
160-
161- fragmentShader: "
162- varying highp vec2 qt_TexCoord0;
163- uniform sampler2D source;
164- uniform highp vec4 keyColorOut;
165- uniform highp vec4 keyColorIn;
166- uniform lowp float threshold;
167- uniform lowp float qt_Opacity;
168- void main() {
169- lowp vec4 sourceColor = texture2D(source, qt_TexCoord0);
170- gl_FragColor = mix(vec4(keyColorOut.rgb, 1.0) * sourceColor.a, sourceColor, step(threshold, distance(sourceColor.rgb / sourceColor.a, keyColorIn.rgb))) * qt_Opacity;
171- }"
172- }
173-}
174
175=== modified file 'plugins/Ubuntu/Settings/Components/qmldir'
176--- plugins/Ubuntu/Settings/Components/qmldir 2015-04-07 09:42:19 +0000
177+++ plugins/Ubuntu/Settings/Components/qmldir 2016-06-30 15:45:36 +0000
178@@ -6,5 +6,4 @@
179 Calendar 0.1 Calendar.qml
180 MessageHeader 0.1 MessageHeader.qml
181 QuickReply 0.1 QuickReply.qml
182-StatusIcon 0.1 StatusIcon.qml
183 UbuntuShapeForItem 0.1 UbuntuShapeForItem.qml
184
185=== modified file 'tests/qmltests/CMakeLists.txt'
186--- tests/qmltests/CMakeLists.txt 2016-06-15 10:45:27 +0000
187+++ tests/qmltests/CMakeLists.txt 2016-06-30 15:45:36 +0000
188@@ -14,7 +14,6 @@
189
190 add_qml_test(Components Calendar)
191 add_qml_test(Components ServerPropertySynchroniser)
192-add_qml_test(Components StatusIcon)
193
194 add_qml_test(Menus AccessPointMenu)
195 add_qml_test(Menus ButtonMenu)
196
197=== removed file 'tests/qmltests/Components/tst_StatusIcon.qml'
198--- tests/qmltests/Components/tst_StatusIcon.qml 2016-02-11 11:23:02 +0000
199+++ tests/qmltests/Components/tst_StatusIcon.qml 1970-01-01 00:00:00 +0000
200@@ -1,79 +0,0 @@
201-/*
202- * Copyright 2014 Canonical Ltd.
203- *
204- * This program is free software; you can redistribute it and/or modify
205- * it under the terms of the GNU General Public License as published by
206- * the Free Software Foundation; version 3.
207- *
208- * This program is distributed in the hope that it will be useful,
209- * but WITHOUT ANY WARRANTY; without even the implied warranty of
210- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
211- * GNU General Public License for more details.
212- *
213- * You should have received a copy of the GNU General Public License
214- * along with this program. If not, see <http://www.gnu.org/licenses/>.
215- */
216-
217-import QtQuick 2.4
218-import QtTest 1.0
219-import Ubuntu.Test 0.1
220-import Ubuntu.Settings.Components 0.1
221-
222-Item {
223- width: units.gu(40)
224- height: units.gu(70)
225-
226- StatusIcon {
227- id: icon
228-
229- height: units.gu(3)
230- }
231-
232- UbuntuTestCase {
233- name: "StatusIcon"
234- when: windowShown
235-
236- function init() {
237- icon.source = "";
238- icon.sets = [ "status" ]
239- waitForRendering(icon)
240- }
241-
242- function test_icon() {
243- icon.source = "image://theme/bar,gps,baz";
244-
245- var image = findChild(icon, "image");
246- tryCompare(image, "source", "file://" + image.iconPath.arg("status").arg("gps"));
247- }
248-
249- function test_iconFallback() {
250- icon.source = "image://theme/foo,bar,baz";
251-
252- var image = findChild(icon, "image");
253- tryCompare(image, "source", "file://" + image.iconPath.arg("status").arg("baz"));
254- }
255-
256- function test_iconSets() {
257- icon.source = "image://theme/bar,add,baz";
258- icon.sets = [ "foo", "actions", "bar" ]
259-
260- var image = findChild(icon, "image");
261- tryCompare(image, "source", "file://" + image.iconPath.arg("actions").arg("add"));
262- }
263-
264- function test_iconSetsFallback() {
265- icon.source = "image://theme/add,bar,baz";
266- icon.sets = [ "foo", "bar", "baz" ]
267-
268- var image = findChild(icon, "image");
269- tryCompare(image, "source", "file://" + image.iconPath.arg("baz").arg("baz"));
270- }
271-
272- function test_iconSource() {
273- var image = findChild(icon, "image");
274- icon.source = image.iconPath.arg("status").arg("gps");
275-
276- tryCompare(image, "source", "file://" + image.iconPath.arg("status").arg("gps"));
277- }
278- }
279-}

Subscribers

People subscribed via source and target branches

to all changes: