Merge lp:~nick-dedekind/unity8/lp1352977 into lp:unity8
- lp1352977
- Merge into trunk
Proposed by
Nick Dedekind
Status: | Superseded |
---|---|
Proposed branch: | lp:~nick-dedekind/unity8/lp1352977 |
Merge into: | lp:unity8 |
Prerequisite: | lp:~unity-team/unity8/scopes-v4 |
Diff against target: |
1922 lines (+481/-470) 29 files modified
debian/control (+3/-3) qml/Dash/Dash.qml (+11/-9) qml/Dash/DashContent.qml (+4/-3) qml/Dash/DashDepartments.qml (+43/-50) qml/Dash/DashDepartmentsList.qml (+14/-15) qml/Dash/GenericScopeView.qml (+11/-4) qml/ScopeTool.qml (+11/-1) qml/Stages/AppSurfaceContainer.qml (+44/-0) qml/Stages/SpreadDelegate.qml (+3/-1) qml/Stages/SurfaceContainer.qml (+5/-22) tests/mocks/Unity/Application/ApplicationDBusAdaptor.cpp (+11/-4) tests/mocks/Unity/Application/ApplicationDBusAdaptor.h (+1/-1) tests/mocks/Unity/Application/ApplicationInfo.cpp (+49/-0) tests/mocks/Unity/Application/ApplicationInfo.h (+13/-0) tests/mocks/Unity/Application/ApplicationManager.cpp (+3/-0) tests/mocks/Unity/Application/ApplicationManager.h (+1/-0) tests/mocks/Unity/Application/MirSurfaceItem.cpp (+2/-2) tests/mocks/Unity/Application/MirSurfaceItem.h (+1/-0) tests/mocks/Unity/CMakeLists.txt (+3/-3) tests/mocks/Unity/Unity.qmltypes (+35/-87) tests/mocks/Unity/fake_department.cpp (+44/-36) tests/mocks/Unity/fake_department.h (+13/-13) tests/mocks/Unity/fake_scope.cpp (+25/-73) tests/mocks/Unity/fake_scope.h (+8/-16) tests/mocks/Unity/fake_scopes.cpp (+2/-10) tests/mocks/Unity/fake_scopes.h (+0/-1) tests/mocks/Unity/fake_unity_plugin.cpp (+2/-2) tests/qmltests/Dash/tst_Dash.qml (+9/-5) tests/qmltests/Dash/tst_DashContent.qml (+110/-109) |
To merge this branch: | bzr merge lp:~nick-dedekind/unity8/lp1352977 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Pending | |
Unity Team | Pending | ||
Review via email: mp+229943@code.launchpad.net |
This proposal has been superseded by a proposal from 2014-08-07.
Commit message
Added application prompt surfaces to allow prompting application which have not yet created a surface.
Description of the change
Added application prompt surfaces to allow prompting application which have not yet created a surface.
To post a comment you must log in.
- 1134. By PS Jenkins bot
-
Resync trunk
- 1135. By Nick Dedekind
-
added prompt surfaces
- 1136. By Nick Dedekind
-
Fixed promptSurface over app splash
- 1137. By Nick Dedekind
-
better mock logging
Unmerged revisions
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/control' | |||
2 | --- debian/control 2014-08-07 14:25:38 +0000 | |||
3 | +++ debian/control 2014-08-07 14:25:38 +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.88), | 27 | libunity-api-dev (>= 7.87), |
10 | 28 | libusermetricsoutput1-dev, | 28 | libusermetricsoutput1-dev, |
11 | 29 | libxcb1-dev, | 29 | libxcb1-dev, |
12 | 30 | pkg-config, | 30 | pkg-config, |
13 | @@ -83,7 +83,7 @@ | |||
14 | 83 | qmenumodel-qml (>= 0.2.8), | 83 | qmenumodel-qml (>= 0.2.8), |
15 | 84 | qml-module-qtquick-xmllistmodel, | 84 | qml-module-qtquick-xmllistmodel, |
16 | 85 | qtdeclarative5-gsettings1.0, | 85 | qtdeclarative5-gsettings1.0, |
18 | 86 | qtdeclarative5-qtmir-plugin (>= 0.4), | 86 | qtdeclarative5-qtmir-plugin (>= 0.4.1), |
19 | 87 | qtdeclarative5-ubuntu-settings-components (>= 0.3), | 87 | qtdeclarative5-ubuntu-settings-components (>= 0.3), |
20 | 88 | qtdeclarative5-ubuntu-telephony0.1, | 88 | qtdeclarative5-ubuntu-telephony0.1, |
21 | 89 | unity-launcher-impl-3, | 89 | unity-launcher-impl-3, |
22 | @@ -112,7 +112,7 @@ | |||
23 | 112 | unity-application-impl-2, | 112 | unity-application-impl-2, |
24 | 113 | unity-notifications-impl-3, | 113 | unity-notifications-impl-3, |
25 | 114 | unity-plugin-scopes | unity-scopes-impl, | 114 | unity-plugin-scopes | unity-scopes-impl, |
27 | 115 | unity-scopes-impl-4, | 115 | unity-scopes-impl-2, |
28 | 116 | unity8-fake-env | unity-application-impl, | 116 | unity8-fake-env | unity-application-impl, |
29 | 117 | ${misc:Depends}, | 117 | ${misc:Depends}, |
30 | 118 | Breaks: unity8 (<< 7.86), | 118 | Breaks: unity8 (<< 7.86), |
31 | 119 | 119 | ||
32 | === modified file 'qml/Dash/Dash.qml' | |||
33 | --- qml/Dash/Dash.qml 2014-08-07 14:25:38 +0000 | |||
34 | +++ qml/Dash/Dash.qml 2014-07-29 11:35:10 +0000 | |||
35 | @@ -38,13 +38,7 @@ | |||
36 | 38 | } | 38 | } |
37 | 39 | 39 | ||
38 | 40 | function setCurrentScope(scopeId, animate, reset) { | 40 | function setCurrentScope(scopeId, animate, reset) { |
46 | 41 | var scopeIndex = -1; | 41 | var scopeIndex = filteredScopes.findFirst(Scopes.RoleId, scopeId) |
40 | 42 | for (var i = 0; i < scopes.count; ++i) { | ||
41 | 43 | if (scopes.getScope(i).id == scopeId) { | ||
42 | 44 | scopeIndex = i; | ||
43 | 45 | break; | ||
44 | 46 | } | ||
45 | 47 | } | ||
47 | 48 | 42 | ||
48 | 49 | if (scopeIndex == -1) { | 43 | if (scopeIndex == -1) { |
49 | 50 | console.warn("No match for scope with id: %1".arg(scopeId)) | 44 | console.warn("No match for scope with id: %1".arg(scopeId)) |
50 | @@ -69,8 +63,15 @@ | |||
51 | 69 | } | 63 | } |
52 | 70 | } | 64 | } |
53 | 71 | 65 | ||
56 | 72 | Scopes { | 66 | SortFilterProxyModel { |
57 | 73 | id: scopes | 67 | id: filteredScopes |
58 | 68 | model: Scopes { | ||
59 | 69 | id: scopes | ||
60 | 70 | } | ||
61 | 71 | dynamicSortFilter: true | ||
62 | 72 | |||
63 | 73 | filterRole: Scopes.RoleVisible | ||
64 | 74 | filterRegExp: RegExp("^true$") | ||
65 | 74 | } | 75 | } |
66 | 75 | 76 | ||
67 | 76 | DashContent { | 77 | DashContent { |
68 | @@ -78,6 +79,7 @@ | |||
69 | 78 | objectName: "dashContent" | 79 | objectName: "dashContent" |
70 | 79 | width: parent.width | 80 | width: parent.width |
71 | 80 | height: parent.height | 81 | height: parent.height |
72 | 82 | model: filteredScopes | ||
73 | 81 | scopes: scopes | 83 | scopes: scopes |
74 | 82 | visible: x != -width | 84 | visible: x != -width |
75 | 83 | onGotoScope: { | 85 | onGotoScope: { |
76 | 84 | 86 | ||
77 | === modified file 'qml/Dash/DashContent.qml' | |||
78 | --- qml/Dash/DashContent.qml 2014-08-07 14:25:38 +0000 | |||
79 | +++ qml/Dash/DashContent.qml 2014-07-24 23:31:44 +0000 | |||
80 | @@ -23,7 +23,8 @@ | |||
81 | 23 | Item { | 23 | Item { |
82 | 24 | id: dashContent | 24 | id: dashContent |
83 | 25 | 25 | ||
85 | 26 | property alias scopes: dashContentList.model | 26 | property var model: null |
86 | 27 | property var scopes: null | ||
87 | 27 | readonly property alias currentIndex: dashContentList.currentIndex | 28 | readonly property alias currentIndex: dashContentList.currentIndex |
88 | 28 | 29 | ||
89 | 29 | signal scopeLoaded(string scopeId) | 30 | signal scopeLoaded(string scopeId) |
90 | @@ -88,9 +89,10 @@ | |||
91 | 88 | id: dashContentList | 89 | id: dashContentList |
92 | 89 | objectName: "dashContentList" | 90 | objectName: "dashContentList" |
93 | 90 | 91 | ||
95 | 91 | interactive: dashContent.scopes.loaded && currentItem && !currentItem.moving && !currentItem.navigationShown | 92 | interactive: dashContent.scopes.loaded && currentItem && !currentItem.moving |
96 | 92 | 93 | ||
97 | 93 | anchors.fill: parent | 94 | anchors.fill: parent |
98 | 95 | model: dashContent.model | ||
99 | 94 | orientation: ListView.Horizontal | 96 | orientation: ListView.Horizontal |
100 | 95 | boundsBehavior: Flickable.DragAndOvershootBounds | 97 | boundsBehavior: Flickable.DragAndOvershootBounds |
101 | 96 | flickDeceleration: units.gu(625) | 98 | flickDeceleration: units.gu(625) |
102 | @@ -128,7 +130,6 @@ | |||
103 | 128 | objectName: scope.id + " loader" | 130 | objectName: scope.id + " loader" |
104 | 129 | 131 | ||
105 | 130 | readonly property bool moving: item ? item.moving : false | 132 | readonly property bool moving: item ? item.moving : false |
106 | 131 | readonly property bool navigationShown: item ? item.navigationShown : false | ||
107 | 132 | readonly property var categoryView: item ? item.categoryView : null | 133 | readonly property var categoryView: item ? item.categoryView : null |
108 | 133 | readonly property var theScope: scope | 134 | readonly property var theScope: scope |
109 | 134 | 135 | ||
110 | 135 | 136 | ||
111 | === renamed file 'qml/Dash/DashNavigation.qml' => 'qml/Dash/DashDepartments.qml' | |||
112 | --- qml/Dash/DashNavigation.qml 2014-08-07 14:25:38 +0000 | |||
113 | +++ qml/Dash/DashDepartments.qml 2014-07-08 11:08:19 +0000 | |||
114 | @@ -15,17 +15,17 @@ | |||
115 | 15 | */ | 15 | */ |
116 | 16 | 16 | ||
117 | 17 | import QtQuick 2.2 | 17 | import QtQuick 2.2 |
119 | 18 | import Ubuntu.Components 1.1 | 18 | import Ubuntu.Components 0.1 |
120 | 19 | 19 | ||
121 | 20 | AbstractButton { | 20 | AbstractButton { |
122 | 21 | id: root | 21 | id: root |
124 | 22 | objectName: "dashNavigation" | 22 | objectName: "dashDepartments" |
125 | 23 | 23 | ||
126 | 24 | property var scope: null | 24 | property var scope: null |
127 | 25 | 25 | ||
128 | 26 | property bool showList: false | 26 | property bool showList: false |
129 | 27 | 27 | ||
131 | 28 | readonly property var currentNavigation: scope && scope.hasNavigation ? scope.getNavigation(scope.currentNavigationId) : null | 28 | readonly property var currentDepartment: scope && scope.hasDepartments ? scope.getDepartment(scope.currentDepartmentId) : null |
132 | 29 | 29 | ||
133 | 30 | property alias windowWidth: blackRect.width | 30 | property alias windowWidth: blackRect.width |
134 | 31 | property alias windowHeight: blackRect.height | 31 | property alias windowHeight: blackRect.height |
135 | @@ -34,21 +34,20 @@ | |||
136 | 34 | // Are we drilling down the tree or up? | 34 | // Are we drilling down the tree or up? |
137 | 35 | property bool isGoingBack: false | 35 | property bool isGoingBack: false |
138 | 36 | 36 | ||
140 | 37 | visible: root.currentNavigation != null | 37 | visible: root.currentDepartment != null |
141 | 38 | 38 | ||
142 | 39 | height: visible ? units.gu(5) : 0 | 39 | height: visible ? units.gu(5) : 0 |
143 | 40 | 40 | ||
144 | 41 | onClicked: { | 41 | onClicked: { |
145 | 42 | navigationListView.updateMaxHeight(); | ||
146 | 43 | root.showList = !root.showList; | 42 | root.showList = !root.showList; |
147 | 44 | } | 43 | } |
148 | 45 | 44 | ||
149 | 46 | Rectangle { | 45 | Rectangle { |
150 | 47 | id: blackRect | 46 | id: blackRect |
151 | 48 | color: "black" | 47 | color: "black" |
153 | 49 | opacity: navigationListView.currentItem && navigationListView.currentItem.visible ? 0.3 : 0 | 48 | opacity: departmentListView.currentItem && departmentListView.currentItem.visible ? 0.3 : 0 |
154 | 50 | Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } } | 49 | Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } } |
156 | 51 | anchors.top: navigationListView.top | 50 | anchors.top: departmentListView.top |
157 | 52 | anchors.right: parent.right | 51 | anchors.right: parent.right |
158 | 53 | visible: opacity != 0 | 52 | visible: opacity != 0 |
159 | 54 | } | 53 | } |
160 | @@ -79,7 +78,7 @@ | |||
161 | 79 | anchors.fill: parent | 78 | anchors.fill: parent |
162 | 80 | anchors.margins: units.gu(2) | 79 | anchors.margins: units.gu(2) |
163 | 81 | verticalAlignment: Text.AlignVCenter | 80 | verticalAlignment: Text.AlignVCenter |
165 | 82 | text: root.currentNavigation ? root.currentNavigation.label : "" | 81 | text: root.currentDepartment ? root.currentDepartment.label : "" |
166 | 83 | color: root.scopeStyle ? root.scopeStyle.foreground : "grey" | 82 | color: root.scopeStyle ? root.scopeStyle.foreground : "grey" |
167 | 84 | } | 83 | } |
168 | 85 | 84 | ||
169 | @@ -93,18 +92,18 @@ | |||
170 | 93 | color: root.scopeStyle ? root.scopeStyle.foreground : "grey" | 92 | color: root.scopeStyle ? root.scopeStyle.foreground : "grey" |
171 | 94 | } | 93 | } |
172 | 95 | 94 | ||
174 | 96 | // navigationListView is outside root | 95 | // departmentListView is outside root |
175 | 97 | ListView { | 96 | ListView { |
178 | 98 | id: navigationListView | 97 | id: departmentListView |
179 | 99 | objectName: "navigationListView" | 98 | objectName: "departmentListView" |
180 | 100 | orientation: ListView.Horizontal | 99 | orientation: ListView.Horizontal |
181 | 101 | interactive: false | 100 | interactive: false |
182 | 102 | clip: root.width != windowWidth | 101 | clip: root.width != windowWidth |
183 | 103 | model: ListModel { | 102 | model: ListModel { |
185 | 104 | id: navigationModel | 103 | id: departmentModel |
186 | 105 | // We have two roles | 104 | // We have two roles |
189 | 106 | // navigationId: the navigation id of the navigation the list represents | 105 | // departmentId: the department id of the department the list represents |
190 | 107 | // nullifyNavigation: overrides navigationId to be null | 106 | // nullifyDepartment: overrides departmentId to be null |
191 | 108 | // This is used to "clear" the delegate when going "right" on the tree | 107 | // This is used to "clear" the delegate when going "right" on the tree |
192 | 109 | } | 108 | } |
193 | 110 | anchors { | 109 | anchors { |
194 | @@ -112,12 +111,7 @@ | |||
195 | 112 | right: parent.right | 111 | right: parent.right |
196 | 113 | top: root.bottom | 112 | top: root.bottom |
197 | 114 | } | 113 | } |
204 | 115 | property int maxHeight: -1 | 114 | readonly property int maxHeight: (windowHeight - mapToItem(null, root.x, root.y).y) - units.gu(8) |
199 | 116 | Component.onCompleted: updateMaxHeight(); | ||
200 | 117 | function updateMaxHeight() | ||
201 | 118 | { | ||
202 | 119 | maxHeight = (windowHeight - mapToItem(null, 0, 0).y) - units.gu(8); | ||
203 | 120 | } | ||
205 | 121 | property int prevHeight: maxHeight | 115 | property int prevHeight: maxHeight |
206 | 122 | height: currentItem ? currentItem.height : maxHeight | 116 | height: currentItem ? currentItem.height : maxHeight |
207 | 123 | onHeightChanged: { | 117 | onHeightChanged: { |
208 | @@ -126,84 +120,83 @@ | |||
209 | 126 | } | 120 | } |
210 | 127 | } | 121 | } |
211 | 128 | highlightMoveDuration: UbuntuAnimation.FastDuration | 122 | highlightMoveDuration: UbuntuAnimation.FastDuration |
214 | 129 | delegate: DashNavigationList { | 123 | delegate: DashDepartmentsList { |
215 | 130 | objectName: "navigation" + index | 124 | objectName: "department" + index |
216 | 131 | visible: height != 0 | 125 | visible: height != 0 |
218 | 132 | width: navigationListView.width | 126 | width: departmentListView.width |
219 | 133 | scopeStyle: root.scopeStyle | 127 | scopeStyle: root.scopeStyle |
220 | 134 | property real desiredHeight: { | 128 | property real desiredHeight: { |
221 | 135 | if (root.showList) { | 129 | if (root.showList) { |
223 | 136 | if (navigation && navigation.loaded && x == navigationListView.contentX) | 130 | if (department && department.loaded && x == departmentListView.contentX) |
224 | 137 | { | 131 | { |
227 | 138 | navigationListView.updateMaxHeight(); | 132 | return Math.min(implicitHeight, departmentListView.maxHeight); |
226 | 139 | return Math.min(implicitHeight, navigationListView.maxHeight); | ||
228 | 140 | } else { | 133 | } else { |
230 | 141 | return navigationListView.prevHeight; | 134 | return departmentListView.prevHeight; |
231 | 142 | } | 135 | } |
232 | 143 | } else { | 136 | } else { |
233 | 144 | return 0; | 137 | return 0; |
234 | 145 | } | 138 | } |
235 | 146 | } | 139 | } |
236 | 147 | height: desiredHeight | 140 | height: desiredHeight |
241 | 148 | navigation: (nullifyNavigation || !scope) ? null : scope.getNavigation(navigationId) | 141 | department: (nullifyDepartment || !scope) ? null : scope.getDepartment(departmentId) |
242 | 149 | currentNavigation: root.currentNavigation | 142 | currentDepartment: root.currentDepartment |
243 | 150 | onEnterNavigation: { | 143 | onEnterDepartment: { |
244 | 151 | scope.setNavigationState(newNavigationId, false); | 144 | scope.loadDepartment(newDepartmentId); |
245 | 152 | // We only need to add a new item to the model | 145 | // We only need to add a new item to the model |
246 | 153 | // if we have children, otherwise just load it | 146 | // if we have children, otherwise just load it |
247 | 154 | if (hasChildren) { | 147 | if (hasChildren) { |
248 | 155 | isGoingBack = false; | 148 | isGoingBack = false; |
251 | 156 | navigationModel.append({"navigationId": newNavigationId, "nullifyNavigation": false}); | 149 | departmentModel.append({"departmentId": newDepartmentId, "nullifyDepartment": false}); |
252 | 157 | navigationListView.currentIndex++; | 150 | departmentListView.currentIndex++; |
253 | 158 | } else { | 151 | } else { |
254 | 159 | showList = false; | 152 | showList = false; |
255 | 160 | } | 153 | } |
256 | 161 | } | 154 | } |
257 | 162 | onGoBackToParentClicked: { | 155 | onGoBackToParentClicked: { |
259 | 163 | scope.setNavigationState(navigation.parentNavigationId, false); | 156 | scope.loadDepartment(department.parentDepartmentId); |
260 | 164 | isGoingBack = true; | 157 | isGoingBack = true; |
263 | 165 | navigationModel.setProperty(navigationListView.currentIndex - 1, "nullifyNavigation", false); | 158 | departmentModel.setProperty(departmentListView.currentIndex - 1, "nullifyDepartment", false); |
264 | 166 | navigationListView.currentIndex--; | 159 | departmentListView.currentIndex--; |
265 | 167 | } | 160 | } |
267 | 168 | onAllNavigationClicked: { | 161 | onAllDepartmentClicked: { |
268 | 169 | showList = false; | 162 | showList = false; |
270 | 170 | if (root.currentNavigation.parentNavigationId == navigation.navigationId) { | 163 | if (root.currentDepartment.parentDepartmentId == department.departmentId) { |
271 | 171 | // For leaves we have to go to the parent too | 164 | // For leaves we have to go to the parent too |
273 | 172 | scope.setNavigationState(root.currentNavigation.parentNavigationId, false); | 165 | scope.loadDepartment(root.currentDepartment.parentDepartmentId); |
274 | 173 | } | 166 | } |
275 | 174 | } | 167 | } |
276 | 175 | } | 168 | } |
277 | 176 | onContentXChanged: { | 169 | onContentXChanged: { |
279 | 177 | if (contentX == width * navigationListView.currentIndex) { | 170 | if (contentX == width * departmentListView.currentIndex) { |
280 | 178 | if (isGoingBack) { | 171 | if (isGoingBack) { |
282 | 179 | navigationModel.remove(navigationListView.currentIndex + 1); | 172 | departmentModel.remove(departmentListView.currentIndex + 1); |
283 | 180 | } else { | 173 | } else { |
285 | 181 | navigationModel.setProperty(navigationListView.currentIndex - 1, "nullifyNavigation", true); | 174 | departmentModel.setProperty(departmentListView.currentIndex - 1, "nullifyDepartment", true); |
286 | 182 | } | 175 | } |
287 | 183 | } | 176 | } |
288 | 184 | } | 177 | } |
289 | 185 | } | 178 | } |
290 | 186 | 179 | ||
291 | 187 | InverseMouseArea { | 180 | InverseMouseArea { |
293 | 188 | anchors.fill: navigationListView | 181 | anchors.fill: departmentListView |
294 | 189 | enabled: root.showList | 182 | enabled: root.showList |
295 | 190 | onClicked: root.showList = false | 183 | onClicked: root.showList = false |
296 | 191 | } | 184 | } |
297 | 192 | 185 | ||
298 | 193 | onScopeChanged: { | 186 | onScopeChanged: { |
302 | 194 | navigationModel.clear(); | 187 | departmentModel.clear(); |
303 | 195 | if (scope && scope.hasNavigation) { | 188 | if (scope && scope.hasDepartments) { |
304 | 196 | navigationModel.append({"navigationId": scope.currentNavigationId, "nullifyNavigation": false}); | 189 | departmentModel.append({"departmentId": scope.currentDepartmentId, "nullifyDepartment": false}); |
305 | 197 | } | 190 | } |
306 | 198 | } | 191 | } |
307 | 199 | 192 | ||
308 | 200 | Connections { | 193 | Connections { |
309 | 201 | target: scope | 194 | target: scope |
313 | 202 | onHasNavigationChanged: { | 195 | onHasDepartmentsChanged: { |
314 | 203 | if (scope.hasNavigation) { | 196 | if (scope.hasDepartments) { |
315 | 204 | navigationModel.append({"navigationId": scope.currentNavigationId, "nullifyNavigation": false}); | 197 | departmentModel.append({"departmentId": scope.currentDepartmentId, "nullifyDepartment": false}); |
316 | 205 | } else { | 198 | } else { |
318 | 206 | navigationModel.clear(); | 199 | departmentModel.clear(); |
319 | 207 | } | 200 | } |
320 | 208 | } | 201 | } |
321 | 209 | } | 202 | } |
322 | 210 | 203 | ||
323 | === renamed file 'qml/Dash/DashNavigationList.qml' => 'qml/Dash/DashDepartmentsList.qml' | |||
324 | --- qml/Dash/DashNavigationList.qml 2014-08-07 14:25:38 +0000 | |||
325 | +++ qml/Dash/DashDepartmentsList.qml 2014-07-08 11:08:19 +0000 | |||
326 | @@ -15,16 +15,16 @@ | |||
327 | 15 | */ | 15 | */ |
328 | 16 | 16 | ||
329 | 17 | import QtQuick 2.2 | 17 | import QtQuick 2.2 |
331 | 18 | import Ubuntu.Components 1.1 | 18 | import Ubuntu.Components 0.1 |
332 | 19 | 19 | ||
333 | 20 | Item { | 20 | Item { |
334 | 21 | id: root | 21 | id: root |
337 | 22 | property var navigation: null | 22 | property var department: null |
338 | 23 | property var currentNavigation: null | 23 | property var currentDepartment: null |
339 | 24 | property var scopeStyle: null | 24 | property var scopeStyle: null |
341 | 25 | signal enterNavigation(var newNavigationId, bool hasChildren) | 25 | signal enterDepartment(var newDepartmentId, bool hasChildren) |
342 | 26 | signal goBackToParentClicked() | 26 | signal goBackToParentClicked() |
344 | 27 | signal allNavigationClicked() | 27 | signal allDepartmentClicked() |
345 | 28 | 28 | ||
346 | 29 | readonly property int itemHeight: units.gu(5) | 29 | readonly property int itemHeight: units.gu(5) |
347 | 30 | readonly property color foregroundColor: root.scopeStyle ? root.scopeStyle.foreground : "grey" | 30 | readonly property color foregroundColor: root.scopeStyle ? root.scopeStyle.foreground : "grey" |
348 | @@ -38,7 +38,7 @@ | |||
349 | 38 | ActivityIndicator { | 38 | ActivityIndicator { |
350 | 39 | id: loadingIndicator | 39 | id: loadingIndicator |
351 | 40 | anchors.centerIn: parent | 40 | anchors.centerIn: parent |
353 | 41 | running: !(navigation && navigation.loaded) | 41 | running: !(department && department.loaded) |
354 | 42 | } | 42 | } |
355 | 43 | clip: true | 43 | clip: true |
356 | 44 | 44 | ||
357 | @@ -54,7 +54,6 @@ | |||
358 | 54 | 54 | ||
359 | 55 | anchors.fill: parent | 55 | anchors.fill: parent |
360 | 56 | 56 | ||
361 | 57 | flickableDirection: Flickable.VerticalFlick | ||
362 | 58 | contentHeight: column.height | 57 | contentHeight: column.height |
363 | 59 | contentWidth: width | 58 | contentWidth: width |
364 | 60 | 59 | ||
365 | @@ -69,7 +68,7 @@ | |||
366 | 69 | id: backButton | 68 | id: backButton |
367 | 70 | objectName: "backButton" | 69 | objectName: "backButton" |
368 | 71 | width: parent.width | 70 | width: parent.width |
370 | 72 | visible: navigation && !navigation.isRoot || false | 71 | visible: department && !department.isRoot || false |
371 | 73 | height: itemHeight | 72 | height: itemHeight |
372 | 74 | 73 | ||
373 | 75 | onClicked: root.goBackToParentClicked(); | 74 | onClicked: root.goBackToParentClicked(); |
374 | @@ -93,7 +92,7 @@ | |||
375 | 93 | left: backImage.right | 92 | left: backImage.right |
376 | 94 | leftMargin: units.gu(0.5) | 93 | leftMargin: units.gu(0.5) |
377 | 95 | } | 94 | } |
379 | 96 | text: navigation ? navigation.parentLabel : "" | 95 | text: department ? department.parentLabel : "" |
380 | 97 | color: root.foregroundColor | 96 | color: root.foregroundColor |
381 | 98 | } | 97 | } |
382 | 99 | 98 | ||
383 | @@ -115,7 +114,7 @@ | |||
384 | 115 | id: allButton | 114 | id: allButton |
385 | 116 | objectName: "allButton" | 115 | objectName: "allButton" |
386 | 117 | width: parent.width | 116 | width: parent.width |
388 | 118 | visible: navigation && (!navigation.isRoot || (root.currentNavigation && !root.currentNavigation.isRoot && root.currentNavigation.parentNavigationId == navigation.navigationId)) || false | 117 | visible: department && (!department.isRoot || (root.currentDepartment && !root.currentDepartment.isRoot && root.currentDepartment.parentDepartmentId == department.departmentId)) || false |
389 | 119 | height: itemHeight | 118 | height: itemHeight |
390 | 120 | 119 | ||
391 | 121 | Label { | 120 | Label { |
392 | @@ -124,7 +123,7 @@ | |||
393 | 124 | left: parent.left | 123 | left: parent.left |
394 | 125 | leftMargin: units.gu(2) | 124 | leftMargin: units.gu(2) |
395 | 126 | } | 125 | } |
397 | 127 | text: navigation ? (navigation.allLabel != "" ? navigation.allLabel : navigation.label) : "" | 126 | text: department ? (department.allLabel != "" ? department.allLabel : department.label) : "" |
398 | 128 | font.bold: true | 127 | font.bold: true |
399 | 129 | color: root.foregroundColor | 128 | color: root.foregroundColor |
400 | 130 | } | 129 | } |
401 | @@ -142,18 +141,18 @@ | |||
402 | 142 | height: units.dp(1) | 141 | height: units.dp(1) |
403 | 143 | } | 142 | } |
404 | 144 | 143 | ||
406 | 145 | onClicked: root.allNavigationClicked(); | 144 | onClicked: root.allDepartmentClicked(); |
407 | 146 | } | 145 | } |
408 | 147 | 146 | ||
409 | 148 | Repeater { | 147 | Repeater { |
411 | 149 | model: navigation && navigation.loaded ? navigation : null | 148 | model: department && department.loaded ? department : null |
412 | 150 | clip: true | 149 | clip: true |
413 | 151 | delegate: AbstractButton { | 150 | delegate: AbstractButton { |
414 | 152 | objectName: root.objectName + "child" + index | 151 | objectName: root.objectName + "child" + index |
415 | 153 | height: root.itemHeight | 152 | height: root.itemHeight |
416 | 154 | width: root.width | 153 | width: root.width |
417 | 155 | 154 | ||
419 | 156 | onClicked: root.enterNavigation(navigationId, hasChildren) | 155 | onClicked: root.enterDepartment(departmentId, hasChildren) |
420 | 157 | 156 | ||
421 | 158 | Label { | 157 | Label { |
422 | 159 | anchors { | 158 | anchors { |
423 | @@ -189,7 +188,7 @@ | |||
424 | 189 | color: root.foregroundColor | 188 | color: root.foregroundColor |
425 | 190 | opacity: 0.1 | 189 | opacity: 0.1 |
426 | 191 | height: units.dp(1) | 190 | height: units.dp(1) |
428 | 192 | visible: index != navigation.count - 1 | 191 | visible: index != department.count - 1 |
429 | 193 | } | 192 | } |
430 | 194 | } | 193 | } |
431 | 195 | } | 194 | } |
432 | 196 | 195 | ||
433 | === modified file 'qml/Dash/GenericScopeView.qml' | |||
434 | --- qml/Dash/GenericScopeView.qml 2014-08-07 14:25:38 +0000 | |||
435 | +++ qml/Dash/GenericScopeView.qml 2014-07-29 11:35:10 +0000 | |||
436 | @@ -25,7 +25,6 @@ | |||
437 | 25 | FocusScope { | 25 | FocusScope { |
438 | 26 | id: scopeView | 26 | id: scopeView |
439 | 27 | 27 | ||
440 | 28 | readonly property alias navigationShown: dashNavigation.showList | ||
441 | 29 | property var scope: null | 28 | property var scope: null |
442 | 30 | property SortFilterProxyModel categories: categoryFilter | 29 | property SortFilterProxyModel categories: categoryFilter |
443 | 31 | property bool isCurrent: false | 30 | property bool isCurrent: false |
444 | @@ -40,6 +39,16 @@ | |||
445 | 40 | 39 | ||
446 | 41 | signal backClicked() | 40 | signal backClicked() |
447 | 42 | 41 | ||
448 | 42 | onScopeChanged: { | ||
449 | 43 | if (scope) { | ||
450 | 44 | scope.activateApplication.connect(activateApp); | ||
451 | 45 | } | ||
452 | 46 | } | ||
453 | 47 | |||
454 | 48 | function activateApp(appId) { | ||
455 | 49 | Qt.openUrlExternally(appId); | ||
456 | 50 | } | ||
457 | 51 | |||
458 | 43 | function positionAtBeginning() { | 52 | function positionAtBeginning() { |
459 | 44 | categoryView.positionAtBeginning() | 53 | categoryView.positionAtBeginning() |
460 | 45 | } | 54 | } |
461 | @@ -110,7 +119,6 @@ | |||
462 | 110 | model: scopeView.categories | 119 | model: scopeView.categories |
463 | 111 | forceNoClip: previewListView.open | 120 | forceNoClip: previewListView.open |
464 | 112 | pixelAligned: true | 121 | pixelAligned: true |
465 | 113 | interactive: !dashNavigation.showList | ||
466 | 114 | 122 | ||
467 | 115 | property string expandedCategoryId: "" | 123 | property string expandedCategoryId: "" |
468 | 116 | 124 | ||
469 | @@ -382,8 +390,7 @@ | |||
470 | 382 | searchInProgress: scopeView.scope ? scopeView.scope.searchInProgress : false | 390 | searchInProgress: scopeView.scope ? scopeView.scope.searchInProgress : false |
471 | 383 | scopeStyle: scopeView.scopeStyle | 391 | scopeStyle: scopeView.scopeStyle |
472 | 384 | 392 | ||
475 | 385 | bottomItem: DashNavigation { | 393 | bottomItem: DashDepartments { |
474 | 386 | id: dashNavigation | ||
476 | 387 | scope: scopeView.scope | 394 | scope: scopeView.scope |
477 | 388 | width: parent.width <= units.gu(60) ? parent.width : units.gu(40) | 395 | width: parent.width <= units.gu(60) ? parent.width : units.gu(40) |
478 | 389 | anchors.right: parent.right | 396 | anchors.right: parent.right |
479 | 390 | 397 | ||
480 | === modified file 'qml/ScopeTool.qml' | |||
481 | --- qml/ScopeTool.qml 2014-08-07 14:25:38 +0000 | |||
482 | +++ qml/ScopeTool.qml 2014-07-03 09:08:22 +0000 | |||
483 | @@ -45,6 +45,16 @@ | |||
484 | 45 | signal searchClicked | 45 | signal searchClicked |
485 | 46 | } | 46 | } |
486 | 47 | 47 | ||
487 | 48 | SortFilterProxyModel { | ||
488 | 49 | id: filteredScopes | ||
489 | 50 | model: Scopes { | ||
490 | 51 | id: scopes | ||
491 | 52 | } | ||
492 | 53 | dynamicSortFilter: true | ||
493 | 54 | |||
494 | 55 | filterRole: Scopes.RoleVisible | ||
495 | 56 | filterRegExp: RegExp("^true$") | ||
496 | 57 | } | ||
497 | 48 | 58 | ||
498 | 49 | Rectangle { | 59 | Rectangle { |
499 | 50 | anchors.fill: dashContent | 60 | anchors.fill: dashContent |
500 | @@ -62,8 +72,8 @@ | |||
501 | 62 | DashContent { | 72 | DashContent { |
502 | 63 | id: dashContent | 73 | id: dashContent |
503 | 64 | 74 | ||
504 | 75 | model: filteredScopes | ||
505 | 65 | property var scope: scopes.getScope(currentIndex) | 76 | property var scope: scopes.getScope(currentIndex) |
506 | 66 | scopes: Scopes { } | ||
507 | 67 | 77 | ||
508 | 68 | anchors { | 78 | anchors { |
509 | 69 | top: parent.top | 79 | top: parent.top |
510 | 70 | 80 | ||
511 | === added file 'qml/Stages/AppSurfaceContainer.qml' | |||
512 | --- qml/Stages/AppSurfaceContainer.qml 1970-01-01 00:00:00 +0000 | |||
513 | +++ qml/Stages/AppSurfaceContainer.qml 2014-08-07 14:25:38 +0000 | |||
514 | @@ -0,0 +1,44 @@ | |||
515 | 1 | /* | ||
516 | 2 | * Copyright 2014 Canonical Ltd. | ||
517 | 3 | * | ||
518 | 4 | * This program is free software; you can redistribute it and/or modify | ||
519 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
520 | 6 | * the Free Software Foundation; version 3. | ||
521 | 7 | * | ||
522 | 8 | * This program is distributed in the hope that it will be useful, | ||
523 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
524 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
525 | 11 | * GNU Lesser General Public License for more details. | ||
526 | 12 | * | ||
527 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
528 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
529 | 15 | */ | ||
530 | 16 | |||
531 | 17 | import QtQuick 2.0 | ||
532 | 18 | import "Animations" | ||
533 | 19 | |||
534 | 20 | SurfaceContainer { | ||
535 | 21 | id: container | ||
536 | 22 | property var promptSurfaces | ||
537 | 23 | |||
538 | 24 | Repeater { | ||
539 | 25 | model: container.promptSurfaces | ||
540 | 26 | |||
541 | 27 | delegate: SurfaceContainer { | ||
542 | 28 | anchors { | ||
543 | 29 | fill: container | ||
544 | 30 | topMargin: container.surface.anchors.topMargin | ||
545 | 31 | rightMargin: container.surface.anchors.rightMargin | ||
546 | 32 | bottomMargin: container.surface.anchors.bottomMargin | ||
547 | 33 | leftMargin: container.surface.anchors.leftMargin | ||
548 | 34 | } | ||
549 | 35 | |||
550 | 36 | z: 3 + index | ||
551 | 37 | surface: modelData | ||
552 | 38 | |||
553 | 39 | Component.onCompleted: { | ||
554 | 40 | animateIn(); | ||
555 | 41 | } | ||
556 | 42 | } | ||
557 | 43 | } | ||
558 | 44 | } | ||
559 | 0 | 45 | ||
560 | === modified file 'qml/Stages/SpreadDelegate.qml' | |||
561 | --- qml/Stages/SpreadDelegate.qml 2014-07-29 11:35:10 +0000 | |||
562 | +++ qml/Stages/SpreadDelegate.qml 2014-08-07 14:25:38 +0000 | |||
563 | @@ -35,11 +35,13 @@ | |||
564 | 35 | signal clicked() | 35 | signal clicked() |
565 | 36 | signal closed() | 36 | signal closed() |
566 | 37 | 37 | ||
568 | 38 | SurfaceContainer { | 38 | AppSurfaceContainer { |
569 | 39 | id: surfaceContainer | 39 | id: surfaceContainer |
570 | 40 | objectName: "surfaceContainer" | 40 | objectName: "surfaceContainer" |
571 | 41 | anchors.fill: parent | 41 | anchors.fill: parent |
572 | 42 | surface: model.surface | 42 | surface: model.surface |
573 | 43 | promptSurfaces: model.application.promptSurfaces | ||
574 | 44 | |||
575 | 43 | property bool appHasCreatedASurface: false | 45 | property bool appHasCreatedASurface: false |
576 | 44 | 46 | ||
577 | 45 | onSurfaceChanged: { | 47 | onSurfaceChanged: { |
578 | 46 | 48 | ||
579 | === modified file 'qml/Stages/SurfaceContainer.qml' | |||
580 | --- qml/Stages/SurfaceContainer.qml 2014-07-23 12:23:10 +0000 | |||
581 | +++ qml/Stages/SurfaceContainer.qml 2014-08-07 14:25:38 +0000 | |||
582 | @@ -40,19 +40,12 @@ | |||
583 | 40 | childSurfaces[i].removed(); | 40 | childSurfaces[i].removed(); |
584 | 41 | } | 41 | } |
585 | 42 | 42 | ||
594 | 43 | //if we don't have children, nothing will tell us to animate out, so do it. | 43 | animateOut(); |
587 | 44 | if (childSurfaces.length === 0) { | ||
588 | 45 | animateOut(); | ||
589 | 46 | } | ||
590 | 47 | // tell our parent to animate out. | ||
591 | 48 | if (surface.parentSurface) { | ||
592 | 49 | surface.parentSurface.parent.animateOut(); | ||
593 | 50 | } | ||
595 | 51 | } | 44 | } |
596 | 52 | } | 45 | } |
597 | 53 | 46 | ||
598 | 54 | Repeater { | 47 | Repeater { |
600 | 55 | model: container.surface ? container.surface.childSurfaces : 0 | 48 | model: surface.childSurfaces |
601 | 56 | 49 | ||
602 | 57 | delegate: Loader { | 50 | delegate: Loader { |
603 | 58 | z: 2 | 51 | z: 2 |
604 | @@ -68,14 +61,13 @@ | |||
605 | 68 | source: Qt.resolvedUrl("SurfaceContainer.qml") | 61 | source: Qt.resolvedUrl("SurfaceContainer.qml") |
606 | 69 | onLoaded: { | 62 | onLoaded: { |
607 | 70 | item.surface = modelData; | 63 | item.surface = modelData; |
610 | 71 | item.animateIn(swipeFromBottom); | 64 | item.animateIn(); |
609 | 72 | container.animateIn(swipeUp); | ||
611 | 73 | } | 65 | } |
612 | 74 | } | 66 | } |
613 | 75 | } | 67 | } |
614 | 76 | 68 | ||
617 | 77 | function animateIn(component) { | 69 | function animateIn() { |
618 | 78 | var animation = component.createObject(container, { "surface": container.surface }); | 70 | var animation = swipeFromBottom.createObject(container, { "surface": container.surface }); |
619 | 79 | animation.start(); | 71 | animation.start(); |
620 | 80 | 72 | ||
621 | 81 | var tmp = d.animations; | 73 | var tmp = d.animations; |
622 | @@ -104,20 +96,11 @@ | |||
623 | 104 | id: swipeFromBottom | 96 | id: swipeFromBottom |
624 | 105 | SwipeFromBottomAnimation {} | 97 | SwipeFromBottomAnimation {} |
625 | 106 | } | 98 | } |
626 | 107 | Component { | ||
627 | 108 | id: swipeUp | ||
628 | 109 | SwipeUpAnimation {} | ||
629 | 110 | } | ||
630 | 111 | Component { | ||
631 | 112 | id: darkenFade | ||
632 | 113 | DarkenAndFadeInAnimation {} | ||
633 | 114 | } | ||
634 | 115 | 99 | ||
635 | 116 | states: [ | 100 | states: [ |
636 | 117 | State { | 101 | State { |
637 | 118 | name: "initial" | 102 | name: "initial" |
638 | 119 | PropertyChanges { target: surface; anchors.fill: container } | 103 | PropertyChanges { target: surface; anchors.fill: container } |
639 | 120 | } | 104 | } |
640 | 121 | // TODO: more animations! | ||
641 | 122 | ] | 105 | ] |
642 | 123 | } | 106 | } |
643 | 124 | 107 | ||
644 | === modified file 'tests/mocks/Unity/Application/ApplicationDBusAdaptor.cpp' | |||
645 | --- tests/mocks/Unity/Application/ApplicationDBusAdaptor.cpp 2014-07-25 05:39:21 +0000 | |||
646 | +++ tests/mocks/Unity/Application/ApplicationDBusAdaptor.cpp 2014-08-07 14:25:38 +0000 | |||
647 | @@ -43,10 +43,8 @@ | |||
648 | 43 | return child ? child : surface; | 43 | return child ? child : surface; |
649 | 44 | } | 44 | } |
650 | 45 | 45 | ||
652 | 46 | quint32 ApplicationDBusAdaptor::addChildSurface(const QString &appId, const QString &surfaceImage) | 46 | quint32 ApplicationDBusAdaptor::addPromptSurface(const QString &appId, const QString &surfaceImage) |
653 | 47 | { | 47 | { |
654 | 48 | qDebug() << "ApplicationDBusAdaptor::addChildSurface - " << appId; | ||
655 | 49 | |||
656 | 50 | ApplicationInfo* application = m_applicationManager->findApplication(appId); | 48 | ApplicationInfo* application = m_applicationManager->findApplication(appId); |
657 | 51 | if (!application) { | 49 | if (!application) { |
658 | 52 | qDebug() << "ApplicationDBusAdaptor::addChildSurface - No application found for " << appId; | 50 | qDebug() << "ApplicationDBusAdaptor::addChildSurface - No application found for " << appId; |
659 | @@ -58,7 +56,16 @@ | |||
660 | 58 | MirSurfaceItem::Maximized, | 56 | MirSurfaceItem::Maximized, |
661 | 59 | QUrl(surfaceImage)); | 57 | QUrl(surfaceImage)); |
662 | 60 | m_childItems[surfaceId] = surface; | 58 | m_childItems[surfaceId] = surface; |
664 | 61 | surface->setParentSurface(topSurface(application->surface())); | 59 | |
665 | 60 | if (application->promptSurfaceList().count() > 0) { | ||
666 | 61 | surface->setParentSurface(topSurface(application->promptSurfaceList()[0])); | ||
667 | 62 | qDebug() << "ApplicationDBusAdaptor::addChildSurface - " << appId; | ||
668 | 63 | } else { | ||
669 | 64 | application->addPromptSurface(surface); | ||
670 | 65 | qDebug() << "ApplicationDBusAdaptor::addPromptSurface - " << appId; | ||
671 | 66 | } | ||
672 | 67 | |||
673 | 68 | |||
674 | 62 | return surfaceId; | 69 | return surfaceId; |
675 | 63 | } | 70 | } |
676 | 64 | 71 | ||
677 | 65 | 72 | ||
678 | === modified file 'tests/mocks/Unity/Application/ApplicationDBusAdaptor.h' | |||
679 | --- tests/mocks/Unity/Application/ApplicationDBusAdaptor.h 2014-07-19 12:06:55 +0000 | |||
680 | +++ tests/mocks/Unity/Application/ApplicationDBusAdaptor.h 2014-08-07 14:25:38 +0000 | |||
681 | @@ -31,7 +31,7 @@ | |||
682 | 31 | ApplicationDBusAdaptor(ApplicationManager* applicationManager); | 31 | ApplicationDBusAdaptor(ApplicationManager* applicationManager); |
683 | 32 | 32 | ||
684 | 33 | public Q_SLOTS: | 33 | public Q_SLOTS: |
686 | 34 | quint32 addChildSurface(const QString& appId, const QString& surfaceImage); | 34 | quint32 addPromptSurface(const QString& appId, const QString& surfaceImage); |
687 | 35 | void removeChildSurface(int surfaceId); | 35 | void removeChildSurface(int surfaceId); |
688 | 36 | 36 | ||
689 | 37 | private: | 37 | private: |
690 | 38 | 38 | ||
691 | === modified file 'tests/mocks/Unity/Application/ApplicationInfo.cpp' | |||
692 | --- tests/mocks/Unity/Application/ApplicationInfo.cpp 2014-07-25 00:10:11 +0000 | |||
693 | +++ tests/mocks/Unity/Application/ApplicationInfo.cpp 2014-08-07 14:25:38 +0000 | |||
694 | @@ -98,3 +98,52 @@ | |||
695 | 98 | Q_EMIT surfaceChanged(m_surface); | 98 | Q_EMIT surfaceChanged(m_surface); |
696 | 99 | SurfaceManager::singleton()->registerSurface(m_surface); | 99 | SurfaceManager::singleton()->registerSurface(m_surface); |
697 | 100 | } | 100 | } |
698 | 101 | |||
699 | 102 | void ApplicationInfo::removeSurface(MirSurfaceItem* surface) | ||
700 | 103 | { | ||
701 | 104 | if (m_surface == surface) { | ||
702 | 105 | setSurface(nullptr); | ||
703 | 106 | } else if (m_promptSurfaces.contains(surface)) { | ||
704 | 107 | m_promptSurfaces.removeAll(surface); | ||
705 | 108 | surface->setApplication(nullptr); | ||
706 | 109 | |||
707 | 110 | Q_EMIT promptSurfacesChanged(); | ||
708 | 111 | } | ||
709 | 112 | } | ||
710 | 113 | |||
711 | 114 | void ApplicationInfo::addPromptSurface(MirSurfaceItem* surface) | ||
712 | 115 | { | ||
713 | 116 | if (surface == m_surface || m_promptSurfaces.contains(surface)) return; | ||
714 | 117 | |||
715 | 118 | surface->setApplication(this); | ||
716 | 119 | m_promptSurfaces.append(surface); | ||
717 | 120 | Q_EMIT promptSurfacesChanged(); | ||
718 | 121 | } | ||
719 | 122 | |||
720 | 123 | QList<MirSurfaceItem*> ApplicationInfo::promptSurfaceList() const | ||
721 | 124 | { | ||
722 | 125 | return m_promptSurfaces; | ||
723 | 126 | } | ||
724 | 127 | |||
725 | 128 | QQmlListProperty<MirSurfaceItem> ApplicationInfo::promptSurfaces() | ||
726 | 129 | { | ||
727 | 130 | return QQmlListProperty<MirSurfaceItem>(this, | ||
728 | 131 | 0, | ||
729 | 132 | ApplicationInfo::promptSurfaceCount, | ||
730 | 133 | ApplicationInfo::promptSurfaceAt); | ||
731 | 134 | } | ||
732 | 135 | |||
733 | 136 | int ApplicationInfo::promptSurfaceCount(QQmlListProperty<MirSurfaceItem> *prop) | ||
734 | 137 | { | ||
735 | 138 | ApplicationInfo *p = qobject_cast<ApplicationInfo*>(prop->object); | ||
736 | 139 | return p->m_promptSurfaces.count(); | ||
737 | 140 | } | ||
738 | 141 | |||
739 | 142 | MirSurfaceItem* ApplicationInfo::promptSurfaceAt(QQmlListProperty<MirSurfaceItem> *prop, int index) | ||
740 | 143 | { | ||
741 | 144 | ApplicationInfo *p = qobject_cast<ApplicationInfo*>(prop->object); | ||
742 | 145 | |||
743 | 146 | if (index < 0 || index >= p->m_promptSurfaces.count()) | ||
744 | 147 | return nullptr; | ||
745 | 148 | return p->m_promptSurfaces[index]; | ||
746 | 149 | } | ||
747 | 101 | 150 | ||
748 | === modified file 'tests/mocks/Unity/Application/ApplicationInfo.h' | |||
749 | --- tests/mocks/Unity/Application/ApplicationInfo.h 2014-07-25 00:10:11 +0000 | |||
750 | +++ tests/mocks/Unity/Application/ApplicationInfo.h 2014-08-07 14:25:38 +0000 | |||
751 | @@ -38,6 +38,7 @@ | |||
752 | 38 | Q_PROPERTY(bool fullscreen READ fullscreen WRITE setFullscreen NOTIFY fullscreenChanged) | 38 | Q_PROPERTY(bool fullscreen READ fullscreen WRITE setFullscreen NOTIFY fullscreenChanged) |
753 | 39 | Q_PROPERTY(Stage stage READ stage WRITE setStage NOTIFY stageChanged) | 39 | Q_PROPERTY(Stage stage READ stage WRITE setStage NOTIFY stageChanged) |
754 | 40 | Q_PROPERTY(MirSurfaceItem* surface READ surface NOTIFY surfaceChanged) | 40 | Q_PROPERTY(MirSurfaceItem* surface READ surface NOTIFY surfaceChanged) |
755 | 41 | Q_PROPERTY(QQmlListProperty<MirSurfaceItem> promptSurfaces READ promptSurfaces NOTIFY promptSurfacesChanged DESIGNABLE false) | ||
756 | 41 | 42 | ||
757 | 42 | // Only exists in this fake implementation | 43 | // Only exists in this fake implementation |
758 | 43 | 44 | ||
759 | @@ -85,8 +86,15 @@ | |||
760 | 85 | void setSurface(MirSurfaceItem* surface); | 86 | void setSurface(MirSurfaceItem* surface); |
761 | 86 | MirSurfaceItem* surface() const { return m_surface; } | 87 | MirSurfaceItem* surface() const { return m_surface; } |
762 | 87 | 88 | ||
763 | 89 | void removeSurface(MirSurfaceItem* surface); | ||
764 | 90 | |||
765 | 91 | void addPromptSurface(MirSurfaceItem* surface); | ||
766 | 92 | QList<MirSurfaceItem*> promptSurfaceList() const; | ||
767 | 93 | QQmlListProperty<MirSurfaceItem> promptSurfaces(); | ||
768 | 94 | |||
769 | 88 | Q_SIGNALS: | 95 | Q_SIGNALS: |
770 | 89 | void surfaceChanged(MirSurfaceItem*); | 96 | void surfaceChanged(MirSurfaceItem*); |
771 | 97 | void promptSurfacesChanged(); | ||
772 | 90 | 98 | ||
773 | 91 | private Q_SLOTS: | 99 | private Q_SLOTS: |
774 | 92 | void onStateChanged(State state); | 100 | void onStateChanged(State state); |
775 | @@ -94,10 +102,15 @@ | |||
776 | 94 | void createSurface(); | 102 | void createSurface(); |
777 | 95 | 103 | ||
778 | 96 | private: | 104 | private: |
779 | 105 | static int promptSurfaceCount(QQmlListProperty<MirSurfaceItem> *prop); | ||
780 | 106 | static MirSurfaceItem* promptSurfaceAt(QQmlListProperty<MirSurfaceItem> *prop, int index); | ||
781 | 107 | |||
782 | 97 | QQuickItem *m_parentItem; | 108 | QQuickItem *m_parentItem; |
783 | 98 | MirSurfaceItem* m_surface; | 109 | MirSurfaceItem* m_surface; |
784 | 110 | QList<MirSurfaceItem*> m_promptSurfaces; | ||
785 | 99 | }; | 111 | }; |
786 | 100 | 112 | ||
787 | 101 | Q_DECLARE_METATYPE(ApplicationInfo*) | 113 | Q_DECLARE_METATYPE(ApplicationInfo*) |
788 | 114 | Q_DECLARE_METATYPE(QQmlListProperty<MirSurfaceItem>) | ||
789 | 102 | 115 | ||
790 | 103 | #endif // APPLICATION_H | 116 | #endif // APPLICATION_H |
791 | 104 | 117 | ||
792 | === modified file 'tests/mocks/Unity/Application/ApplicationManager.cpp' | |||
793 | --- tests/mocks/Unity/Application/ApplicationManager.cpp 2014-07-29 11:41:39 +0000 | |||
794 | +++ tests/mocks/Unity/Application/ApplicationManager.cpp 2014-08-07 14:25:38 +0000 | |||
795 | @@ -51,6 +51,7 @@ | |||
796 | 51 | { | 51 | { |
797 | 52 | m_roleNames.insert(RoleSurface, "surface"); | 52 | m_roleNames.insert(RoleSurface, "surface"); |
798 | 53 | m_roleNames.insert(RoleFullscreen, "fullscreen"); | 53 | m_roleNames.insert(RoleFullscreen, "fullscreen"); |
799 | 54 | m_roleNames.insert(RoleApplication, "application"); | ||
800 | 54 | 55 | ||
801 | 55 | buildListOfAvailableApplications(); | 56 | buildListOfAvailableApplications(); |
802 | 56 | 57 | ||
803 | @@ -92,6 +93,8 @@ | |||
804 | 92 | return QVariant::fromValue(app->surface()); | 93 | return QVariant::fromValue(app->surface()); |
805 | 93 | case RoleFullscreen: | 94 | case RoleFullscreen: |
806 | 94 | return app->fullscreen(); | 95 | return app->fullscreen(); |
807 | 96 | case RoleApplication: | ||
808 | 97 | return QVariant::fromValue(app); | ||
809 | 95 | default: | 98 | default: |
810 | 96 | return QVariant(); | 99 | return QVariant(); |
811 | 97 | } | 100 | } |
812 | 98 | 101 | ||
813 | === modified file 'tests/mocks/Unity/Application/ApplicationManager.h' | |||
814 | --- tests/mocks/Unity/Application/ApplicationManager.h 2014-07-25 00:10:11 +0000 | |||
815 | +++ tests/mocks/Unity/Application/ApplicationManager.h 2014-08-07 14:25:38 +0000 | |||
816 | @@ -53,6 +53,7 @@ | |||
817 | 53 | enum MoreRoles { | 53 | enum MoreRoles { |
818 | 54 | RoleSurface = RoleScreenshot+1, | 54 | RoleSurface = RoleScreenshot+1, |
819 | 55 | RoleFullscreen, | 55 | RoleFullscreen, |
820 | 56 | RoleApplication, | ||
821 | 56 | }; | 57 | }; |
822 | 57 | enum Role { | 58 | enum Role { |
823 | 58 | Dash, Default, Indicators, Notifications, Greeter, Launcher, OnScreenKeyboard, | 59 | Dash, Default, Indicators, Notifications, Greeter, Launcher, OnScreenKeyboard, |
824 | 59 | 60 | ||
825 | === modified file 'tests/mocks/Unity/Application/MirSurfaceItem.cpp' | |||
826 | --- tests/mocks/Unity/Application/MirSurfaceItem.cpp 2014-07-25 05:39:21 +0000 | |||
827 | +++ tests/mocks/Unity/Application/MirSurfaceItem.cpp 2014-08-07 14:25:38 +0000 | |||
828 | @@ -54,7 +54,7 @@ | |||
829 | 54 | m_parentSurface->removeChildSurface(this); | 54 | m_parentSurface->removeChildSurface(this); |
830 | 55 | 55 | ||
831 | 56 | if (m_application) | 56 | if (m_application) |
833 | 57 | m_application->setSurface(nullptr); | 57 | m_application->removeSurface(this); |
834 | 58 | } | 58 | } |
835 | 59 | 59 | ||
836 | 60 | void MirSurfaceItem::paint(QPainter * painter) | 60 | void MirSurfaceItem::paint(QPainter * painter) |
837 | @@ -75,7 +75,7 @@ | |||
838 | 75 | } | 75 | } |
839 | 76 | 76 | ||
840 | 77 | if (m_application) { | 77 | if (m_application) { |
842 | 78 | m_application->setSurface(nullptr); | 78 | m_application->removeSurface(this); |
843 | 79 | } | 79 | } |
844 | 80 | if (!parent()) { | 80 | if (!parent()) { |
845 | 81 | deleteLater(); | 81 | deleteLater(); |
846 | 82 | 82 | ||
847 | === modified file 'tests/mocks/Unity/Application/MirSurfaceItem.h' | |||
848 | --- tests/mocks/Unity/Application/MirSurfaceItem.h 2014-07-25 06:50:09 +0000 | |||
849 | +++ tests/mocks/Unity/Application/MirSurfaceItem.h 2014-08-07 14:25:38 +0000 | |||
850 | @@ -117,5 +117,6 @@ | |||
851 | 117 | }; | 117 | }; |
852 | 118 | 118 | ||
853 | 119 | Q_DECLARE_METATYPE(MirSurfaceItem*) | 119 | Q_DECLARE_METATYPE(MirSurfaceItem*) |
854 | 120 | Q_DECLARE_METATYPE(QList<MirSurfaceItem*>) | ||
855 | 120 | 121 | ||
856 | 121 | #endif // MIRSURFACEITEM_H | 122 | #endif // MIRSURFACEITEM_H |
857 | 122 | 123 | ||
858 | === modified file 'tests/mocks/Unity/CMakeLists.txt' | |||
859 | --- tests/mocks/Unity/CMakeLists.txt 2014-08-07 14:25:38 +0000 | |||
860 | +++ tests/mocks/Unity/CMakeLists.txt 2014-08-05 12:06:16 +0000 | |||
861 | @@ -7,7 +7,7 @@ | |||
862 | 7 | pkg_search_module(DEE dee-1.0 REQUIRED) | 7 | pkg_search_module(DEE dee-1.0 REQUIRED) |
863 | 8 | pkg_search_module(GOBJECT gobject-2.0 REQUIRED) | 8 | pkg_search_module(GOBJECT gobject-2.0 REQUIRED) |
864 | 9 | pkg_search_module(DEEQT libdee-qt5 REQUIRED) | 9 | pkg_search_module(DEEQT libdee-qt5 REQUIRED) |
866 | 10 | pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=4) | 10 | pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=3) |
867 | 11 | 11 | ||
868 | 12 | include_directories( | 12 | include_directories( |
869 | 13 | ${CMAKE_CURRENT_BINARY_DIR} | 13 | ${CMAKE_CURRENT_BINARY_DIR} |
870 | @@ -23,14 +23,14 @@ | |||
871 | 23 | fake_scope.cpp | 23 | fake_scope.cpp |
872 | 24 | fake_scopes.cpp | 24 | fake_scopes.cpp |
873 | 25 | fake_categories.cpp | 25 | fake_categories.cpp |
875 | 26 | fake_navigation.cpp | 26 | fake_department.cpp |
876 | 27 | fake_resultsmodel.cpp | 27 | fake_resultsmodel.cpp |
877 | 28 | fake_previewmodel.cpp | 28 | fake_previewmodel.cpp |
878 | 29 | fake_previewstack.cpp | 29 | fake_previewstack.cpp |
879 | 30 | fake_previewwidgetmodel.cpp | 30 | fake_previewwidgetmodel.cpp |
880 | 31 | fake_unity_plugin.cpp | 31 | fake_unity_plugin.cpp |
881 | 32 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/CategoriesInterface.h | 32 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/CategoriesInterface.h |
883 | 33 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/NavigationInterface.h | 33 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/DepartmentInterface.h |
884 | 34 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewModelInterface.h | 34 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewModelInterface.h |
885 | 35 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewStackInterface.h | 35 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewStackInterface.h |
886 | 36 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewWidgetModelInterface.h | 36 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewWidgetModelInterface.h |
887 | 37 | 37 | ||
888 | === modified file 'tests/mocks/Unity/Unity.qmltypes' | |||
889 | --- tests/mocks/Unity/Unity.qmltypes 2014-08-07 14:25:38 +0000 | |||
890 | +++ tests/mocks/Unity/Unity.qmltypes 2014-07-10 10:59:08 +0000 | |||
891 | @@ -24,12 +24,6 @@ | |||
892 | 24 | Parameter { name: "categoryId"; type: "string" } | 24 | Parameter { name: "categoryId"; type: "string" } |
893 | 25 | Parameter { name: "json"; type: "string" } | 25 | Parameter { name: "json"; type: "string" } |
894 | 26 | } | 26 | } |
895 | 27 | Method { | ||
896 | 28 | name: "data" | ||
897 | 29 | type: "QVariant" | ||
898 | 30 | Parameter { name: "row"; type: "int" } | ||
899 | 31 | Parameter { name: "role"; type: "int" } | ||
900 | 32 | } | ||
901 | 33 | } | 27 | } |
902 | 34 | Component { | 28 | Component { |
903 | 35 | name: "PreviewModel" | 29 | name: "PreviewModel" |
904 | @@ -68,10 +62,6 @@ | |||
905 | 68 | prototype: "unity::shell::scopes::ScopeInterface" | 62 | prototype: "unity::shell::scopes::ScopeInterface" |
906 | 69 | exports: ["Unity/MockScope 0.2"] | 63 | exports: ["Unity/MockScope 0.2"] |
907 | 70 | exportMetaObjectRevisions: [0] | 64 | exportMetaObjectRevisions: [0] |
908 | 71 | Signal { | ||
909 | 72 | name: "performQuery" | ||
910 | 73 | Parameter { name: "query"; type: "string" } | ||
911 | 74 | } | ||
912 | 75 | Method { | 65 | Method { |
913 | 76 | name: "setSearchInProgress" | 66 | name: "setSearchInProgress" |
914 | 77 | Parameter { name: "inProg"; type: "bool" } | 67 | Parameter { name: "inProg"; type: "bool" } |
915 | @@ -91,21 +81,18 @@ | |||
916 | 91 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } | 81 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } |
917 | 92 | } | 82 | } |
918 | 93 | Method { | 83 | Method { |
934 | 94 | name: "getNavigation" | 84 | name: "getDepartment" |
935 | 95 | type: "unity::shell::scopes::NavigationInterface*" | 85 | type: "unity::shell::scopes::DepartmentInterface*" |
936 | 96 | Parameter { name: "navigationId"; type: "string" } | 86 | Parameter { name: "id"; type: "string" } |
937 | 97 | } | 87 | } |
938 | 98 | Method { | 88 | Method { |
939 | 99 | name: "getAltNavigation" | 89 | name: "loadDepartment" |
940 | 100 | type: "unity::shell::scopes::NavigationInterface*" | 90 | Parameter { name: "id"; type: "string" } |
941 | 101 | Parameter { name: "altNavigationId"; type: "string" } | 91 | } |
942 | 102 | } | 92 | Method { |
943 | 103 | Method { | 93 | name: "performQuery" |
944 | 104 | name: "setNavigationState" | 94 | Parameter { name: "query"; type: "string" } |
945 | 105 | Parameter { name: "navigationId"; type: "string" } | 95 | } |
931 | 106 | Parameter { name: "isAltNavigation"; type: "bool" } | ||
932 | 107 | } | ||
933 | 108 | Method { name: "refresh" } | ||
946 | 109 | } | 96 | } |
947 | 110 | Component { | 97 | Component { |
948 | 111 | name: "Scopes" | 98 | name: "Scopes" |
949 | @@ -150,7 +137,6 @@ | |||
950 | 150 | "RoleRawRendererTemplate": 3, | 137 | "RoleRawRendererTemplate": 3, |
951 | 151 | "RoleRenderer": 4, | 138 | "RoleRenderer": 4, |
952 | 152 | "RoleComponents": 5, | 139 | "RoleComponents": 5, |
953 | 153 | "RoleHeaderLink": 6, | ||
954 | 154 | "RoleResults": 7, | 140 | "RoleResults": 7, |
955 | 155 | "RoleCount": 8 | 141 | "RoleCount": 8 |
956 | 156 | } | 142 | } |
957 | @@ -171,28 +157,27 @@ | |||
958 | 171 | } | 157 | } |
959 | 172 | } | 158 | } |
960 | 173 | Component { | 159 | Component { |
962 | 174 | name: "unity::shell::scopes::NavigationInterface" | 160 | name: "unity::shell::scopes::DepartmentInterface" |
963 | 175 | prototype: "QAbstractListModel" | 161 | prototype: "QAbstractListModel" |
965 | 176 | exports: ["Unity/Navigation 0.2"] | 162 | exports: ["Unity/Department 0.2"] |
966 | 177 | isCreatable: false | 163 | isCreatable: false |
967 | 178 | exportMetaObjectRevisions: [0] | 164 | exportMetaObjectRevisions: [0] |
968 | 179 | Enum { | 165 | Enum { |
969 | 180 | name: "Roles" | 166 | name: "Roles" |
970 | 181 | values: { | 167 | values: { |
972 | 182 | "RoleNavigationId": 0, | 168 | "RoleDepartmentId": 0, |
973 | 183 | "RoleLabel": 1, | 169 | "RoleLabel": 1, |
974 | 184 | "RoleHasChildren": 2, | 170 | "RoleHasChildren": 2, |
975 | 185 | "RoleIsActive": 3 | 171 | "RoleIsActive": 3 |
976 | 186 | } | 172 | } |
977 | 187 | } | 173 | } |
979 | 188 | Property { name: "navigationId"; type: "string"; isReadonly: true } | 174 | Property { name: "departmentId"; type: "string"; isReadonly: true } |
980 | 189 | Property { name: "label"; type: "string"; isReadonly: true } | 175 | Property { name: "label"; type: "string"; isReadonly: true } |
981 | 190 | Property { name: "allLabel"; type: "string"; isReadonly: true } | 176 | Property { name: "allLabel"; type: "string"; isReadonly: true } |
983 | 191 | Property { name: "parentNavigationId"; type: "string"; isReadonly: true } | 177 | Property { name: "parentDepartmentId"; type: "string"; isReadonly: true } |
984 | 192 | Property { name: "parentLabel"; type: "string"; isReadonly: true } | 178 | Property { name: "parentLabel"; type: "string"; isReadonly: true } |
985 | 193 | Property { name: "loaded"; type: "bool"; isReadonly: true } | 179 | Property { name: "loaded"; type: "bool"; isReadonly: true } |
986 | 194 | Property { name: "isRoot"; type: "bool"; isReadonly: true } | 180 | Property { name: "isRoot"; type: "bool"; isReadonly: true } |
987 | 195 | Property { name: "hidden"; type: "bool"; isReadonly: true } | ||
988 | 196 | Property { name: "count"; type: "int"; isReadonly: true } | 181 | Property { name: "count"; type: "int"; isReadonly: true } |
989 | 197 | } | 182 | } |
990 | 198 | Component { | 183 | Component { |
991 | @@ -262,8 +247,7 @@ | |||
992 | 262 | "RoleEmblem": 8, | 247 | "RoleEmblem": 8, |
993 | 263 | "RoleSummary": 9, | 248 | "RoleSummary": 9, |
994 | 264 | "RoleAttributes": 10, | 249 | "RoleAttributes": 10, |
997 | 265 | "RoleBackground": 11, | 250 | "RoleBackground": 11 |
996 | 266 | "RoleOverlayColor": 12 | ||
998 | 267 | } | 251 | } |
999 | 268 | } | 252 | } |
1000 | 269 | Property { name: "categoryId"; type: "string" } | 253 | Property { name: "categoryId"; type: "string" } |
1001 | @@ -275,22 +259,13 @@ | |||
1002 | 275 | exports: ["Unity/Scope 0.2"] | 259 | exports: ["Unity/Scope 0.2"] |
1003 | 276 | isCreatable: false | 260 | isCreatable: false |
1004 | 277 | exportMetaObjectRevisions: [0] | 261 | exportMetaObjectRevisions: [0] |
1005 | 278 | Enum { | ||
1006 | 279 | name: "Status" | ||
1007 | 280 | values: { | ||
1008 | 281 | "Okay": 0, | ||
1009 | 282 | "NoInternet": 1, | ||
1010 | 283 | "NoLocationData": 2, | ||
1011 | 284 | "Unknown": 3 | ||
1012 | 285 | } | ||
1013 | 286 | } | ||
1014 | 287 | Property { name: "id"; type: "string"; isReadonly: true } | 262 | Property { name: "id"; type: "string"; isReadonly: true } |
1015 | 288 | Property { name: "name"; type: "string"; isReadonly: true } | 263 | Property { name: "name"; type: "string"; isReadonly: true } |
1016 | 289 | Property { name: "iconHint"; type: "string"; isReadonly: true } | 264 | Property { name: "iconHint"; type: "string"; isReadonly: true } |
1017 | 290 | Property { name: "description"; type: "string"; isReadonly: true } | 265 | Property { name: "description"; type: "string"; isReadonly: true } |
1018 | 291 | Property { name: "searchHint"; type: "string"; isReadonly: true } | 266 | Property { name: "searchHint"; type: "string"; isReadonly: true } |
1019 | 292 | Property { name: "searchInProgress"; type: "bool"; isReadonly: true } | 267 | Property { name: "searchInProgress"; type: "bool"; isReadonly: true } |
1021 | 293 | Property { name: "favorite"; type: "bool" } | 268 | Property { name: "visible"; type: "bool"; isReadonly: true } |
1022 | 294 | Property { name: "shortcut"; type: "string"; isReadonly: true } | 269 | Property { name: "shortcut"; type: "string"; isReadonly: true } |
1023 | 295 | Property { | 270 | Property { |
1024 | 296 | name: "categories" | 271 | name: "categories" |
1025 | @@ -298,27 +273,13 @@ | |||
1026 | 298 | isReadonly: true | 273 | isReadonly: true |
1027 | 299 | isPointer: true | 274 | isPointer: true |
1028 | 300 | } | 275 | } |
1029 | 301 | Property { | ||
1030 | 302 | name: "settings" | ||
1031 | 303 | type: "unity::shell::scopes::SettingsModelInterface" | ||
1032 | 304 | isReadonly: true | ||
1033 | 305 | isPointer: true | ||
1034 | 306 | } | ||
1035 | 307 | Property { name: "searchQuery"; type: "string" } | 276 | Property { name: "searchQuery"; type: "string" } |
1036 | 308 | Property { name: "noResultsHint"; type: "string" } | 277 | Property { name: "noResultsHint"; type: "string" } |
1037 | 309 | Property { name: "formFactor"; type: "string" } | 278 | Property { name: "formFactor"; type: "string" } |
1038 | 310 | Property { name: "isActive"; type: "bool" } | 279 | Property { name: "isActive"; type: "bool" } |
1043 | 311 | Property { name: "currentNavigationId"; type: "string"; isReadonly: true } | 280 | Property { name: "currentDepartmentId"; type: "string"; isReadonly: true } |
1044 | 312 | Property { name: "hasNavigation"; type: "bool"; isReadonly: true } | 281 | Property { name: "hasDepartments"; type: "bool"; isReadonly: true } |
1041 | 313 | Property { name: "currentAltNavigationId"; type: "string"; isReadonly: true } | ||
1042 | 314 | Property { name: "hasAltNavigation"; type: "bool"; isReadonly: true } | ||
1045 | 315 | Property { name: "customizations"; type: "QVariantMap"; isReadonly: true } | 282 | Property { name: "customizations"; type: "QVariantMap"; isReadonly: true } |
1046 | 316 | Property { | ||
1047 | 317 | name: "status" | ||
1048 | 318 | type: "unity::shell::scopes::ScopeInterface::Status" | ||
1049 | 319 | isReadonly: true | ||
1050 | 320 | } | ||
1051 | 321 | Signal { name: "detailsChanged" } | ||
1052 | 322 | Signal { name: "showDash" } | 283 | Signal { name: "showDash" } |
1053 | 323 | Signal { name: "hideDash" } | 284 | Signal { name: "hideDash" } |
1054 | 324 | Signal { | 285 | Signal { |
1055 | @@ -337,6 +298,10 @@ | |||
1056 | 337 | name: "openScope" | 298 | name: "openScope" |
1057 | 338 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } | 299 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } |
1058 | 339 | } | 300 | } |
1059 | 301 | Signal { | ||
1060 | 302 | name: "activateApplication" | ||
1061 | 303 | Parameter { name: "desktop"; type: "string" } | ||
1062 | 304 | } | ||
1063 | 340 | Method { | 305 | Method { |
1064 | 341 | name: "activate" | 306 | name: "activate" |
1065 | 342 | Parameter { name: "result"; type: "QVariant" } | 307 | Parameter { name: "result"; type: "QVariant" } |
1066 | @@ -352,25 +317,14 @@ | |||
1067 | 352 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } | 317 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } |
1068 | 353 | } | 318 | } |
1069 | 354 | Method { | 319 | Method { |
1089 | 355 | name: "getNavigation" | 320 | name: "getDepartment" |
1090 | 356 | type: "unity::shell::scopes::NavigationInterface*" | 321 | type: "unity::shell::scopes::DepartmentInterface*" |
1091 | 357 | Parameter { name: "navigationId"; type: "string" } | 322 | Parameter { name: "departmentId"; type: "string" } |
1092 | 358 | } | 323 | } |
1093 | 359 | Method { | 324 | Method { |
1094 | 360 | name: "getAltNavigation" | 325 | name: "loadDepartment" |
1095 | 361 | type: "unity::shell::scopes::NavigationInterface*" | 326 | Parameter { name: "departmentId"; type: "string" } |
1096 | 362 | Parameter { name: "altNavigationId"; type: "string" } | 327 | } |
1078 | 363 | } | ||
1079 | 364 | Method { | ||
1080 | 365 | name: "setNavigationState" | ||
1081 | 366 | Parameter { name: "navId"; type: "string" } | ||
1082 | 367 | Parameter { name: "altNavigation"; type: "bool" } | ||
1083 | 368 | } | ||
1084 | 369 | Method { | ||
1085 | 370 | name: "performQuery" | ||
1086 | 371 | Parameter { name: "cannedQuery"; type: "string" } | ||
1087 | 372 | } | ||
1088 | 373 | Method { name: "refresh" } | ||
1097 | 374 | } | 328 | } |
1098 | 375 | Component { | 329 | Component { |
1099 | 376 | name: "unity::shell::scopes::ScopesInterface" | 330 | name: "unity::shell::scopes::ScopesInterface" |
1100 | @@ -380,17 +334,11 @@ | |||
1101 | 380 | values: { | 334 | values: { |
1102 | 381 | "RoleScope": 0, | 335 | "RoleScope": 0, |
1103 | 382 | "RoleId": 1, | 336 | "RoleId": 1, |
1105 | 383 | "RoleTitle": 2 | 337 | "RoleVisible": 2, |
1106 | 338 | "RoleTitle": 3 | ||
1107 | 384 | } | 339 | } |
1108 | 385 | } | 340 | } |
1109 | 386 | Property { name: "loaded"; type: "bool"; isReadonly: true } | 341 | Property { name: "loaded"; type: "bool"; isReadonly: true } |
1110 | 387 | Property { name: "count"; type: "int"; isReadonly: true } | ||
1111 | 388 | Property { | ||
1112 | 389 | name: "overviewScope" | ||
1113 | 390 | type: "unity::shell::scopes::ScopeInterface" | ||
1114 | 391 | isReadonly: true | ||
1115 | 392 | isPointer: true | ||
1116 | 393 | } | ||
1117 | 394 | Method { | 342 | Method { |
1118 | 395 | name: "getScope" | 343 | name: "getScope" |
1119 | 396 | type: "unity::shell::scopes::ScopeInterface*" | 344 | type: "unity::shell::scopes::ScopeInterface*" |
1120 | 397 | 345 | ||
1121 | === renamed file 'tests/mocks/Unity/fake_navigation.cpp' => 'tests/mocks/Unity/fake_department.cpp' | |||
1122 | --- tests/mocks/Unity/fake_navigation.cpp 2014-08-07 14:25:38 +0000 | |||
1123 | +++ tests/mocks/Unity/fake_department.cpp 2014-06-18 13:48:32 +0000 | |||
1124 | @@ -14,15 +14,14 @@ | |||
1125 | 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/>. |
1126 | 15 | */ | 15 | */ |
1127 | 16 | 16 | ||
1129 | 17 | #include "fake_navigation.h" | 17 | #include "fake_department.h" |
1130 | 18 | 18 | ||
1131 | 19 | #include "fake_scope.h" | 19 | #include "fake_scope.h" |
1132 | 20 | 20 | ||
1133 | 21 | #include <QDebug> | ||
1134 | 22 | #include <QTimer> | 21 | #include <QTimer> |
1135 | 23 | 22 | ||
1138 | 24 | Navigation::Navigation(const QString& navigationId, const QString& label, const QString& allLabel, const QString& parentId, const QString& parentLabel, Scope* scope) | 23 | Department::Department(const QString& departmentId, const QString& label, const QString& allLabel, const QString& parentId, const QString& parentLabel, Scope* scope) |
1139 | 25 | : m_navigationId(navigationId) | 24 | : m_departmentId(departmentId) |
1140 | 26 | , m_label(label) | 25 | , m_label(label) |
1141 | 27 | , m_allLabel(allLabel) | 26 | , m_allLabel(allLabel) |
1142 | 28 | , m_parentId(parentId) | 27 | , m_parentId(parentId) |
1143 | @@ -31,87 +30,96 @@ | |||
1144 | 31 | , m_scope(scope) | 30 | , m_scope(scope) |
1145 | 32 | { | 31 | { |
1146 | 33 | QTimer::singleShot(1500, this, SLOT(slotLoaded())); | 32 | QTimer::singleShot(1500, this, SLOT(slotLoaded())); |
1148 | 34 | connect(scope, SIGNAL(currentNavigationIdChanged()), this, SLOT(slotCurrentNavigationChanged())); | 33 | connect(scope, SIGNAL(currentDepartmentIdChanged()), this, SLOT(slotCurrentDepartmentChanged())); |
1149 | 35 | } | 34 | } |
1150 | 36 | 35 | ||
1152 | 37 | QString Navigation::navigationId() const | 36 | QString Department::departmentId() const |
1153 | 38 | { | 37 | { |
1155 | 39 | return m_navigationId; | 38 | return m_departmentId; |
1156 | 40 | } | 39 | } |
1157 | 41 | 40 | ||
1159 | 42 | QString Navigation::label() const | 41 | QString Department::label() const |
1160 | 43 | { | 42 | { |
1161 | 44 | return m_label; | 43 | return m_label; |
1162 | 45 | } | 44 | } |
1163 | 46 | 45 | ||
1165 | 47 | QString Navigation::allLabel() const | 46 | QString Department::allLabel() const |
1166 | 48 | { | 47 | { |
1167 | 49 | return m_allLabel; | 48 | return m_allLabel; |
1168 | 50 | } | 49 | } |
1169 | 51 | 50 | ||
1171 | 52 | QString Navigation::parentNavigationId() const | 51 | QString Department::parentDepartmentId() const |
1172 | 53 | { | 52 | { |
1173 | 54 | return m_parentId; | 53 | return m_parentId; |
1174 | 55 | } | 54 | } |
1175 | 56 | 55 | ||
1177 | 57 | QString Navigation::parentLabel() const | 56 | QString Department::parentLabel() const |
1178 | 58 | { | 57 | { |
1179 | 59 | return m_parentLabel; | 58 | return m_parentLabel; |
1180 | 60 | } | 59 | } |
1181 | 61 | 60 | ||
1183 | 62 | void Navigation::slotLoaded() | 61 | void Department::slotLoaded() |
1184 | 63 | { | 62 | { |
1185 | 64 | m_loaded = true; | 63 | m_loaded = true; |
1186 | 65 | Q_EMIT loadedChanged(); | 64 | Q_EMIT loadedChanged(); |
1187 | 66 | } | 65 | } |
1188 | 67 | 66 | ||
1190 | 68 | bool Navigation::loaded() const | 67 | bool Department::loaded() const |
1191 | 69 | { | 68 | { |
1192 | 70 | return m_loaded; | 69 | return m_loaded; |
1193 | 71 | } | 70 | } |
1194 | 72 | 71 | ||
1196 | 73 | int Navigation::count() const | 72 | int Department::count() const |
1197 | 74 | { | 73 | { |
1198 | 75 | return rowCount(); | 74 | return rowCount(); |
1199 | 76 | } | 75 | } |
1200 | 77 | 76 | ||
1214 | 78 | bool Navigation::isRoot() const | 77 | bool Department::isRoot() const |
1215 | 79 | { | 78 | { |
1216 | 80 | return m_navigationId == "root" || m_navigationId == "altroot"; | 79 | return m_departmentId == "root"; |
1217 | 81 | } | 80 | } |
1218 | 82 | 81 | ||
1219 | 83 | bool Navigation::hidden() const | 82 | int Department::rowCount(const QModelIndex & /*parent*/) const |
1220 | 84 | { | 83 | { |
1221 | 85 | return m_navigationId == "altroot"; | 84 | if (!m_loaded || m_departmentId.startsWith("child") || m_departmentId == "middle3") |
1209 | 86 | } | ||
1210 | 87 | |||
1211 | 88 | int Navigation::rowCount(const QModelIndex & /*parent*/) const | ||
1212 | 89 | { | ||
1213 | 90 | if (!m_loaded || m_navigationId.startsWith("child") || m_navigationId == "middle3") | ||
1222 | 91 | return 0; | 85 | return 0; |
1223 | 92 | else | 86 | else |
1224 | 93 | return 8; | 87 | return 8; |
1225 | 94 | } | 88 | } |
1226 | 95 | 89 | ||
1228 | 96 | QVariant Navigation::data(const QModelIndex &index, int role) const | 90 | QHash<int, QByteArray> Department::roleNames() const |
1229 | 91 | { | ||
1230 | 92 | QHash<int, QByteArray> res; | ||
1231 | 93 | res[RoleDepartmentId] = "departmentId"; | ||
1232 | 94 | res[RoleLabel] = "label"; | ||
1233 | 95 | res[RoleHasChildren] = "hasChildren"; | ||
1234 | 96 | res[RoleIsActive] = "isActive"; | ||
1235 | 97 | return res; | ||
1236 | 98 | } | ||
1237 | 99 | |||
1238 | 100 | QVariant Department::data(const QModelIndex &index, int role) const | ||
1239 | 97 | { | 101 | { |
1240 | 98 | switch (role) { | 102 | switch (role) { |
1243 | 99 | case RoleNavigationId: | 103 | case RoleDepartmentId: |
1244 | 100 | if (m_navigationId == "root") | 104 | if (m_departmentId == "root") |
1245 | 101 | return QString("middle%1").arg(index.row()); | 105 | return QString("middle%1").arg(index.row()); |
1248 | 102 | else if (m_navigationId.startsWith("middle")) | 106 | else if (m_departmentId.startsWith("middle")) |
1249 | 103 | return QString("child%1%2").arg(m_navigationId).arg(index.row()); | 107 | return QString("child%1%2").arg(m_departmentId).arg(index.row()); |
1250 | 108 | break; | ||
1251 | 104 | case RoleLabel: | 109 | case RoleLabel: |
1253 | 105 | return QString("%1Child%2").arg(m_navigationId).arg(index.row()); | 110 | return QString("%1Child%2").arg(m_departmentId).arg(index.row()); |
1254 | 111 | break; | ||
1255 | 106 | case RoleHasChildren: | 112 | case RoleHasChildren: |
1257 | 107 | return m_navigationId == "root" && index.row() != 3; | 113 | return m_departmentId == "root" && index.row() != 3; |
1258 | 114 | break; | ||
1259 | 108 | case RoleIsActive: | 115 | case RoleIsActive: |
1261 | 109 | return m_scope->currentNavigationId() == data(index, RoleNavigationId); | 116 | return m_scope->currentDepartmentId() == data(index, RoleDepartmentId); |
1262 | 117 | break; | ||
1263 | 110 | } | 118 | } |
1264 | 111 | return QVariant(); | 119 | return QVariant(); |
1265 | 112 | } | 120 | } |
1266 | 113 | 121 | ||
1268 | 114 | void Navigation::slotCurrentNavigationChanged() | 122 | void Department::slotCurrentDepartmentChanged() |
1269 | 115 | { | 123 | { |
1270 | 116 | // This is wasteful, should only emit it if really something changed in this | 124 | // This is wasteful, should only emit it if really something changed in this |
1271 | 117 | // deparment, but this is a mock, so no need to optimize | 125 | // deparment, but this is a mock, so no need to optimize |
1272 | 118 | 126 | ||
1273 | === renamed file 'tests/mocks/Unity/fake_navigation.h' => 'tests/mocks/Unity/fake_department.h' | |||
1274 | --- tests/mocks/Unity/fake_navigation.h 2014-08-07 14:25:38 +0000 | |||
1275 | +++ tests/mocks/Unity/fake_department.h 2014-05-29 10:25:21 +0000 | |||
1276 | @@ -14,48 +14,48 @@ | |||
1277 | 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/>. |
1278 | 15 | */ | 15 | */ |
1279 | 16 | 16 | ||
1282 | 17 | #ifndef FAKE_NAVIGATION_H | 17 | #ifndef FAKE_DEPARTMENT_H |
1283 | 18 | #define FAKE_NAVIGATION_H | 18 | #define FAKE_DEPARTMENT_H |
1284 | 19 | 19 | ||
1286 | 20 | #include <unity/shell/scopes/NavigationInterface.h> | 20 | #include <unity/shell/scopes/DepartmentInterface.h> |
1287 | 21 | 21 | ||
1288 | 22 | class Scope; | 22 | class Scope; |
1289 | 23 | 23 | ||
1291 | 24 | class Navigation : public unity::shell::scopes::NavigationInterface | 24 | class Department : public unity::shell::scopes::DepartmentInterface |
1292 | 25 | { | 25 | { |
1293 | 26 | Q_OBJECT | 26 | Q_OBJECT |
1294 | 27 | 27 | ||
1295 | 28 | public: | 28 | public: |
1297 | 29 | Navigation(const QString& navigationId, const QString& label, const QString& allLabel, const QString& parentId, const QString& parentLabel, Scope* scope); | 29 | Department(const QString& departmentId, const QString& label, const QString& allLabel, const QString& parentId, const QString& parentLabel, Scope* scope); |
1298 | 30 | 30 | ||
1300 | 31 | QString navigationId() const override; | 31 | QString departmentId() const override; |
1301 | 32 | QString label() const override; | 32 | QString label() const override; |
1302 | 33 | QString allLabel() const override; | 33 | QString allLabel() const override; |
1304 | 34 | QString parentNavigationId() const override; | 34 | QString parentDepartmentId() const override; |
1305 | 35 | QString parentLabel() const override; | 35 | QString parentLabel() const override; |
1306 | 36 | bool loaded() const override; | 36 | bool loaded() const override; |
1307 | 37 | int count() const override; | ||
1308 | 37 | bool isRoot() const override; | 38 | bool isRoot() const override; |
1309 | 38 | bool hidden() const override; | ||
1310 | 39 | int count() const override; | ||
1311 | 40 | 39 | ||
1312 | 41 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; | 40 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; |
1313 | 41 | QHash<int, QByteArray> roleNames() const; | ||
1314 | 42 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; | 42 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; |
1315 | 43 | 43 | ||
1316 | 44 | public Q_SLOTS: | 44 | public Q_SLOTS: |
1318 | 45 | void slotCurrentNavigationChanged(); | 45 | void slotCurrentDepartmentChanged(); |
1319 | 46 | 46 | ||
1320 | 47 | private Q_SLOTS: | 47 | private Q_SLOTS: |
1321 | 48 | void slotLoaded(); | 48 | void slotLoaded(); |
1322 | 49 | 49 | ||
1323 | 50 | private: | 50 | private: |
1325 | 51 | QString m_navigationId; | 51 | QString m_departmentId; |
1326 | 52 | QString m_label; | 52 | QString m_label; |
1327 | 53 | QString m_allLabel; | 53 | QString m_allLabel; |
1328 | 54 | QString m_parentId; | 54 | QString m_parentId; |
1329 | 55 | QString m_parentLabel; | 55 | QString m_parentLabel; |
1330 | 56 | bool m_loaded; | 56 | bool m_loaded; |
1332 | 57 | QString m_currentNavigation; | 57 | QString m_currentDepartment; |
1333 | 58 | Scope *m_scope; | 58 | Scope *m_scope; |
1334 | 59 | }; | 59 | }; |
1335 | 60 | 60 | ||
1337 | 61 | #endif // FAKE_NAVIGATION_H | 61 | #endif // FAKE_DEPARTMENT_H |
1338 | 62 | 62 | ||
1339 | === modified file 'tests/mocks/Unity/fake_scope.cpp' | |||
1340 | --- tests/mocks/Unity/fake_scope.cpp 2014-08-07 14:25:38 +0000 | |||
1341 | +++ tests/mocks/Unity/fake_scope.cpp 2014-07-24 20:40:57 +0000 | |||
1342 | @@ -14,26 +14,24 @@ | |||
1343 | 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/>. |
1344 | 15 | */ | 15 | */ |
1345 | 16 | 16 | ||
1346 | 17 | #include <QDebug> | ||
1347 | 18 | #include <QUrl> | 17 | #include <QUrl> |
1348 | 19 | 18 | ||
1349 | 20 | #include "fake_scope.h" | 19 | #include "fake_scope.h" |
1351 | 21 | #include "fake_navigation.h" | 20 | #include "fake_department.h" |
1352 | 22 | #include "fake_resultsmodel.h" | 21 | #include "fake_resultsmodel.h" |
1353 | 23 | 22 | ||
1354 | 24 | Scope::Scope(QObject* parent) : Scope(QString(), QString(), false, parent) | 23 | Scope::Scope(QObject* parent) : Scope(QString(), QString(), false, parent) |
1355 | 25 | { | 24 | { |
1356 | 26 | } | 25 | } |
1357 | 27 | 26 | ||
1359 | 28 | Scope::Scope(QString const& id, QString const& name, bool favorite, QObject* parent, int categories) | 27 | Scope::Scope(QString const& id, QString const& name, bool visible, QObject* parent, int categories) |
1360 | 29 | : unity::shell::scopes::ScopeInterface(parent) | 28 | : unity::shell::scopes::ScopeInterface(parent) |
1361 | 30 | , m_id(id) | 29 | , m_id(id) |
1362 | 31 | , m_name(name) | 30 | , m_name(name) |
1363 | 31 | , m_visible(visible) | ||
1364 | 32 | , m_searching(false) | 32 | , m_searching(false) |
1365 | 33 | , m_favorite(favorite) | ||
1366 | 34 | , m_isActive(false) | 33 | , m_isActive(false) |
1369 | 35 | , m_currentNavigationId("root") | 34 | , m_currentDeparment("root") |
1368 | 36 | , m_currentAltNavigationId("altroot") | ||
1370 | 37 | , m_previewRendererName("preview-generic") | 35 | , m_previewRendererName("preview-generic") |
1371 | 38 | , m_categories(new Categories(categories, this)) | 36 | , m_categories(new Categories(categories, this)) |
1372 | 39 | { | 37 | { |
1373 | @@ -79,11 +77,6 @@ | |||
1374 | 79 | return m_searching; | 77 | return m_searching; |
1375 | 80 | } | 78 | } |
1376 | 81 | 79 | ||
1377 | 82 | bool Scope::favorite() const | ||
1378 | 83 | { | ||
1379 | 84 | return m_favorite; | ||
1380 | 85 | } | ||
1381 | 86 | |||
1382 | 87 | unity::shell::scopes::CategoriesInterface* Scope::categories() const | 80 | unity::shell::scopes::CategoriesInterface* Scope::categories() const |
1383 | 88 | { | 81 | { |
1384 | 89 | return m_categories; | 82 | return m_categories; |
1385 | @@ -104,6 +97,11 @@ | |||
1386 | 104 | return m_formFactor; | 97 | return m_formFactor; |
1387 | 105 | } | 98 | } |
1388 | 106 | 99 | ||
1389 | 100 | bool Scope::visible() const | ||
1390 | 101 | { | ||
1391 | 102 | return m_visible; | ||
1392 | 103 | } | ||
1393 | 104 | |||
1394 | 107 | bool Scope::isActive() const | 105 | bool Scope::isActive() const |
1395 | 108 | { | 106 | { |
1396 | 109 | return m_isActive; | 107 | return m_isActive; |
1397 | @@ -133,13 +131,6 @@ | |||
1398 | 133 | } | 131 | } |
1399 | 134 | } | 132 | } |
1400 | 135 | 133 | ||
1401 | 136 | void Scope::setFavorite(const bool favorite) | ||
1402 | 137 | { | ||
1403 | 138 | if (favorite != m_favorite) { | ||
1404 | 139 | m_favorite = favorite; | ||
1405 | 140 | Q_EMIT favoriteChanged(); | ||
1406 | 141 | } | ||
1407 | 142 | } | ||
1408 | 143 | void Scope::setSearchInProgress(const bool inProg) | 134 | void Scope::setSearchInProgress(const bool inProg) |
1409 | 144 | { | 135 | { |
1410 | 145 | if (inProg != m_searching) { | 136 | if (inProg != m_searching) { |
1411 | @@ -179,29 +170,14 @@ | |||
1412 | 179 | qFatal("Scope::closeScope is not implemented"); | 170 | qFatal("Scope::closeScope is not implemented"); |
1413 | 180 | } | 171 | } |
1414 | 181 | 172 | ||
1438 | 182 | QString Scope::currentNavigationId() const | 173 | QString Scope::currentDepartmentId() const |
1439 | 183 | { | 174 | { |
1440 | 184 | return m_currentNavigationId; | 175 | return m_currentDeparment; |
1441 | 185 | } | 176 | } |
1442 | 186 | 177 | ||
1443 | 187 | bool Scope::hasNavigation() const | 178 | bool Scope::hasDepartments() const |
1444 | 188 | { | 179 | { |
1445 | 189 | return true; | 180 | return true; |
1423 | 190 | } | ||
1424 | 191 | |||
1425 | 192 | QString Scope::currentAltNavigationId() const | ||
1426 | 193 | { | ||
1427 | 194 | return m_currentAltNavigationId; | ||
1428 | 195 | } | ||
1429 | 196 | |||
1430 | 197 | bool Scope::hasAltNavigation() const | ||
1431 | 198 | { | ||
1432 | 199 | return true; | ||
1433 | 200 | } | ||
1434 | 201 | |||
1435 | 202 | Scope::Status Scope::status() const | ||
1436 | 203 | { | ||
1437 | 204 | return Status::Okay; | ||
1446 | 205 | } | 181 | } |
1447 | 206 | 182 | ||
1448 | 207 | QVariantMap Scope::customizations() const | 183 | QVariantMap Scope::customizations() const |
1449 | @@ -220,12 +196,7 @@ | |||
1450 | 220 | return m; | 196 | return m; |
1451 | 221 | } | 197 | } |
1452 | 222 | 198 | ||
1459 | 223 | void Scope::refresh() | 199 | unity::shell::scopes::DepartmentInterface* Scope::getDepartment(const QString& id) |
1454 | 224 | { | ||
1455 | 225 | qDebug() << "Scope::refresh is currently not implmented in the fake scopes plugin"; | ||
1456 | 226 | } | ||
1457 | 227 | |||
1458 | 228 | unity::shell::scopes::NavigationInterface* Scope::getNavigation(const QString& id) | ||
1460 | 229 | { | 200 | { |
1461 | 230 | if (id.isEmpty()) | 201 | if (id.isEmpty()) |
1462 | 231 | return nullptr; | 202 | return nullptr; |
1463 | @@ -239,30 +210,11 @@ | |||
1464 | 239 | parentId = id.mid(5, 7); | 210 | parentId = id.mid(5, 7); |
1465 | 240 | parentLabel = parentId; | 211 | parentLabel = parentId; |
1466 | 241 | } | 212 | } |
1493 | 242 | return new Navigation(id, id, "all"+id, parentId, parentLabel, this); | 213 | return new Department(id, id, "all"+id, parentId, parentLabel, this); |
1494 | 243 | } | 214 | } |
1495 | 244 | 215 | ||
1496 | 245 | unity::shell::scopes::NavigationInterface* Scope::getAltNavigation(QString const& id) | 216 | void Scope::loadDepartment(const QString& id) |
1497 | 246 | { | 217 | { |
1498 | 247 | if (id.isEmpty()) | 218 | m_currentDeparment = id; |
1499 | 248 | return nullptr; | 219 | Q_EMIT currentDepartmentIdChanged(); |
1474 | 249 | |||
1475 | 250 | QString parentId; | ||
1476 | 251 | QString parentLabel; | ||
1477 | 252 | if (id.startsWith("altmiddle")) { | ||
1478 | 253 | parentId = "altroot"; | ||
1479 | 254 | parentLabel = "altroot"; | ||
1480 | 255 | } | ||
1481 | 256 | return new Navigation(id, id, "all"+id, parentId, parentLabel, this); | ||
1482 | 257 | } | ||
1483 | 258 | |||
1484 | 259 | void Scope::setNavigationState(const QString &navigationId, bool isAltNavigation) | ||
1485 | 260 | { | ||
1486 | 261 | if (isAltNavigation) { | ||
1487 | 262 | m_currentAltNavigationId = navigationId; | ||
1488 | 263 | Q_EMIT currentAltNavigationIdChanged(); | ||
1489 | 264 | } else { | ||
1490 | 265 | m_currentNavigationId = navigationId; | ||
1491 | 266 | Q_EMIT currentNavigationIdChanged(); | ||
1492 | 267 | } | ||
1500 | 268 | } | 220 | } |
1501 | 269 | 221 | ||
1502 | === modified file 'tests/mocks/Unity/fake_scope.h' | |||
1503 | --- tests/mocks/Unity/fake_scope.h 2014-08-07 14:25:38 +0000 | |||
1504 | +++ tests/mocks/Unity/fake_scope.h 2014-07-11 16:39:33 +0000 | |||
1505 | @@ -30,7 +30,7 @@ | |||
1506 | 30 | 30 | ||
1507 | 31 | public: | 31 | public: |
1508 | 32 | Scope(QObject* parent = 0); | 32 | Scope(QObject* parent = 0); |
1510 | 33 | Scope(QString const& id, QString const& name, bool favorite, QObject* parent = 0, int categories = 20); | 33 | Scope(QString const& id, QString const& name, bool visible, QObject* parent = 0, int categories = 20); |
1511 | 34 | 34 | ||
1512 | 35 | /* getters */ | 35 | /* getters */ |
1513 | 36 | QString id() const override; | 36 | QString id() const override; |
1514 | @@ -38,9 +38,9 @@ | |||
1515 | 38 | QString iconHint() const override; | 38 | QString iconHint() const override; |
1516 | 39 | QString description() const override; | 39 | QString description() const override; |
1517 | 40 | QString searchHint() const override; | 40 | QString searchHint() const override; |
1518 | 41 | bool visible() const override; | ||
1519 | 41 | QString shortcut() const override; | 42 | QString shortcut() const override; |
1520 | 42 | bool searchInProgress() const override; | 43 | bool searchInProgress() const override; |
1521 | 43 | bool favorite() const override; | ||
1522 | 44 | unity::shell::scopes::CategoriesInterface* categories() const override; | 44 | unity::shell::scopes::CategoriesInterface* categories() const override; |
1523 | 45 | QString searchQuery() const override; | 45 | QString searchQuery() const override; |
1524 | 46 | QString noResultsHint() const override; | 46 | QString noResultsHint() const override; |
1525 | @@ -53,7 +53,6 @@ | |||
1526 | 53 | void setNoResultsHint(const QString& hint) override; | 53 | void setNoResultsHint(const QString& hint) override; |
1527 | 54 | void setFormFactor(const QString& form_factor) override; | 54 | void setFormFactor(const QString& form_factor) override; |
1528 | 55 | void setActive(const bool) override; | 55 | void setActive(const bool) override; |
1529 | 56 | void setFavorite(const bool) override; | ||
1530 | 57 | Q_INVOKABLE void setSearchInProgress(const bool inProg); // This is not invokable in the Interface, here for testing benefits | 56 | Q_INVOKABLE void setSearchInProgress(const bool inProg); // This is not invokable in the Interface, here for testing benefits |
1531 | 58 | 57 | ||
1532 | 59 | Q_INVOKABLE void activate(QVariant const& result) override; | 58 | Q_INVOKABLE void activate(QVariant const& result) override; |
1533 | @@ -61,20 +60,14 @@ | |||
1534 | 61 | Q_INVOKABLE void cancelActivation() override; | 60 | Q_INVOKABLE void cancelActivation() override; |
1535 | 62 | Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override; | 61 | Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override; |
1536 | 63 | 62 | ||
1544 | 64 | QString currentNavigationId() const override; | 63 | QString currentDepartmentId() const override; |
1545 | 65 | bool hasNavigation() const override; | 64 | bool hasDepartments() const override; |
1546 | 66 | QString currentAltNavigationId() const override; | 65 | Q_INVOKABLE unity::shell::scopes::DepartmentInterface* getDepartment(const QString& id) override; |
1547 | 67 | bool hasAltNavigation() const override; | 66 | Q_INVOKABLE void loadDepartment(const QString& id) override; |
1541 | 68 | Q_INVOKABLE unity::shell::scopes::NavigationInterface* getNavigation(QString const& navigationId) override; | ||
1542 | 69 | Q_INVOKABLE unity::shell::scopes::NavigationInterface* getAltNavigation(QString const& altNavigationId) override; | ||
1543 | 70 | Q_INVOKABLE void setNavigationState(const QString &navigationId, bool isAltNavigation) override; | ||
1548 | 71 | Q_SIGNAL void performQuery(const QString& query) override; | 67 | Q_SIGNAL void performQuery(const QString& query) override; |
1549 | 72 | 68 | ||
1550 | 73 | Status status() const override; | ||
1551 | 74 | QVariantMap customizations() const override; | 69 | QVariantMap customizations() const override; |
1552 | 75 | 70 | ||
1553 | 76 | Q_INVOKABLE void refresh() override; | ||
1554 | 77 | |||
1555 | 78 | protected: | 71 | protected: |
1556 | 79 | 72 | ||
1557 | 80 | QString m_id; | 73 | QString m_id; |
1558 | @@ -84,11 +77,10 @@ | |||
1559 | 84 | QString m_searchQuery; | 77 | QString m_searchQuery; |
1560 | 85 | QString m_noResultsHint; | 78 | QString m_noResultsHint; |
1561 | 86 | QString m_formFactor; | 79 | QString m_formFactor; |
1562 | 80 | bool m_visible; | ||
1563 | 87 | bool m_searching; | 81 | bool m_searching; |
1564 | 88 | bool m_favorite; | ||
1565 | 89 | bool m_isActive; | 82 | bool m_isActive; |
1568 | 90 | QString m_currentNavigationId; | 83 | QString m_currentDeparment; |
1567 | 91 | QString m_currentAltNavigationId; | ||
1569 | 92 | 84 | ||
1570 | 93 | QString m_previewRendererName; | 85 | QString m_previewRendererName; |
1571 | 94 | 86 | ||
1572 | 95 | 87 | ||
1573 | === modified file 'tests/mocks/Unity/fake_scopes.cpp' | |||
1574 | --- tests/mocks/Unity/fake_scopes.cpp 2014-08-07 14:25:38 +0000 | |||
1575 | +++ tests/mocks/Unity/fake_scopes.cpp 2014-07-25 13:25:45 +0000 | |||
1576 | @@ -32,11 +32,6 @@ | |||
1577 | 32 | timer.setSingleShot(true); | 32 | timer.setSingleShot(true); |
1578 | 33 | timer.setInterval(100); | 33 | timer.setInterval(100); |
1579 | 34 | QObject::connect(&timer, SIGNAL(timeout()), this, SLOT(updateScopes())); | 34 | QObject::connect(&timer, SIGNAL(timeout()), this, SLOT(updateScopes())); |
1580 | 35 | |||
1581 | 36 | QObject::connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SIGNAL(countChanged())); | ||
1582 | 37 | QObject::connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SIGNAL(countChanged())); | ||
1583 | 38 | QObject::connect(this, SIGNAL(modelReset()), this, SIGNAL(countChanged())); | ||
1584 | 39 | |||
1585 | 40 | load(); | 35 | load(); |
1586 | 41 | } | 36 | } |
1587 | 42 | 37 | ||
1588 | @@ -97,6 +92,8 @@ | |||
1589 | 97 | return QVariant::fromValue(scope); | 92 | return QVariant::fromValue(scope); |
1590 | 98 | } else if (role == Scopes::RoleId) { | 93 | } else if (role == Scopes::RoleId) { |
1591 | 99 | return QVariant::fromValue(scope->id()); | 94 | return QVariant::fromValue(scope->id()); |
1592 | 95 | } else if (role == Scopes::RoleVisible) { | ||
1593 | 96 | return QVariant::fromValue(scope->visible()); | ||
1594 | 100 | } else if (role == Scopes::RoleTitle) { | 97 | } else if (role == Scopes::RoleTitle) { |
1595 | 101 | return QVariant::fromValue(scope->name()); | 98 | return QVariant::fromValue(scope->name()); |
1596 | 102 | } else { | 99 | } else { |
1597 | @@ -128,11 +125,6 @@ | |||
1598 | 128 | return m_loaded; | 125 | return m_loaded; |
1599 | 129 | } | 126 | } |
1600 | 130 | 127 | ||
1601 | 131 | int Scopes::count() const | ||
1602 | 132 | { | ||
1603 | 133 | return rowCount(); | ||
1604 | 134 | } | ||
1605 | 135 | |||
1606 | 136 | unity::shell::scopes::ScopeInterface* Scopes::overviewScope() const | 128 | unity::shell::scopes::ScopeInterface* Scopes::overviewScope() const |
1607 | 137 | { | 129 | { |
1608 | 138 | return nullptr; | 130 | return nullptr; |
1609 | 139 | 131 | ||
1610 | === modified file 'tests/mocks/Unity/fake_scopes.h' | |||
1611 | --- tests/mocks/Unity/fake_scopes.h 2014-08-07 14:25:38 +0000 | |||
1612 | +++ tests/mocks/Unity/fake_scopes.h 2014-07-25 13:25:45 +0000 | |||
1613 | @@ -50,7 +50,6 @@ | |||
1614 | 50 | QModelIndex parent ( const QModelIndex & index ) const; | 50 | QModelIndex parent ( const QModelIndex & index ) const; |
1615 | 51 | 51 | ||
1616 | 52 | bool loaded() const override; | 52 | bool loaded() const override; |
1617 | 53 | int count() const override; | ||
1618 | 54 | unity::shell::scopes::ScopeInterface* overviewScope() const override; | 53 | unity::shell::scopes::ScopeInterface* overviewScope() const override; |
1619 | 55 | 54 | ||
1620 | 56 | private Q_SLOTS: | 55 | private Q_SLOTS: |
1621 | 57 | 56 | ||
1622 | === modified file 'tests/mocks/Unity/fake_unity_plugin.cpp' | |||
1623 | --- tests/mocks/Unity/fake_unity_plugin.cpp 2014-08-07 14:25:38 +0000 | |||
1624 | +++ tests/mocks/Unity/fake_unity_plugin.cpp 2014-07-08 11:26:44 +0000 | |||
1625 | @@ -22,7 +22,7 @@ | |||
1626 | 22 | // local | 22 | // local |
1627 | 23 | #include "fake_scopes.h" | 23 | #include "fake_scopes.h" |
1628 | 24 | #include "fake_categories.h" | 24 | #include "fake_categories.h" |
1630 | 25 | #include "fake_navigation.h" | 25 | #include "fake_department.h" |
1631 | 26 | #include "fake_previewmodel.h" | 26 | #include "fake_previewmodel.h" |
1632 | 27 | #include "fake_previewwidgetmodel.h" | 27 | #include "fake_previewwidgetmodel.h" |
1633 | 28 | #include "fake_resultsmodel.h" | 28 | #include "fake_resultsmodel.h" |
1634 | @@ -43,7 +43,7 @@ | |||
1635 | 43 | qmlRegisterType<Scopes>(uri, 0, 2, "Scopes"); | 43 | qmlRegisterType<Scopes>(uri, 0, 2, "Scopes"); |
1636 | 44 | qmlRegisterType<Scope>(uri, 0, 2, "MockScope"); | 44 | qmlRegisterType<Scope>(uri, 0, 2, "MockScope"); |
1637 | 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."); |
1639 | 46 | qmlRegisterUncreatableType<unity::shell::scopes::NavigationInterface>(uri, 0, 2, "Navigation", "Can't create Navigation object in QML."); | 46 | qmlRegisterUncreatableType<unity::shell::scopes::DepartmentInterface>(uri, 0, 2, "Department", "Can't create Department object in QML."); |
1640 | 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."); |
1641 | 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."); |
1642 | 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."); |
1643 | 50 | 50 | ||
1644 | === modified file 'tests/qmltests/Dash/tst_Dash.qml' | |||
1645 | --- tests/qmltests/Dash/tst_Dash.qml 2014-08-07 14:25:38 +0000 | |||
1646 | +++ tests/qmltests/Dash/tst_Dash.qml 2014-07-29 11:35:10 +0000 | |||
1647 | @@ -64,10 +64,10 @@ | |||
1648 | 64 | 64 | ||
1649 | 65 | function get_scope_data() { | 65 | function get_scope_data() { |
1650 | 66 | return [ | 66 | return [ |
1655 | 67 | { tag: "MockScope1", visualIndex: 0 }, | 67 | { tag: "MockScope1", visualIndex: 0, shouldBeVisible: true }, |
1656 | 68 | { tag: "MockScope2", visualIndex: 1 }, | 68 | { tag: "MockScope2", visualIndex: -1, shouldBeVisible: false }, |
1657 | 69 | { tag: "clickscope", visualIndex: 2 }, | 69 | { tag: "clickscope", visualIndex: 1, shouldBeVisible: true }, |
1658 | 70 | { tag: "MockScope5", visualIndex: 3 }, | 70 | { tag: "MockScope5", visualIndex: 2, shouldBeVisible: true }, |
1659 | 71 | ] | 71 | ] |
1660 | 72 | } | 72 | } |
1661 | 73 | 73 | ||
1662 | @@ -76,6 +76,10 @@ | |||
1663 | 76 | } | 76 | } |
1664 | 77 | 77 | ||
1665 | 78 | function test_show_scope_on_load(data) { | 78 | function test_show_scope_on_load(data) { |
1666 | 79 | if (data.shouldBeVisible == false) { | ||
1667 | 80 | console.log("Not testing " + data.tag + ": not visible"); | ||
1668 | 81 | return; | ||
1669 | 82 | } | ||
1670 | 79 | var dashContentList = findChild(dash, "dashContentList"); | 83 | var dashContentList = findChild(dash, "dashContentList"); |
1671 | 80 | 84 | ||
1672 | 81 | dash.showScopeOnLoaded = data.tag | 85 | dash.showScopeOnLoaded = data.tag |
1673 | @@ -83,7 +87,7 @@ | |||
1674 | 83 | tryCompare(dashContentList, "count", 0); | 87 | tryCompare(dashContentList, "count", 0); |
1675 | 84 | scopes.load(); | 88 | scopes.load(); |
1676 | 85 | tryCompare(scopes, "loaded", true); | 89 | tryCompare(scopes, "loaded", true); |
1678 | 86 | tryCompare(dashContentList, "count", 5); | 90 | tryCompare(dashContentList, "count", 4); |
1679 | 87 | 91 | ||
1680 | 88 | verify(dashContentList != undefined); | 92 | verify(dashContentList != undefined); |
1681 | 89 | tryCompare(dashContentList, "currentIndex", data.visualIndex); | 93 | tryCompare(dashContentList, "currentIndex", data.visualIndex); |
1682 | 90 | 94 | ||
1683 | === modified file 'tests/qmltests/Dash/tst_DashContent.qml' | |||
1684 | --- tests/qmltests/Dash/tst_DashContent.qml 2014-08-07 14:25:38 +0000 | |||
1685 | +++ tests/qmltests/Dash/tst_DashContent.qml 2014-07-21 13:28:35 +0000 | |||
1686 | @@ -43,6 +43,9 @@ | |||
1687 | 43 | id: dashContent | 43 | id: dashContent |
1688 | 44 | anchors.fill: parent | 44 | anchors.fill: parent |
1689 | 45 | 45 | ||
1690 | 46 | model: SortFilterProxyModel { | ||
1691 | 47 | model: scopesModel | ||
1692 | 48 | } | ||
1693 | 46 | scopes : scopesModel | 49 | scopes : scopesModel |
1694 | 47 | } | 50 | } |
1695 | 48 | 51 | ||
1696 | @@ -265,119 +268,117 @@ | |||
1697 | 265 | verify(carouselLV.tileWidth / carouselLV.tileHeight == cardTool.components["art"]["aspect-ratio"]); | 268 | verify(carouselLV.tileWidth / carouselLV.tileHeight == cardTool.components["art"]["aspect-ratio"]); |
1698 | 266 | } | 269 | } |
1699 | 267 | 270 | ||
1792 | 268 | function test_navigations() { | 271 | function test_departments() { |
1793 | 269 | var dashContentList = findChild(dashContent, "dashContentList"); | 272 | var dashDepartments = findChild(dashContent, "dashDepartments"); |
1794 | 270 | tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true); | 273 | compare(dashDepartments.visible, true); |
1795 | 271 | var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation"); | 274 | compare(dashDepartments.showList, false); |
1796 | 272 | tryCompare(dashNavigation, "visible", true); | 275 | waitForRendering(dashDepartments); |
1797 | 273 | compare(dashNavigation.showList, false); | 276 | mouseClick(dashDepartments, 0, 0); |
1798 | 274 | waitForRendering(dashNavigation); | 277 | compare(dashDepartments.showList, true); |
1799 | 275 | mouseClick(dashNavigation, 0, 0); | 278 | |
1800 | 276 | compare(dashNavigation.showList, true); | 279 | var departmentListView = findChild(dashDepartments, "departmentListView"); |
1801 | 277 | 280 | compare(departmentListView.count, 1); | |
1802 | 278 | var navigationListView = findChild(dashNavigation, "navigationListView"); | 281 | tryCompare(departmentListView.currentItem.department, "loaded", true); |
1803 | 279 | compare(navigationListView.count, 1); | 282 | |
1804 | 280 | tryCompare(navigationListView.currentItem.navigation, "loaded", true); | 283 | waitForRendering(departmentListView); |
1805 | 281 | 284 | waitForRendering(departmentListView.currentItem); | |
1806 | 282 | waitForRendering(navigationListView); | 285 | |
1807 | 283 | waitForRendering(navigationListView.currentItem); | 286 | var allButton = findChild(dashDepartments, "allButton"); |
1808 | 284 | 287 | compare(allButton.visible, false); | |
1809 | 285 | var allButton = findChild(dashNavigation, "allButton"); | 288 | |
1810 | 286 | compare(allButton.visible, false); | 289 | var department = findChild(dashDepartments, "department0child3"); |
1811 | 287 | 290 | mouseClick(department, 0, 0); | |
1812 | 288 | var navigation = findChild(dashNavigation, "navigation0child3"); | 291 | compare(dashDepartments.showList, false); |
1813 | 289 | mouseClick(navigation, 0, 0); | 292 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle3"); |
1814 | 290 | compare(dashNavigation.showList, false); | 293 | tryCompare(departmentListView.currentItem.department, "departmentId", "root"); |
1815 | 291 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle3"); | 294 | |
1816 | 292 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "root"); | 295 | mouseClick(dashDepartments, 0, 0); |
1817 | 293 | 296 | compare(dashDepartments.showList, true); | |
1818 | 294 | mouseClick(dashNavigation, 0, 0); | 297 | waitForRendering(departmentListView); |
1819 | 295 | compare(dashNavigation.showList, true); | 298 | waitForRendering(departmentListView.currentItem); |
1820 | 296 | waitForRendering(navigationListView); | 299 | compare(allButton.visible, true); |
1821 | 297 | waitForRendering(navigationListView.currentItem); | 300 | |
1822 | 298 | compare(allButton.visible, true); | 301 | mouseClick(allButton, 0, 0); |
1823 | 299 | 302 | compare(dashDepartments.showList, false); | |
1824 | 300 | mouseClick(allButton, 0, 0); | 303 | tryCompare(dashDepartments.currentDepartment, "departmentId", "root"); |
1825 | 301 | compare(dashNavigation.showList, false); | 304 | tryCompare(departmentListView.currentItem.department, "departmentId", "root"); |
1826 | 302 | tryCompare(dashNavigation.currentNavigation, "navigationId", "root"); | 305 | |
1827 | 303 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "root"); | 306 | mouseClick(dashDepartments, 0, 0); |
1828 | 304 | 307 | compare(dashDepartments.showList, true); | |
1829 | 305 | mouseClick(dashNavigation, 0, 0); | 308 | waitForRendering(departmentListView); |
1830 | 306 | compare(dashNavigation.showList, true); | 309 | waitForRendering(departmentListView.currentItem); |
1831 | 307 | waitForRendering(navigationListView); | 310 | compare(allButton.visible, false); |
1832 | 308 | waitForRendering(navigationListView.currentItem); | 311 | |
1833 | 309 | compare(allButton.visible, false); | 312 | department = findChild(dashDepartments, "department0child2"); |
1834 | 310 | 313 | mouseClick(department, 0, 0); | |
1835 | 311 | navigation = findChild(dashNavigation, "navigation0child2"); | 314 | compare(dashDepartments.showList, true); |
1836 | 312 | mouseClick(navigation, 0, 0); | 315 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); |
1837 | 313 | compare(dashNavigation.showList, true); | 316 | tryCompare(departmentListView.currentItem.department, "departmentId", "middle2"); |
1838 | 314 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); | 317 | |
1839 | 315 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2"); | 318 | var departmentList1 = findChild(dashDepartments, "department1"); |
1840 | 316 | 319 | allButton = findChild(departmentList1, "allButton"); | |
1841 | 317 | var navigationList1 = findChild(dashNavigation, "navigation1"); | 320 | var backButton = findChild(findChild(departmentList1, "department1"), "backButton"); |
1842 | 318 | allButton = findChild(navigationList1, "allButton"); | 321 | compare(allButton.visible, true); |
1843 | 319 | var backButton = findChild(findChild(navigationList1, "navigation1"), "backButton"); | 322 | compare(backButton.visible, true); |
1844 | 320 | compare(allButton.visible, true); | 323 | |
1845 | 321 | compare(backButton.visible, true); | 324 | tryCompare(departmentListView, "contentX", departmentList1.x); |
1846 | 322 | 325 | waitForRendering(departmentListView); | |
1847 | 323 | tryCompare(navigationListView, "contentX", navigationList1.x); | 326 | mouseClick(allButton, 0, 0); |
1848 | 324 | waitForRendering(navigationListView); | 327 | compare(dashDepartments.showList, false); |
1849 | 325 | mouseClick(allButton, 0, 0); | 328 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); |
1850 | 326 | compare(dashNavigation.showList, false); | 329 | tryCompare(departmentListView.currentItem.department, "departmentId", "middle2"); |
1851 | 327 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); | 330 | |
1852 | 328 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2"); | 331 | mouseClick(dashDepartments, 0, 0); |
1853 | 329 | 332 | compare(dashDepartments.showList, true); | |
1854 | 330 | mouseClick(dashNavigation, 0, 0); | 333 | waitForRendering(departmentListView); |
1855 | 331 | compare(dashNavigation.showList, true); | 334 | waitForRendering(departmentListView.currentItem); |
1856 | 332 | waitForRendering(navigationListView); | 335 | compare(allButton.visible, true); |
1857 | 333 | waitForRendering(navigationListView.currentItem); | 336 | compare(backButton.visible, true); |
1858 | 334 | compare(allButton.visible, true); | 337 | |
1859 | 335 | compare(backButton.visible, true); | 338 | tryCompare(departmentList1.department, "loaded", true); |
1860 | 336 | 339 | department = findChild(dashDepartments, "department1child2"); | |
1861 | 337 | tryCompare(navigationList1.navigation, "loaded", true); | 340 | mouseClick(department, 0, 0); |
1862 | 338 | navigation = findChild(dashNavigation, "navigation1child2"); | 341 | compare(dashDepartments.showList, false); |
1863 | 339 | mouseClick(navigation, 0, 0); | 342 | tryCompare(dashDepartments.currentDepartment, "departmentId", "childmiddle22"); |
1864 | 340 | compare(dashNavigation.showList, false); | 343 | tryCompare(departmentListView.currentItem.department, "departmentId", "middle2"); |
1865 | 341 | tryCompare(dashNavigation.currentNavigation, "navigationId", "childmiddle22"); | 344 | |
1866 | 342 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2"); | 345 | mouseClick(dashDepartments, 0, 0); |
1867 | 343 | 346 | compare(dashDepartments.showList, true); | |
1868 | 344 | mouseClick(dashNavigation, 0, 0); | 347 | waitForRendering(departmentListView); |
1869 | 345 | compare(dashNavigation.showList, true); | 348 | waitForRendering(departmentListView.currentItem); |
1870 | 346 | waitForRendering(navigationListView); | 349 | |
1871 | 347 | waitForRendering(navigationListView.currentItem); | 350 | tryCompare(departmentList1.department, "loaded", true); |
1872 | 348 | 351 | department = findChild(dashDepartments, "department1child3"); | |
1873 | 349 | tryCompare(navigationList1.navigation, "loaded", true); | 352 | mouseClick(department, 0, 0); |
1874 | 350 | navigation = findChild(dashNavigation, "navigation1child3"); | 353 | compare(dashDepartments.showList, false); |
1875 | 351 | mouseClick(navigation, 0, 0); | 354 | tryCompare(dashDepartments.currentDepartment, "departmentId", "childmiddle23"); |
1876 | 352 | compare(dashNavigation.showList, false); | 355 | tryCompare(departmentListView.currentItem.department, "departmentId", "middle2"); |
1877 | 353 | tryCompare(dashNavigation.currentNavigation, "navigationId", "childmiddle23"); | 356 | |
1878 | 354 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2"); | 357 | mouseClick(dashDepartments, 0, 0); |
1879 | 355 | 358 | compare(dashDepartments.showList, true); | |
1880 | 356 | mouseClick(dashNavigation, 0, 0); | 359 | waitForRendering(departmentListView); |
1881 | 357 | compare(dashNavigation.showList, true); | 360 | waitForRendering(departmentListView.currentItem); |
1790 | 358 | waitForRendering(navigationListView); | ||
1791 | 359 | waitForRendering(navigationListView.currentItem); | ||
1882 | 360 | mouseClick(backButton, 0, 0); | 361 | mouseClick(backButton, 0, 0); |
1883 | 361 | 362 | ||
1889 | 362 | tryCompare(dashNavigation.currentNavigation, "navigationId", "root"); | 363 | tryCompare(dashDepartments.currentDepartment, "departmentId", "root"); |
1890 | 363 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "root"); | 364 | tryCompare(departmentListView.currentItem.department, "departmentId", "root"); |
1891 | 364 | compare(dashNavigation.showList, true); | 365 | compare(dashDepartments.showList, true); |
1892 | 365 | mouseClick(dashNavigation, 0, 0); | 366 | mouseClick(dashDepartments, 0, 0); |
1893 | 366 | compare(dashNavigation.showList, false); | 367 | compare(dashDepartments.showList, false); |
1894 | 367 | 368 | ||
1906 | 368 | mouseClick(dashNavigation, 0, 0); | 369 | mouseClick(dashDepartments, 0, 0); |
1907 | 369 | compare(dashNavigation.showList, true); | 370 | compare(dashDepartments.showList, true); |
1908 | 370 | tryCompare(navigationListView.currentItem.navigation, "loaded", true); | 371 | tryCompare(departmentListView.currentItem.department, "loaded", true); |
1909 | 371 | navigation = findChild(dashNavigation, "navigation0child2"); | 372 | department = findChild(dashDepartments, "department0child2"); |
1910 | 372 | mouseClick(navigation, 0, 0); | 373 | mouseClick(department, 0, 0); |
1911 | 373 | compare(dashNavigation.showList, true); | 374 | compare(dashDepartments.showList, true); |
1912 | 374 | navigationList1 = findChild(dashNavigation, "navigation1"); | 375 | departmentList1 = findChild(dashDepartments, "department1"); |
1913 | 375 | compare(navigationList1.navigation.loaded, false); | 376 | compare(departmentList1.department.loaded, false); |
1914 | 376 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); | 377 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); |
1915 | 377 | allButton = findChild(navigationList1, "allButton"); | 378 | allButton = findChild(departmentList1, "allButton"); |
1916 | 378 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); | 379 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); |
1917 | 379 | mouseClick(allButton, 0, 0); | 380 | mouseClick(allButton, 0, 0); |
1919 | 380 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); | 381 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); |
1920 | 381 | } | 382 | } |
1921 | 382 | } | 383 | } |
1922 | 383 | } | 384 | } |