Merge lp:~unity-team/unity8/scopes-v4 into lp:unity8
- scopes-v4
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~unity-team/unity8/scopes-v4 |
Merge into: | lp:unity8 |
Diff against target: |
1480 lines (+419/-328) 17 files modified
debian/control (+1/-1) qml/Dash/Dash.qml (+9/-11) qml/Dash/DashContent.qml (+3/-4) qml/Dash/DashNavigation.qml (+50/-43) qml/Dash/DashNavigationList.qml (+15/-14) qml/Dash/GenericScopeView.qml (+4/-11) qml/ScopeTool.qml (+1/-11) tests/mocks/Unity/CMakeLists.txt (+3/-3) tests/mocks/Unity/Unity.qmltypes (+73/-26) tests/mocks/Unity/fake_navigation.cpp (+36/-44) tests/mocks/Unity/fake_navigation.h (+13/-13) tests/mocks/Unity/fake_scope.cpp (+73/-25) tests/mocks/Unity/fake_scope.h (+16/-8) tests/mocks/Unity/fake_scopes.cpp (+10/-2) tests/mocks/Unity/fake_scopes.h (+1/-0) tests/mocks/Unity/fake_unity_plugin.cpp (+2/-2) tests/qmltests/Dash/tst_DashContent.qml (+109/-110) |
To merge this branch: | bzr merge lp:~unity-team/unity8/scopes-v4 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Albert Astals Cid (community) | Abstain | ||
Review via email: mp+229224@code.launchpad.net |
This proposal has been superseded by a proposal from 2014-08-06.
Commit message
Work with the scopes-v4 branch + departments-
Description of the change
* Are there any related MPs required for this MP to build/function as expected?
https:/
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes
* Did you make sure that your branch does not contain spurious tags?
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
Albert Astals Cid (aacid) : | # |
- 1095. By Albert Astals Cid
-
Fix scope tool
PS Jenkins bot (ps-jenkins) wrote : | # |
- 1096. By Albert Astals Cid
-
need new api-dev
- 1097. By Albert Astals Cid
-
Adapt to API changes
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1095
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1097
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1098. By Albert Astals Cid
-
Merge
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1098
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1099. By Albert Astals Cid
-
Dummy implement refresh()
- 1100. By Albert Astals Cid
-
Merge dashSepartments
ListTweaks - 1101. By Albert Astals Cid
-
Merge unstable departments test
- 1102. By Albert Astals Cid
-
Fix merge/tests
- 1103. By Albert Astals Cid
-
more renaming
- 1104. By Albert Astals Cid
-
New need implementation
- 1105. By Albert Astals Cid
-
More updates
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1101
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Unmerged revisions
Preview Diff
1 | === modified file 'debian/control' | |||
2 | --- debian/control 2014-07-31 16:48:11 +0000 | |||
3 | +++ debian/control 2014-08-06 10:17:24 +0000 | |||
4 | @@ -24,7 +24,7 @@ | |||
5 | 24 | libpulse-dev, | 24 | libpulse-dev, |
6 | 25 | libqmenumodel-dev (>= 0.2.8), | 25 | libqmenumodel-dev (>= 0.2.8), |
7 | 26 | libqt5xmlpatterns5-dev, | 26 | libqt5xmlpatterns5-dev, |
9 | 27 | libunity-api-dev (>= 7.87), | 27 | libunity-api-dev (>= 7.88), |
10 | 28 | libusermetricsoutput1-dev, | 28 | libusermetricsoutput1-dev, |
11 | 29 | libxcb1-dev, | 29 | libxcb1-dev, |
12 | 30 | pkg-config, | 30 | pkg-config, |
13 | 31 | 31 | ||
14 | === modified file 'qml/Dash/Dash.qml' | |||
15 | --- qml/Dash/Dash.qml 2014-07-29 11:35:10 +0000 | |||
16 | +++ qml/Dash/Dash.qml 2014-08-06 10:17:24 +0000 | |||
17 | @@ -38,7 +38,13 @@ | |||
18 | 38 | } | 38 | } |
19 | 39 | 39 | ||
20 | 40 | function setCurrentScope(scopeId, animate, reset) { | 40 | function setCurrentScope(scopeId, animate, reset) { |
22 | 41 | var scopeIndex = filteredScopes.findFirst(Scopes.RoleId, scopeId) | 41 | var scopeIndex = -1; |
23 | 42 | for (var i = 0; i < scopes.count; ++i) { | ||
24 | 43 | if (scopes.getScope(i).id == scopeId) { | ||
25 | 44 | scopeIndex = i; | ||
26 | 45 | break; | ||
27 | 46 | } | ||
28 | 47 | } | ||
29 | 42 | 48 | ||
30 | 43 | if (scopeIndex == -1) { | 49 | if (scopeIndex == -1) { |
31 | 44 | console.warn("No match for scope with id: %1".arg(scopeId)) | 50 | console.warn("No match for scope with id: %1".arg(scopeId)) |
32 | @@ -63,15 +69,8 @@ | |||
33 | 63 | } | 69 | } |
34 | 64 | } | 70 | } |
35 | 65 | 71 | ||
45 | 66 | SortFilterProxyModel { | 72 | Scopes { |
46 | 67 | id: filteredScopes | 73 | id: scopes |
38 | 68 | model: Scopes { | ||
39 | 69 | id: scopes | ||
40 | 70 | } | ||
41 | 71 | dynamicSortFilter: true | ||
42 | 72 | |||
43 | 73 | filterRole: Scopes.RoleVisible | ||
44 | 74 | filterRegExp: RegExp("^true$") | ||
47 | 75 | } | 74 | } |
48 | 76 | 75 | ||
49 | 77 | DashContent { | 76 | DashContent { |
50 | @@ -79,7 +78,6 @@ | |||
51 | 79 | objectName: "dashContent" | 78 | objectName: "dashContent" |
52 | 80 | width: parent.width | 79 | width: parent.width |
53 | 81 | height: parent.height | 80 | height: parent.height |
54 | 82 | model: filteredScopes | ||
55 | 83 | scopes: scopes | 81 | scopes: scopes |
56 | 84 | visible: x != -width | 82 | visible: x != -width |
57 | 85 | onGotoScope: { | 83 | onGotoScope: { |
58 | 86 | 84 | ||
59 | === modified file 'qml/Dash/DashContent.qml' | |||
60 | --- qml/Dash/DashContent.qml 2014-07-24 23:31:44 +0000 | |||
61 | +++ qml/Dash/DashContent.qml 2014-08-06 10:17:24 +0000 | |||
62 | @@ -23,8 +23,7 @@ | |||
63 | 23 | Item { | 23 | Item { |
64 | 24 | id: dashContent | 24 | id: dashContent |
65 | 25 | 25 | ||
68 | 26 | property var model: null | 26 | property alias scopes: dashContentList.model |
67 | 27 | property var scopes: null | ||
69 | 28 | readonly property alias currentIndex: dashContentList.currentIndex | 27 | readonly property alias currentIndex: dashContentList.currentIndex |
70 | 29 | 28 | ||
71 | 30 | signal scopeLoaded(string scopeId) | 29 | signal scopeLoaded(string scopeId) |
72 | @@ -89,10 +88,9 @@ | |||
73 | 89 | id: dashContentList | 88 | id: dashContentList |
74 | 90 | objectName: "dashContentList" | 89 | objectName: "dashContentList" |
75 | 91 | 90 | ||
77 | 92 | interactive: dashContent.scopes.loaded && currentItem && !currentItem.moving | 91 | interactive: dashContent.scopes.loaded && currentItem && !currentItem.moving && !currentItem.departmentsShown |
78 | 93 | 92 | ||
79 | 94 | anchors.fill: parent | 93 | anchors.fill: parent |
80 | 95 | model: dashContent.model | ||
81 | 96 | orientation: ListView.Horizontal | 94 | orientation: ListView.Horizontal |
82 | 97 | boundsBehavior: Flickable.DragAndOvershootBounds | 95 | boundsBehavior: Flickable.DragAndOvershootBounds |
83 | 98 | flickDeceleration: units.gu(625) | 96 | flickDeceleration: units.gu(625) |
84 | @@ -130,6 +128,7 @@ | |||
85 | 130 | objectName: scope.id + " loader" | 128 | objectName: scope.id + " loader" |
86 | 131 | 129 | ||
87 | 132 | readonly property bool moving: item ? item.moving : false | 130 | readonly property bool moving: item ? item.moving : false |
88 | 131 | readonly property bool departmentsShown: item ? item.departmentsShown : false | ||
89 | 133 | readonly property var categoryView: item ? item.categoryView : null | 132 | readonly property var categoryView: item ? item.categoryView : null |
90 | 134 | readonly property var theScope: scope | 133 | readonly property var theScope: scope |
91 | 135 | 134 | ||
92 | 136 | 135 | ||
93 | === renamed file 'qml/Dash/DashDepartments.qml' => 'qml/Dash/DashNavigation.qml' | |||
94 | --- qml/Dash/DashDepartments.qml 2014-07-08 11:08:19 +0000 | |||
95 | +++ qml/Dash/DashNavigation.qml 2014-08-06 10:17:24 +0000 | |||
96 | @@ -15,17 +15,17 @@ | |||
97 | 15 | */ | 15 | */ |
98 | 16 | 16 | ||
99 | 17 | import QtQuick 2.2 | 17 | import QtQuick 2.2 |
101 | 18 | import Ubuntu.Components 0.1 | 18 | import Ubuntu.Components 1.1 |
102 | 19 | 19 | ||
103 | 20 | AbstractButton { | 20 | AbstractButton { |
104 | 21 | id: root | 21 | id: root |
106 | 22 | objectName: "dashDepartments" | 22 | objectName: "dashNavigation" |
107 | 23 | 23 | ||
108 | 24 | property var scope: null | 24 | property var scope: null |
109 | 25 | 25 | ||
110 | 26 | property bool showList: false | 26 | property bool showList: false |
111 | 27 | 27 | ||
113 | 28 | readonly property var currentDepartment: scope && scope.hasDepartments ? scope.getDepartment(scope.currentDepartmentId) : null | 28 | readonly property var currentNavigation: scope && scope.hasNavigation ? scope.getNavigation(scope.currentNavigationId) : null |
114 | 29 | 29 | ||
115 | 30 | property alias windowWidth: blackRect.width | 30 | property alias windowWidth: blackRect.width |
116 | 31 | property alias windowHeight: blackRect.height | 31 | property alias windowHeight: blackRect.height |
117 | @@ -34,20 +34,21 @@ | |||
118 | 34 | // Are we drilling down the tree or up? | 34 | // Are we drilling down the tree or up? |
119 | 35 | property bool isGoingBack: false | 35 | property bool isGoingBack: false |
120 | 36 | 36 | ||
122 | 37 | visible: root.currentDepartment != null | 37 | visible: root.currentNavigation != null |
123 | 38 | 38 | ||
124 | 39 | height: visible ? units.gu(5) : 0 | 39 | height: visible ? units.gu(5) : 0 |
125 | 40 | 40 | ||
126 | 41 | onClicked: { | 41 | onClicked: { |
127 | 42 | departmentListView.updateMaxHeight(); | ||
128 | 42 | root.showList = !root.showList; | 43 | root.showList = !root.showList; |
129 | 43 | } | 44 | } |
130 | 44 | 45 | ||
131 | 45 | Rectangle { | 46 | Rectangle { |
132 | 46 | id: blackRect | 47 | id: blackRect |
133 | 47 | color: "black" | 48 | color: "black" |
135 | 48 | opacity: departmentListView.currentItem && departmentListView.currentItem.visible ? 0.3 : 0 | 49 | opacity: navigationListView.currentItem && navigationListView.currentItem.visible ? 0.3 : 0 |
136 | 49 | Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } } | 50 | Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } } |
138 | 50 | anchors.top: departmentListView.top | 51 | anchors.top: navigationListView.top |
139 | 51 | anchors.right: parent.right | 52 | anchors.right: parent.right |
140 | 52 | visible: opacity != 0 | 53 | visible: opacity != 0 |
141 | 53 | } | 54 | } |
142 | @@ -78,7 +79,7 @@ | |||
143 | 78 | anchors.fill: parent | 79 | anchors.fill: parent |
144 | 79 | anchors.margins: units.gu(2) | 80 | anchors.margins: units.gu(2) |
145 | 80 | verticalAlignment: Text.AlignVCenter | 81 | verticalAlignment: Text.AlignVCenter |
147 | 81 | text: root.currentDepartment ? root.currentDepartment.label : "" | 82 | text: root.currentNavigation ? root.currentNavigation.label : "" |
148 | 82 | color: root.scopeStyle ? root.scopeStyle.foreground : "grey" | 83 | color: root.scopeStyle ? root.scopeStyle.foreground : "grey" |
149 | 83 | } | 84 | } |
150 | 84 | 85 | ||
151 | @@ -92,18 +93,18 @@ | |||
152 | 92 | color: root.scopeStyle ? root.scopeStyle.foreground : "grey" | 93 | color: root.scopeStyle ? root.scopeStyle.foreground : "grey" |
153 | 93 | } | 94 | } |
154 | 94 | 95 | ||
156 | 95 | // departmentListView is outside root | 96 | // navigationListView is outside root |
157 | 96 | ListView { | 97 | ListView { |
160 | 97 | id: departmentListView | 98 | id: navigationListView |
161 | 98 | objectName: "departmentListView" | 99 | objectName: "navigationListView" |
162 | 99 | orientation: ListView.Horizontal | 100 | orientation: ListView.Horizontal |
163 | 100 | interactive: false | 101 | interactive: false |
164 | 101 | clip: root.width != windowWidth | 102 | clip: root.width != windowWidth |
165 | 102 | model: ListModel { | 103 | model: ListModel { |
167 | 103 | id: departmentModel | 104 | id: navigationModel |
168 | 104 | // We have two roles | 105 | // We have two roles |
171 | 105 | // departmentId: the department id of the department the list represents | 106 | // navigationId: the navigation id of the navigation the list represents |
172 | 106 | // nullifyDepartment: overrides departmentId to be null | 107 | // nullifyNavigation: overrides navigationId to be null |
173 | 107 | // This is used to "clear" the delegate when going "right" on the tree | 108 | // This is used to "clear" the delegate when going "right" on the tree |
174 | 108 | } | 109 | } |
175 | 109 | anchors { | 110 | anchors { |
176 | @@ -111,7 +112,12 @@ | |||
177 | 111 | right: parent.right | 112 | right: parent.right |
178 | 112 | top: root.bottom | 113 | top: root.bottom |
179 | 113 | } | 114 | } |
181 | 114 | readonly property int maxHeight: (windowHeight - mapToItem(null, root.x, root.y).y) - units.gu(8) | 115 | property int maxHeight: -1 |
182 | 116 | Component.onCompleted: updateMaxHeight(); | ||
183 | 117 | function updateMaxHeight() | ||
184 | 118 | { | ||
185 | 119 | maxHeight = (windowHeight - mapToItem(null, 0, 0).y) - units.gu(8); | ||
186 | 120 | } | ||
187 | 115 | property int prevHeight: maxHeight | 121 | property int prevHeight: maxHeight |
188 | 116 | height: currentItem ? currentItem.height : maxHeight | 122 | height: currentItem ? currentItem.height : maxHeight |
189 | 117 | onHeightChanged: { | 123 | onHeightChanged: { |
190 | @@ -120,83 +126,84 @@ | |||
191 | 120 | } | 126 | } |
192 | 121 | } | 127 | } |
193 | 122 | highlightMoveDuration: UbuntuAnimation.FastDuration | 128 | highlightMoveDuration: UbuntuAnimation.FastDuration |
196 | 123 | delegate: DashDepartmentsList { | 129 | delegate: DashNavigationList { |
197 | 124 | objectName: "department" + index | 130 | objectName: "navigation" + index |
198 | 125 | visible: height != 0 | 131 | visible: height != 0 |
200 | 126 | width: departmentListView.width | 132 | width: navigationListView.width |
201 | 127 | scopeStyle: root.scopeStyle | 133 | scopeStyle: root.scopeStyle |
202 | 128 | property real desiredHeight: { | 134 | property real desiredHeight: { |
203 | 129 | if (root.showList) { | 135 | if (root.showList) { |
205 | 130 | if (department && department.loaded && x == departmentListView.contentX) | 136 | if (navigation && navigation.loaded && x == navigationListView.contentX) |
206 | 131 | { | 137 | { |
208 | 132 | return Math.min(implicitHeight, departmentListView.maxHeight); | 138 | navigationListView.updateMaxHeight(); |
209 | 139 | return Math.min(implicitHeight, navigationListView.maxHeight); | ||
210 | 133 | } else { | 140 | } else { |
212 | 134 | return departmentListView.prevHeight; | 141 | return navigationListView.prevHeight; |
213 | 135 | } | 142 | } |
214 | 136 | } else { | 143 | } else { |
215 | 137 | return 0; | 144 | return 0; |
216 | 138 | } | 145 | } |
217 | 139 | } | 146 | } |
218 | 140 | height: desiredHeight | 147 | height: desiredHeight |
223 | 141 | department: (nullifyDepartment || !scope) ? null : scope.getDepartment(departmentId) | 148 | navigation: (nullifyNavigation || !scope) ? null : scope.getNavigation(navigationId) |
224 | 142 | currentDepartment: root.currentDepartment | 149 | currentNavigation: root.currentNavigation |
225 | 143 | onEnterDepartment: { | 150 | onEnterNavigation: { |
226 | 144 | scope.loadDepartment(newDepartmentId); | 151 | scope.setNavigationState(newNavigationId, false); |
227 | 145 | // We only need to add a new item to the model | 152 | // We only need to add a new item to the model |
228 | 146 | // if we have children, otherwise just load it | 153 | // if we have children, otherwise just load it |
229 | 147 | if (hasChildren) { | 154 | if (hasChildren) { |
230 | 148 | isGoingBack = false; | 155 | isGoingBack = false; |
233 | 149 | departmentModel.append({"departmentId": newDepartmentId, "nullifyDepartment": false}); | 156 | navigationModel.append({"navigationId": newNavigationId, "nullifyNavigation": false}); |
234 | 150 | departmentListView.currentIndex++; | 157 | navigationListView.currentIndex++; |
235 | 151 | } else { | 158 | } else { |
236 | 152 | showList = false; | 159 | showList = false; |
237 | 153 | } | 160 | } |
238 | 154 | } | 161 | } |
239 | 155 | onGoBackToParentClicked: { | 162 | onGoBackToParentClicked: { |
241 | 156 | scope.loadDepartment(department.parentDepartmentId); | 163 | scope.setNavigationState(navigation.parentNavigationId, false); |
242 | 157 | isGoingBack = true; | 164 | isGoingBack = true; |
245 | 158 | departmentModel.setProperty(departmentListView.currentIndex - 1, "nullifyDepartment", false); | 165 | navigationModel.setProperty(navigationListView.currentIndex - 1, "nullifyNavigation", false); |
246 | 159 | departmentListView.currentIndex--; | 166 | navigationListView.currentIndex--; |
247 | 160 | } | 167 | } |
249 | 161 | onAllDepartmentClicked: { | 168 | onAllNavigationClicked: { |
250 | 162 | showList = false; | 169 | showList = false; |
252 | 163 | if (root.currentDepartment.parentDepartmentId == department.departmentId) { | 170 | if (root.currentNavigation.parentNavigationId == navigation.navigationId) { |
253 | 164 | // For leaves we have to go to the parent too | 171 | // For leaves we have to go to the parent too |
255 | 165 | scope.loadDepartment(root.currentDepartment.parentDepartmentId); | 172 | scope.setNavigationState(root.currentNavigation.parentNavigationId, false); |
256 | 166 | } | 173 | } |
257 | 167 | } | 174 | } |
258 | 168 | } | 175 | } |
259 | 169 | onContentXChanged: { | 176 | onContentXChanged: { |
261 | 170 | if (contentX == width * departmentListView.currentIndex) { | 177 | if (contentX == width * navigationListView.currentIndex) { |
262 | 171 | if (isGoingBack) { | 178 | if (isGoingBack) { |
264 | 172 | departmentModel.remove(departmentListView.currentIndex + 1); | 179 | navigationModel.remove(navigationListView.currentIndex + 1); |
265 | 173 | } else { | 180 | } else { |
267 | 174 | departmentModel.setProperty(departmentListView.currentIndex - 1, "nullifyDepartment", true); | 181 | navigationModel.setProperty(navigationListView.currentIndex - 1, "nullifyNavigation", true); |
268 | 175 | } | 182 | } |
269 | 176 | } | 183 | } |
270 | 177 | } | 184 | } |
271 | 178 | } | 185 | } |
272 | 179 | 186 | ||
273 | 180 | InverseMouseArea { | 187 | InverseMouseArea { |
275 | 181 | anchors.fill: departmentListView | 188 | anchors.fill: navigationListView |
276 | 182 | enabled: root.showList | 189 | enabled: root.showList |
277 | 183 | onClicked: root.showList = false | 190 | onClicked: root.showList = false |
278 | 184 | } | 191 | } |
279 | 185 | 192 | ||
280 | 186 | onScopeChanged: { | 193 | onScopeChanged: { |
284 | 187 | departmentModel.clear(); | 194 | navigationModel.clear(); |
285 | 188 | if (scope && scope.hasDepartments) { | 195 | if (scope && scope.hasNavigation) { |
286 | 189 | departmentModel.append({"departmentId": scope.currentDepartmentId, "nullifyDepartment": false}); | 196 | navigationModel.append({"navigationId": scope.currentNavigationId, "nullifyNavigation": false}); |
287 | 190 | } | 197 | } |
288 | 191 | } | 198 | } |
289 | 192 | 199 | ||
290 | 193 | Connections { | 200 | Connections { |
291 | 194 | target: scope | 201 | target: scope |
295 | 195 | onHasDepartmentsChanged: { | 202 | onHasNavigationChanged: { |
296 | 196 | if (scope.hasDepartments) { | 203 | if (scope.hasNavigation) { |
297 | 197 | departmentModel.append({"departmentId": scope.currentDepartmentId, "nullifyDepartment": false}); | 204 | navigationModel.append({"navigationId": scope.currentNavigationId, "nullifyNavigation": false}); |
298 | 198 | } else { | 205 | } else { |
300 | 199 | departmentModel.clear(); | 206 | navigationModel.clear(); |
301 | 200 | } | 207 | } |
302 | 201 | } | 208 | } |
303 | 202 | } | 209 | } |
304 | 203 | 210 | ||
305 | === renamed file 'qml/Dash/DashDepartmentsList.qml' => 'qml/Dash/DashNavigationList.qml' | |||
306 | --- qml/Dash/DashDepartmentsList.qml 2014-07-08 11:08:19 +0000 | |||
307 | +++ qml/Dash/DashNavigationList.qml 2014-08-06 10:17:24 +0000 | |||
308 | @@ -15,16 +15,16 @@ | |||
309 | 15 | */ | 15 | */ |
310 | 16 | 16 | ||
311 | 17 | import QtQuick 2.2 | 17 | import QtQuick 2.2 |
313 | 18 | import Ubuntu.Components 0.1 | 18 | import Ubuntu.Components 1.1 |
314 | 19 | 19 | ||
315 | 20 | Item { | 20 | Item { |
316 | 21 | id: root | 21 | id: root |
319 | 22 | property var department: null | 22 | property var navigation: null |
320 | 23 | property var currentDepartment: null | 23 | property var currentNavigation: null |
321 | 24 | property var scopeStyle: null | 24 | property var scopeStyle: null |
323 | 25 | signal enterDepartment(var newDepartmentId, bool hasChildren) | 25 | signal enterNavigation(var newNavigationId, bool hasChildren) |
324 | 26 | signal goBackToParentClicked() | 26 | signal goBackToParentClicked() |
326 | 27 | signal allDepartmentClicked() | 27 | signal allNavigationClicked() |
327 | 28 | 28 | ||
328 | 29 | readonly property int itemHeight: units.gu(5) | 29 | readonly property int itemHeight: units.gu(5) |
329 | 30 | readonly property color foregroundColor: root.scopeStyle ? root.scopeStyle.foreground : "grey" | 30 | readonly property color foregroundColor: root.scopeStyle ? root.scopeStyle.foreground : "grey" |
330 | @@ -38,7 +38,7 @@ | |||
331 | 38 | ActivityIndicator { | 38 | ActivityIndicator { |
332 | 39 | id: loadingIndicator | 39 | id: loadingIndicator |
333 | 40 | anchors.centerIn: parent | 40 | anchors.centerIn: parent |
335 | 41 | running: !(department && department.loaded) | 41 | running: !(navigation && navigation.loaded) |
336 | 42 | } | 42 | } |
337 | 43 | clip: true | 43 | clip: true |
338 | 44 | 44 | ||
339 | @@ -54,6 +54,7 @@ | |||
340 | 54 | 54 | ||
341 | 55 | anchors.fill: parent | 55 | anchors.fill: parent |
342 | 56 | 56 | ||
343 | 57 | flickableDirection: Flickable.VerticalFlick | ||
344 | 57 | contentHeight: column.height | 58 | contentHeight: column.height |
345 | 58 | contentWidth: width | 59 | contentWidth: width |
346 | 59 | 60 | ||
347 | @@ -68,7 +69,7 @@ | |||
348 | 68 | id: backButton | 69 | id: backButton |
349 | 69 | objectName: "backButton" | 70 | objectName: "backButton" |
350 | 70 | width: parent.width | 71 | width: parent.width |
352 | 71 | visible: department && !department.isRoot || false | 72 | visible: navigation && !navigation.isRoot || false |
353 | 72 | height: itemHeight | 73 | height: itemHeight |
354 | 73 | 74 | ||
355 | 74 | onClicked: root.goBackToParentClicked(); | 75 | onClicked: root.goBackToParentClicked(); |
356 | @@ -92,7 +93,7 @@ | |||
357 | 92 | left: backImage.right | 93 | left: backImage.right |
358 | 93 | leftMargin: units.gu(0.5) | 94 | leftMargin: units.gu(0.5) |
359 | 94 | } | 95 | } |
361 | 95 | text: department ? department.parentLabel : "" | 96 | text: navigation ? navigation.parentLabel : "" |
362 | 96 | color: root.foregroundColor | 97 | color: root.foregroundColor |
363 | 97 | } | 98 | } |
364 | 98 | 99 | ||
365 | @@ -114,7 +115,7 @@ | |||
366 | 114 | id: allButton | 115 | id: allButton |
367 | 115 | objectName: "allButton" | 116 | objectName: "allButton" |
368 | 116 | width: parent.width | 117 | width: parent.width |
370 | 117 | visible: department && (!department.isRoot || (root.currentDepartment && !root.currentDepartment.isRoot && root.currentDepartment.parentDepartmentId == department.departmentId)) || false | 118 | visible: navigation && (!navigation.isRoot || (root.currentNavigation && !root.currentNavigation.isRoot && root.currentNavigation.parentNavigationId == navigation.navigationId)) || false |
371 | 118 | height: itemHeight | 119 | height: itemHeight |
372 | 119 | 120 | ||
373 | 120 | Label { | 121 | Label { |
374 | @@ -123,7 +124,7 @@ | |||
375 | 123 | left: parent.left | 124 | left: parent.left |
376 | 124 | leftMargin: units.gu(2) | 125 | leftMargin: units.gu(2) |
377 | 125 | } | 126 | } |
379 | 126 | text: department ? (department.allLabel != "" ? department.allLabel : department.label) : "" | 127 | text: navigation ? (navigation.allLabel != "" ? navigation.allLabel : navigation.label) : "" |
380 | 127 | font.bold: true | 128 | font.bold: true |
381 | 128 | color: root.foregroundColor | 129 | color: root.foregroundColor |
382 | 129 | } | 130 | } |
383 | @@ -141,18 +142,18 @@ | |||
384 | 141 | height: units.dp(1) | 142 | height: units.dp(1) |
385 | 142 | } | 143 | } |
386 | 143 | 144 | ||
388 | 144 | onClicked: root.allDepartmentClicked(); | 145 | onClicked: root.allNavigationClicked(); |
389 | 145 | } | 146 | } |
390 | 146 | 147 | ||
391 | 147 | Repeater { | 148 | Repeater { |
393 | 148 | model: department && department.loaded ? department : null | 149 | model: navigation && navigation.loaded ? navigation : null |
394 | 149 | clip: true | 150 | clip: true |
395 | 150 | delegate: AbstractButton { | 151 | delegate: AbstractButton { |
396 | 151 | objectName: root.objectName + "child" + index | 152 | objectName: root.objectName + "child" + index |
397 | 152 | height: root.itemHeight | 153 | height: root.itemHeight |
398 | 153 | width: root.width | 154 | width: root.width |
399 | 154 | 155 | ||
401 | 155 | onClicked: root.enterDepartment(departmentId, hasChildren) | 156 | onClicked: root.enterNavigation(navigationId, hasChildren) |
402 | 156 | 157 | ||
403 | 157 | Label { | 158 | Label { |
404 | 158 | anchors { | 159 | anchors { |
405 | @@ -188,7 +189,7 @@ | |||
406 | 188 | color: root.foregroundColor | 189 | color: root.foregroundColor |
407 | 189 | opacity: 0.1 | 190 | opacity: 0.1 |
408 | 190 | height: units.dp(1) | 191 | height: units.dp(1) |
410 | 191 | visible: index != department.count - 1 | 192 | visible: index != navigation.count - 1 |
411 | 192 | } | 193 | } |
412 | 193 | } | 194 | } |
413 | 194 | } | 195 | } |
414 | 195 | 196 | ||
415 | === modified file 'qml/Dash/GenericScopeView.qml' | |||
416 | --- qml/Dash/GenericScopeView.qml 2014-07-29 11:35:10 +0000 | |||
417 | +++ qml/Dash/GenericScopeView.qml 2014-08-06 10:17:24 +0000 | |||
418 | @@ -25,6 +25,7 @@ | |||
419 | 25 | FocusScope { | 25 | FocusScope { |
420 | 26 | id: scopeView | 26 | id: scopeView |
421 | 27 | 27 | ||
422 | 28 | readonly property alias departmentsShown: dashNavigation.showList | ||
423 | 28 | property var scope: null | 29 | property var scope: null |
424 | 29 | property SortFilterProxyModel categories: categoryFilter | 30 | property SortFilterProxyModel categories: categoryFilter |
425 | 30 | property bool isCurrent: false | 31 | property bool isCurrent: false |
426 | @@ -39,16 +40,6 @@ | |||
427 | 39 | 40 | ||
428 | 40 | signal backClicked() | 41 | signal backClicked() |
429 | 41 | 42 | ||
430 | 42 | onScopeChanged: { | ||
431 | 43 | if (scope) { | ||
432 | 44 | scope.activateApplication.connect(activateApp); | ||
433 | 45 | } | ||
434 | 46 | } | ||
435 | 47 | |||
436 | 48 | function activateApp(appId) { | ||
437 | 49 | Qt.openUrlExternally(appId); | ||
438 | 50 | } | ||
439 | 51 | |||
440 | 52 | function positionAtBeginning() { | 43 | function positionAtBeginning() { |
441 | 53 | categoryView.positionAtBeginning() | 44 | categoryView.positionAtBeginning() |
442 | 54 | } | 45 | } |
443 | @@ -119,6 +110,7 @@ | |||
444 | 119 | model: scopeView.categories | 110 | model: scopeView.categories |
445 | 120 | forceNoClip: previewListView.open | 111 | forceNoClip: previewListView.open |
446 | 121 | pixelAligned: true | 112 | pixelAligned: true |
447 | 113 | interactive: !dashNavigation.showList | ||
448 | 122 | 114 | ||
449 | 123 | property string expandedCategoryId: "" | 115 | property string expandedCategoryId: "" |
450 | 124 | 116 | ||
451 | @@ -390,7 +382,8 @@ | |||
452 | 390 | searchInProgress: scopeView.scope ? scopeView.scope.searchInProgress : false | 382 | searchInProgress: scopeView.scope ? scopeView.scope.searchInProgress : false |
453 | 391 | scopeStyle: scopeView.scopeStyle | 383 | scopeStyle: scopeView.scopeStyle |
454 | 392 | 384 | ||
456 | 393 | bottomItem: DashDepartments { | 385 | bottomItem: DashNavigation { |
457 | 386 | id: dashNavigation | ||
458 | 394 | scope: scopeView.scope | 387 | scope: scopeView.scope |
459 | 395 | width: parent.width <= units.gu(60) ? parent.width : units.gu(40) | 388 | width: parent.width <= units.gu(60) ? parent.width : units.gu(40) |
460 | 396 | anchors.right: parent.right | 389 | anchors.right: parent.right |
461 | 397 | 390 | ||
462 | === modified file 'qml/ScopeTool.qml' | |||
463 | --- qml/ScopeTool.qml 2014-07-03 09:08:22 +0000 | |||
464 | +++ qml/ScopeTool.qml 2014-08-06 10:17:24 +0000 | |||
465 | @@ -45,16 +45,6 @@ | |||
466 | 45 | signal searchClicked | 45 | signal searchClicked |
467 | 46 | } | 46 | } |
468 | 47 | 47 | ||
469 | 48 | SortFilterProxyModel { | ||
470 | 49 | id: filteredScopes | ||
471 | 50 | model: Scopes { | ||
472 | 51 | id: scopes | ||
473 | 52 | } | ||
474 | 53 | dynamicSortFilter: true | ||
475 | 54 | |||
476 | 55 | filterRole: Scopes.RoleVisible | ||
477 | 56 | filterRegExp: RegExp("^true$") | ||
478 | 57 | } | ||
479 | 58 | 48 | ||
480 | 59 | Rectangle { | 49 | Rectangle { |
481 | 60 | anchors.fill: dashContent | 50 | anchors.fill: dashContent |
482 | @@ -72,8 +62,8 @@ | |||
483 | 72 | DashContent { | 62 | DashContent { |
484 | 73 | id: dashContent | 63 | id: dashContent |
485 | 74 | 64 | ||
486 | 75 | model: filteredScopes | ||
487 | 76 | property var scope: scopes.getScope(currentIndex) | 65 | property var scope: scopes.getScope(currentIndex) |
488 | 66 | scopes: Scopes { } | ||
489 | 77 | 67 | ||
490 | 78 | anchors { | 68 | anchors { |
491 | 79 | top: parent.top | 69 | top: parent.top |
492 | 80 | 70 | ||
493 | === modified file 'tests/mocks/Unity/CMakeLists.txt' | |||
494 | --- tests/mocks/Unity/CMakeLists.txt 2014-08-05 12:06:16 +0000 | |||
495 | +++ tests/mocks/Unity/CMakeLists.txt 2014-08-06 10:17:24 +0000 | |||
496 | @@ -7,7 +7,7 @@ | |||
497 | 7 | pkg_search_module(DEE dee-1.0 REQUIRED) | 7 | pkg_search_module(DEE dee-1.0 REQUIRED) |
498 | 8 | pkg_search_module(GOBJECT gobject-2.0 REQUIRED) | 8 | pkg_search_module(GOBJECT gobject-2.0 REQUIRED) |
499 | 9 | pkg_search_module(DEEQT libdee-qt5 REQUIRED) | 9 | pkg_search_module(DEEQT libdee-qt5 REQUIRED) |
501 | 10 | pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=3) | 10 | pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=4) |
502 | 11 | 11 | ||
503 | 12 | include_directories( | 12 | include_directories( |
504 | 13 | ${CMAKE_CURRENT_BINARY_DIR} | 13 | ${CMAKE_CURRENT_BINARY_DIR} |
505 | @@ -23,14 +23,14 @@ | |||
506 | 23 | fake_scope.cpp | 23 | fake_scope.cpp |
507 | 24 | fake_scopes.cpp | 24 | fake_scopes.cpp |
508 | 25 | fake_categories.cpp | 25 | fake_categories.cpp |
510 | 26 | fake_department.cpp | 26 | fake_navigation.cpp |
511 | 27 | fake_resultsmodel.cpp | 27 | fake_resultsmodel.cpp |
512 | 28 | fake_previewmodel.cpp | 28 | fake_previewmodel.cpp |
513 | 29 | fake_previewstack.cpp | 29 | fake_previewstack.cpp |
514 | 30 | fake_previewwidgetmodel.cpp | 30 | fake_previewwidgetmodel.cpp |
515 | 31 | fake_unity_plugin.cpp | 31 | fake_unity_plugin.cpp |
516 | 32 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/CategoriesInterface.h | 32 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/CategoriesInterface.h |
518 | 33 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/DepartmentInterface.h | 33 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/NavigationInterface.h |
519 | 34 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewModelInterface.h | 34 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewModelInterface.h |
520 | 35 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewStackInterface.h | 35 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewStackInterface.h |
521 | 36 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewWidgetModelInterface.h | 36 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewWidgetModelInterface.h |
522 | 37 | 37 | ||
523 | === modified file 'tests/mocks/Unity/Unity.qmltypes' | |||
524 | --- tests/mocks/Unity/Unity.qmltypes 2014-07-10 10:59:08 +0000 | |||
525 | +++ tests/mocks/Unity/Unity.qmltypes 2014-08-06 10:17:24 +0000 | |||
526 | @@ -24,6 +24,12 @@ | |||
527 | 24 | Parameter { name: "categoryId"; type: "string" } | 24 | Parameter { name: "categoryId"; type: "string" } |
528 | 25 | Parameter { name: "json"; type: "string" } | 25 | Parameter { name: "json"; type: "string" } |
529 | 26 | } | 26 | } |
530 | 27 | Method { | ||
531 | 28 | name: "data" | ||
532 | 29 | type: "QVariant" | ||
533 | 30 | Parameter { name: "row"; type: "int" } | ||
534 | 31 | Parameter { name: "role"; type: "int" } | ||
535 | 32 | } | ||
536 | 27 | } | 33 | } |
537 | 28 | Component { | 34 | Component { |
538 | 29 | name: "PreviewModel" | 35 | name: "PreviewModel" |
539 | @@ -81,13 +87,14 @@ | |||
540 | 81 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } | 87 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } |
541 | 82 | } | 88 | } |
542 | 83 | Method { | 89 | Method { |
546 | 84 | name: "getDepartment" | 90 | name: "getNavigation" |
547 | 85 | type: "unity::shell::scopes::DepartmentInterface*" | 91 | type: "unity::shell::scopes::NavigationInterface*" |
548 | 86 | Parameter { name: "id"; type: "string" } | 92 | Parameter { name: "navigationId"; type: "string" } |
549 | 87 | } | 93 | } |
550 | 88 | Method { | 94 | Method { |
553 | 89 | name: "loadDepartment" | 95 | name: "getAltNavigation" |
554 | 90 | Parameter { name: "id"; type: "string" } | 96 | type: "unity::shell::scopes::NavigationInterface*" |
555 | 97 | Parameter { name: "altNavigationId"; type: "string" } | ||
556 | 91 | } | 98 | } |
557 | 92 | Method { | 99 | Method { |
558 | 93 | name: "performQuery" | 100 | name: "performQuery" |
559 | @@ -137,6 +144,7 @@ | |||
560 | 137 | "RoleRawRendererTemplate": 3, | 144 | "RoleRawRendererTemplate": 3, |
561 | 138 | "RoleRenderer": 4, | 145 | "RoleRenderer": 4, |
562 | 139 | "RoleComponents": 5, | 146 | "RoleComponents": 5, |
563 | 147 | "RoleHeaderLink": 6, | ||
564 | 140 | "RoleResults": 7, | 148 | "RoleResults": 7, |
565 | 141 | "RoleCount": 8 | 149 | "RoleCount": 8 |
566 | 142 | } | 150 | } |
567 | @@ -157,27 +165,31 @@ | |||
568 | 157 | } | 165 | } |
569 | 158 | } | 166 | } |
570 | 159 | Component { | 167 | Component { |
572 | 160 | name: "unity::shell::scopes::DepartmentInterface" | 168 | name: "unity::shell::scopes::NavigationInterface" |
573 | 161 | prototype: "QAbstractListModel" | 169 | prototype: "QAbstractListModel" |
575 | 162 | exports: ["Unity/Department 0.2"] | 170 | exports: ["Unity/Navigation 0.2"] |
576 | 163 | isCreatable: false | 171 | isCreatable: false |
577 | 164 | exportMetaObjectRevisions: [0] | 172 | exportMetaObjectRevisions: [0] |
578 | 165 | Enum { | 173 | Enum { |
579 | 166 | name: "Roles" | 174 | name: "Roles" |
580 | 167 | values: { | 175 | values: { |
585 | 168 | "RoleDepartmentId": 0, | 176 | "RoleNavigationId": 0, |
586 | 169 | "RoleLabel": 1, | 177 | "RoleQuery": 1, |
587 | 170 | "RoleHasChildren": 2, | 178 | "RoleLabel": 2, |
588 | 171 | "RoleIsActive": 3 | 179 | "RoleHasChildren": 3, |
589 | 180 | "RoleIsActive": 4 | ||
590 | 172 | } | 181 | } |
591 | 173 | } | 182 | } |
593 | 174 | Property { name: "departmentId"; type: "string"; isReadonly: true } | 183 | Property { name: "navigationId"; type: "string"; isReadonly: true } |
594 | 184 | Property { name: "query"; type: "string"; isReadonly: true } | ||
595 | 175 | Property { name: "label"; type: "string"; isReadonly: true } | 185 | Property { name: "label"; type: "string"; isReadonly: true } |
596 | 176 | Property { name: "allLabel"; type: "string"; isReadonly: true } | 186 | Property { name: "allLabel"; type: "string"; isReadonly: true } |
598 | 177 | Property { name: "parentDepartmentId"; type: "string"; isReadonly: true } | 187 | Property { name: "parentNavigationId"; type: "string"; isReadonly: true } |
599 | 188 | Property { name: "parentQuery"; type: "string"; isReadonly: true } | ||
600 | 178 | Property { name: "parentLabel"; type: "string"; isReadonly: true } | 189 | Property { name: "parentLabel"; type: "string"; isReadonly: true } |
601 | 179 | Property { name: "loaded"; type: "bool"; isReadonly: true } | 190 | Property { name: "loaded"; type: "bool"; isReadonly: true } |
602 | 180 | Property { name: "isRoot"; type: "bool"; isReadonly: true } | 191 | Property { name: "isRoot"; type: "bool"; isReadonly: true } |
603 | 192 | Property { name: "hidden"; type: "bool"; isReadonly: true } | ||
604 | 181 | Property { name: "count"; type: "int"; isReadonly: true } | 193 | Property { name: "count"; type: "int"; isReadonly: true } |
605 | 182 | } | 194 | } |
606 | 183 | Component { | 195 | Component { |
607 | @@ -247,7 +259,8 @@ | |||
608 | 247 | "RoleEmblem": 8, | 259 | "RoleEmblem": 8, |
609 | 248 | "RoleSummary": 9, | 260 | "RoleSummary": 9, |
610 | 249 | "RoleAttributes": 10, | 261 | "RoleAttributes": 10, |
612 | 250 | "RoleBackground": 11 | 262 | "RoleBackground": 11, |
613 | 263 | "RoleOverlayColor": 12 | ||
614 | 251 | } | 264 | } |
615 | 252 | } | 265 | } |
616 | 253 | Property { name: "categoryId"; type: "string" } | 266 | Property { name: "categoryId"; type: "string" } |
617 | @@ -259,13 +272,22 @@ | |||
618 | 259 | exports: ["Unity/Scope 0.2"] | 272 | exports: ["Unity/Scope 0.2"] |
619 | 260 | isCreatable: false | 273 | isCreatable: false |
620 | 261 | exportMetaObjectRevisions: [0] | 274 | exportMetaObjectRevisions: [0] |
621 | 275 | Enum { | ||
622 | 276 | name: "Status" | ||
623 | 277 | values: { | ||
624 | 278 | "Okay": 0, | ||
625 | 279 | "NoInternet": 1, | ||
626 | 280 | "NoLocationData": 2, | ||
627 | 281 | "Unknown": 3 | ||
628 | 282 | } | ||
629 | 283 | } | ||
630 | 262 | Property { name: "id"; type: "string"; isReadonly: true } | 284 | Property { name: "id"; type: "string"; isReadonly: true } |
631 | 263 | Property { name: "name"; type: "string"; isReadonly: true } | 285 | Property { name: "name"; type: "string"; isReadonly: true } |
632 | 264 | Property { name: "iconHint"; type: "string"; isReadonly: true } | 286 | Property { name: "iconHint"; type: "string"; isReadonly: true } |
633 | 265 | Property { name: "description"; type: "string"; isReadonly: true } | 287 | Property { name: "description"; type: "string"; isReadonly: true } |
634 | 266 | Property { name: "searchHint"; type: "string"; isReadonly: true } | 288 | Property { name: "searchHint"; type: "string"; isReadonly: true } |
635 | 267 | Property { name: "searchInProgress"; type: "bool"; isReadonly: true } | 289 | Property { name: "searchInProgress"; type: "bool"; isReadonly: true } |
637 | 268 | Property { name: "visible"; type: "bool"; isReadonly: true } | 290 | Property { name: "favorite"; type: "bool" } |
638 | 269 | Property { name: "shortcut"; type: "string"; isReadonly: true } | 291 | Property { name: "shortcut"; type: "string"; isReadonly: true } |
639 | 270 | Property { | 292 | Property { |
640 | 271 | name: "categories" | 293 | name: "categories" |
641 | @@ -273,13 +295,27 @@ | |||
642 | 273 | isReadonly: true | 295 | isReadonly: true |
643 | 274 | isPointer: true | 296 | isPointer: true |
644 | 275 | } | 297 | } |
645 | 298 | Property { | ||
646 | 299 | name: "settings" | ||
647 | 300 | type: "unity::shell::scopes::SettingsModelInterface" | ||
648 | 301 | isReadonly: true | ||
649 | 302 | isPointer: true | ||
650 | 303 | } | ||
651 | 276 | Property { name: "searchQuery"; type: "string" } | 304 | Property { name: "searchQuery"; type: "string" } |
652 | 277 | Property { name: "noResultsHint"; type: "string" } | 305 | Property { name: "noResultsHint"; type: "string" } |
653 | 278 | Property { name: "formFactor"; type: "string" } | 306 | Property { name: "formFactor"; type: "string" } |
654 | 279 | Property { name: "isActive"; type: "bool" } | 307 | Property { name: "isActive"; type: "bool" } |
657 | 280 | Property { name: "currentDepartmentId"; type: "string"; isReadonly: true } | 308 | Property { name: "currentNavigationId"; type: "string"; isReadonly: true } |
658 | 281 | Property { name: "hasDepartments"; type: "bool"; isReadonly: true } | 309 | Property { name: "hasNavigation"; type: "bool"; isReadonly: true } |
659 | 310 | Property { name: "currentAltNavigationId"; type: "string"; isReadonly: true } | ||
660 | 311 | Property { name: "hasAltNavigation"; type: "bool"; isReadonly: true } | ||
661 | 282 | Property { name: "customizations"; type: "QVariantMap"; isReadonly: true } | 312 | Property { name: "customizations"; type: "QVariantMap"; isReadonly: true } |
662 | 313 | Property { | ||
663 | 314 | name: "status" | ||
664 | 315 | type: "unity::shell::scopes::ScopeInterface::Status" | ||
665 | 316 | isReadonly: true | ||
666 | 317 | } | ||
667 | 318 | Signal { name: "detailsChanged" } | ||
668 | 283 | Signal { name: "showDash" } | 319 | Signal { name: "showDash" } |
669 | 284 | Signal { name: "hideDash" } | 320 | Signal { name: "hideDash" } |
670 | 285 | Signal { | 321 | Signal { |
671 | @@ -317,13 +353,18 @@ | |||
672 | 317 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } | 353 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } |
673 | 318 | } | 354 | } |
674 | 319 | Method { | 355 | Method { |
682 | 320 | name: "getDepartment" | 356 | name: "getNavigation" |
683 | 321 | type: "unity::shell::scopes::DepartmentInterface*" | 357 | type: "unity::shell::scopes::NavigationInterface*" |
684 | 322 | Parameter { name: "departmentId"; type: "string" } | 358 | Parameter { name: "navigationId"; type: "string" } |
685 | 323 | } | 359 | } |
686 | 324 | Method { | 360 | Method { |
687 | 325 | name: "loadDepartment" | 361 | name: "getAltNavigation" |
688 | 326 | Parameter { name: "departmentId"; type: "string" } | 362 | type: "unity::shell::scopes::NavigationInterface*" |
689 | 363 | Parameter { name: "altNavigationId"; type: "string" } | ||
690 | 364 | } | ||
691 | 365 | Method { | ||
692 | 366 | name: "performQuery" | ||
693 | 367 | Parameter { name: "cannedQuery"; type: "string" } | ||
694 | 327 | } | 368 | } |
695 | 328 | } | 369 | } |
696 | 329 | Component { | 370 | Component { |
697 | @@ -334,11 +375,17 @@ | |||
698 | 334 | values: { | 375 | values: { |
699 | 335 | "RoleScope": 0, | 376 | "RoleScope": 0, |
700 | 336 | "RoleId": 1, | 377 | "RoleId": 1, |
703 | 337 | "RoleVisible": 2, | 378 | "RoleTitle": 2 |
702 | 338 | "RoleTitle": 3 | ||
704 | 339 | } | 379 | } |
705 | 340 | } | 380 | } |
706 | 341 | Property { name: "loaded"; type: "bool"; isReadonly: true } | 381 | Property { name: "loaded"; type: "bool"; isReadonly: true } |
707 | 382 | Property { name: "count"; type: "int"; isReadonly: true } | ||
708 | 383 | Property { | ||
709 | 384 | name: "overviewScope" | ||
710 | 385 | type: "unity::shell::scopes::ScopeInterface" | ||
711 | 386 | isReadonly: true | ||
712 | 387 | isPointer: true | ||
713 | 388 | } | ||
714 | 342 | Method { | 389 | Method { |
715 | 343 | name: "getScope" | 390 | name: "getScope" |
716 | 344 | type: "unity::shell::scopes::ScopeInterface*" | 391 | type: "unity::shell::scopes::ScopeInterface*" |
717 | 345 | 392 | ||
718 | === renamed file 'tests/mocks/Unity/fake_department.cpp' => 'tests/mocks/Unity/fake_navigation.cpp' | |||
719 | --- tests/mocks/Unity/fake_department.cpp 2014-06-18 13:48:32 +0000 | |||
720 | +++ tests/mocks/Unity/fake_navigation.cpp 2014-08-06 10:17:24 +0000 | |||
721 | @@ -14,14 +14,15 @@ | |||
722 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
723 | 15 | */ | 15 | */ |
724 | 16 | 16 | ||
726 | 17 | #include "fake_department.h" | 17 | #include "fake_navigation.h" |
727 | 18 | 18 | ||
728 | 19 | #include "fake_scope.h" | 19 | #include "fake_scope.h" |
729 | 20 | 20 | ||
730 | 21 | #include <QDebug> | ||
731 | 21 | #include <QTimer> | 22 | #include <QTimer> |
732 | 22 | 23 | ||
735 | 23 | Department::Department(const QString& departmentId, const QString& label, const QString& allLabel, const QString& parentId, const QString& parentLabel, Scope* scope) | 24 | Navigation::Navigation(const QString& navigationId, const QString& label, const QString& allLabel, const QString& parentId, const QString& parentLabel, Scope* scope) |
736 | 24 | : m_departmentId(departmentId) | 25 | : m_navigationId(navigationId) |
737 | 25 | , m_label(label) | 26 | , m_label(label) |
738 | 26 | , m_allLabel(allLabel) | 27 | , m_allLabel(allLabel) |
739 | 27 | , m_parentId(parentId) | 28 | , m_parentId(parentId) |
740 | @@ -30,96 +31,87 @@ | |||
741 | 30 | , m_scope(scope) | 31 | , m_scope(scope) |
742 | 31 | { | 32 | { |
743 | 32 | QTimer::singleShot(1500, this, SLOT(slotLoaded())); | 33 | QTimer::singleShot(1500, this, SLOT(slotLoaded())); |
745 | 33 | connect(scope, SIGNAL(currentDepartmentIdChanged()), this, SLOT(slotCurrentDepartmentChanged())); | 34 | connect(scope, SIGNAL(currentNavigationIdChanged()), this, SLOT(slotCurrentNavigationChanged())); |
746 | 34 | } | 35 | } |
747 | 35 | 36 | ||
749 | 36 | QString Department::departmentId() const | 37 | QString Navigation::navigationId() const |
750 | 37 | { | 38 | { |
752 | 38 | return m_departmentId; | 39 | return m_navigationId; |
753 | 39 | } | 40 | } |
754 | 40 | 41 | ||
756 | 41 | QString Department::label() const | 42 | QString Navigation::label() const |
757 | 42 | { | 43 | { |
758 | 43 | return m_label; | 44 | return m_label; |
759 | 44 | } | 45 | } |
760 | 45 | 46 | ||
762 | 46 | QString Department::allLabel() const | 47 | QString Navigation::allLabel() const |
763 | 47 | { | 48 | { |
764 | 48 | return m_allLabel; | 49 | return m_allLabel; |
765 | 49 | } | 50 | } |
766 | 50 | 51 | ||
768 | 51 | QString Department::parentDepartmentId() const | 52 | QString Navigation::parentNavigationId() const |
769 | 52 | { | 53 | { |
770 | 53 | return m_parentId; | 54 | return m_parentId; |
771 | 54 | } | 55 | } |
772 | 55 | 56 | ||
774 | 56 | QString Department::parentLabel() const | 57 | QString Navigation::parentLabel() const |
775 | 57 | { | 58 | { |
776 | 58 | return m_parentLabel; | 59 | return m_parentLabel; |
777 | 59 | } | 60 | } |
778 | 60 | 61 | ||
780 | 61 | void Department::slotLoaded() | 62 | void Navigation::slotLoaded() |
781 | 62 | { | 63 | { |
782 | 63 | m_loaded = true; | 64 | m_loaded = true; |
783 | 64 | Q_EMIT loadedChanged(); | 65 | Q_EMIT loadedChanged(); |
784 | 65 | } | 66 | } |
785 | 66 | 67 | ||
787 | 67 | bool Department::loaded() const | 68 | bool Navigation::loaded() const |
788 | 68 | { | 69 | { |
789 | 69 | return m_loaded; | 70 | return m_loaded; |
790 | 70 | } | 71 | } |
791 | 71 | 72 | ||
793 | 72 | int Department::count() const | 73 | int Navigation::count() const |
794 | 73 | { | 74 | { |
795 | 74 | return rowCount(); | 75 | return rowCount(); |
796 | 75 | } | 76 | } |
797 | 76 | 77 | ||
806 | 77 | bool Department::isRoot() const | 78 | bool Navigation::isRoot() const |
807 | 78 | { | 79 | { |
808 | 79 | return m_departmentId == "root"; | 80 | return m_navigationId == "root" || m_navigationId == "altroot"; |
809 | 80 | } | 81 | } |
810 | 81 | 82 | ||
811 | 82 | int Department::rowCount(const QModelIndex & /*parent*/) const | 83 | bool Navigation::hidden() const |
812 | 83 | { | 84 | { |
813 | 84 | if (!m_loaded || m_departmentId.startsWith("child") || m_departmentId == "middle3") | 85 | return m_navigationId == "altroot"; |
814 | 86 | } | ||
815 | 87 | |||
816 | 88 | int Navigation::rowCount(const QModelIndex & /*parent*/) const | ||
817 | 89 | { | ||
818 | 90 | if (!m_loaded || m_navigationId.startsWith("child") || m_navigationId == "middle3") | ||
819 | 85 | return 0; | 91 | return 0; |
820 | 86 | else | 92 | else |
821 | 87 | return 8; | 93 | return 8; |
822 | 88 | } | 94 | } |
823 | 89 | 95 | ||
835 | 90 | QHash<int, QByteArray> Department::roleNames() const | 96 | QVariant Navigation::data(const QModelIndex &index, int role) const |
825 | 91 | { | ||
826 | 92 | QHash<int, QByteArray> res; | ||
827 | 93 | res[RoleDepartmentId] = "departmentId"; | ||
828 | 94 | res[RoleLabel] = "label"; | ||
829 | 95 | res[RoleHasChildren] = "hasChildren"; | ||
830 | 96 | res[RoleIsActive] = "isActive"; | ||
831 | 97 | return res; | ||
832 | 98 | } | ||
833 | 99 | |||
834 | 100 | QVariant Department::data(const QModelIndex &index, int role) const | ||
836 | 101 | { | 97 | { |
837 | 102 | switch (role) { | 98 | switch (role) { |
840 | 103 | case RoleDepartmentId: | 99 | case RoleNavigationId: |
841 | 104 | if (m_departmentId == "root") | 100 | if (m_navigationId == "root") |
842 | 105 | return QString("middle%1").arg(index.row()); | 101 | return QString("middle%1").arg(index.row()); |
846 | 106 | else if (m_departmentId.startsWith("middle")) | 102 | else if (m_navigationId.startsWith("middle")) |
847 | 107 | return QString("child%1%2").arg(m_departmentId).arg(index.row()); | 103 | return QString("child%1%2").arg(m_navigationId).arg(index.row()); |
845 | 108 | break; | ||
848 | 109 | case RoleLabel: | 104 | case RoleLabel: |
851 | 110 | return QString("%1Child%2").arg(m_departmentId).arg(index.row()); | 105 | return QString("%1Child%2").arg(m_navigationId).arg(index.row()); |
850 | 111 | break; | ||
852 | 112 | case RoleHasChildren: | 106 | case RoleHasChildren: |
855 | 113 | return m_departmentId == "root" && index.row() != 3; | 107 | return m_navigationId == "root" && index.row() != 3; |
854 | 114 | break; | ||
856 | 115 | case RoleIsActive: | 108 | case RoleIsActive: |
859 | 116 | return m_scope->currentDepartmentId() == data(index, RoleDepartmentId); | 109 | return m_scope->currentNavigationId() == data(index, RoleNavigationId); |
858 | 117 | break; | ||
860 | 118 | } | 110 | } |
861 | 119 | return QVariant(); | 111 | return QVariant(); |
862 | 120 | } | 112 | } |
863 | 121 | 113 | ||
865 | 122 | void Department::slotCurrentDepartmentChanged() | 114 | void Navigation::slotCurrentNavigationChanged() |
866 | 123 | { | 115 | { |
867 | 124 | // This is wasteful, should only emit it if really something changed in this | 116 | // This is wasteful, should only emit it if really something changed in this |
868 | 125 | // deparment, but this is a mock, so no need to optimize | 117 | // deparment, but this is a mock, so no need to optimize |
869 | 126 | 118 | ||
870 | === renamed file 'tests/mocks/Unity/fake_department.h' => 'tests/mocks/Unity/fake_navigation.h' | |||
871 | --- tests/mocks/Unity/fake_department.h 2014-05-29 10:25:21 +0000 | |||
872 | +++ tests/mocks/Unity/fake_navigation.h 2014-08-06 10:17:24 +0000 | |||
873 | @@ -14,48 +14,48 @@ | |||
874 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
875 | 15 | */ | 15 | */ |
876 | 16 | 16 | ||
879 | 17 | #ifndef FAKE_DEPARTMENT_H | 17 | #ifndef FAKE_NAVIGATION_H |
880 | 18 | #define FAKE_DEPARTMENT_H | 18 | #define FAKE_NAVIGATION_H |
881 | 19 | 19 | ||
883 | 20 | #include <unity/shell/scopes/DepartmentInterface.h> | 20 | #include <unity/shell/scopes/NavigationInterface.h> |
884 | 21 | 21 | ||
885 | 22 | class Scope; | 22 | class Scope; |
886 | 23 | 23 | ||
888 | 24 | class Department : public unity::shell::scopes::DepartmentInterface | 24 | class Navigation : public unity::shell::scopes::NavigationInterface |
889 | 25 | { | 25 | { |
890 | 26 | Q_OBJECT | 26 | Q_OBJECT |
891 | 27 | 27 | ||
892 | 28 | public: | 28 | public: |
894 | 29 | Department(const QString& departmentId, const QString& label, const QString& allLabel, const QString& parentId, const QString& parentLabel, Scope* scope); | 29 | Navigation(const QString& navigationId, const QString& label, const QString& allLabel, const QString& parentId, const QString& parentLabel, Scope* scope); |
895 | 30 | 30 | ||
897 | 31 | QString departmentId() const override; | 31 | QString navigationId() const override; |
898 | 32 | QString label() const override; | 32 | QString label() const override; |
899 | 33 | QString allLabel() const override; | 33 | QString allLabel() const override; |
901 | 34 | QString parentDepartmentId() const override; | 34 | QString parentNavigationId() const override; |
902 | 35 | QString parentLabel() const override; | 35 | QString parentLabel() const override; |
903 | 36 | bool loaded() const override; | 36 | bool loaded() const override; |
904 | 37 | bool isRoot() const override; | ||
905 | 38 | bool hidden() const override; | ||
906 | 37 | int count() const override; | 39 | int count() const override; |
907 | 38 | bool isRoot() const override; | ||
908 | 39 | 40 | ||
909 | 40 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; | 41 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; |
910 | 41 | QHash<int, QByteArray> roleNames() const; | ||
911 | 42 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; | 42 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; |
912 | 43 | 43 | ||
913 | 44 | public Q_SLOTS: | 44 | public Q_SLOTS: |
915 | 45 | void slotCurrentDepartmentChanged(); | 45 | void slotCurrentNavigationChanged(); |
916 | 46 | 46 | ||
917 | 47 | private Q_SLOTS: | 47 | private Q_SLOTS: |
918 | 48 | void slotLoaded(); | 48 | void slotLoaded(); |
919 | 49 | 49 | ||
920 | 50 | private: | 50 | private: |
922 | 51 | QString m_departmentId; | 51 | QString m_navigationId; |
923 | 52 | QString m_label; | 52 | QString m_label; |
924 | 53 | QString m_allLabel; | 53 | QString m_allLabel; |
925 | 54 | QString m_parentId; | 54 | QString m_parentId; |
926 | 55 | QString m_parentLabel; | 55 | QString m_parentLabel; |
927 | 56 | bool m_loaded; | 56 | bool m_loaded; |
929 | 57 | QString m_currentDepartment; | 57 | QString m_currentNavigation; |
930 | 58 | Scope *m_scope; | 58 | Scope *m_scope; |
931 | 59 | }; | 59 | }; |
932 | 60 | 60 | ||
934 | 61 | #endif // FAKE_DEPARTMENT_H | 61 | #endif // FAKE_NAVIGATION_H |
935 | 62 | 62 | ||
936 | === modified file 'tests/mocks/Unity/fake_scope.cpp' | |||
937 | --- tests/mocks/Unity/fake_scope.cpp 2014-07-24 20:40:57 +0000 | |||
938 | +++ tests/mocks/Unity/fake_scope.cpp 2014-08-06 10:17:24 +0000 | |||
939 | @@ -14,24 +14,26 @@ | |||
940 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
941 | 15 | */ | 15 | */ |
942 | 16 | 16 | ||
943 | 17 | #include <QDebug> | ||
944 | 17 | #include <QUrl> | 18 | #include <QUrl> |
945 | 18 | 19 | ||
946 | 19 | #include "fake_scope.h" | 20 | #include "fake_scope.h" |
948 | 20 | #include "fake_department.h" | 21 | #include "fake_navigation.h" |
949 | 21 | #include "fake_resultsmodel.h" | 22 | #include "fake_resultsmodel.h" |
950 | 22 | 23 | ||
951 | 23 | Scope::Scope(QObject* parent) : Scope(QString(), QString(), false, parent) | 24 | Scope::Scope(QObject* parent) : Scope(QString(), QString(), false, parent) |
952 | 24 | { | 25 | { |
953 | 25 | } | 26 | } |
954 | 26 | 27 | ||
956 | 27 | Scope::Scope(QString const& id, QString const& name, bool visible, QObject* parent, int categories) | 28 | Scope::Scope(QString const& id, QString const& name, bool favorite, QObject* parent, int categories) |
957 | 28 | : unity::shell::scopes::ScopeInterface(parent) | 29 | : unity::shell::scopes::ScopeInterface(parent) |
958 | 29 | , m_id(id) | 30 | , m_id(id) |
959 | 30 | , m_name(name) | 31 | , m_name(name) |
960 | 31 | , m_visible(visible) | ||
961 | 32 | , m_searching(false) | 32 | , m_searching(false) |
962 | 33 | , m_favorite(favorite) | ||
963 | 33 | , m_isActive(false) | 34 | , m_isActive(false) |
965 | 34 | , m_currentDeparment("root") | 35 | , m_currentNavigationId("root") |
966 | 36 | , m_currentAltNavigationId("altroot") | ||
967 | 35 | , m_previewRendererName("preview-generic") | 37 | , m_previewRendererName("preview-generic") |
968 | 36 | , m_categories(new Categories(categories, this)) | 38 | , m_categories(new Categories(categories, this)) |
969 | 37 | { | 39 | { |
970 | @@ -77,6 +79,11 @@ | |||
971 | 77 | return m_searching; | 79 | return m_searching; |
972 | 78 | } | 80 | } |
973 | 79 | 81 | ||
974 | 82 | bool Scope::favorite() const | ||
975 | 83 | { | ||
976 | 84 | return m_favorite; | ||
977 | 85 | } | ||
978 | 86 | |||
979 | 80 | unity::shell::scopes::CategoriesInterface* Scope::categories() const | 87 | unity::shell::scopes::CategoriesInterface* Scope::categories() const |
980 | 81 | { | 88 | { |
981 | 82 | return m_categories; | 89 | return m_categories; |
982 | @@ -97,11 +104,6 @@ | |||
983 | 97 | return m_formFactor; | 104 | return m_formFactor; |
984 | 98 | } | 105 | } |
985 | 99 | 106 | ||
986 | 100 | bool Scope::visible() const | ||
987 | 101 | { | ||
988 | 102 | return m_visible; | ||
989 | 103 | } | ||
990 | 104 | |||
991 | 105 | bool Scope::isActive() const | 107 | bool Scope::isActive() const |
992 | 106 | { | 108 | { |
993 | 107 | return m_isActive; | 109 | return m_isActive; |
994 | @@ -131,6 +133,13 @@ | |||
995 | 131 | } | 133 | } |
996 | 132 | } | 134 | } |
997 | 133 | 135 | ||
998 | 136 | void Scope::setFavorite(const bool favorite) | ||
999 | 137 | { | ||
1000 | 138 | if (favorite != m_favorite) { | ||
1001 | 139 | m_favorite = favorite; | ||
1002 | 140 | Q_EMIT favoriteChanged(); | ||
1003 | 141 | } | ||
1004 | 142 | } | ||
1005 | 134 | void Scope::setSearchInProgress(const bool inProg) | 143 | void Scope::setSearchInProgress(const bool inProg) |
1006 | 135 | { | 144 | { |
1007 | 136 | if (inProg != m_searching) { | 145 | if (inProg != m_searching) { |
1008 | @@ -170,14 +179,29 @@ | |||
1009 | 170 | qFatal("Scope::closeScope is not implemented"); | 179 | qFatal("Scope::closeScope is not implemented"); |
1010 | 171 | } | 180 | } |
1011 | 172 | 181 | ||
1020 | 173 | QString Scope::currentDepartmentId() const | 182 | QString Scope::currentNavigationId() const |
1021 | 174 | { | 183 | { |
1022 | 175 | return m_currentDeparment; | 184 | return m_currentNavigationId; |
1023 | 176 | } | 185 | } |
1024 | 177 | 186 | ||
1025 | 178 | bool Scope::hasDepartments() const | 187 | bool Scope::hasNavigation() const |
1026 | 179 | { | 188 | { |
1027 | 180 | return true; | 189 | return true; |
1028 | 190 | } | ||
1029 | 191 | |||
1030 | 192 | QString Scope::currentAltNavigationId() const | ||
1031 | 193 | { | ||
1032 | 194 | return m_currentAltNavigationId; | ||
1033 | 195 | } | ||
1034 | 196 | |||
1035 | 197 | bool Scope::hasAltNavigation() const | ||
1036 | 198 | { | ||
1037 | 199 | return true; | ||
1038 | 200 | } | ||
1039 | 201 | |||
1040 | 202 | Scope::Status Scope::status() const | ||
1041 | 203 | { | ||
1042 | 204 | return Status::Okay; | ||
1043 | 181 | } | 205 | } |
1044 | 182 | 206 | ||
1045 | 183 | QVariantMap Scope::customizations() const | 207 | QVariantMap Scope::customizations() const |
1046 | @@ -196,7 +220,12 @@ | |||
1047 | 196 | return m; | 220 | return m; |
1048 | 197 | } | 221 | } |
1049 | 198 | 222 | ||
1051 | 199 | unity::shell::scopes::DepartmentInterface* Scope::getDepartment(const QString& id) | 223 | void Scope::refresh() |
1052 | 224 | { | ||
1053 | 225 | qDebug() << "Scope::refresh is currently not implmented in the fake scopes plugin"; | ||
1054 | 226 | } | ||
1055 | 227 | |||
1056 | 228 | unity::shell::scopes::NavigationInterface* Scope::getNavigation(const QString& id) | ||
1057 | 200 | { | 229 | { |
1058 | 201 | if (id.isEmpty()) | 230 | if (id.isEmpty()) |
1059 | 202 | return nullptr; | 231 | return nullptr; |
1060 | @@ -210,11 +239,30 @@ | |||
1061 | 210 | parentId = id.mid(5, 7); | 239 | parentId = id.mid(5, 7); |
1062 | 211 | parentLabel = parentId; | 240 | parentLabel = parentId; |
1063 | 212 | } | 241 | } |
1071 | 213 | return new Department(id, id, "all"+id, parentId, parentLabel, this); | 242 | return new Navigation(id, id, "all"+id, parentId, parentLabel, this); |
1072 | 214 | } | 243 | } |
1073 | 215 | 244 | ||
1074 | 216 | void Scope::loadDepartment(const QString& id) | 245 | unity::shell::scopes::NavigationInterface* Scope::getAltNavigation(QString const& id) |
1075 | 217 | { | 246 | { |
1076 | 218 | m_currentDeparment = id; | 247 | if (id.isEmpty()) |
1077 | 219 | Q_EMIT currentDepartmentIdChanged(); | 248 | return nullptr; |
1078 | 249 | |||
1079 | 250 | QString parentId; | ||
1080 | 251 | QString parentLabel; | ||
1081 | 252 | if (id.startsWith("altmiddle")) { | ||
1082 | 253 | parentId = "altroot"; | ||
1083 | 254 | parentLabel = "altroot"; | ||
1084 | 255 | } | ||
1085 | 256 | return new Navigation(id, id, "all"+id, parentId, parentLabel, this); | ||
1086 | 257 | } | ||
1087 | 258 | |||
1088 | 259 | void Scope::setNavigationState(const QString &navigationId, bool isAltNavigation) | ||
1089 | 260 | { | ||
1090 | 261 | if (isAltNavigation) { | ||
1091 | 262 | m_currentAltNavigationId = navigationId; | ||
1092 | 263 | Q_EMIT currentAltNavigationIdChanged(); | ||
1093 | 264 | } else { | ||
1094 | 265 | m_currentNavigationId = navigationId; | ||
1095 | 266 | Q_EMIT currentNavigationIdChanged(); | ||
1096 | 267 | } | ||
1097 | 220 | } | 268 | } |
1098 | 221 | 269 | ||
1099 | === modified file 'tests/mocks/Unity/fake_scope.h' | |||
1100 | --- tests/mocks/Unity/fake_scope.h 2014-07-11 16:39:33 +0000 | |||
1101 | +++ tests/mocks/Unity/fake_scope.h 2014-08-06 10:17:24 +0000 | |||
1102 | @@ -30,7 +30,7 @@ | |||
1103 | 30 | 30 | ||
1104 | 31 | public: | 31 | public: |
1105 | 32 | Scope(QObject* parent = 0); | 32 | Scope(QObject* parent = 0); |
1107 | 33 | Scope(QString const& id, QString const& name, bool visible, QObject* parent = 0, int categories = 20); | 33 | Scope(QString const& id, QString const& name, bool favorite, QObject* parent = 0, int categories = 20); |
1108 | 34 | 34 | ||
1109 | 35 | /* getters */ | 35 | /* getters */ |
1110 | 36 | QString id() const override; | 36 | QString id() const override; |
1111 | @@ -38,9 +38,9 @@ | |||
1112 | 38 | QString iconHint() const override; | 38 | QString iconHint() const override; |
1113 | 39 | QString description() const override; | 39 | QString description() const override; |
1114 | 40 | QString searchHint() const override; | 40 | QString searchHint() const override; |
1115 | 41 | bool visible() const override; | ||
1116 | 42 | QString shortcut() const override; | 41 | QString shortcut() const override; |
1117 | 43 | bool searchInProgress() const override; | 42 | bool searchInProgress() const override; |
1118 | 43 | bool favorite() const override; | ||
1119 | 44 | unity::shell::scopes::CategoriesInterface* categories() const override; | 44 | unity::shell::scopes::CategoriesInterface* categories() const override; |
1120 | 45 | QString searchQuery() const override; | 45 | QString searchQuery() const override; |
1121 | 46 | QString noResultsHint() const override; | 46 | QString noResultsHint() const override; |
1122 | @@ -53,6 +53,7 @@ | |||
1123 | 53 | void setNoResultsHint(const QString& hint) override; | 53 | void setNoResultsHint(const QString& hint) override; |
1124 | 54 | void setFormFactor(const QString& form_factor) override; | 54 | void setFormFactor(const QString& form_factor) override; |
1125 | 55 | void setActive(const bool) override; | 55 | void setActive(const bool) override; |
1126 | 56 | void setFavorite(const bool) override; | ||
1127 | 56 | Q_INVOKABLE void setSearchInProgress(const bool inProg); // This is not invokable in the Interface, here for testing benefits | 57 | Q_INVOKABLE void setSearchInProgress(const bool inProg); // This is not invokable in the Interface, here for testing benefits |
1128 | 57 | 58 | ||
1129 | 58 | Q_INVOKABLE void activate(QVariant const& result) override; | 59 | Q_INVOKABLE void activate(QVariant const& result) override; |
1130 | @@ -60,14 +61,20 @@ | |||
1131 | 60 | Q_INVOKABLE void cancelActivation() override; | 61 | Q_INVOKABLE void cancelActivation() override; |
1132 | 61 | Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override; | 62 | Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override; |
1133 | 62 | 63 | ||
1138 | 63 | QString currentDepartmentId() const override; | 64 | QString currentNavigationId() const override; |
1139 | 64 | bool hasDepartments() const override; | 65 | bool hasNavigation() const override; |
1140 | 65 | Q_INVOKABLE unity::shell::scopes::DepartmentInterface* getDepartment(const QString& id) override; | 66 | QString currentAltNavigationId() const override; |
1141 | 66 | Q_INVOKABLE void loadDepartment(const QString& id) override; | 67 | bool hasAltNavigation() const override; |
1142 | 68 | Q_INVOKABLE unity::shell::scopes::NavigationInterface* getNavigation(QString const& navigationId) override; | ||
1143 | 69 | Q_INVOKABLE unity::shell::scopes::NavigationInterface* getAltNavigation(QString const& altNavigationId) override; | ||
1144 | 70 | Q_INVOKABLE void setNavigationState(const QString &navigationId, bool isAltNavigation) override; | ||
1145 | 67 | Q_SIGNAL void performQuery(const QString& query) override; | 71 | Q_SIGNAL void performQuery(const QString& query) override; |
1146 | 68 | 72 | ||
1147 | 73 | Status status() const override; | ||
1148 | 69 | QVariantMap customizations() const override; | 74 | QVariantMap customizations() const override; |
1149 | 70 | 75 | ||
1150 | 76 | Q_INVOKABLE void refresh() override; | ||
1151 | 77 | |||
1152 | 71 | protected: | 78 | protected: |
1153 | 72 | 79 | ||
1154 | 73 | QString m_id; | 80 | QString m_id; |
1155 | @@ -77,10 +84,11 @@ | |||
1156 | 77 | QString m_searchQuery; | 84 | QString m_searchQuery; |
1157 | 78 | QString m_noResultsHint; | 85 | QString m_noResultsHint; |
1158 | 79 | QString m_formFactor; | 86 | QString m_formFactor; |
1159 | 80 | bool m_visible; | ||
1160 | 81 | bool m_searching; | 87 | bool m_searching; |
1161 | 88 | bool m_favorite; | ||
1162 | 82 | bool m_isActive; | 89 | bool m_isActive; |
1164 | 83 | QString m_currentDeparment; | 90 | QString m_currentNavigationId; |
1165 | 91 | QString m_currentAltNavigationId; | ||
1166 | 84 | 92 | ||
1167 | 85 | QString m_previewRendererName; | 93 | QString m_previewRendererName; |
1168 | 86 | 94 | ||
1169 | 87 | 95 | ||
1170 | === modified file 'tests/mocks/Unity/fake_scopes.cpp' | |||
1171 | --- tests/mocks/Unity/fake_scopes.cpp 2014-07-25 13:25:45 +0000 | |||
1172 | +++ tests/mocks/Unity/fake_scopes.cpp 2014-08-06 10:17:24 +0000 | |||
1173 | @@ -32,6 +32,11 @@ | |||
1174 | 32 | timer.setSingleShot(true); | 32 | timer.setSingleShot(true); |
1175 | 33 | timer.setInterval(100); | 33 | timer.setInterval(100); |
1176 | 34 | QObject::connect(&timer, SIGNAL(timeout()), this, SLOT(updateScopes())); | 34 | QObject::connect(&timer, SIGNAL(timeout()), this, SLOT(updateScopes())); |
1177 | 35 | |||
1178 | 36 | QObject::connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SIGNAL(countChanged())); | ||
1179 | 37 | QObject::connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SIGNAL(countChanged())); | ||
1180 | 38 | QObject::connect(this, SIGNAL(modelReset()), this, SIGNAL(countChanged())); | ||
1181 | 39 | |||
1182 | 35 | load(); | 40 | load(); |
1183 | 36 | } | 41 | } |
1184 | 37 | 42 | ||
1185 | @@ -92,8 +97,6 @@ | |||
1186 | 92 | return QVariant::fromValue(scope); | 97 | return QVariant::fromValue(scope); |
1187 | 93 | } else if (role == Scopes::RoleId) { | 98 | } else if (role == Scopes::RoleId) { |
1188 | 94 | return QVariant::fromValue(scope->id()); | 99 | return QVariant::fromValue(scope->id()); |
1189 | 95 | } else if (role == Scopes::RoleVisible) { | ||
1190 | 96 | return QVariant::fromValue(scope->visible()); | ||
1191 | 97 | } else if (role == Scopes::RoleTitle) { | 100 | } else if (role == Scopes::RoleTitle) { |
1192 | 98 | return QVariant::fromValue(scope->name()); | 101 | return QVariant::fromValue(scope->name()); |
1193 | 99 | } else { | 102 | } else { |
1194 | @@ -125,6 +128,11 @@ | |||
1195 | 125 | return m_loaded; | 128 | return m_loaded; |
1196 | 126 | } | 129 | } |
1197 | 127 | 130 | ||
1198 | 131 | int Scopes::count() const | ||
1199 | 132 | { | ||
1200 | 133 | return rowCount(); | ||
1201 | 134 | } | ||
1202 | 135 | |||
1203 | 128 | unity::shell::scopes::ScopeInterface* Scopes::overviewScope() const | 136 | unity::shell::scopes::ScopeInterface* Scopes::overviewScope() const |
1204 | 129 | { | 137 | { |
1205 | 130 | return nullptr; | 138 | return nullptr; |
1206 | 131 | 139 | ||
1207 | === modified file 'tests/mocks/Unity/fake_scopes.h' | |||
1208 | --- tests/mocks/Unity/fake_scopes.h 2014-07-25 13:25:45 +0000 | |||
1209 | +++ tests/mocks/Unity/fake_scopes.h 2014-08-06 10:17:24 +0000 | |||
1210 | @@ -50,6 +50,7 @@ | |||
1211 | 50 | QModelIndex parent ( const QModelIndex & index ) const; | 50 | QModelIndex parent ( const QModelIndex & index ) const; |
1212 | 51 | 51 | ||
1213 | 52 | bool loaded() const override; | 52 | bool loaded() const override; |
1214 | 53 | int count() const override; | ||
1215 | 53 | unity::shell::scopes::ScopeInterface* overviewScope() const override; | 54 | unity::shell::scopes::ScopeInterface* overviewScope() const override; |
1216 | 54 | 55 | ||
1217 | 55 | private Q_SLOTS: | 56 | private Q_SLOTS: |
1218 | 56 | 57 | ||
1219 | === modified file 'tests/mocks/Unity/fake_unity_plugin.cpp' | |||
1220 | --- tests/mocks/Unity/fake_unity_plugin.cpp 2014-07-08 11:26:44 +0000 | |||
1221 | +++ tests/mocks/Unity/fake_unity_plugin.cpp 2014-08-06 10:17:24 +0000 | |||
1222 | @@ -22,7 +22,7 @@ | |||
1223 | 22 | // local | 22 | // local |
1224 | 23 | #include "fake_scopes.h" | 23 | #include "fake_scopes.h" |
1225 | 24 | #include "fake_categories.h" | 24 | #include "fake_categories.h" |
1227 | 25 | #include "fake_department.h" | 25 | #include "fake_navigation.h" |
1228 | 26 | #include "fake_previewmodel.h" | 26 | #include "fake_previewmodel.h" |
1229 | 27 | #include "fake_previewwidgetmodel.h" | 27 | #include "fake_previewwidgetmodel.h" |
1230 | 28 | #include "fake_resultsmodel.h" | 28 | #include "fake_resultsmodel.h" |
1231 | @@ -43,7 +43,7 @@ | |||
1232 | 43 | qmlRegisterType<Scopes>(uri, 0, 2, "Scopes"); | 43 | qmlRegisterType<Scopes>(uri, 0, 2, "Scopes"); |
1233 | 44 | qmlRegisterType<Scope>(uri, 0, 2, "MockScope"); | 44 | qmlRegisterType<Scope>(uri, 0, 2, "MockScope"); |
1234 | 45 | qmlRegisterUncreatableType<unity::shell::scopes::ScopeInterface>(uri, 0, 2, "Scope", "Can't create Scope object in QML."); | 45 | qmlRegisterUncreatableType<unity::shell::scopes::ScopeInterface>(uri, 0, 2, "Scope", "Can't create Scope object in QML."); |
1236 | 46 | qmlRegisterUncreatableType<unity::shell::scopes::DepartmentInterface>(uri, 0, 2, "Department", "Can't create Department object in QML."); | 46 | qmlRegisterUncreatableType<unity::shell::scopes::NavigationInterface>(uri, 0, 2, "Navigation", "Can't create Navigation object in QML."); |
1237 | 47 | qmlRegisterUncreatableType<unity::shell::scopes::CategoriesInterface>(uri, 0, 2, "Categories", "Can't create Categories object in QML."); | 47 | qmlRegisterUncreatableType<unity::shell::scopes::CategoriesInterface>(uri, 0, 2, "Categories", "Can't create Categories object in QML."); |
1238 | 48 | qmlRegisterUncreatableType<unity::shell::scopes::PreviewModelInterface>(uri, 0, 2, "PreviewModel", "Can't create new PreviewModel in QML. Get them from PreviewStack instance."); | 48 | qmlRegisterUncreatableType<unity::shell::scopes::PreviewModelInterface>(uri, 0, 2, "PreviewModel", "Can't create new PreviewModel in QML. Get them from PreviewStack instance."); |
1239 | 49 | qmlRegisterUncreatableType<ResultsModel>(uri, 0, 2, "ResultsModel", "Can't create ResultsModel object in QML."); | 49 | qmlRegisterUncreatableType<ResultsModel>(uri, 0, 2, "ResultsModel", "Can't create ResultsModel object in QML."); |
1240 | 50 | 50 | ||
1241 | === modified file 'tests/qmltests/Dash/tst_DashContent.qml' | |||
1242 | --- tests/qmltests/Dash/tst_DashContent.qml 2014-07-21 13:28:35 +0000 | |||
1243 | +++ tests/qmltests/Dash/tst_DashContent.qml 2014-08-06 10:17:24 +0000 | |||
1244 | @@ -43,9 +43,6 @@ | |||
1245 | 43 | id: dashContent | 43 | id: dashContent |
1246 | 44 | anchors.fill: parent | 44 | anchors.fill: parent |
1247 | 45 | 45 | ||
1248 | 46 | model: SortFilterProxyModel { | ||
1249 | 47 | model: scopesModel | ||
1250 | 48 | } | ||
1251 | 49 | scopes : scopesModel | 46 | scopes : scopesModel |
1252 | 50 | } | 47 | } |
1253 | 51 | 48 | ||
1254 | @@ -268,117 +265,119 @@ | |||
1255 | 268 | verify(carouselLV.tileWidth / carouselLV.tileHeight == cardTool.components["art"]["aspect-ratio"]); | 265 | verify(carouselLV.tileWidth / carouselLV.tileHeight == cardTool.components["art"]["aspect-ratio"]); |
1256 | 269 | } | 266 | } |
1257 | 270 | 267 | ||
1348 | 271 | function test_departments() { | 268 | function test_navigations() { |
1349 | 272 | var dashDepartments = findChild(dashContent, "dashDepartments"); | 269 | var dashContentList = findChild(dashContent, "dashContentList"); |
1350 | 273 | compare(dashDepartments.visible, true); | 270 | tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true); |
1351 | 274 | compare(dashDepartments.showList, false); | 271 | var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation"); |
1352 | 275 | waitForRendering(dashDepartments); | 272 | tryCompare(dashNavigation, "visible", true); |
1353 | 276 | mouseClick(dashDepartments, 0, 0); | 273 | compare(dashNavigation.showList, false); |
1354 | 277 | compare(dashDepartments.showList, true); | 274 | waitForRendering(dashNavigation); |
1355 | 278 | 275 | mouseClick(dashNavigation, 0, 0); | |
1356 | 279 | var departmentListView = findChild(dashDepartments, "departmentListView"); | 276 | compare(dashNavigation.showList, true); |
1357 | 280 | compare(departmentListView.count, 1); | 277 | |
1358 | 281 | tryCompare(departmentListView.currentItem.department, "loaded", true); | 278 | var navigationListView = findChild(dashNavigation, "navigationListView"); |
1359 | 282 | 279 | compare(navigationListView.count, 1); | |
1360 | 283 | waitForRendering(departmentListView); | 280 | tryCompare(navigationListView.currentItem.navigation, "loaded", true); |
1361 | 284 | waitForRendering(departmentListView.currentItem); | 281 | |
1362 | 285 | 282 | waitForRendering(navigationListView); | |
1363 | 286 | var allButton = findChild(dashDepartments, "allButton"); | 283 | waitForRendering(navigationListView.currentItem); |
1364 | 287 | compare(allButton.visible, false); | 284 | |
1365 | 288 | 285 | var allButton = findChild(dashNavigation, "allButton"); | |
1366 | 289 | var department = findChild(dashDepartments, "department0child3"); | 286 | compare(allButton.visible, false); |
1367 | 290 | mouseClick(department, 0, 0); | 287 | |
1368 | 291 | compare(dashDepartments.showList, false); | 288 | var navigation = findChild(dashNavigation, "navigation0child3"); |
1369 | 292 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle3"); | 289 | mouseClick(navigation, 0, 0); |
1370 | 293 | tryCompare(departmentListView.currentItem.department, "departmentId", "root"); | 290 | compare(dashNavigation.showList, false); |
1371 | 294 | 291 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle3"); | |
1372 | 295 | mouseClick(dashDepartments, 0, 0); | 292 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "root"); |
1373 | 296 | compare(dashDepartments.showList, true); | 293 | |
1374 | 297 | waitForRendering(departmentListView); | 294 | mouseClick(dashNavigation, 0, 0); |
1375 | 298 | waitForRendering(departmentListView.currentItem); | 295 | compare(dashNavigation.showList, true); |
1376 | 299 | compare(allButton.visible, true); | 296 | waitForRendering(navigationListView); |
1377 | 300 | 297 | waitForRendering(navigationListView.currentItem); | |
1378 | 301 | mouseClick(allButton, 0, 0); | 298 | compare(allButton.visible, true); |
1379 | 302 | compare(dashDepartments.showList, false); | 299 | |
1380 | 303 | tryCompare(dashDepartments.currentDepartment, "departmentId", "root"); | 300 | mouseClick(allButton, 0, 0); |
1381 | 304 | tryCompare(departmentListView.currentItem.department, "departmentId", "root"); | 301 | compare(dashNavigation.showList, false); |
1382 | 305 | 302 | tryCompare(dashNavigation.currentNavigation, "navigationId", "root"); | |
1383 | 306 | mouseClick(dashDepartments, 0, 0); | 303 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "root"); |
1384 | 307 | compare(dashDepartments.showList, true); | 304 | |
1385 | 308 | waitForRendering(departmentListView); | 305 | mouseClick(dashNavigation, 0, 0); |
1386 | 309 | waitForRendering(departmentListView.currentItem); | 306 | compare(dashNavigation.showList, true); |
1387 | 310 | compare(allButton.visible, false); | 307 | waitForRendering(navigationListView); |
1388 | 311 | 308 | waitForRendering(navigationListView.currentItem); | |
1389 | 312 | department = findChild(dashDepartments, "department0child2"); | 309 | compare(allButton.visible, false); |
1390 | 313 | mouseClick(department, 0, 0); | 310 | |
1391 | 314 | compare(dashDepartments.showList, true); | 311 | navigation = findChild(dashNavigation, "navigation0child2"); |
1392 | 315 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); | 312 | mouseClick(navigation, 0, 0); |
1393 | 316 | tryCompare(departmentListView.currentItem.department, "departmentId", "middle2"); | 313 | compare(dashNavigation.showList, true); |
1394 | 317 | 314 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); | |
1395 | 318 | var departmentList1 = findChild(dashDepartments, "department1"); | 315 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2"); |
1396 | 319 | allButton = findChild(departmentList1, "allButton"); | 316 | |
1397 | 320 | var backButton = findChild(findChild(departmentList1, "department1"), "backButton"); | 317 | var navigationList1 = findChild(dashNavigation, "navigation1"); |
1398 | 321 | compare(allButton.visible, true); | 318 | allButton = findChild(navigationList1, "allButton"); |
1399 | 322 | compare(backButton.visible, true); | 319 | var backButton = findChild(findChild(navigationList1, "navigation1"), "backButton"); |
1400 | 323 | 320 | compare(allButton.visible, true); | |
1401 | 324 | tryCompare(departmentListView, "contentX", departmentList1.x); | 321 | compare(backButton.visible, true); |
1402 | 325 | waitForRendering(departmentListView); | 322 | |
1403 | 326 | mouseClick(allButton, 0, 0); | 323 | tryCompare(navigationListView, "contentX", navigationList1.x); |
1404 | 327 | compare(dashDepartments.showList, false); | 324 | waitForRendering(navigationListView); |
1405 | 328 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); | 325 | mouseClick(allButton, 0, 0); |
1406 | 329 | tryCompare(departmentListView.currentItem.department, "departmentId", "middle2"); | 326 | compare(dashNavigation.showList, false); |
1407 | 330 | 327 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); | |
1408 | 331 | mouseClick(dashDepartments, 0, 0); | 328 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2"); |
1409 | 332 | compare(dashDepartments.showList, true); | 329 | |
1410 | 333 | waitForRendering(departmentListView); | 330 | mouseClick(dashNavigation, 0, 0); |
1411 | 334 | waitForRendering(departmentListView.currentItem); | 331 | compare(dashNavigation.showList, true); |
1412 | 335 | compare(allButton.visible, true); | 332 | waitForRendering(navigationListView); |
1413 | 336 | compare(backButton.visible, true); | 333 | waitForRendering(navigationListView.currentItem); |
1414 | 337 | 334 | compare(allButton.visible, true); | |
1415 | 338 | tryCompare(departmentList1.department, "loaded", true); | 335 | compare(backButton.visible, true); |
1416 | 339 | department = findChild(dashDepartments, "department1child2"); | 336 | |
1417 | 340 | mouseClick(department, 0, 0); | 337 | tryCompare(navigationList1.navigation, "loaded", true); |
1418 | 341 | compare(dashDepartments.showList, false); | 338 | navigation = findChild(dashNavigation, "navigation1child2"); |
1419 | 342 | tryCompare(dashDepartments.currentDepartment, "departmentId", "childmiddle22"); | 339 | mouseClick(navigation, 0, 0); |
1420 | 343 | tryCompare(departmentListView.currentItem.department, "departmentId", "middle2"); | 340 | compare(dashNavigation.showList, false); |
1421 | 344 | 341 | tryCompare(dashNavigation.currentNavigation, "navigationId", "childmiddle22"); | |
1422 | 345 | mouseClick(dashDepartments, 0, 0); | 342 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2"); |
1423 | 346 | compare(dashDepartments.showList, true); | 343 | |
1424 | 347 | waitForRendering(departmentListView); | 344 | mouseClick(dashNavigation, 0, 0); |
1425 | 348 | waitForRendering(departmentListView.currentItem); | 345 | compare(dashNavigation.showList, true); |
1426 | 349 | 346 | waitForRendering(navigationListView); | |
1427 | 350 | tryCompare(departmentList1.department, "loaded", true); | 347 | waitForRendering(navigationListView.currentItem); |
1428 | 351 | department = findChild(dashDepartments, "department1child3"); | 348 | |
1429 | 352 | mouseClick(department, 0, 0); | 349 | tryCompare(navigationList1.navigation, "loaded", true); |
1430 | 353 | compare(dashDepartments.showList, false); | 350 | navigation = findChild(dashNavigation, "navigation1child3"); |
1431 | 354 | tryCompare(dashDepartments.currentDepartment, "departmentId", "childmiddle23"); | 351 | mouseClick(navigation, 0, 0); |
1432 | 355 | tryCompare(departmentListView.currentItem.department, "departmentId", "middle2"); | 352 | compare(dashNavigation.showList, false); |
1433 | 356 | 353 | tryCompare(dashNavigation.currentNavigation, "navigationId", "childmiddle23"); | |
1434 | 357 | mouseClick(dashDepartments, 0, 0); | 354 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2"); |
1435 | 358 | compare(dashDepartments.showList, true); | 355 | |
1436 | 359 | waitForRendering(departmentListView); | 356 | mouseClick(dashNavigation, 0, 0); |
1437 | 360 | waitForRendering(departmentListView.currentItem); | 357 | compare(dashNavigation.showList, true); |
1438 | 358 | waitForRendering(navigationListView); | ||
1439 | 359 | waitForRendering(navigationListView.currentItem); | ||
1440 | 361 | mouseClick(backButton, 0, 0); | 360 | mouseClick(backButton, 0, 0); |
1441 | 362 | 361 | ||
1447 | 363 | tryCompare(dashDepartments.currentDepartment, "departmentId", "root"); | 362 | tryCompare(dashNavigation.currentNavigation, "navigationId", "root"); |
1448 | 364 | tryCompare(departmentListView.currentItem.department, "departmentId", "root"); | 363 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "root"); |
1449 | 365 | compare(dashDepartments.showList, true); | 364 | compare(dashNavigation.showList, true); |
1450 | 366 | mouseClick(dashDepartments, 0, 0); | 365 | mouseClick(dashNavigation, 0, 0); |
1451 | 367 | compare(dashDepartments.showList, false); | 366 | compare(dashNavigation.showList, false); |
1452 | 368 | 367 | ||
1464 | 369 | mouseClick(dashDepartments, 0, 0); | 368 | mouseClick(dashNavigation, 0, 0); |
1465 | 370 | compare(dashDepartments.showList, true); | 369 | compare(dashNavigation.showList, true); |
1466 | 371 | tryCompare(departmentListView.currentItem.department, "loaded", true); | 370 | tryCompare(navigationListView.currentItem.navigation, "loaded", true); |
1467 | 372 | department = findChild(dashDepartments, "department0child2"); | 371 | navigation = findChild(dashNavigation, "navigation0child2"); |
1468 | 373 | mouseClick(department, 0, 0); | 372 | mouseClick(navigation, 0, 0); |
1469 | 374 | compare(dashDepartments.showList, true); | 373 | compare(dashNavigation.showList, true); |
1470 | 375 | departmentList1 = findChild(dashDepartments, "department1"); | 374 | navigationList1 = findChild(dashNavigation, "navigation1"); |
1471 | 376 | compare(departmentList1.department.loaded, false); | 375 | compare(navigationList1.navigation.loaded, false); |
1472 | 377 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); | 376 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); |
1473 | 378 | allButton = findChild(departmentList1, "allButton"); | 377 | allButton = findChild(navigationList1, "allButton"); |
1474 | 379 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); | 378 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); |
1475 | 380 | mouseClick(allButton, 0, 0); | 379 | mouseClick(allButton, 0, 0); |
1477 | 381 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); | 380 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); |
1478 | 382 | } | 381 | } |
1479 | 383 | } | 382 | } |
1480 | 384 | } | 383 | } |
FAILED: Continuous integration, rev:1094 jenkins. qa.ubuntu. com/job/ unity8- ci/3743/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/2966/ console jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- utopic/ 745/console jenkins. qa.ubuntu. com/job/ unity8- utopic- amd64-ci/ 837/console jenkins. qa.ubuntu. com/job/ unity8- utopic- armhf-ci/ 837/console jenkins. qa.ubuntu. com/job/ unity8- utopic- i386-ci/ 837/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/4209/ console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity8- ci/3743/ rebuild
http://