Merge lp:~paulliu/unity8/noninteractive20140804 into lp:unity8

Proposed by Ying-Chun Liu
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 1129
Merged at revision: 1387
Proposed branch: lp:~paulliu/unity8/noninteractive20140804
Merge into: lp:unity8
Diff against target: 158 lines (+51/-2)
9 files modified
plugins/Dash/CardCreator.js (+3/-1)
tests/plugins/Dash/cardcreator/1.res (+2/-0)
tests/plugins/Dash/cardcreator/2.res (+2/-0)
tests/plugins/Dash/cardcreator/3.res (+2/-0)
tests/plugins/Dash/cardcreator/4.res (+2/-0)
tests/plugins/Dash/cardcreator/5.res (+3/-1)
tests/plugins/Dash/cardcreator/6.res (+2/-0)
tests/plugins/Dash/cardcreator/7.res (+2/-0)
tests/qmltests/Dash/tst_GenericScopeView.qml (+33/-0)
To merge this branch: bzr merge lp:~paulliu/unity8/noninteractive20140804
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Albert Astals Cid (community) Approve
Review via email: mp+231746@code.launchpad.net

Commit message

Add non-interactive code into GenericScopeView.

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

To post a comment you must log in.
1118. By Ying-Chun Liu on 2014-09-11

Merge trunk.

Albert Astals Cid (aacid) wrote :

What's this for? Can you please link at the spec/use for this flag?

review: Needs Information
Albert Astals Cid (aacid) wrote :

Text conflict in qml/Dash/GenericScopeView.qml
Text conflict in tests/plugins/Dash/cardcreator/1.res
Text conflict in tests/plugins/Dash/cardcreator/3.res
Text conflict in tests/plugins/Dash/cardcreator/5.res
4 conflicts encountered.

1119. By Ying-Chun Liu on 2014-09-23

merge trunk

Albert Astals Cid (aacid) wrote :

Text conflict in tests/plugins/Dash/cardcreator/1.res
Text conflict in tests/plugins/Dash/cardcreator/2.res
Text conflict in tests/plugins/Dash/cardcreator/3.res
Text conflict in tests/plugins/Dash/cardcreator/4.res
Text conflict in tests/plugins/Dash/cardcreator/5.res
Text conflict in tests/plugins/Dash/cardcreator/6.res
Text conflict in tests/plugins/Dash/cardcreator/7.res
Text conflict in tests/qmltests/Dash/tst_GenericScopeView.qml
8 conflicts encountered.

review: Needs Fixing
1120. By Ying-Chun Liu on 2014-10-08

merge trunk

Albert Astals Cid (aacid) wrote :

Paul, there's something weird in your tests/plugins/Dash/cardcreator/*.res diffs, you hardly changed anything on CardCreator.js but there's lots of changes in this diff, can you check why and remove them if not really needed?

review: Needs Fixing
1121. By Ying-Chun Liu on 2014-10-09

Fix results

1122. By Ying-Chun Liu on 2014-10-09

remove empty lines

Albert Astals Cid (aacid) wrote :

Wouldn't it be easier to just set the enabled property of the button to false?

review: Needs Information
1123. By Ying-Chun Liu on 2014-10-14

merge trunk

1124. By Ying-Chun Liu on 2014-10-14

Use enabled property

1125. By Ying-Chun Liu on 2014-10-14

Fix card result

Ying-Chun Liu (paulliu) wrote :

Seems using enabled property of the AbstractButton not working as expected.

Inside the AbstractButton, there's MouseArea. And it only looks private __acceptEvents for accepting or not. Not the enabled property inherit from ActionItem.

Albert Astals Cid (aacid) wrote :

> Seems using enabled property of the AbstractButton not working as expected.
>
> Inside the AbstractButton, there's MouseArea. And it only looks private
> __acceptEvents for accepting or not. Not the enabled property inherit from
> ActionItem.

That's strange i just did an AbstractButton and set it to disabled and it's internal mouse area is also disabled.

1126. By Ying-Chun Liu on 2014-10-20

Fix unit tests

1127. By Ying-Chun Liu on 2014-10-20

Merge trunk

Albert Astals Cid (aacid) wrote :

Do we need the change for "visible:" in CardCreator? Since the card is never enabled root.pressed should never be true, so i think we don't really need that change, no?

review: Needs Information
1128. By Ying-Chun Liu on 2014-10-20

Don't modify touchdown visible

1129. By Ying-Chun Liu on 2014-10-21

Save objectName for rendererLoader.

Albert Astals Cid (aacid) :
review: Approve
Albert Astals Cid (aacid) wrote :

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

 * Did CI run pass? If not, please explain why.
No, unrelated

 * Did you make sure that the branch does not contain spurious tags?
Yes

review: Approve
1130. By Ying-Chun Liu on 2014-10-27

Merge trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Dash/CardCreator.js'
2--- plugins/Dash/CardCreator.js 2014-10-10 11:13:26 +0000
3+++ plugins/Dash/CardCreator.js 2014-10-27 13:45:30 +0000
4@@ -313,7 +313,9 @@
5 readonly property string title: cardData && cardData["title"] || ""; \n\
6 property bool asynchronous: true; \n\
7 property bool showHeader: true; \n\
8- implicitWidth: childrenRect.width; \n';
9+ implicitWidth: childrenRect.width; \n\
10+ enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true); \n\
11+ \n';
12
13 var hasArt = components["art"] && components["art"]["field"] || false;
14 var hasSummary = components["summary"] || false;
15
16=== modified file 'tests/plugins/Dash/cardcreator/1.res'
17--- tests/plugins/Dash/cardcreator/1.res 2014-10-06 08:01:08 +0000
18+++ tests/plugins/Dash/cardcreator/1.res 2014-10-27 13:45:30 +0000
19@@ -13,6 +13,8 @@
20 property bool asynchronous: true;
21 property bool showHeader: true;
22 implicitWidth: childrenRect.width;
23+ enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
24+
25 onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
26 readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
27 Item {
28
29=== modified file 'tests/plugins/Dash/cardcreator/2.res'
30--- tests/plugins/Dash/cardcreator/2.res 2014-10-10 11:13:26 +0000
31+++ tests/plugins/Dash/cardcreator/2.res 2014-10-27 13:45:30 +0000
32@@ -13,6 +13,8 @@
33 property bool asynchronous: true;
34 property bool showHeader: true;
35 implicitWidth: childrenRect.width;
36+ enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
37+
38 Loader {
39 id: backgroundLoader;
40 objectName: "backgroundLoader";
41
42=== modified file 'tests/plugins/Dash/cardcreator/3.res'
43--- tests/plugins/Dash/cardcreator/3.res 2014-10-06 08:01:08 +0000
44+++ tests/plugins/Dash/cardcreator/3.res 2014-10-27 13:45:30 +0000
45@@ -13,6 +13,8 @@
46 property bool asynchronous: true;
47 property bool showHeader: true;
48 implicitWidth: childrenRect.width;
49+ enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
50+
51 onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
52 readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
53 Item {
54
55=== modified file 'tests/plugins/Dash/cardcreator/4.res'
56--- tests/plugins/Dash/cardcreator/4.res 2014-10-06 08:01:08 +0000
57+++ tests/plugins/Dash/cardcreator/4.res 2014-10-27 13:45:30 +0000
58@@ -13,6 +13,8 @@
59 property bool asynchronous: true;
60 property bool showHeader: true;
61 implicitWidth: childrenRect.width;
62+ enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
63+
64 readonly property size artShapeSize: Qt.size(-1, -1);
65 readonly property int headerHeight: row.height;
66 Row {
67
68=== modified file 'tests/plugins/Dash/cardcreator/5.res'
69--- tests/plugins/Dash/cardcreator/5.res 2014-10-10 11:13:26 +0000
70+++ tests/plugins/Dash/cardcreator/5.res 2014-10-27 13:45:30 +0000
71@@ -13,6 +13,8 @@
72 property bool asynchronous: true;
73 property bool showHeader: true;
74 implicitWidth: childrenRect.width;
75+ enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
76+
77 onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
78 readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
79 Item {
80@@ -143,7 +145,7 @@
81 id: touchdown;
82 objectName: "touchdown";
83 anchors { fill: artShapeHolder }
84- visible: root.pressed;
85+ visible: root.pressed;
86 radius: "medium";
87 borderSource: "radius_pressed.sci"
88 }
89
90=== modified file 'tests/plugins/Dash/cardcreator/6.res'
91--- tests/plugins/Dash/cardcreator/6.res 2014-09-29 08:19:06 +0000
92+++ tests/plugins/Dash/cardcreator/6.res 2014-10-27 13:45:30 +0000
93@@ -13,6 +13,8 @@
94 property bool asynchronous: true;
95 property bool showHeader: true;
96 implicitWidth: childrenRect.width;
97+ enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
98+
99 Loader {
100 id: backgroundLoader;
101 objectName: "backgroundLoader";
102
103=== modified file 'tests/plugins/Dash/cardcreator/7.res'
104--- tests/plugins/Dash/cardcreator/7.res 2014-10-10 11:13:26 +0000
105+++ tests/plugins/Dash/cardcreator/7.res 2014-10-27 13:45:30 +0000
106@@ -13,6 +13,8 @@
107 property bool asynchronous: true;
108 property bool showHeader: true;
109 implicitWidth: childrenRect.width;
110+ enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
111+
112 Loader {
113 id: backgroundLoader;
114 objectName: "backgroundLoader";
115
116=== modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml'
117--- tests/qmltests/Dash/tst_GenericScopeView.qml 2014-10-10 11:13:26 +0000
118+++ tests/qmltests/Dash/tst_GenericScopeView.qml 2014-10-27 13:45:30 +0000
119@@ -603,6 +603,39 @@
120 spy.wait()
121 compare(spy.count, 1)
122 }
123+
124+ function test_item_noninteractive() {
125+ waitForRendering(genericScopeView);
126+
127+ var categoryListView = findChild(genericScopeView, "categoryListView");
128+ waitForRendering(categoryListView);
129+
130+ var category0 = findChild(categoryListView, "dashCategory0");
131+ waitForRendering(category0);
132+
133+ var cardTool = findChild(category0, "cardTool");
134+ var cardGrid = category0.item;
135+
136+ cardTool.template["non-interactive"] = true;
137+ compare(cardGrid.cardTool.template["non-interactive"], true);
138+
139+ var item0 = findChild(cardGrid, "delegate0");
140+ waitForRendering(item0);
141+ item0.template = cardTool.template;
142+ compare(item0.template["non-interactive"], true);
143+ compare(item0.enabled, false);
144+ var touchdown = findChild(item0, "touchdown");
145+
146+ compare(touchdown.visible, false);
147+ mouseClick(item0, item0.width / 2, item0.height / 2);
148+ compare(touchdown.visible, false);
149+
150+ cardTool.template["non-interactive"] = false;
151+ compare(cardGrid.cardTool.template["non-interactive"], false);
152+ item0.template = cardTool.template;
153+ compare(item0.template["non-interactive"], false);
154+ compare(item0.enabled, true);
155+ }
156 }
157 }
158 }

Subscribers

People subscribed via source and target branches