Merge lp:~unity-team/unity8/scopes-v4 into lp:unity8
- scopes-v4
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Michał Sawicz |
Approved revision: | 1105 |
Merged at revision: | 1128 |
Proposed branch: | lp:~unity-team/unity8/scopes-v4 |
Merge into: | lp:unity8 |
Prerequisite: | lp:~aacid/unity8/unstable_departments_test |
Diff against target: |
1551 lines (+431/-353) 18 files modified
debian/control (+2/-2) qml/Dash/Dash.qml (+9/-11) qml/Dash/DashContent.qml (+3/-5) qml/Dash/DashNavigation.qml (+44/-44) qml/Dash/DashNavigationList.qml (+14/-14) qml/Dash/GenericScopeView.qml (+4/-14) qml/ScopeTool.qml (+1/-11) tests/mocks/Unity/CMakeLists.txt (+3/-3) tests/mocks/Unity/Unity.qmltypes (+87/-35) 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_Dash.qml (+5/-9) tests/qmltests/Dash/tst_DashContent.qml (+108/-111) |
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 | |
Michal Hruby (community) | Approve | ||
Michał Sawicz | Approve | ||
Albert Astals Cid | Pending | ||
Review via email: mp+229758@code.launchpad.net |
This proposal supersedes a proposal from 2014-08-01.
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) : Posted in a previous version of this proposal | # |
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
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 : Posted in a previous version of this proposal | # |
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://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
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://
Michał Sawicz (saviq) wrote : | # |
testDash is failing
- 1102. By Albert Astals Cid
-
Fix merge/tests
Michal Hruby (mhr3) wrote : | # |
Missing bump to dep on scopes-impl-4
- 1103. By Albert Astals Cid
-
more renaming
Albert Astals Cid (aacid) wrote : | # |
> Missing bump to dep on scopes-impl-4
Disagree, that is just for https:/
Albert Astals Cid (aacid) wrote : | # |
> testDash is failing
Should be fixed now
- 1104. By Albert Astals Cid
-
New need implementation
Albert Astals Cid (aacid) wrote : | # |
> > Missing bump to dep on scopes-impl-4
>
> Disagree, that is just for
> https:/
Ok, you're right, since there are renames we need this. Added.
- 1105. By Albert Astals Cid
-
More updates
Michał Sawicz (saviq) 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.
Won't, need v4, but passes locally.
Michal Hruby (mhr3) wrote : | # |
Looks good to me now.
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
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://
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://
Preview Diff
1 | === modified file 'debian/control' | |||
2 | --- debian/control 2014-07-31 16:48:11 +0000 | |||
3 | +++ debian/control 2014-08-06 11:31:11 +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 | @@ -112,7 +112,7 @@ | |||
14 | 112 | unity-application-impl-2, | 112 | unity-application-impl-2, |
15 | 113 | unity-notifications-impl-3, | 113 | unity-notifications-impl-3, |
16 | 114 | unity-plugin-scopes | unity-scopes-impl, | 114 | unity-plugin-scopes | unity-scopes-impl, |
18 | 115 | unity-scopes-impl-2, | 115 | unity-scopes-impl-4, |
19 | 116 | unity8-fake-env | unity-application-impl, | 116 | unity8-fake-env | unity-application-impl, |
20 | 117 | ${misc:Depends}, | 117 | ${misc:Depends}, |
21 | 118 | Breaks: unity8 (<< 7.86), | 118 | Breaks: unity8 (<< 7.86), |
22 | 119 | 119 | ||
23 | === modified file 'qml/Dash/Dash.qml' | |||
24 | --- qml/Dash/Dash.qml 2014-07-29 11:35:10 +0000 | |||
25 | +++ qml/Dash/Dash.qml 2014-08-06 11:31:11 +0000 | |||
26 | @@ -38,7 +38,13 @@ | |||
27 | 38 | } | 38 | } |
28 | 39 | 39 | ||
29 | 40 | function setCurrentScope(scopeId, animate, reset) { | 40 | function setCurrentScope(scopeId, animate, reset) { |
31 | 41 | var scopeIndex = filteredScopes.findFirst(Scopes.RoleId, scopeId) | 41 | var scopeIndex = -1; |
32 | 42 | for (var i = 0; i < scopes.count; ++i) { | ||
33 | 43 | if (scopes.getScope(i).id == scopeId) { | ||
34 | 44 | scopeIndex = i; | ||
35 | 45 | break; | ||
36 | 46 | } | ||
37 | 47 | } | ||
38 | 42 | 48 | ||
39 | 43 | if (scopeIndex == -1) { | 49 | if (scopeIndex == -1) { |
40 | 44 | console.warn("No match for scope with id: %1".arg(scopeId)) | 50 | console.warn("No match for scope with id: %1".arg(scopeId)) |
41 | @@ -63,15 +69,8 @@ | |||
42 | 63 | } | 69 | } |
43 | 64 | } | 70 | } |
44 | 65 | 71 | ||
54 | 66 | SortFilterProxyModel { | 72 | Scopes { |
55 | 67 | id: filteredScopes | 73 | id: scopes |
47 | 68 | model: Scopes { | ||
48 | 69 | id: scopes | ||
49 | 70 | } | ||
50 | 71 | dynamicSortFilter: true | ||
51 | 72 | |||
52 | 73 | filterRole: Scopes.RoleVisible | ||
53 | 74 | filterRegExp: RegExp("^true$") | ||
56 | 75 | } | 74 | } |
57 | 76 | 75 | ||
58 | 77 | DashContent { | 76 | DashContent { |
59 | @@ -79,7 +78,6 @@ | |||
60 | 79 | objectName: "dashContent" | 78 | objectName: "dashContent" |
61 | 80 | width: parent.width | 79 | width: parent.width |
62 | 81 | height: parent.height | 80 | height: parent.height |
63 | 82 | model: filteredScopes | ||
64 | 83 | scopes: scopes | 81 | scopes: scopes |
65 | 84 | visible: x != -width | 82 | visible: x != -width |
66 | 85 | onGotoScope: { | 83 | onGotoScope: { |
67 | 86 | 84 | ||
68 | === modified file 'qml/Dash/DashContent.qml' | |||
69 | --- qml/Dash/DashContent.qml 2014-08-06 11:31:10 +0000 | |||
70 | +++ qml/Dash/DashContent.qml 2014-08-06 11:31:11 +0000 | |||
71 | @@ -23,8 +23,7 @@ | |||
72 | 23 | Item { | 23 | Item { |
73 | 24 | id: dashContent | 24 | id: dashContent |
74 | 25 | 25 | ||
77 | 26 | property var model: null | 26 | property alias scopes: dashContentList.model |
76 | 27 | property var scopes: null | ||
78 | 28 | readonly property alias currentIndex: dashContentList.currentIndex | 27 | readonly property alias currentIndex: dashContentList.currentIndex |
79 | 29 | 28 | ||
80 | 30 | signal scopeLoaded(string scopeId) | 29 | signal scopeLoaded(string scopeId) |
81 | @@ -89,10 +88,9 @@ | |||
82 | 89 | id: dashContentList | 88 | id: dashContentList |
83 | 90 | objectName: "dashContentList" | 89 | objectName: "dashContentList" |
84 | 91 | 90 | ||
86 | 92 | interactive: dashContent.scopes.loaded && currentItem && !currentItem.moving && !currentItem.departmentsShown | 91 | interactive: dashContent.scopes.loaded && currentItem && !currentItem.moving && !currentItem.navigationShown |
87 | 93 | 92 | ||
88 | 94 | anchors.fill: parent | 93 | anchors.fill: parent |
89 | 95 | model: dashContent.model | ||
90 | 96 | orientation: ListView.Horizontal | 94 | orientation: ListView.Horizontal |
91 | 97 | boundsBehavior: Flickable.DragAndOvershootBounds | 95 | boundsBehavior: Flickable.DragAndOvershootBounds |
92 | 98 | flickDeceleration: units.gu(625) | 96 | flickDeceleration: units.gu(625) |
93 | @@ -130,7 +128,7 @@ | |||
94 | 130 | objectName: scope.id + " loader" | 128 | objectName: scope.id + " loader" |
95 | 131 | 129 | ||
96 | 132 | readonly property bool moving: item ? item.moving : false | 130 | readonly property bool moving: item ? item.moving : false |
98 | 133 | readonly property bool departmentsShown: item ? item.departmentsShown : false | 131 | readonly property bool navigationShown: item ? item.navigationShown : false |
99 | 134 | readonly property var categoryView: item ? item.categoryView : null | 132 | readonly property var categoryView: item ? item.categoryView : null |
100 | 135 | readonly property var theScope: scope | 133 | readonly property var theScope: scope |
101 | 136 | 134 | ||
102 | 137 | 135 | ||
103 | === renamed file 'qml/Dash/DashDepartments.qml' => 'qml/Dash/DashNavigation.qml' | |||
104 | --- qml/Dash/DashDepartments.qml 2014-08-06 11:31:10 +0000 | |||
105 | +++ qml/Dash/DashNavigation.qml 2014-08-06 11:31:11 +0000 | |||
106 | @@ -15,17 +15,17 @@ | |||
107 | 15 | */ | 15 | */ |
108 | 16 | 16 | ||
109 | 17 | import QtQuick 2.2 | 17 | import QtQuick 2.2 |
111 | 18 | import Ubuntu.Components 0.1 | 18 | import Ubuntu.Components 1.1 |
112 | 19 | 19 | ||
113 | 20 | AbstractButton { | 20 | AbstractButton { |
114 | 21 | id: root | 21 | id: root |
116 | 22 | objectName: "dashDepartments" | 22 | objectName: "dashNavigation" |
117 | 23 | 23 | ||
118 | 24 | property var scope: null | 24 | property var scope: null |
119 | 25 | 25 | ||
120 | 26 | property bool showList: false | 26 | property bool showList: false |
121 | 27 | 27 | ||
123 | 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 |
124 | 29 | 29 | ||
125 | 30 | property alias windowWidth: blackRect.width | 30 | property alias windowWidth: blackRect.width |
126 | 31 | property alias windowHeight: blackRect.height | 31 | property alias windowHeight: blackRect.height |
127 | @@ -34,21 +34,21 @@ | |||
128 | 34 | // Are we drilling down the tree or up? | 34 | // Are we drilling down the tree or up? |
129 | 35 | property bool isGoingBack: false | 35 | property bool isGoingBack: false |
130 | 36 | 36 | ||
132 | 37 | visible: root.currentDepartment != null | 37 | visible: root.currentNavigation != null |
133 | 38 | 38 | ||
134 | 39 | height: visible ? units.gu(5) : 0 | 39 | height: visible ? units.gu(5) : 0 |
135 | 40 | 40 | ||
136 | 41 | onClicked: { | 41 | onClicked: { |
138 | 42 | departmentListView.updateMaxHeight(); | 42 | navigationListView.updateMaxHeight(); |
139 | 43 | root.showList = !root.showList; | 43 | root.showList = !root.showList; |
140 | 44 | } | 44 | } |
141 | 45 | 45 | ||
142 | 46 | Rectangle { | 46 | Rectangle { |
143 | 47 | id: blackRect | 47 | id: blackRect |
144 | 48 | color: "black" | 48 | color: "black" |
146 | 49 | opacity: departmentListView.currentItem && departmentListView.currentItem.visible ? 0.3 : 0 | 49 | opacity: navigationListView.currentItem && navigationListView.currentItem.visible ? 0.3 : 0 |
147 | 50 | Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } } | 50 | Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } } |
149 | 51 | anchors.top: departmentListView.top | 51 | anchors.top: navigationListView.top |
150 | 52 | anchors.right: parent.right | 52 | anchors.right: parent.right |
151 | 53 | visible: opacity != 0 | 53 | visible: opacity != 0 |
152 | 54 | } | 54 | } |
153 | @@ -79,7 +79,7 @@ | |||
154 | 79 | anchors.fill: parent | 79 | anchors.fill: parent |
155 | 80 | anchors.margins: units.gu(2) | 80 | anchors.margins: units.gu(2) |
156 | 81 | verticalAlignment: Text.AlignVCenter | 81 | verticalAlignment: Text.AlignVCenter |
158 | 82 | text: root.currentDepartment ? root.currentDepartment.label : "" | 82 | text: root.currentNavigation ? root.currentNavigation.label : "" |
159 | 83 | color: root.scopeStyle ? root.scopeStyle.foreground : "grey" | 83 | color: root.scopeStyle ? root.scopeStyle.foreground : "grey" |
160 | 84 | } | 84 | } |
161 | 85 | 85 | ||
162 | @@ -93,18 +93,18 @@ | |||
163 | 93 | color: root.scopeStyle ? root.scopeStyle.foreground : "grey" | 93 | color: root.scopeStyle ? root.scopeStyle.foreground : "grey" |
164 | 94 | } | 94 | } |
165 | 95 | 95 | ||
167 | 96 | // departmentListView is outside root | 96 | // navigationListView is outside root |
168 | 97 | ListView { | 97 | ListView { |
171 | 98 | id: departmentListView | 98 | id: navigationListView |
172 | 99 | objectName: "departmentListView" | 99 | objectName: "navigationListView" |
173 | 100 | orientation: ListView.Horizontal | 100 | orientation: ListView.Horizontal |
174 | 101 | interactive: false | 101 | interactive: false |
175 | 102 | clip: root.width != windowWidth | 102 | clip: root.width != windowWidth |
176 | 103 | model: ListModel { | 103 | model: ListModel { |
178 | 104 | id: departmentModel | 104 | id: navigationModel |
179 | 105 | // We have two roles | 105 | // We have two roles |
182 | 106 | // departmentId: the department id of the department the list represents | 106 | // navigationId: the navigation id of the navigation the list represents |
183 | 107 | // nullifyDepartment: overrides departmentId to be null | 107 | // nullifyNavigation: overrides navigationId to be null |
184 | 108 | // 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 |
185 | 109 | } | 109 | } |
186 | 110 | anchors { | 110 | anchors { |
187 | @@ -126,84 +126,84 @@ | |||
188 | 126 | } | 126 | } |
189 | 127 | } | 127 | } |
190 | 128 | highlightMoveDuration: UbuntuAnimation.FastDuration | 128 | highlightMoveDuration: UbuntuAnimation.FastDuration |
193 | 129 | delegate: DashDepartmentsList { | 129 | delegate: DashNavigationList { |
194 | 130 | objectName: "department" + index | 130 | objectName: "navigation" + index |
195 | 131 | visible: height != 0 | 131 | visible: height != 0 |
197 | 132 | width: departmentListView.width | 132 | width: navigationListView.width |
198 | 133 | scopeStyle: root.scopeStyle | 133 | scopeStyle: root.scopeStyle |
199 | 134 | property real desiredHeight: { | 134 | property real desiredHeight: { |
200 | 135 | if (root.showList) { | 135 | if (root.showList) { |
202 | 136 | if (department && department.loaded && x == departmentListView.contentX) | 136 | if (navigation && navigation.loaded && x == navigationListView.contentX) |
203 | 137 | { | 137 | { |
206 | 138 | departmentListView.updateMaxHeight(); | 138 | navigationListView.updateMaxHeight(); |
207 | 139 | return Math.min(implicitHeight, departmentListView.maxHeight); | 139 | return Math.min(implicitHeight, navigationListView.maxHeight); |
208 | 140 | } else { | 140 | } else { |
210 | 141 | return departmentListView.prevHeight; | 141 | return navigationListView.prevHeight; |
211 | 142 | } | 142 | } |
212 | 143 | } else { | 143 | } else { |
213 | 144 | return 0; | 144 | return 0; |
214 | 145 | } | 145 | } |
215 | 146 | } | 146 | } |
216 | 147 | height: desiredHeight | 147 | height: desiredHeight |
221 | 148 | department: (nullifyDepartment || !scope) ? null : scope.getDepartment(departmentId) | 148 | navigation: (nullifyNavigation || !scope) ? null : scope.getNavigation(navigationId) |
222 | 149 | currentDepartment: root.currentDepartment | 149 | currentNavigation: root.currentNavigation |
223 | 150 | onEnterDepartment: { | 150 | onEnterNavigation: { |
224 | 151 | scope.loadDepartment(newDepartmentId); | 151 | scope.setNavigationState(newNavigationId, false); |
225 | 152 | // We only need to add a new item to the model | 152 | // We only need to add a new item to the model |
226 | 153 | // if we have children, otherwise just load it | 153 | // if we have children, otherwise just load it |
227 | 154 | if (hasChildren) { | 154 | if (hasChildren) { |
228 | 155 | isGoingBack = false; | 155 | isGoingBack = false; |
231 | 156 | departmentModel.append({"departmentId": newDepartmentId, "nullifyDepartment": false}); | 156 | navigationModel.append({"navigationId": newNavigationId, "nullifyNavigation": false}); |
232 | 157 | departmentListView.currentIndex++; | 157 | navigationListView.currentIndex++; |
233 | 158 | } else { | 158 | } else { |
234 | 159 | showList = false; | 159 | showList = false; |
235 | 160 | } | 160 | } |
236 | 161 | } | 161 | } |
237 | 162 | onGoBackToParentClicked: { | 162 | onGoBackToParentClicked: { |
239 | 163 | scope.loadDepartment(department.parentDepartmentId); | 163 | scope.setNavigationState(navigation.parentNavigationId, false); |
240 | 164 | isGoingBack = true; | 164 | isGoingBack = true; |
243 | 165 | departmentModel.setProperty(departmentListView.currentIndex - 1, "nullifyDepartment", false); | 165 | navigationModel.setProperty(navigationListView.currentIndex - 1, "nullifyNavigation", false); |
244 | 166 | departmentListView.currentIndex--; | 166 | navigationListView.currentIndex--; |
245 | 167 | } | 167 | } |
247 | 168 | onAllDepartmentClicked: { | 168 | onAllNavigationClicked: { |
248 | 169 | showList = false; | 169 | showList = false; |
250 | 170 | if (root.currentDepartment.parentDepartmentId == department.departmentId) { | 170 | if (root.currentNavigation.parentNavigationId == navigation.navigationId) { |
251 | 171 | // For leaves we have to go to the parent too | 171 | // For leaves we have to go to the parent too |
253 | 172 | scope.loadDepartment(root.currentDepartment.parentDepartmentId); | 172 | scope.setNavigationState(root.currentNavigation.parentNavigationId, false); |
254 | 173 | } | 173 | } |
255 | 174 | } | 174 | } |
256 | 175 | } | 175 | } |
257 | 176 | onContentXChanged: { | 176 | onContentXChanged: { |
259 | 177 | if (contentX == width * departmentListView.currentIndex) { | 177 | if (contentX == width * navigationListView.currentIndex) { |
260 | 178 | if (isGoingBack) { | 178 | if (isGoingBack) { |
262 | 179 | departmentModel.remove(departmentListView.currentIndex + 1); | 179 | navigationModel.remove(navigationListView.currentIndex + 1); |
263 | 180 | } else { | 180 | } else { |
265 | 181 | departmentModel.setProperty(departmentListView.currentIndex - 1, "nullifyDepartment", true); | 181 | navigationModel.setProperty(navigationListView.currentIndex - 1, "nullifyNavigation", true); |
266 | 182 | } | 182 | } |
267 | 183 | } | 183 | } |
268 | 184 | } | 184 | } |
269 | 185 | } | 185 | } |
270 | 186 | 186 | ||
271 | 187 | InverseMouseArea { | 187 | InverseMouseArea { |
273 | 188 | anchors.fill: departmentListView | 188 | anchors.fill: navigationListView |
274 | 189 | enabled: root.showList | 189 | enabled: root.showList |
275 | 190 | onClicked: root.showList = false | 190 | onClicked: root.showList = false |
276 | 191 | } | 191 | } |
277 | 192 | 192 | ||
278 | 193 | onScopeChanged: { | 193 | onScopeChanged: { |
282 | 194 | departmentModel.clear(); | 194 | navigationModel.clear(); |
283 | 195 | if (scope && scope.hasDepartments) { | 195 | if (scope && scope.hasNavigation) { |
284 | 196 | departmentModel.append({"departmentId": scope.currentDepartmentId, "nullifyDepartment": false}); | 196 | navigationModel.append({"navigationId": scope.currentNavigationId, "nullifyNavigation": false}); |
285 | 197 | } | 197 | } |
286 | 198 | } | 198 | } |
287 | 199 | 199 | ||
288 | 200 | Connections { | 200 | Connections { |
289 | 201 | target: scope | 201 | target: scope |
293 | 202 | onHasDepartmentsChanged: { | 202 | onHasNavigationChanged: { |
294 | 203 | if (scope.hasDepartments) { | 203 | if (scope.hasNavigation) { |
295 | 204 | departmentModel.append({"departmentId": scope.currentDepartmentId, "nullifyDepartment": false}); | 204 | navigationModel.append({"navigationId": scope.currentNavigationId, "nullifyNavigation": false}); |
296 | 205 | } else { | 205 | } else { |
298 | 206 | departmentModel.clear(); | 206 | navigationModel.clear(); |
299 | 207 | } | 207 | } |
300 | 208 | } | 208 | } |
301 | 209 | } | 209 | } |
302 | 210 | 210 | ||
303 | === renamed file 'qml/Dash/DashDepartmentsList.qml' => 'qml/Dash/DashNavigationList.qml' | |||
304 | --- qml/Dash/DashDepartmentsList.qml 2014-08-06 11:31:10 +0000 | |||
305 | +++ qml/Dash/DashNavigationList.qml 2014-08-06 11:31:11 +0000 | |||
306 | @@ -15,16 +15,16 @@ | |||
307 | 15 | */ | 15 | */ |
308 | 16 | 16 | ||
309 | 17 | import QtQuick 2.2 | 17 | import QtQuick 2.2 |
311 | 18 | import Ubuntu.Components 0.1 | 18 | import Ubuntu.Components 1.1 |
312 | 19 | 19 | ||
313 | 20 | Item { | 20 | Item { |
314 | 21 | id: root | 21 | id: root |
317 | 22 | property var department: null | 22 | property var navigation: null |
318 | 23 | property var currentDepartment: null | 23 | property var currentNavigation: null |
319 | 24 | property var scopeStyle: null | 24 | property var scopeStyle: null |
321 | 25 | signal enterDepartment(var newDepartmentId, bool hasChildren) | 25 | signal enterNavigation(var newNavigationId, bool hasChildren) |
322 | 26 | signal goBackToParentClicked() | 26 | signal goBackToParentClicked() |
324 | 27 | signal allDepartmentClicked() | 27 | signal allNavigationClicked() |
325 | 28 | 28 | ||
326 | 29 | readonly property int itemHeight: units.gu(5) | 29 | readonly property int itemHeight: units.gu(5) |
327 | 30 | readonly property color foregroundColor: root.scopeStyle ? root.scopeStyle.foreground : "grey" | 30 | readonly property color foregroundColor: root.scopeStyle ? root.scopeStyle.foreground : "grey" |
328 | @@ -38,7 +38,7 @@ | |||
329 | 38 | ActivityIndicator { | 38 | ActivityIndicator { |
330 | 39 | id: loadingIndicator | 39 | id: loadingIndicator |
331 | 40 | anchors.centerIn: parent | 40 | anchors.centerIn: parent |
333 | 41 | running: !(department && department.loaded) | 41 | running: !(navigation && navigation.loaded) |
334 | 42 | } | 42 | } |
335 | 43 | clip: true | 43 | clip: true |
336 | 44 | 44 | ||
337 | @@ -69,7 +69,7 @@ | |||
338 | 69 | id: backButton | 69 | id: backButton |
339 | 70 | objectName: "backButton" | 70 | objectName: "backButton" |
340 | 71 | width: parent.width | 71 | width: parent.width |
342 | 72 | visible: department && !department.isRoot || false | 72 | visible: navigation && !navigation.isRoot || false |
343 | 73 | height: itemHeight | 73 | height: itemHeight |
344 | 74 | 74 | ||
345 | 75 | onClicked: root.goBackToParentClicked(); | 75 | onClicked: root.goBackToParentClicked(); |
346 | @@ -93,7 +93,7 @@ | |||
347 | 93 | left: backImage.right | 93 | left: backImage.right |
348 | 94 | leftMargin: units.gu(0.5) | 94 | leftMargin: units.gu(0.5) |
349 | 95 | } | 95 | } |
351 | 96 | text: department ? department.parentLabel : "" | 96 | text: navigation ? navigation.parentLabel : "" |
352 | 97 | color: root.foregroundColor | 97 | color: root.foregroundColor |
353 | 98 | } | 98 | } |
354 | 99 | 99 | ||
355 | @@ -115,7 +115,7 @@ | |||
356 | 115 | id: allButton | 115 | id: allButton |
357 | 116 | objectName: "allButton" | 116 | objectName: "allButton" |
358 | 117 | width: parent.width | 117 | width: parent.width |
360 | 118 | 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 |
361 | 119 | height: itemHeight | 119 | height: itemHeight |
362 | 120 | 120 | ||
363 | 121 | Label { | 121 | Label { |
364 | @@ -124,7 +124,7 @@ | |||
365 | 124 | left: parent.left | 124 | left: parent.left |
366 | 125 | leftMargin: units.gu(2) | 125 | leftMargin: units.gu(2) |
367 | 126 | } | 126 | } |
369 | 127 | text: department ? (department.allLabel != "" ? department.allLabel : department.label) : "" | 127 | text: navigation ? (navigation.allLabel != "" ? navigation.allLabel : navigation.label) : "" |
370 | 128 | font.bold: true | 128 | font.bold: true |
371 | 129 | color: root.foregroundColor | 129 | color: root.foregroundColor |
372 | 130 | } | 130 | } |
373 | @@ -142,18 +142,18 @@ | |||
374 | 142 | height: units.dp(1) | 142 | height: units.dp(1) |
375 | 143 | } | 143 | } |
376 | 144 | 144 | ||
378 | 145 | onClicked: root.allDepartmentClicked(); | 145 | onClicked: root.allNavigationClicked(); |
379 | 146 | } | 146 | } |
380 | 147 | 147 | ||
381 | 148 | Repeater { | 148 | Repeater { |
383 | 149 | model: department && department.loaded ? department : null | 149 | model: navigation && navigation.loaded ? navigation : null |
384 | 150 | clip: true | 150 | clip: true |
385 | 151 | delegate: AbstractButton { | 151 | delegate: AbstractButton { |
386 | 152 | objectName: root.objectName + "child" + index | 152 | objectName: root.objectName + "child" + index |
387 | 153 | height: root.itemHeight | 153 | height: root.itemHeight |
388 | 154 | width: root.width | 154 | width: root.width |
389 | 155 | 155 | ||
391 | 156 | onClicked: root.enterDepartment(departmentId, hasChildren) | 156 | onClicked: root.enterNavigation(navigationId, hasChildren) |
392 | 157 | 157 | ||
393 | 158 | Label { | 158 | Label { |
394 | 159 | anchors { | 159 | anchors { |
395 | @@ -189,7 +189,7 @@ | |||
396 | 189 | color: root.foregroundColor | 189 | color: root.foregroundColor |
397 | 190 | opacity: 0.1 | 190 | opacity: 0.1 |
398 | 191 | height: units.dp(1) | 191 | height: units.dp(1) |
400 | 192 | visible: index != department.count - 1 | 192 | visible: index != navigation.count - 1 |
401 | 193 | } | 193 | } |
402 | 194 | } | 194 | } |
403 | 195 | } | 195 | } |
404 | 196 | 196 | ||
405 | === modified file 'qml/Dash/GenericScopeView.qml' | |||
406 | --- qml/Dash/GenericScopeView.qml 2014-08-06 11:31:10 +0000 | |||
407 | +++ qml/Dash/GenericScopeView.qml 2014-08-06 11:31:11 +0000 | |||
408 | @@ -25,7 +25,7 @@ | |||
409 | 25 | FocusScope { | 25 | FocusScope { |
410 | 26 | id: scopeView | 26 | id: scopeView |
411 | 27 | 27 | ||
413 | 28 | readonly property alias departmentsShown: dashDepartments.showList | 28 | readonly property alias navigationShown: dashNavigation.showList |
414 | 29 | property var scope: null | 29 | property var scope: null |
415 | 30 | property SortFilterProxyModel categories: categoryFilter | 30 | property SortFilterProxyModel categories: categoryFilter |
416 | 31 | property bool isCurrent: false | 31 | property bool isCurrent: false |
417 | @@ -40,16 +40,6 @@ | |||
418 | 40 | 40 | ||
419 | 41 | signal backClicked() | 41 | signal backClicked() |
420 | 42 | 42 | ||
421 | 43 | onScopeChanged: { | ||
422 | 44 | if (scope) { | ||
423 | 45 | scope.activateApplication.connect(activateApp); | ||
424 | 46 | } | ||
425 | 47 | } | ||
426 | 48 | |||
427 | 49 | function activateApp(appId) { | ||
428 | 50 | Qt.openUrlExternally(appId); | ||
429 | 51 | } | ||
430 | 52 | |||
431 | 53 | function positionAtBeginning() { | 43 | function positionAtBeginning() { |
432 | 54 | categoryView.positionAtBeginning() | 44 | categoryView.positionAtBeginning() |
433 | 55 | } | 45 | } |
434 | @@ -120,7 +110,7 @@ | |||
435 | 120 | model: scopeView.categories | 110 | model: scopeView.categories |
436 | 121 | forceNoClip: previewListView.open | 111 | forceNoClip: previewListView.open |
437 | 122 | pixelAligned: true | 112 | pixelAligned: true |
439 | 123 | interactive: !dashDepartments.showList | 113 | interactive: !dashNavigation.showList |
440 | 124 | 114 | ||
441 | 125 | property string expandedCategoryId: "" | 115 | property string expandedCategoryId: "" |
442 | 126 | 116 | ||
443 | @@ -392,8 +382,8 @@ | |||
444 | 392 | searchInProgress: scopeView.scope ? scopeView.scope.searchInProgress : false | 382 | searchInProgress: scopeView.scope ? scopeView.scope.searchInProgress : false |
445 | 393 | scopeStyle: scopeView.scopeStyle | 383 | scopeStyle: scopeView.scopeStyle |
446 | 394 | 384 | ||
449 | 395 | bottomItem: DashDepartments { | 385 | bottomItem: DashNavigation { |
450 | 396 | id: dashDepartments | 386 | id: dashNavigation |
451 | 397 | scope: scopeView.scope | 387 | scope: scopeView.scope |
452 | 398 | width: parent.width <= units.gu(60) ? parent.width : units.gu(40) | 388 | width: parent.width <= units.gu(60) ? parent.width : units.gu(40) |
453 | 399 | anchors.right: parent.right | 389 | anchors.right: parent.right |
454 | 400 | 390 | ||
455 | === modified file 'qml/ScopeTool.qml' | |||
456 | --- qml/ScopeTool.qml 2014-07-03 09:08:22 +0000 | |||
457 | +++ qml/ScopeTool.qml 2014-08-06 11:31:11 +0000 | |||
458 | @@ -45,16 +45,6 @@ | |||
459 | 45 | signal searchClicked | 45 | signal searchClicked |
460 | 46 | } | 46 | } |
461 | 47 | 47 | ||
462 | 48 | SortFilterProxyModel { | ||
463 | 49 | id: filteredScopes | ||
464 | 50 | model: Scopes { | ||
465 | 51 | id: scopes | ||
466 | 52 | } | ||
467 | 53 | dynamicSortFilter: true | ||
468 | 54 | |||
469 | 55 | filterRole: Scopes.RoleVisible | ||
470 | 56 | filterRegExp: RegExp("^true$") | ||
471 | 57 | } | ||
472 | 58 | 48 | ||
473 | 59 | Rectangle { | 49 | Rectangle { |
474 | 60 | anchors.fill: dashContent | 50 | anchors.fill: dashContent |
475 | @@ -72,8 +62,8 @@ | |||
476 | 72 | DashContent { | 62 | DashContent { |
477 | 73 | id: dashContent | 63 | id: dashContent |
478 | 74 | 64 | ||
479 | 75 | model: filteredScopes | ||
480 | 76 | property var scope: scopes.getScope(currentIndex) | 65 | property var scope: scopes.getScope(currentIndex) |
481 | 66 | scopes: Scopes { } | ||
482 | 77 | 67 | ||
483 | 78 | anchors { | 68 | anchors { |
484 | 79 | top: parent.top | 69 | top: parent.top |
485 | 80 | 70 | ||
486 | === modified file 'tests/mocks/Unity/CMakeLists.txt' | |||
487 | --- tests/mocks/Unity/CMakeLists.txt 2014-08-05 12:06:16 +0000 | |||
488 | +++ tests/mocks/Unity/CMakeLists.txt 2014-08-06 11:31:11 +0000 | |||
489 | @@ -7,7 +7,7 @@ | |||
490 | 7 | pkg_search_module(DEE dee-1.0 REQUIRED) | 7 | pkg_search_module(DEE dee-1.0 REQUIRED) |
491 | 8 | pkg_search_module(GOBJECT gobject-2.0 REQUIRED) | 8 | pkg_search_module(GOBJECT gobject-2.0 REQUIRED) |
492 | 9 | pkg_search_module(DEEQT libdee-qt5 REQUIRED) | 9 | pkg_search_module(DEEQT libdee-qt5 REQUIRED) |
494 | 10 | pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=3) | 10 | pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=4) |
495 | 11 | 11 | ||
496 | 12 | include_directories( | 12 | include_directories( |
497 | 13 | ${CMAKE_CURRENT_BINARY_DIR} | 13 | ${CMAKE_CURRENT_BINARY_DIR} |
498 | @@ -23,14 +23,14 @@ | |||
499 | 23 | fake_scope.cpp | 23 | fake_scope.cpp |
500 | 24 | fake_scopes.cpp | 24 | fake_scopes.cpp |
501 | 25 | fake_categories.cpp | 25 | fake_categories.cpp |
503 | 26 | fake_department.cpp | 26 | fake_navigation.cpp |
504 | 27 | fake_resultsmodel.cpp | 27 | fake_resultsmodel.cpp |
505 | 28 | fake_previewmodel.cpp | 28 | fake_previewmodel.cpp |
506 | 29 | fake_previewstack.cpp | 29 | fake_previewstack.cpp |
507 | 30 | fake_previewwidgetmodel.cpp | 30 | fake_previewwidgetmodel.cpp |
508 | 31 | fake_unity_plugin.cpp | 31 | fake_unity_plugin.cpp |
509 | 32 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/CategoriesInterface.h | 32 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/CategoriesInterface.h |
511 | 33 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/DepartmentInterface.h | 33 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/NavigationInterface.h |
512 | 34 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewModelInterface.h | 34 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewModelInterface.h |
513 | 35 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewStackInterface.h | 35 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewStackInterface.h |
514 | 36 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewWidgetModelInterface.h | 36 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewWidgetModelInterface.h |
515 | 37 | 37 | ||
516 | === modified file 'tests/mocks/Unity/Unity.qmltypes' | |||
517 | --- tests/mocks/Unity/Unity.qmltypes 2014-07-10 10:59:08 +0000 | |||
518 | +++ tests/mocks/Unity/Unity.qmltypes 2014-08-06 11:31:11 +0000 | |||
519 | @@ -24,6 +24,12 @@ | |||
520 | 24 | Parameter { name: "categoryId"; type: "string" } | 24 | Parameter { name: "categoryId"; type: "string" } |
521 | 25 | Parameter { name: "json"; type: "string" } | 25 | Parameter { name: "json"; type: "string" } |
522 | 26 | } | 26 | } |
523 | 27 | Method { | ||
524 | 28 | name: "data" | ||
525 | 29 | type: "QVariant" | ||
526 | 30 | Parameter { name: "row"; type: "int" } | ||
527 | 31 | Parameter { name: "role"; type: "int" } | ||
528 | 32 | } | ||
529 | 27 | } | 33 | } |
530 | 28 | Component { | 34 | Component { |
531 | 29 | name: "PreviewModel" | 35 | name: "PreviewModel" |
532 | @@ -62,6 +68,10 @@ | |||
533 | 62 | prototype: "unity::shell::scopes::ScopeInterface" | 68 | prototype: "unity::shell::scopes::ScopeInterface" |
534 | 63 | exports: ["Unity/MockScope 0.2"] | 69 | exports: ["Unity/MockScope 0.2"] |
535 | 64 | exportMetaObjectRevisions: [0] | 70 | exportMetaObjectRevisions: [0] |
536 | 71 | Signal { | ||
537 | 72 | name: "performQuery" | ||
538 | 73 | Parameter { name: "query"; type: "string" } | ||
539 | 74 | } | ||
540 | 65 | Method { | 75 | Method { |
541 | 66 | name: "setSearchInProgress" | 76 | name: "setSearchInProgress" |
542 | 67 | Parameter { name: "inProg"; type: "bool" } | 77 | Parameter { name: "inProg"; type: "bool" } |
543 | @@ -81,18 +91,21 @@ | |||
544 | 81 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } | 91 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } |
545 | 82 | } | 92 | } |
546 | 83 | Method { | 93 | Method { |
559 | 84 | name: "getDepartment" | 94 | name: "getNavigation" |
560 | 85 | type: "unity::shell::scopes::DepartmentInterface*" | 95 | type: "unity::shell::scopes::NavigationInterface*" |
561 | 86 | Parameter { name: "id"; type: "string" } | 96 | Parameter { name: "navigationId"; type: "string" } |
562 | 87 | } | 97 | } |
563 | 88 | Method { | 98 | Method { |
564 | 89 | name: "loadDepartment" | 99 | name: "getAltNavigation" |
565 | 90 | Parameter { name: "id"; type: "string" } | 100 | type: "unity::shell::scopes::NavigationInterface*" |
566 | 91 | } | 101 | Parameter { name: "altNavigationId"; type: "string" } |
567 | 92 | Method { | 102 | } |
568 | 93 | name: "performQuery" | 103 | Method { |
569 | 94 | Parameter { name: "query"; type: "string" } | 104 | name: "setNavigationState" |
570 | 95 | } | 105 | Parameter { name: "navigationId"; type: "string" } |
571 | 106 | Parameter { name: "isAltNavigation"; type: "bool" } | ||
572 | 107 | } | ||
573 | 108 | Method { name: "refresh" } | ||
574 | 96 | } | 109 | } |
575 | 97 | Component { | 110 | Component { |
576 | 98 | name: "Scopes" | 111 | name: "Scopes" |
577 | @@ -137,6 +150,7 @@ | |||
578 | 137 | "RoleRawRendererTemplate": 3, | 150 | "RoleRawRendererTemplate": 3, |
579 | 138 | "RoleRenderer": 4, | 151 | "RoleRenderer": 4, |
580 | 139 | "RoleComponents": 5, | 152 | "RoleComponents": 5, |
581 | 153 | "RoleHeaderLink": 6, | ||
582 | 140 | "RoleResults": 7, | 154 | "RoleResults": 7, |
583 | 141 | "RoleCount": 8 | 155 | "RoleCount": 8 |
584 | 142 | } | 156 | } |
585 | @@ -157,27 +171,28 @@ | |||
586 | 157 | } | 171 | } |
587 | 158 | } | 172 | } |
588 | 159 | Component { | 173 | Component { |
590 | 160 | name: "unity::shell::scopes::DepartmentInterface" | 174 | name: "unity::shell::scopes::NavigationInterface" |
591 | 161 | prototype: "QAbstractListModel" | 175 | prototype: "QAbstractListModel" |
593 | 162 | exports: ["Unity/Department 0.2"] | 176 | exports: ["Unity/Navigation 0.2"] |
594 | 163 | isCreatable: false | 177 | isCreatable: false |
595 | 164 | exportMetaObjectRevisions: [0] | 178 | exportMetaObjectRevisions: [0] |
596 | 165 | Enum { | 179 | Enum { |
597 | 166 | name: "Roles" | 180 | name: "Roles" |
598 | 167 | values: { | 181 | values: { |
600 | 168 | "RoleDepartmentId": 0, | 182 | "RoleNavigationId": 0, |
601 | 169 | "RoleLabel": 1, | 183 | "RoleLabel": 1, |
602 | 170 | "RoleHasChildren": 2, | 184 | "RoleHasChildren": 2, |
603 | 171 | "RoleIsActive": 3 | 185 | "RoleIsActive": 3 |
604 | 172 | } | 186 | } |
605 | 173 | } | 187 | } |
607 | 174 | Property { name: "departmentId"; type: "string"; isReadonly: true } | 188 | Property { name: "navigationId"; type: "string"; isReadonly: true } |
608 | 175 | Property { name: "label"; type: "string"; isReadonly: true } | 189 | Property { name: "label"; type: "string"; isReadonly: true } |
609 | 176 | Property { name: "allLabel"; type: "string"; isReadonly: true } | 190 | Property { name: "allLabel"; type: "string"; isReadonly: true } |
611 | 177 | Property { name: "parentDepartmentId"; type: "string"; isReadonly: true } | 191 | Property { name: "parentNavigationId"; type: "string"; isReadonly: true } |
612 | 178 | Property { name: "parentLabel"; type: "string"; isReadonly: true } | 192 | Property { name: "parentLabel"; type: "string"; isReadonly: true } |
613 | 179 | Property { name: "loaded"; type: "bool"; isReadonly: true } | 193 | Property { name: "loaded"; type: "bool"; isReadonly: true } |
614 | 180 | Property { name: "isRoot"; type: "bool"; isReadonly: true } | 194 | Property { name: "isRoot"; type: "bool"; isReadonly: true } |
615 | 195 | Property { name: "hidden"; type: "bool"; isReadonly: true } | ||
616 | 181 | Property { name: "count"; type: "int"; isReadonly: true } | 196 | Property { name: "count"; type: "int"; isReadonly: true } |
617 | 182 | } | 197 | } |
618 | 183 | Component { | 198 | Component { |
619 | @@ -247,7 +262,8 @@ | |||
620 | 247 | "RoleEmblem": 8, | 262 | "RoleEmblem": 8, |
621 | 248 | "RoleSummary": 9, | 263 | "RoleSummary": 9, |
622 | 249 | "RoleAttributes": 10, | 264 | "RoleAttributes": 10, |
624 | 250 | "RoleBackground": 11 | 265 | "RoleBackground": 11, |
625 | 266 | "RoleOverlayColor": 12 | ||
626 | 251 | } | 267 | } |
627 | 252 | } | 268 | } |
628 | 253 | Property { name: "categoryId"; type: "string" } | 269 | Property { name: "categoryId"; type: "string" } |
629 | @@ -259,13 +275,22 @@ | |||
630 | 259 | exports: ["Unity/Scope 0.2"] | 275 | exports: ["Unity/Scope 0.2"] |
631 | 260 | isCreatable: false | 276 | isCreatable: false |
632 | 261 | exportMetaObjectRevisions: [0] | 277 | exportMetaObjectRevisions: [0] |
633 | 278 | Enum { | ||
634 | 279 | name: "Status" | ||
635 | 280 | values: { | ||
636 | 281 | "Okay": 0, | ||
637 | 282 | "NoInternet": 1, | ||
638 | 283 | "NoLocationData": 2, | ||
639 | 284 | "Unknown": 3 | ||
640 | 285 | } | ||
641 | 286 | } | ||
642 | 262 | Property { name: "id"; type: "string"; isReadonly: true } | 287 | Property { name: "id"; type: "string"; isReadonly: true } |
643 | 263 | Property { name: "name"; type: "string"; isReadonly: true } | 288 | Property { name: "name"; type: "string"; isReadonly: true } |
644 | 264 | Property { name: "iconHint"; type: "string"; isReadonly: true } | 289 | Property { name: "iconHint"; type: "string"; isReadonly: true } |
645 | 265 | Property { name: "description"; type: "string"; isReadonly: true } | 290 | Property { name: "description"; type: "string"; isReadonly: true } |
646 | 266 | Property { name: "searchHint"; type: "string"; isReadonly: true } | 291 | Property { name: "searchHint"; type: "string"; isReadonly: true } |
647 | 267 | Property { name: "searchInProgress"; type: "bool"; isReadonly: true } | 292 | Property { name: "searchInProgress"; type: "bool"; isReadonly: true } |
649 | 268 | Property { name: "visible"; type: "bool"; isReadonly: true } | 293 | Property { name: "favorite"; type: "bool" } |
650 | 269 | Property { name: "shortcut"; type: "string"; isReadonly: true } | 294 | Property { name: "shortcut"; type: "string"; isReadonly: true } |
651 | 270 | Property { | 295 | Property { |
652 | 271 | name: "categories" | 296 | name: "categories" |
653 | @@ -273,13 +298,27 @@ | |||
654 | 273 | isReadonly: true | 298 | isReadonly: true |
655 | 274 | isPointer: true | 299 | isPointer: true |
656 | 275 | } | 300 | } |
657 | 301 | Property { | ||
658 | 302 | name: "settings" | ||
659 | 303 | type: "unity::shell::scopes::SettingsModelInterface" | ||
660 | 304 | isReadonly: true | ||
661 | 305 | isPointer: true | ||
662 | 306 | } | ||
663 | 276 | Property { name: "searchQuery"; type: "string" } | 307 | Property { name: "searchQuery"; type: "string" } |
664 | 277 | Property { name: "noResultsHint"; type: "string" } | 308 | Property { name: "noResultsHint"; type: "string" } |
665 | 278 | Property { name: "formFactor"; type: "string" } | 309 | Property { name: "formFactor"; type: "string" } |
666 | 279 | Property { name: "isActive"; type: "bool" } | 310 | Property { name: "isActive"; type: "bool" } |
669 | 280 | Property { name: "currentDepartmentId"; type: "string"; isReadonly: true } | 311 | Property { name: "currentNavigationId"; type: "string"; isReadonly: true } |
670 | 281 | Property { name: "hasDepartments"; type: "bool"; isReadonly: true } | 312 | Property { name: "hasNavigation"; type: "bool"; isReadonly: true } |
671 | 313 | Property { name: "currentAltNavigationId"; type: "string"; isReadonly: true } | ||
672 | 314 | Property { name: "hasAltNavigation"; type: "bool"; isReadonly: true } | ||
673 | 282 | Property { name: "customizations"; type: "QVariantMap"; isReadonly: true } | 315 | Property { name: "customizations"; type: "QVariantMap"; isReadonly: true } |
674 | 316 | Property { | ||
675 | 317 | name: "status" | ||
676 | 318 | type: "unity::shell::scopes::ScopeInterface::Status" | ||
677 | 319 | isReadonly: true | ||
678 | 320 | } | ||
679 | 321 | Signal { name: "detailsChanged" } | ||
680 | 283 | Signal { name: "showDash" } | 322 | Signal { name: "showDash" } |
681 | 284 | Signal { name: "hideDash" } | 323 | Signal { name: "hideDash" } |
682 | 285 | Signal { | 324 | Signal { |
683 | @@ -298,10 +337,6 @@ | |||
684 | 298 | name: "openScope" | 337 | name: "openScope" |
685 | 299 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } | 338 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } |
686 | 300 | } | 339 | } |
687 | 301 | Signal { | ||
688 | 302 | name: "activateApplication" | ||
689 | 303 | Parameter { name: "desktop"; type: "string" } | ||
690 | 304 | } | ||
691 | 305 | Method { | 340 | Method { |
692 | 306 | name: "activate" | 341 | name: "activate" |
693 | 307 | Parameter { name: "result"; type: "QVariant" } | 342 | Parameter { name: "result"; type: "QVariant" } |
694 | @@ -317,14 +352,25 @@ | |||
695 | 317 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } | 352 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } |
696 | 318 | } | 353 | } |
697 | 319 | Method { | 354 | Method { |
706 | 320 | name: "getDepartment" | 355 | name: "getNavigation" |
707 | 321 | type: "unity::shell::scopes::DepartmentInterface*" | 356 | type: "unity::shell::scopes::NavigationInterface*" |
708 | 322 | Parameter { name: "departmentId"; type: "string" } | 357 | Parameter { name: "navigationId"; type: "string" } |
709 | 323 | } | 358 | } |
710 | 324 | Method { | 359 | Method { |
711 | 325 | name: "loadDepartment" | 360 | name: "getAltNavigation" |
712 | 326 | Parameter { name: "departmentId"; type: "string" } | 361 | type: "unity::shell::scopes::NavigationInterface*" |
713 | 327 | } | 362 | Parameter { name: "altNavigationId"; type: "string" } |
714 | 363 | } | ||
715 | 364 | Method { | ||
716 | 365 | name: "setNavigationState" | ||
717 | 366 | Parameter { name: "navId"; type: "string" } | ||
718 | 367 | Parameter { name: "altNavigation"; type: "bool" } | ||
719 | 368 | } | ||
720 | 369 | Method { | ||
721 | 370 | name: "performQuery" | ||
722 | 371 | Parameter { name: "cannedQuery"; type: "string" } | ||
723 | 372 | } | ||
724 | 373 | Method { name: "refresh" } | ||
725 | 328 | } | 374 | } |
726 | 329 | Component { | 375 | Component { |
727 | 330 | name: "unity::shell::scopes::ScopesInterface" | 376 | name: "unity::shell::scopes::ScopesInterface" |
728 | @@ -334,11 +380,17 @@ | |||
729 | 334 | values: { | 380 | values: { |
730 | 335 | "RoleScope": 0, | 381 | "RoleScope": 0, |
731 | 336 | "RoleId": 1, | 382 | "RoleId": 1, |
734 | 337 | "RoleVisible": 2, | 383 | "RoleTitle": 2 |
733 | 338 | "RoleTitle": 3 | ||
735 | 339 | } | 384 | } |
736 | 340 | } | 385 | } |
737 | 341 | Property { name: "loaded"; type: "bool"; isReadonly: true } | 386 | Property { name: "loaded"; type: "bool"; isReadonly: true } |
738 | 387 | Property { name: "count"; type: "int"; isReadonly: true } | ||
739 | 388 | Property { | ||
740 | 389 | name: "overviewScope" | ||
741 | 390 | type: "unity::shell::scopes::ScopeInterface" | ||
742 | 391 | isReadonly: true | ||
743 | 392 | isPointer: true | ||
744 | 393 | } | ||
745 | 342 | Method { | 394 | Method { |
746 | 343 | name: "getScope" | 395 | name: "getScope" |
747 | 344 | type: "unity::shell::scopes::ScopeInterface*" | 396 | type: "unity::shell::scopes::ScopeInterface*" |
748 | 345 | 397 | ||
749 | === renamed file 'tests/mocks/Unity/fake_department.cpp' => 'tests/mocks/Unity/fake_navigation.cpp' | |||
750 | --- tests/mocks/Unity/fake_department.cpp 2014-06-18 13:48:32 +0000 | |||
751 | +++ tests/mocks/Unity/fake_navigation.cpp 2014-08-06 11:31:11 +0000 | |||
752 | @@ -14,14 +14,15 @@ | |||
753 | 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/>. |
754 | 15 | */ | 15 | */ |
755 | 16 | 16 | ||
757 | 17 | #include "fake_department.h" | 17 | #include "fake_navigation.h" |
758 | 18 | 18 | ||
759 | 19 | #include "fake_scope.h" | 19 | #include "fake_scope.h" |
760 | 20 | 20 | ||
761 | 21 | #include <QDebug> | ||
762 | 21 | #include <QTimer> | 22 | #include <QTimer> |
763 | 22 | 23 | ||
766 | 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) |
767 | 24 | : m_departmentId(departmentId) | 25 | : m_navigationId(navigationId) |
768 | 25 | , m_label(label) | 26 | , m_label(label) |
769 | 26 | , m_allLabel(allLabel) | 27 | , m_allLabel(allLabel) |
770 | 27 | , m_parentId(parentId) | 28 | , m_parentId(parentId) |
771 | @@ -30,96 +31,87 @@ | |||
772 | 30 | , m_scope(scope) | 31 | , m_scope(scope) |
773 | 31 | { | 32 | { |
774 | 32 | QTimer::singleShot(1500, this, SLOT(slotLoaded())); | 33 | QTimer::singleShot(1500, this, SLOT(slotLoaded())); |
776 | 33 | connect(scope, SIGNAL(currentDepartmentIdChanged()), this, SLOT(slotCurrentDepartmentChanged())); | 34 | connect(scope, SIGNAL(currentNavigationIdChanged()), this, SLOT(slotCurrentNavigationChanged())); |
777 | 34 | } | 35 | } |
778 | 35 | 36 | ||
780 | 36 | QString Department::departmentId() const | 37 | QString Navigation::navigationId() const |
781 | 37 | { | 38 | { |
783 | 38 | return m_departmentId; | 39 | return m_navigationId; |
784 | 39 | } | 40 | } |
785 | 40 | 41 | ||
787 | 41 | QString Department::label() const | 42 | QString Navigation::label() const |
788 | 42 | { | 43 | { |
789 | 43 | return m_label; | 44 | return m_label; |
790 | 44 | } | 45 | } |
791 | 45 | 46 | ||
793 | 46 | QString Department::allLabel() const | 47 | QString Navigation::allLabel() const |
794 | 47 | { | 48 | { |
795 | 48 | return m_allLabel; | 49 | return m_allLabel; |
796 | 49 | } | 50 | } |
797 | 50 | 51 | ||
799 | 51 | QString Department::parentDepartmentId() const | 52 | QString Navigation::parentNavigationId() const |
800 | 52 | { | 53 | { |
801 | 53 | return m_parentId; | 54 | return m_parentId; |
802 | 54 | } | 55 | } |
803 | 55 | 56 | ||
805 | 56 | QString Department::parentLabel() const | 57 | QString Navigation::parentLabel() const |
806 | 57 | { | 58 | { |
807 | 58 | return m_parentLabel; | 59 | return m_parentLabel; |
808 | 59 | } | 60 | } |
809 | 60 | 61 | ||
811 | 61 | void Department::slotLoaded() | 62 | void Navigation::slotLoaded() |
812 | 62 | { | 63 | { |
813 | 63 | m_loaded = true; | 64 | m_loaded = true; |
814 | 64 | Q_EMIT loadedChanged(); | 65 | Q_EMIT loadedChanged(); |
815 | 65 | } | 66 | } |
816 | 66 | 67 | ||
818 | 67 | bool Department::loaded() const | 68 | bool Navigation::loaded() const |
819 | 68 | { | 69 | { |
820 | 69 | return m_loaded; | 70 | return m_loaded; |
821 | 70 | } | 71 | } |
822 | 71 | 72 | ||
824 | 72 | int Department::count() const | 73 | int Navigation::count() const |
825 | 73 | { | 74 | { |
826 | 74 | return rowCount(); | 75 | return rowCount(); |
827 | 75 | } | 76 | } |
828 | 76 | 77 | ||
837 | 77 | bool Department::isRoot() const | 78 | bool Navigation::isRoot() const |
838 | 78 | { | 79 | { |
839 | 79 | return m_departmentId == "root"; | 80 | return m_navigationId == "root" || m_navigationId == "altroot"; |
840 | 80 | } | 81 | } |
841 | 81 | 82 | ||
842 | 82 | int Department::rowCount(const QModelIndex & /*parent*/) const | 83 | bool Navigation::hidden() const |
843 | 83 | { | 84 | { |
844 | 84 | if (!m_loaded || m_departmentId.startsWith("child") || m_departmentId == "middle3") | 85 | return m_navigationId == "altroot"; |
845 | 86 | } | ||
846 | 87 | |||
847 | 88 | int Navigation::rowCount(const QModelIndex & /*parent*/) const | ||
848 | 89 | { | ||
849 | 90 | if (!m_loaded || m_navigationId.startsWith("child") || m_navigationId == "middle3") | ||
850 | 85 | return 0; | 91 | return 0; |
851 | 86 | else | 92 | else |
852 | 87 | return 8; | 93 | return 8; |
853 | 88 | } | 94 | } |
854 | 89 | 95 | ||
866 | 90 | QHash<int, QByteArray> Department::roleNames() const | 96 | QVariant Navigation::data(const QModelIndex &index, int role) const |
856 | 91 | { | ||
857 | 92 | QHash<int, QByteArray> res; | ||
858 | 93 | res[RoleDepartmentId] = "departmentId"; | ||
859 | 94 | res[RoleLabel] = "label"; | ||
860 | 95 | res[RoleHasChildren] = "hasChildren"; | ||
861 | 96 | res[RoleIsActive] = "isActive"; | ||
862 | 97 | return res; | ||
863 | 98 | } | ||
864 | 99 | |||
865 | 100 | QVariant Department::data(const QModelIndex &index, int role) const | ||
867 | 101 | { | 97 | { |
868 | 102 | switch (role) { | 98 | switch (role) { |
871 | 103 | case RoleDepartmentId: | 99 | case RoleNavigationId: |
872 | 104 | if (m_departmentId == "root") | 100 | if (m_navigationId == "root") |
873 | 105 | return QString("middle%1").arg(index.row()); | 101 | return QString("middle%1").arg(index.row()); |
877 | 106 | else if (m_departmentId.startsWith("middle")) | 102 | else if (m_navigationId.startsWith("middle")) |
878 | 107 | return QString("child%1%2").arg(m_departmentId).arg(index.row()); | 103 | return QString("child%1%2").arg(m_navigationId).arg(index.row()); |
876 | 108 | break; | ||
879 | 109 | case RoleLabel: | 104 | case RoleLabel: |
882 | 110 | return QString("%1Child%2").arg(m_departmentId).arg(index.row()); | 105 | return QString("%1Child%2").arg(m_navigationId).arg(index.row()); |
881 | 111 | break; | ||
883 | 112 | case RoleHasChildren: | 106 | case RoleHasChildren: |
886 | 113 | return m_departmentId == "root" && index.row() != 3; | 107 | return m_navigationId == "root" && index.row() != 3; |
885 | 114 | break; | ||
887 | 115 | case RoleIsActive: | 108 | case RoleIsActive: |
890 | 116 | return m_scope->currentDepartmentId() == data(index, RoleDepartmentId); | 109 | return m_scope->currentNavigationId() == data(index, RoleNavigationId); |
889 | 117 | break; | ||
891 | 118 | } | 110 | } |
892 | 119 | return QVariant(); | 111 | return QVariant(); |
893 | 120 | } | 112 | } |
894 | 121 | 113 | ||
896 | 122 | void Department::slotCurrentDepartmentChanged() | 114 | void Navigation::slotCurrentNavigationChanged() |
897 | 123 | { | 115 | { |
898 | 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 |
899 | 125 | // deparment, but this is a mock, so no need to optimize | 117 | // deparment, but this is a mock, so no need to optimize |
900 | 126 | 118 | ||
901 | === renamed file 'tests/mocks/Unity/fake_department.h' => 'tests/mocks/Unity/fake_navigation.h' | |||
902 | --- tests/mocks/Unity/fake_department.h 2014-05-29 10:25:21 +0000 | |||
903 | +++ tests/mocks/Unity/fake_navigation.h 2014-08-06 11:31:11 +0000 | |||
904 | @@ -14,48 +14,48 @@ | |||
905 | 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/>. |
906 | 15 | */ | 15 | */ |
907 | 16 | 16 | ||
910 | 17 | #ifndef FAKE_DEPARTMENT_H | 17 | #ifndef FAKE_NAVIGATION_H |
911 | 18 | #define FAKE_DEPARTMENT_H | 18 | #define FAKE_NAVIGATION_H |
912 | 19 | 19 | ||
914 | 20 | #include <unity/shell/scopes/DepartmentInterface.h> | 20 | #include <unity/shell/scopes/NavigationInterface.h> |
915 | 21 | 21 | ||
916 | 22 | class Scope; | 22 | class Scope; |
917 | 23 | 23 | ||
919 | 24 | class Department : public unity::shell::scopes::DepartmentInterface | 24 | class Navigation : public unity::shell::scopes::NavigationInterface |
920 | 25 | { | 25 | { |
921 | 26 | Q_OBJECT | 26 | Q_OBJECT |
922 | 27 | 27 | ||
923 | 28 | public: | 28 | public: |
925 | 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); |
926 | 30 | 30 | ||
928 | 31 | QString departmentId() const override; | 31 | QString navigationId() const override; |
929 | 32 | QString label() const override; | 32 | QString label() const override; |
930 | 33 | QString allLabel() const override; | 33 | QString allLabel() const override; |
932 | 34 | QString parentDepartmentId() const override; | 34 | QString parentNavigationId() const override; |
933 | 35 | QString parentLabel() const override; | 35 | QString parentLabel() const override; |
934 | 36 | bool loaded() const override; | 36 | bool loaded() const override; |
935 | 37 | bool isRoot() const override; | ||
936 | 38 | bool hidden() const override; | ||
937 | 37 | int count() const override; | 39 | int count() const override; |
938 | 38 | bool isRoot() const override; | ||
939 | 39 | 40 | ||
940 | 40 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; | 41 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; |
941 | 41 | QHash<int, QByteArray> roleNames() const; | ||
942 | 42 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; | 42 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; |
943 | 43 | 43 | ||
944 | 44 | public Q_SLOTS: | 44 | public Q_SLOTS: |
946 | 45 | void slotCurrentDepartmentChanged(); | 45 | void slotCurrentNavigationChanged(); |
947 | 46 | 46 | ||
948 | 47 | private Q_SLOTS: | 47 | private Q_SLOTS: |
949 | 48 | void slotLoaded(); | 48 | void slotLoaded(); |
950 | 49 | 49 | ||
951 | 50 | private: | 50 | private: |
953 | 51 | QString m_departmentId; | 51 | QString m_navigationId; |
954 | 52 | QString m_label; | 52 | QString m_label; |
955 | 53 | QString m_allLabel; | 53 | QString m_allLabel; |
956 | 54 | QString m_parentId; | 54 | QString m_parentId; |
957 | 55 | QString m_parentLabel; | 55 | QString m_parentLabel; |
958 | 56 | bool m_loaded; | 56 | bool m_loaded; |
960 | 57 | QString m_currentDepartment; | 57 | QString m_currentNavigation; |
961 | 58 | Scope *m_scope; | 58 | Scope *m_scope; |
962 | 59 | }; | 59 | }; |
963 | 60 | 60 | ||
965 | 61 | #endif // FAKE_DEPARTMENT_H | 61 | #endif // FAKE_NAVIGATION_H |
966 | 62 | 62 | ||
967 | === modified file 'tests/mocks/Unity/fake_scope.cpp' | |||
968 | --- tests/mocks/Unity/fake_scope.cpp 2014-07-24 20:40:57 +0000 | |||
969 | +++ tests/mocks/Unity/fake_scope.cpp 2014-08-06 11:31:11 +0000 | |||
970 | @@ -14,24 +14,26 @@ | |||
971 | 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/>. |
972 | 15 | */ | 15 | */ |
973 | 16 | 16 | ||
974 | 17 | #include <QDebug> | ||
975 | 17 | #include <QUrl> | 18 | #include <QUrl> |
976 | 18 | 19 | ||
977 | 19 | #include "fake_scope.h" | 20 | #include "fake_scope.h" |
979 | 20 | #include "fake_department.h" | 21 | #include "fake_navigation.h" |
980 | 21 | #include "fake_resultsmodel.h" | 22 | #include "fake_resultsmodel.h" |
981 | 22 | 23 | ||
982 | 23 | Scope::Scope(QObject* parent) : Scope(QString(), QString(), false, parent) | 24 | Scope::Scope(QObject* parent) : Scope(QString(), QString(), false, parent) |
983 | 24 | { | 25 | { |
984 | 25 | } | 26 | } |
985 | 26 | 27 | ||
987 | 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) |
988 | 28 | : unity::shell::scopes::ScopeInterface(parent) | 29 | : unity::shell::scopes::ScopeInterface(parent) |
989 | 29 | , m_id(id) | 30 | , m_id(id) |
990 | 30 | , m_name(name) | 31 | , m_name(name) |
991 | 31 | , m_visible(visible) | ||
992 | 32 | , m_searching(false) | 32 | , m_searching(false) |
993 | 33 | , m_favorite(favorite) | ||
994 | 33 | , m_isActive(false) | 34 | , m_isActive(false) |
996 | 34 | , m_currentDeparment("root") | 35 | , m_currentNavigationId("root") |
997 | 36 | , m_currentAltNavigationId("altroot") | ||
998 | 35 | , m_previewRendererName("preview-generic") | 37 | , m_previewRendererName("preview-generic") |
999 | 36 | , m_categories(new Categories(categories, this)) | 38 | , m_categories(new Categories(categories, this)) |
1000 | 37 | { | 39 | { |
1001 | @@ -77,6 +79,11 @@ | |||
1002 | 77 | return m_searching; | 79 | return m_searching; |
1003 | 78 | } | 80 | } |
1004 | 79 | 81 | ||
1005 | 82 | bool Scope::favorite() const | ||
1006 | 83 | { | ||
1007 | 84 | return m_favorite; | ||
1008 | 85 | } | ||
1009 | 86 | |||
1010 | 80 | unity::shell::scopes::CategoriesInterface* Scope::categories() const | 87 | unity::shell::scopes::CategoriesInterface* Scope::categories() const |
1011 | 81 | { | 88 | { |
1012 | 82 | return m_categories; | 89 | return m_categories; |
1013 | @@ -97,11 +104,6 @@ | |||
1014 | 97 | return m_formFactor; | 104 | return m_formFactor; |
1015 | 98 | } | 105 | } |
1016 | 99 | 106 | ||
1017 | 100 | bool Scope::visible() const | ||
1018 | 101 | { | ||
1019 | 102 | return m_visible; | ||
1020 | 103 | } | ||
1021 | 104 | |||
1022 | 105 | bool Scope::isActive() const | 107 | bool Scope::isActive() const |
1023 | 106 | { | 108 | { |
1024 | 107 | return m_isActive; | 109 | return m_isActive; |
1025 | @@ -131,6 +133,13 @@ | |||
1026 | 131 | } | 133 | } |
1027 | 132 | } | 134 | } |
1028 | 133 | 135 | ||
1029 | 136 | void Scope::setFavorite(const bool favorite) | ||
1030 | 137 | { | ||
1031 | 138 | if (favorite != m_favorite) { | ||
1032 | 139 | m_favorite = favorite; | ||
1033 | 140 | Q_EMIT favoriteChanged(); | ||
1034 | 141 | } | ||
1035 | 142 | } | ||
1036 | 134 | void Scope::setSearchInProgress(const bool inProg) | 143 | void Scope::setSearchInProgress(const bool inProg) |
1037 | 135 | { | 144 | { |
1038 | 136 | if (inProg != m_searching) { | 145 | if (inProg != m_searching) { |
1039 | @@ -170,14 +179,29 @@ | |||
1040 | 170 | qFatal("Scope::closeScope is not implemented"); | 179 | qFatal("Scope::closeScope is not implemented"); |
1041 | 171 | } | 180 | } |
1042 | 172 | 181 | ||
1051 | 173 | QString Scope::currentDepartmentId() const | 182 | QString Scope::currentNavigationId() const |
1052 | 174 | { | 183 | { |
1053 | 175 | return m_currentDeparment; | 184 | return m_currentNavigationId; |
1054 | 176 | } | 185 | } |
1055 | 177 | 186 | ||
1056 | 178 | bool Scope::hasDepartments() const | 187 | bool Scope::hasNavigation() const |
1057 | 179 | { | 188 | { |
1058 | 180 | return true; | 189 | return true; |
1059 | 190 | } | ||
1060 | 191 | |||
1061 | 192 | QString Scope::currentAltNavigationId() const | ||
1062 | 193 | { | ||
1063 | 194 | return m_currentAltNavigationId; | ||
1064 | 195 | } | ||
1065 | 196 | |||
1066 | 197 | bool Scope::hasAltNavigation() const | ||
1067 | 198 | { | ||
1068 | 199 | return true; | ||
1069 | 200 | } | ||
1070 | 201 | |||
1071 | 202 | Scope::Status Scope::status() const | ||
1072 | 203 | { | ||
1073 | 204 | return Status::Okay; | ||
1074 | 181 | } | 205 | } |
1075 | 182 | 206 | ||
1076 | 183 | QVariantMap Scope::customizations() const | 207 | QVariantMap Scope::customizations() const |
1077 | @@ -196,7 +220,12 @@ | |||
1078 | 196 | return m; | 220 | return m; |
1079 | 197 | } | 221 | } |
1080 | 198 | 222 | ||
1082 | 199 | unity::shell::scopes::DepartmentInterface* Scope::getDepartment(const QString& id) | 223 | void Scope::refresh() |
1083 | 224 | { | ||
1084 | 225 | qDebug() << "Scope::refresh is currently not implmented in the fake scopes plugin"; | ||
1085 | 226 | } | ||
1086 | 227 | |||
1087 | 228 | unity::shell::scopes::NavigationInterface* Scope::getNavigation(const QString& id) | ||
1088 | 200 | { | 229 | { |
1089 | 201 | if (id.isEmpty()) | 230 | if (id.isEmpty()) |
1090 | 202 | return nullptr; | 231 | return nullptr; |
1091 | @@ -210,11 +239,30 @@ | |||
1092 | 210 | parentId = id.mid(5, 7); | 239 | parentId = id.mid(5, 7); |
1093 | 211 | parentLabel = parentId; | 240 | parentLabel = parentId; |
1094 | 212 | } | 241 | } |
1102 | 213 | return new Department(id, id, "all"+id, parentId, parentLabel, this); | 242 | return new Navigation(id, id, "all"+id, parentId, parentLabel, this); |
1103 | 214 | } | 243 | } |
1104 | 215 | 244 | ||
1105 | 216 | void Scope::loadDepartment(const QString& id) | 245 | unity::shell::scopes::NavigationInterface* Scope::getAltNavigation(QString const& id) |
1106 | 217 | { | 246 | { |
1107 | 218 | m_currentDeparment = id; | 247 | if (id.isEmpty()) |
1108 | 219 | Q_EMIT currentDepartmentIdChanged(); | 248 | return nullptr; |
1109 | 249 | |||
1110 | 250 | QString parentId; | ||
1111 | 251 | QString parentLabel; | ||
1112 | 252 | if (id.startsWith("altmiddle")) { | ||
1113 | 253 | parentId = "altroot"; | ||
1114 | 254 | parentLabel = "altroot"; | ||
1115 | 255 | } | ||
1116 | 256 | return new Navigation(id, id, "all"+id, parentId, parentLabel, this); | ||
1117 | 257 | } | ||
1118 | 258 | |||
1119 | 259 | void Scope::setNavigationState(const QString &navigationId, bool isAltNavigation) | ||
1120 | 260 | { | ||
1121 | 261 | if (isAltNavigation) { | ||
1122 | 262 | m_currentAltNavigationId = navigationId; | ||
1123 | 263 | Q_EMIT currentAltNavigationIdChanged(); | ||
1124 | 264 | } else { | ||
1125 | 265 | m_currentNavigationId = navigationId; | ||
1126 | 266 | Q_EMIT currentNavigationIdChanged(); | ||
1127 | 267 | } | ||
1128 | 220 | } | 268 | } |
1129 | 221 | 269 | ||
1130 | === modified file 'tests/mocks/Unity/fake_scope.h' | |||
1131 | --- tests/mocks/Unity/fake_scope.h 2014-07-11 16:39:33 +0000 | |||
1132 | +++ tests/mocks/Unity/fake_scope.h 2014-08-06 11:31:11 +0000 | |||
1133 | @@ -30,7 +30,7 @@ | |||
1134 | 30 | 30 | ||
1135 | 31 | public: | 31 | public: |
1136 | 32 | Scope(QObject* parent = 0); | 32 | Scope(QObject* parent = 0); |
1138 | 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); |
1139 | 34 | 34 | ||
1140 | 35 | /* getters */ | 35 | /* getters */ |
1141 | 36 | QString id() const override; | 36 | QString id() const override; |
1142 | @@ -38,9 +38,9 @@ | |||
1143 | 38 | QString iconHint() const override; | 38 | QString iconHint() const override; |
1144 | 39 | QString description() const override; | 39 | QString description() const override; |
1145 | 40 | QString searchHint() const override; | 40 | QString searchHint() const override; |
1146 | 41 | bool visible() const override; | ||
1147 | 42 | QString shortcut() const override; | 41 | QString shortcut() const override; |
1148 | 43 | bool searchInProgress() const override; | 42 | bool searchInProgress() const override; |
1149 | 43 | bool favorite() const override; | ||
1150 | 44 | unity::shell::scopes::CategoriesInterface* categories() const override; | 44 | unity::shell::scopes::CategoriesInterface* categories() const override; |
1151 | 45 | QString searchQuery() const override; | 45 | QString searchQuery() const override; |
1152 | 46 | QString noResultsHint() const override; | 46 | QString noResultsHint() const override; |
1153 | @@ -53,6 +53,7 @@ | |||
1154 | 53 | void setNoResultsHint(const QString& hint) override; | 53 | void setNoResultsHint(const QString& hint) override; |
1155 | 54 | void setFormFactor(const QString& form_factor) override; | 54 | void setFormFactor(const QString& form_factor) override; |
1156 | 55 | void setActive(const bool) override; | 55 | void setActive(const bool) override; |
1157 | 56 | void setFavorite(const bool) override; | ||
1158 | 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 |
1159 | 57 | 58 | ||
1160 | 58 | Q_INVOKABLE void activate(QVariant const& result) override; | 59 | Q_INVOKABLE void activate(QVariant const& result) override; |
1161 | @@ -60,14 +61,20 @@ | |||
1162 | 60 | Q_INVOKABLE void cancelActivation() override; | 61 | Q_INVOKABLE void cancelActivation() override; |
1163 | 61 | Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override; | 62 | Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override; |
1164 | 62 | 63 | ||
1169 | 63 | QString currentDepartmentId() const override; | 64 | QString currentNavigationId() const override; |
1170 | 64 | bool hasDepartments() const override; | 65 | bool hasNavigation() const override; |
1171 | 65 | Q_INVOKABLE unity::shell::scopes::DepartmentInterface* getDepartment(const QString& id) override; | 66 | QString currentAltNavigationId() const override; |
1172 | 66 | Q_INVOKABLE void loadDepartment(const QString& id) override; | 67 | bool hasAltNavigation() const override; |
1173 | 68 | Q_INVOKABLE unity::shell::scopes::NavigationInterface* getNavigation(QString const& navigationId) override; | ||
1174 | 69 | Q_INVOKABLE unity::shell::scopes::NavigationInterface* getAltNavigation(QString const& altNavigationId) override; | ||
1175 | 70 | Q_INVOKABLE void setNavigationState(const QString &navigationId, bool isAltNavigation) override; | ||
1176 | 67 | Q_SIGNAL void performQuery(const QString& query) override; | 71 | Q_SIGNAL void performQuery(const QString& query) override; |
1177 | 68 | 72 | ||
1178 | 73 | Status status() const override; | ||
1179 | 69 | QVariantMap customizations() const override; | 74 | QVariantMap customizations() const override; |
1180 | 70 | 75 | ||
1181 | 76 | Q_INVOKABLE void refresh() override; | ||
1182 | 77 | |||
1183 | 71 | protected: | 78 | protected: |
1184 | 72 | 79 | ||
1185 | 73 | QString m_id; | 80 | QString m_id; |
1186 | @@ -77,10 +84,11 @@ | |||
1187 | 77 | QString m_searchQuery; | 84 | QString m_searchQuery; |
1188 | 78 | QString m_noResultsHint; | 85 | QString m_noResultsHint; |
1189 | 79 | QString m_formFactor; | 86 | QString m_formFactor; |
1190 | 80 | bool m_visible; | ||
1191 | 81 | bool m_searching; | 87 | bool m_searching; |
1192 | 88 | bool m_favorite; | ||
1193 | 82 | bool m_isActive; | 89 | bool m_isActive; |
1195 | 83 | QString m_currentDeparment; | 90 | QString m_currentNavigationId; |
1196 | 91 | QString m_currentAltNavigationId; | ||
1197 | 84 | 92 | ||
1198 | 85 | QString m_previewRendererName; | 93 | QString m_previewRendererName; |
1199 | 86 | 94 | ||
1200 | 87 | 95 | ||
1201 | === modified file 'tests/mocks/Unity/fake_scopes.cpp' | |||
1202 | --- tests/mocks/Unity/fake_scopes.cpp 2014-07-25 13:25:45 +0000 | |||
1203 | +++ tests/mocks/Unity/fake_scopes.cpp 2014-08-06 11:31:11 +0000 | |||
1204 | @@ -32,6 +32,11 @@ | |||
1205 | 32 | timer.setSingleShot(true); | 32 | timer.setSingleShot(true); |
1206 | 33 | timer.setInterval(100); | 33 | timer.setInterval(100); |
1207 | 34 | QObject::connect(&timer, SIGNAL(timeout()), this, SLOT(updateScopes())); | 34 | QObject::connect(&timer, SIGNAL(timeout()), this, SLOT(updateScopes())); |
1208 | 35 | |||
1209 | 36 | QObject::connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SIGNAL(countChanged())); | ||
1210 | 37 | QObject::connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SIGNAL(countChanged())); | ||
1211 | 38 | QObject::connect(this, SIGNAL(modelReset()), this, SIGNAL(countChanged())); | ||
1212 | 39 | |||
1213 | 35 | load(); | 40 | load(); |
1214 | 36 | } | 41 | } |
1215 | 37 | 42 | ||
1216 | @@ -92,8 +97,6 @@ | |||
1217 | 92 | return QVariant::fromValue(scope); | 97 | return QVariant::fromValue(scope); |
1218 | 93 | } else if (role == Scopes::RoleId) { | 98 | } else if (role == Scopes::RoleId) { |
1219 | 94 | return QVariant::fromValue(scope->id()); | 99 | return QVariant::fromValue(scope->id()); |
1220 | 95 | } else if (role == Scopes::RoleVisible) { | ||
1221 | 96 | return QVariant::fromValue(scope->visible()); | ||
1222 | 97 | } else if (role == Scopes::RoleTitle) { | 100 | } else if (role == Scopes::RoleTitle) { |
1223 | 98 | return QVariant::fromValue(scope->name()); | 101 | return QVariant::fromValue(scope->name()); |
1224 | 99 | } else { | 102 | } else { |
1225 | @@ -125,6 +128,11 @@ | |||
1226 | 125 | return m_loaded; | 128 | return m_loaded; |
1227 | 126 | } | 129 | } |
1228 | 127 | 130 | ||
1229 | 131 | int Scopes::count() const | ||
1230 | 132 | { | ||
1231 | 133 | return rowCount(); | ||
1232 | 134 | } | ||
1233 | 135 | |||
1234 | 128 | unity::shell::scopes::ScopeInterface* Scopes::overviewScope() const | 136 | unity::shell::scopes::ScopeInterface* Scopes::overviewScope() const |
1235 | 129 | { | 137 | { |
1236 | 130 | return nullptr; | 138 | return nullptr; |
1237 | 131 | 139 | ||
1238 | === modified file 'tests/mocks/Unity/fake_scopes.h' | |||
1239 | --- tests/mocks/Unity/fake_scopes.h 2014-07-25 13:25:45 +0000 | |||
1240 | +++ tests/mocks/Unity/fake_scopes.h 2014-08-06 11:31:11 +0000 | |||
1241 | @@ -50,6 +50,7 @@ | |||
1242 | 50 | QModelIndex parent ( const QModelIndex & index ) const; | 50 | QModelIndex parent ( const QModelIndex & index ) const; |
1243 | 51 | 51 | ||
1244 | 52 | bool loaded() const override; | 52 | bool loaded() const override; |
1245 | 53 | int count() const override; | ||
1246 | 53 | unity::shell::scopes::ScopeInterface* overviewScope() const override; | 54 | unity::shell::scopes::ScopeInterface* overviewScope() const override; |
1247 | 54 | 55 | ||
1248 | 55 | private Q_SLOTS: | 56 | private Q_SLOTS: |
1249 | 56 | 57 | ||
1250 | === modified file 'tests/mocks/Unity/fake_unity_plugin.cpp' | |||
1251 | --- tests/mocks/Unity/fake_unity_plugin.cpp 2014-07-08 11:26:44 +0000 | |||
1252 | +++ tests/mocks/Unity/fake_unity_plugin.cpp 2014-08-06 11:31:11 +0000 | |||
1253 | @@ -22,7 +22,7 @@ | |||
1254 | 22 | // local | 22 | // local |
1255 | 23 | #include "fake_scopes.h" | 23 | #include "fake_scopes.h" |
1256 | 24 | #include "fake_categories.h" | 24 | #include "fake_categories.h" |
1258 | 25 | #include "fake_department.h" | 25 | #include "fake_navigation.h" |
1259 | 26 | #include "fake_previewmodel.h" | 26 | #include "fake_previewmodel.h" |
1260 | 27 | #include "fake_previewwidgetmodel.h" | 27 | #include "fake_previewwidgetmodel.h" |
1261 | 28 | #include "fake_resultsmodel.h" | 28 | #include "fake_resultsmodel.h" |
1262 | @@ -43,7 +43,7 @@ | |||
1263 | 43 | qmlRegisterType<Scopes>(uri, 0, 2, "Scopes"); | 43 | qmlRegisterType<Scopes>(uri, 0, 2, "Scopes"); |
1264 | 44 | qmlRegisterType<Scope>(uri, 0, 2, "MockScope"); | 44 | qmlRegisterType<Scope>(uri, 0, 2, "MockScope"); |
1265 | 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."); |
1267 | 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."); |
1268 | 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."); |
1269 | 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."); |
1270 | 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."); |
1271 | 50 | 50 | ||
1272 | === modified file 'tests/qmltests/Dash/tst_Dash.qml' | |||
1273 | --- tests/qmltests/Dash/tst_Dash.qml 2014-07-29 11:35:10 +0000 | |||
1274 | +++ tests/qmltests/Dash/tst_Dash.qml 2014-08-06 11:31:11 +0000 | |||
1275 | @@ -64,10 +64,10 @@ | |||
1276 | 64 | 64 | ||
1277 | 65 | function get_scope_data() { | 65 | function get_scope_data() { |
1278 | 66 | return [ | 66 | return [ |
1283 | 67 | { tag: "MockScope1", visualIndex: 0, shouldBeVisible: true }, | 67 | { tag: "MockScope1", visualIndex: 0 }, |
1284 | 68 | { tag: "MockScope2", visualIndex: -1, shouldBeVisible: false }, | 68 | { tag: "MockScope2", visualIndex: 1 }, |
1285 | 69 | { tag: "clickscope", visualIndex: 1, shouldBeVisible: true }, | 69 | { tag: "clickscope", visualIndex: 2 }, |
1286 | 70 | { tag: "MockScope5", visualIndex: 2, shouldBeVisible: true }, | 70 | { tag: "MockScope5", visualIndex: 3 }, |
1287 | 71 | ] | 71 | ] |
1288 | 72 | } | 72 | } |
1289 | 73 | 73 | ||
1290 | @@ -76,10 +76,6 @@ | |||
1291 | 76 | } | 76 | } |
1292 | 77 | 77 | ||
1293 | 78 | function test_show_scope_on_load(data) { | 78 | function test_show_scope_on_load(data) { |
1294 | 79 | if (data.shouldBeVisible == false) { | ||
1295 | 80 | console.log("Not testing " + data.tag + ": not visible"); | ||
1296 | 81 | return; | ||
1297 | 82 | } | ||
1298 | 83 | var dashContentList = findChild(dash, "dashContentList"); | 79 | var dashContentList = findChild(dash, "dashContentList"); |
1299 | 84 | 80 | ||
1300 | 85 | dash.showScopeOnLoaded = data.tag | 81 | dash.showScopeOnLoaded = data.tag |
1301 | @@ -87,7 +83,7 @@ | |||
1302 | 87 | tryCompare(dashContentList, "count", 0); | 83 | tryCompare(dashContentList, "count", 0); |
1303 | 88 | scopes.load(); | 84 | scopes.load(); |
1304 | 89 | tryCompare(scopes, "loaded", true); | 85 | tryCompare(scopes, "loaded", true); |
1306 | 90 | tryCompare(dashContentList, "count", 4); | 86 | tryCompare(dashContentList, "count", 5); |
1307 | 91 | 87 | ||
1308 | 92 | verify(dashContentList != undefined); | 88 | verify(dashContentList != undefined); |
1309 | 93 | tryCompare(dashContentList, "currentIndex", data.visualIndex); | 89 | tryCompare(dashContentList, "currentIndex", data.visualIndex); |
1310 | 94 | 90 | ||
1311 | === modified file 'tests/qmltests/Dash/tst_DashContent.qml' | |||
1312 | --- tests/qmltests/Dash/tst_DashContent.qml 2014-08-06 11:31:10 +0000 | |||
1313 | +++ tests/qmltests/Dash/tst_DashContent.qml 2014-08-06 11:31:11 +0000 | |||
1314 | @@ -43,9 +43,6 @@ | |||
1315 | 43 | id: dashContent | 43 | id: dashContent |
1316 | 44 | anchors.fill: parent | 44 | anchors.fill: parent |
1317 | 45 | 45 | ||
1318 | 46 | model: SortFilterProxyModel { | ||
1319 | 47 | model: scopesModel | ||
1320 | 48 | } | ||
1321 | 49 | scopes : scopesModel | 46 | scopes : scopesModel |
1322 | 50 | } | 47 | } |
1323 | 51 | 48 | ||
1324 | @@ -268,119 +265,119 @@ | |||
1325 | 268 | verify(carouselLV.tileWidth / carouselLV.tileHeight == cardTool.components["art"]["aspect-ratio"]); | 265 | verify(carouselLV.tileWidth / carouselLV.tileHeight == cardTool.components["art"]["aspect-ratio"]); |
1326 | 269 | } | 266 | } |
1327 | 270 | 267 | ||
1329 | 271 | function test_departments() { | 268 | function test_navigations() { |
1330 | 272 | var dashContentList = findChild(dashContent, "dashContentList"); | 269 | var dashContentList = findChild(dashContent, "dashContentList"); |
1421 | 273 | tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashDepartments") != null; }, true); | 270 | tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true); |
1422 | 274 | var dashDepartments = findChild(dashContentList.currentItem, "dashDepartments"); | 271 | var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation"); |
1423 | 275 | tryCompare(dashDepartments, "visible", true); | 272 | tryCompare(dashNavigation, "visible", true); |
1424 | 276 | compare(dashDepartments.showList, false); | 273 | compare(dashNavigation.showList, false); |
1425 | 277 | waitForRendering(dashDepartments); | 274 | waitForRendering(dashNavigation); |
1426 | 278 | mouseClick(dashDepartments, 0, 0); | 275 | mouseClick(dashNavigation, 0, 0); |
1427 | 279 | compare(dashDepartments.showList, true); | 276 | compare(dashNavigation.showList, true); |
1428 | 280 | 277 | ||
1429 | 281 | var departmentListView = findChild(dashDepartments, "departmentListView"); | 278 | var navigationListView = findChild(dashNavigation, "navigationListView"); |
1430 | 282 | compare(departmentListView.count, 1); | 279 | compare(navigationListView.count, 1); |
1431 | 283 | tryCompare(departmentListView.currentItem.department, "loaded", true); | 280 | tryCompare(navigationListView.currentItem.navigation, "loaded", true); |
1432 | 284 | 281 | ||
1433 | 285 | waitForRendering(departmentListView); | 282 | waitForRendering(navigationListView); |
1434 | 286 | waitForRendering(departmentListView.currentItem); | 283 | waitForRendering(navigationListView.currentItem); |
1435 | 287 | 284 | ||
1436 | 288 | var allButton = findChild(dashDepartments, "allButton"); | 285 | var allButton = findChild(dashNavigation, "allButton"); |
1437 | 289 | compare(allButton.visible, false); | 286 | compare(allButton.visible, false); |
1438 | 290 | 287 | ||
1439 | 291 | var department = findChild(dashDepartments, "department0child3"); | 288 | var navigation = findChild(dashNavigation, "navigation0child3"); |
1440 | 292 | mouseClick(department, 0, 0); | 289 | mouseClick(navigation, 0, 0); |
1441 | 293 | compare(dashDepartments.showList, false); | 290 | compare(dashNavigation.showList, false); |
1442 | 294 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle3"); | 291 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle3"); |
1443 | 295 | tryCompare(departmentListView.currentItem.department, "departmentId", "root"); | 292 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "root"); |
1444 | 296 | 293 | ||
1445 | 297 | mouseClick(dashDepartments, 0, 0); | 294 | mouseClick(dashNavigation, 0, 0); |
1446 | 298 | compare(dashDepartments.showList, true); | 295 | compare(dashNavigation.showList, true); |
1447 | 299 | waitForRendering(departmentListView); | 296 | waitForRendering(navigationListView); |
1448 | 300 | waitForRendering(departmentListView.currentItem); | 297 | waitForRendering(navigationListView.currentItem); |
1449 | 301 | compare(allButton.visible, true); | 298 | compare(allButton.visible, true); |
1450 | 302 | 299 | ||
1451 | 303 | mouseClick(allButton, 0, 0); | 300 | mouseClick(allButton, 0, 0); |
1452 | 304 | compare(dashDepartments.showList, false); | 301 | compare(dashNavigation.showList, false); |
1453 | 305 | tryCompare(dashDepartments.currentDepartment, "departmentId", "root"); | 302 | tryCompare(dashNavigation.currentNavigation, "navigationId", "root"); |
1454 | 306 | tryCompare(departmentListView.currentItem.department, "departmentId", "root"); | 303 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "root"); |
1455 | 307 | 304 | ||
1456 | 308 | mouseClick(dashDepartments, 0, 0); | 305 | mouseClick(dashNavigation, 0, 0); |
1457 | 309 | compare(dashDepartments.showList, true); | 306 | compare(dashNavigation.showList, true); |
1458 | 310 | waitForRendering(departmentListView); | 307 | waitForRendering(navigationListView); |
1459 | 311 | waitForRendering(departmentListView.currentItem); | 308 | waitForRendering(navigationListView.currentItem); |
1460 | 312 | compare(allButton.visible, false); | 309 | compare(allButton.visible, false); |
1461 | 313 | 310 | ||
1462 | 314 | department = findChild(dashDepartments, "department0child2"); | 311 | navigation = findChild(dashNavigation, "navigation0child2"); |
1463 | 315 | mouseClick(department, 0, 0); | 312 | mouseClick(navigation, 0, 0); |
1464 | 316 | compare(dashDepartments.showList, true); | 313 | compare(dashNavigation.showList, true); |
1465 | 317 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); | 314 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); |
1466 | 318 | tryCompare(departmentListView.currentItem.department, "departmentId", "middle2"); | 315 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2"); |
1467 | 319 | 316 | ||
1468 | 320 | var departmentList1 = findChild(dashDepartments, "department1"); | 317 | var navigationList1 = findChild(dashNavigation, "navigation1"); |
1469 | 321 | allButton = findChild(departmentList1, "allButton"); | 318 | allButton = findChild(navigationList1, "allButton"); |
1470 | 322 | var backButton = findChild(findChild(departmentList1, "department1"), "backButton"); | 319 | var backButton = findChild(findChild(navigationList1, "navigation1"), "backButton"); |
1471 | 323 | compare(allButton.visible, true); | 320 | compare(allButton.visible, true); |
1472 | 324 | compare(backButton.visible, true); | 321 | compare(backButton.visible, true); |
1473 | 325 | 322 | ||
1474 | 326 | tryCompare(departmentListView, "contentX", departmentList1.x); | 323 | tryCompare(navigationListView, "contentX", navigationList1.x); |
1475 | 327 | waitForRendering(departmentListView); | 324 | waitForRendering(navigationListView); |
1476 | 328 | mouseClick(allButton, 0, 0); | 325 | mouseClick(allButton, 0, 0); |
1477 | 329 | compare(dashDepartments.showList, false); | 326 | compare(dashNavigation.showList, false); |
1478 | 330 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); | 327 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); |
1479 | 331 | tryCompare(departmentListView.currentItem.department, "departmentId", "middle2"); | 328 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2"); |
1480 | 332 | 329 | ||
1481 | 333 | mouseClick(dashDepartments, 0, 0); | 330 | mouseClick(dashNavigation, 0, 0); |
1482 | 334 | compare(dashDepartments.showList, true); | 331 | compare(dashNavigation.showList, true); |
1483 | 335 | waitForRendering(departmentListView); | 332 | waitForRendering(navigationListView); |
1484 | 336 | waitForRendering(departmentListView.currentItem); | 333 | waitForRendering(navigationListView.currentItem); |
1485 | 337 | compare(allButton.visible, true); | 334 | compare(allButton.visible, true); |
1486 | 338 | compare(backButton.visible, true); | 335 | compare(backButton.visible, true); |
1487 | 339 | 336 | ||
1488 | 340 | tryCompare(departmentList1.department, "loaded", true); | 337 | tryCompare(navigationList1.navigation, "loaded", true); |
1489 | 341 | department = findChild(dashDepartments, "department1child2"); | 338 | navigation = findChild(dashNavigation, "navigation1child2"); |
1490 | 342 | mouseClick(department, 0, 0); | 339 | mouseClick(navigation, 0, 0); |
1491 | 343 | compare(dashDepartments.showList, false); | 340 | compare(dashNavigation.showList, false); |
1492 | 344 | tryCompare(dashDepartments.currentDepartment, "departmentId", "childmiddle22"); | 341 | tryCompare(dashNavigation.currentNavigation, "navigationId", "childmiddle22"); |
1493 | 345 | tryCompare(departmentListView.currentItem.department, "departmentId", "middle2"); | 342 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2"); |
1494 | 346 | 343 | ||
1495 | 347 | mouseClick(dashDepartments, 0, 0); | 344 | mouseClick(dashNavigation, 0, 0); |
1496 | 348 | compare(dashDepartments.showList, true); | 345 | compare(dashNavigation.showList, true); |
1497 | 349 | waitForRendering(departmentListView); | 346 | waitForRendering(navigationListView); |
1498 | 350 | waitForRendering(departmentListView.currentItem); | 347 | waitForRendering(navigationListView.currentItem); |
1499 | 351 | 348 | ||
1500 | 352 | tryCompare(departmentList1.department, "loaded", true); | 349 | tryCompare(navigationList1.navigation, "loaded", true); |
1501 | 353 | department = findChild(dashDepartments, "department1child3"); | 350 | navigation = findChild(dashNavigation, "navigation1child3"); |
1502 | 354 | mouseClick(department, 0, 0); | 351 | mouseClick(navigation, 0, 0); |
1503 | 355 | compare(dashDepartments.showList, false); | 352 | compare(dashNavigation.showList, false); |
1504 | 356 | tryCompare(dashDepartments.currentDepartment, "departmentId", "childmiddle23"); | 353 | tryCompare(dashNavigation.currentNavigation, "navigationId", "childmiddle23"); |
1505 | 357 | tryCompare(departmentListView.currentItem.department, "departmentId", "middle2"); | 354 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2"); |
1506 | 358 | 355 | ||
1507 | 359 | mouseClick(dashDepartments, 0, 0); | 356 | mouseClick(dashNavigation, 0, 0); |
1508 | 360 | compare(dashDepartments.showList, true); | 357 | compare(dashNavigation.showList, true); |
1509 | 361 | waitForRendering(departmentListView); | 358 | waitForRendering(navigationListView); |
1510 | 362 | waitForRendering(departmentListView.currentItem); | 359 | waitForRendering(navigationListView.currentItem); |
1511 | 363 | mouseClick(backButton, 0, 0); | 360 | mouseClick(backButton, 0, 0); |
1512 | 364 | 361 | ||
1518 | 365 | tryCompare(dashDepartments.currentDepartment, "departmentId", "root"); | 362 | tryCompare(dashNavigation.currentNavigation, "navigationId", "root"); |
1519 | 366 | tryCompare(departmentListView.currentItem.department, "departmentId", "root"); | 363 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "root"); |
1520 | 367 | compare(dashDepartments.showList, true); | 364 | compare(dashNavigation.showList, true); |
1521 | 368 | mouseClick(dashDepartments, 0, 0); | 365 | mouseClick(dashNavigation, 0, 0); |
1522 | 369 | compare(dashDepartments.showList, false); | 366 | compare(dashNavigation.showList, false); |
1523 | 370 | 367 | ||
1535 | 371 | mouseClick(dashDepartments, 0, 0); | 368 | mouseClick(dashNavigation, 0, 0); |
1536 | 372 | compare(dashDepartments.showList, true); | 369 | compare(dashNavigation.showList, true); |
1537 | 373 | tryCompare(departmentListView.currentItem.department, "loaded", true); | 370 | tryCompare(navigationListView.currentItem.navigation, "loaded", true); |
1538 | 374 | department = findChild(dashDepartments, "department0child2"); | 371 | navigation = findChild(dashNavigation, "navigation0child2"); |
1539 | 375 | mouseClick(department, 0, 0); | 372 | mouseClick(navigation, 0, 0); |
1540 | 376 | compare(dashDepartments.showList, true); | 373 | compare(dashNavigation.showList, true); |
1541 | 377 | departmentList1 = findChild(dashDepartments, "department1"); | 374 | navigationList1 = findChild(dashNavigation, "navigation1"); |
1542 | 378 | compare(departmentList1.department.loaded, false); | 375 | compare(navigationList1.navigation.loaded, false); |
1543 | 379 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); | 376 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); |
1544 | 380 | allButton = findChild(departmentList1, "allButton"); | 377 | allButton = findChild(navigationList1, "allButton"); |
1545 | 381 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); | 378 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); |
1546 | 382 | mouseClick(allButton, 0, 0); | 379 | mouseClick(allButton, 0, 0); |
1548 | 383 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); | 380 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); |
1549 | 384 | } | 381 | } |
1550 | 385 | } | 382 | } |
1551 | 386 | } | 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://