Merge lp:~saviq/unity8/dash-activity-indicator into lp:unity8
- dash-activity-indicator
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~saviq/unity8/dash-activity-indicator |
Merge into: | lp:unity8 |
Diff against target: |
1995 lines (+588/-444) 25 files modified
debian/control (+2/-2) plugins/Dash/ScopeStyle.qml (+11/-8) qml/Components/PageHeader.qml (+1/-14) qml/Dash/Dash.qml (+77/-12) qml/Dash/DashContent.qml (+5/-4) qml/Dash/DashNavigation.qml (+50/-43) qml/Dash/DashNavigationList.qml (+14/-18) qml/Dash/GenericScopeView.qml (+6/-12) qml/Dash/PreviewListView.qml (+27/-31) qml/ScopeTool.qml (+1/-11) tests/autopilot/unity8/shell/emulators/dash.py (+1/-1) tests/mocks/Unity/CMakeLists.txt (+3/-3) tests/mocks/Unity/Unity.qmltypes (+87/-35) tests/mocks/Unity/fake_navigation.cpp (+36/-44) tests/mocks/Unity/fake_navigation.h (+13/-13) tests/mocks/Unity/fake_scope.cpp (+73/-25) tests/mocks/Unity/fake_scope.h (+16/-8) tests/mocks/Unity/fake_scopes.cpp (+10/-2) tests/mocks/Unity/fake_scopes.h (+1/-0) tests/mocks/Unity/fake_unity_plugin.cpp (+2/-2) tests/plugins/Dash/tst_ScopeStyle.qml (+14/-7) tests/qmltests/Components/tst_PageHeader.qml (+0/-23) tests/qmltests/Dash/tst_Dash.qml (+28/-15) tests/qmltests/Dash/tst_DashContent.qml (+109/-110) tests/qmltests/Dash/tst_GenericScopeView.qml (+1/-1) |
To merge this branch: | bzr merge lp:~saviq/unity8/dash-activity-indicator |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Albert Astals Cid (community) | Needs Fixing | ||
Andrea Cimitan (community) | Needs Fixing | ||
Review via email: mp+228718@code.launchpad.net |
This proposal has been superseded by a proposal from 2014-08-06.
Commit message
Refactor dash activity indicator.
Description of the change
* Are there any related MPs required for this MP to build/function as expected? Please list.
No.
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes.
* Did you make sure that your branch does not contain spurious tags?
Yes.
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A
* If you changed the UI, has there been a design review?
Yes, there was. And will be again.
- 1078. By Michał Sawicz
-
Add one more step to verify that indicator goes away.
- 1079. By Michał Sawicz
-
Drop departments id, unused.
- 1080. By Michał Sawicz
-
Re-add newline.
- 1081. By Michał Sawicz
-
Newline--
- 1082. By Michał Sawicz
-
Undo divider changes.
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1082
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1083. By Michał Sawicz
-
Merge trunk.
- 1084. By Michał Sawicz
-
Fix review comments.
Michał Sawicz (saviq) : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1083
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1084
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
Text conflict in tests/qmltests/
1 conflicts encountered.
- 1085. By Michał Sawicz
-
Merge.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1085
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
There are autopilot failures related to autopilot, can you have a look?
Albert Astals Cid (aacid) wrote : | # |
err, autopilot failures related to indicators i mean :D
- 1086. By Michał Sawicz
-
Fix search emulator.
- 1087. By Michał Sawicz
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1086
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Unmerged revisions
Preview Diff
1 | === modified file 'debian/control' | |||
2 | --- debian/control 2014-07-31 16:48:11 +0000 | |||
3 | +++ debian/control 2014-08-06 14:50: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.87), | 27 | libunity-api-dev (>= 7.88), |
10 | 28 | libusermetricsoutput1-dev, | 28 | libusermetricsoutput1-dev, |
11 | 29 | libxcb1-dev, | 29 | libxcb1-dev, |
12 | 30 | pkg-config, | 30 | pkg-config, |
13 | @@ -112,7 +112,7 @@ | |||
14 | 112 | unity-application-impl-2, | 112 | unity-application-impl-2, |
15 | 113 | unity-notifications-impl-3, | 113 | unity-notifications-impl-3, |
16 | 114 | unity-plugin-scopes | unity-scopes-impl, | 114 | unity-plugin-scopes | unity-scopes-impl, |
18 | 115 | unity-scopes-impl-2, | 115 | unity-scopes-impl-4, |
19 | 116 | unity8-fake-env | unity-application-impl, | 116 | unity8-fake-env | unity-application-impl, |
20 | 117 | ${misc:Depends}, | 117 | ${misc:Depends}, |
21 | 118 | Breaks: unity8 (<< 7.86), | 118 | Breaks: unity8 (<< 7.86), |
22 | 119 | 119 | ||
23 | === modified file 'plugins/Dash/ScopeStyle.qml' | |||
24 | --- plugins/Dash/ScopeStyle.qml 2014-07-18 18:09:13 +0000 | |||
25 | +++ plugins/Dash/ScopeStyle.qml 2014-08-06 14:50:38 +0000 | |||
26 | @@ -38,14 +38,20 @@ | |||
27 | 38 | /// Color used for text and symbolic icons | 38 | /// Color used for text and symbolic icons |
28 | 39 | readonly property color foreground: "foreground-color" in style ? style["foreground-color"] : d.defaultDark | 39 | readonly property color foreground: "foreground-color" in style ? style["foreground-color"] : d.defaultDark |
29 | 40 | 40 | ||
30 | 41 | /// Luminance of the foreground color | ||
31 | 42 | readonly property real foregroundLuminance: foreground ? luminance(foreground) : d.defaultForegroundLuminance | ||
32 | 43 | |||
33 | 41 | /// Color used for the overall background | 44 | /// Color used for the overall background |
34 | 42 | readonly property color background: "background-color" in style ? style["background-color"] : "transparent" | 45 | readonly property color background: "background-color" in style ? style["background-color"] : "transparent" |
35 | 43 | 46 | ||
36 | 47 | /// Luminance of the foreground color | ||
37 | 48 | readonly property real backgroundLuminance: background ? luminance(background) : d.defaultBackgroundLuminance | ||
38 | 49 | |||
39 | 44 | /*! \brief Luminance threshold for switching between fore and background color | 50 | /*! \brief Luminance threshold for switching between fore and background color |
40 | 45 | 51 | ||
41 | 46 | \note If background colour is not fully opaque, it's not taken into account. | 52 | \note If background colour is not fully opaque, it's not taken into account. |
42 | 47 | */ | 53 | */ |
44 | 48 | readonly property real threshold: background.a !== 1.0 ? d.foregroundLuminance : (d.foregroundLuminance + d.backgroundLuminance) / 2 | 54 | readonly property real threshold: background.a !== 1.0 ? foregroundLuminance : (foregroundLuminance + backgroundLuminance) / 2 |
45 | 49 | 55 | ||
46 | 50 | /*! \brief The lighter of foreground and background colors | 56 | /*! \brief The lighter of foreground and background colors |
47 | 51 | 57 | ||
48 | @@ -53,8 +59,8 @@ | |||
49 | 53 | and defaults to the theme-provided light color. | 59 | and defaults to the theme-provided light color. |
50 | 54 | */ | 60 | */ |
51 | 55 | readonly property color light: { | 61 | readonly property color light: { |
54 | 56 | if (background.a !== 1.0) return d.foregroundLuminance > d.defaultLightLuminance ? foreground : d.defaultLight; | 62 | if (background.a !== 1.0) return foregroundLuminance > d.defaultLightLuminance ? foreground : d.defaultLight; |
55 | 57 | return d.foregroundLuminance > d.backgroundLuminance ? foreground : background; | 63 | return foregroundLuminance > backgroundLuminance ? foreground : background; |
56 | 58 | } | 64 | } |
57 | 59 | 65 | ||
58 | 60 | /*! \brief The darker of foreground and background colors | 66 | /*! \brief The darker of foreground and background colors |
59 | @@ -63,8 +69,8 @@ | |||
60 | 63 | and defaults to the theme-provided dark color. | 69 | and defaults to the theme-provided dark color. |
61 | 64 | */ | 70 | */ |
62 | 65 | readonly property color dark: { | 71 | readonly property color dark: { |
65 | 66 | if (background.a !== 1.0) return d.foregroundLuminance < d.defaultDarkLuminance ? foreground : d.defaultDark; | 72 | if (background.a !== 1.0) return foregroundLuminance < d.defaultDarkLuminance ? foreground : d.defaultDark; |
66 | 67 | return d.foregroundLuminance < d.backgroundLuminance ? foreground : background; | 73 | return foregroundLuminance < backgroundLuminance ? foreground : background; |
67 | 68 | } | 74 | } |
68 | 69 | 75 | ||
69 | 70 | /// Source of the logo image for the header | 76 | /// Source of the logo image for the header |
70 | @@ -78,9 +84,6 @@ | |||
71 | 78 | 84 | ||
72 | 79 | //! @cond | 85 | //! @cond |
73 | 80 | property var d: QtObject { | 86 | property var d: QtObject { |
74 | 81 | readonly property real foregroundLuminance: luminance(foreground) | ||
75 | 82 | readonly property real backgroundLuminance: luminance(background) | ||
76 | 83 | |||
77 | 84 | // FIXME: should be taken from the theme | 87 | // FIXME: should be taken from the theme |
78 | 85 | readonly property color defaultLight: "white" | 88 | readonly property color defaultLight: "white" |
79 | 86 | readonly property color defaultDark: "grey" | 89 | readonly property color defaultDark: "grey" |
80 | 87 | 90 | ||
81 | === modified file 'qml/Components/PageHeader.qml' | |||
82 | --- qml/Components/PageHeader.qml 2014-07-31 16:49:50 +0000 | |||
83 | +++ qml/Components/PageHeader.qml 2014-08-06 14:50:38 +0000 | |||
84 | @@ -32,7 +32,6 @@ | |||
85 | 32 | property bool searchEntryEnabled: false | 32 | property bool searchEntryEnabled: false |
86 | 33 | property ListModel searchHistory: SearchHistoryModel | 33 | property ListModel searchHistory: SearchHistoryModel |
87 | 34 | property alias searchQuery: searchTextField.text | 34 | property alias searchQuery: searchTextField.text |
88 | 35 | property bool searchInProgress: false | ||
89 | 36 | 35 | ||
90 | 37 | property alias bottomItem: bottomContainer.children | 36 | property alias bottomItem: bottomContainer.children |
91 | 38 | 37 | ||
92 | @@ -200,25 +199,13 @@ | |||
93 | 200 | anchors.fill: parent | 199 | anchors.fill: parent |
94 | 201 | anchors.margins: units.gu(.75) | 200 | anchors.margins: units.gu(.75) |
95 | 202 | source: "image://theme/clear" | 201 | source: "image://theme/clear" |
97 | 203 | opacity: searchTextField.text.length > 0 && !searchActivityIndicator.running | 202 | opacity: searchTextField.text.length > 0 |
98 | 204 | visible: opacity > 0 | 203 | visible: opacity > 0 |
99 | 205 | Behavior on opacity { | 204 | Behavior on opacity { |
100 | 206 | UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration } | 205 | UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration } |
101 | 207 | } | 206 | } |
102 | 208 | } | 207 | } |
103 | 209 | 208 | ||
104 | 210 | ActivityIndicator { | ||
105 | 211 | id: searchActivityIndicator | ||
106 | 212 | objectName: "searchIndicator" | ||
107 | 213 | anchors.fill: parent | ||
108 | 214 | anchors.margins: units.gu(.75) | ||
109 | 215 | running: root.searchInProgress | ||
110 | 216 | opacity: running ? 1 : 0 | ||
111 | 217 | Behavior on opacity { | ||
112 | 218 | UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration } | ||
113 | 219 | } | ||
114 | 220 | } | ||
115 | 221 | |||
116 | 222 | onClicked: { | 209 | onClicked: { |
117 | 223 | root.resetSearch(true); | 210 | root.resetSearch(true); |
118 | 224 | root.openSearchHistory(); | 211 | root.openSearchHistory(); |
119 | 225 | 212 | ||
120 | === modified file 'qml/Dash/Dash.qml' | |||
121 | --- qml/Dash/Dash.qml 2014-07-29 11:35:10 +0000 | |||
122 | +++ qml/Dash/Dash.qml 2014-08-06 14:50:38 +0000 | |||
123 | @@ -14,7 +14,7 @@ | |||
124 | 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/>. |
125 | 15 | */ | 15 | */ |
126 | 16 | 16 | ||
128 | 17 | import QtQuick 2.0 | 17 | import QtQuick 2.2 |
129 | 18 | import Ubuntu.Components 0.1 | 18 | import Ubuntu.Components 0.1 |
130 | 19 | import Unity 0.2 | 19 | import Unity 0.2 |
131 | 20 | import Utils 0.1 | 20 | import Utils 0.1 |
132 | @@ -38,7 +38,13 @@ | |||
133 | 38 | } | 38 | } |
134 | 39 | 39 | ||
135 | 40 | function setCurrentScope(scopeId, animate, reset) { | 40 | function setCurrentScope(scopeId, animate, reset) { |
137 | 41 | var scopeIndex = filteredScopes.findFirst(Scopes.RoleId, scopeId) | 41 | var scopeIndex = -1; |
138 | 42 | for (var i = 0; i < scopes.count; ++i) { | ||
139 | 43 | if (scopes.getScope(i).id == scopeId) { | ||
140 | 44 | scopeIndex = i; | ||
141 | 45 | break; | ||
142 | 46 | } | ||
143 | 47 | } | ||
144 | 42 | 48 | ||
145 | 43 | if (scopeIndex == -1) { | 49 | if (scopeIndex == -1) { |
146 | 44 | console.warn("No match for scope with id: %1".arg(scopeId)) | 50 | console.warn("No match for scope with id: %1".arg(scopeId)) |
147 | @@ -63,15 +69,8 @@ | |||
148 | 63 | } | 69 | } |
149 | 64 | } | 70 | } |
150 | 65 | 71 | ||
160 | 66 | SortFilterProxyModel { | 72 | Scopes { |
161 | 67 | id: filteredScopes | 73 | id: scopes |
153 | 68 | model: Scopes { | ||
154 | 69 | id: scopes | ||
155 | 70 | } | ||
156 | 71 | dynamicSortFilter: true | ||
157 | 72 | |||
158 | 73 | filterRole: Scopes.RoleVisible | ||
159 | 74 | filterRegExp: RegExp("^true$") | ||
162 | 75 | } | 74 | } |
163 | 76 | 75 | ||
164 | 77 | DashContent { | 76 | DashContent { |
165 | @@ -79,7 +78,6 @@ | |||
166 | 79 | objectName: "dashContent" | 78 | objectName: "dashContent" |
167 | 80 | width: parent.width | 79 | width: parent.width |
168 | 81 | height: parent.height | 80 | height: parent.height |
169 | 82 | model: filteredScopes | ||
170 | 83 | scopes: scopes | 81 | scopes: scopes |
171 | 84 | visible: x != -width | 82 | visible: x != -width |
172 | 85 | onGotoScope: { | 83 | onGotoScope: { |
173 | @@ -134,4 +132,71 @@ | |||
174 | 134 | } | 132 | } |
175 | 135 | } | 133 | } |
176 | 136 | } | 134 | } |
177 | 135 | |||
178 | 136 | Rectangle { | ||
179 | 137 | id: indicator | ||
180 | 138 | objectName: "processingIndicator" | ||
181 | 139 | anchors { | ||
182 | 140 | left: parent.left | ||
183 | 141 | right: parent.right | ||
184 | 142 | bottom: parent.bottom | ||
185 | 143 | } | ||
186 | 144 | height: units.dp(3) | ||
187 | 145 | color: scopeStyle.backgroundLuminance > 0.7 ? "#50000000" : "#50ffffff" | ||
188 | 146 | opacity: 0 | ||
189 | 147 | visible: opacity > 0 | ||
190 | 148 | |||
191 | 149 | readonly property bool processing: dashContent.processing || scopeItem.processing | ||
192 | 150 | |||
193 | 151 | Behavior on opacity { | ||
194 | 152 | UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration } | ||
195 | 153 | } | ||
196 | 154 | |||
197 | 155 | onProcessingChanged: { | ||
198 | 156 | if (processing) delay.start(); | ||
199 | 157 | else if (!persist.running) indicator.opacity = 0; | ||
200 | 158 | } | ||
201 | 159 | |||
202 | 160 | Timer { | ||
203 | 161 | id: delay | ||
204 | 162 | interval: 200 | ||
205 | 163 | onTriggered: if (indicator.processing) { | ||
206 | 164 | persist.restart(); | ||
207 | 165 | indicator.opacity = 1; | ||
208 | 166 | } | ||
209 | 167 | } | ||
210 | 168 | |||
211 | 169 | Timer { | ||
212 | 170 | id: persist | ||
213 | 171 | interval: 2 * UbuntuAnimation.SleepyDuration - UbuntuAnimation.FastDuration | ||
214 | 172 | onTriggered: if (!indicator.processing) indicator.opacity = 0 | ||
215 | 173 | } | ||
216 | 174 | |||
217 | 175 | Rectangle { | ||
218 | 176 | id: orange | ||
219 | 177 | anchors { top: parent.top; bottom: parent.bottom } | ||
220 | 178 | width: parent.width / 4 | ||
221 | 179 | color: Theme.palette.selected.foreground | ||
222 | 180 | |||
223 | 181 | SequentialAnimation { | ||
224 | 182 | running: indicator.visible | ||
225 | 183 | loops: Animation.Infinite | ||
226 | 184 | XAnimator { | ||
227 | 185 | from: -orange.width / 2 | ||
228 | 186 | to: indicator.width - orange.width / 2 | ||
229 | 187 | duration: UbuntuAnimation.SleepyDuration | ||
230 | 188 | easing.type: Easing.InOutSine | ||
231 | 189 | target: orange | ||
232 | 190 | } | ||
233 | 191 | XAnimator { | ||
234 | 192 | from: indicator.width - orange.width / 2 | ||
235 | 193 | to: -orange.width / 2 | ||
236 | 194 | duration: UbuntuAnimation.SleepyDuration | ||
237 | 195 | easing.type: Easing.InOutSine | ||
238 | 196 | target: orange | ||
239 | 197 | } | ||
240 | 198 | } | ||
241 | 199 | } | ||
242 | 200 | } | ||
243 | 201 | |||
244 | 137 | } | 202 | } |
245 | 138 | 203 | ||
246 | === modified file 'qml/Dash/DashContent.qml' | |||
247 | --- qml/Dash/DashContent.qml 2014-07-24 23:31:44 +0000 | |||
248 | +++ qml/Dash/DashContent.qml 2014-08-06 14:50:38 +0000 | |||
249 | @@ -23,9 +23,10 @@ | |||
250 | 23 | Item { | 23 | Item { |
251 | 24 | id: dashContent | 24 | id: dashContent |
252 | 25 | 25 | ||
255 | 26 | property var model: null | 26 | property alias scopes: dashContentList.model |
254 | 27 | property var scopes: null | ||
256 | 28 | readonly property alias currentIndex: dashContentList.currentIndex | 27 | readonly property alias currentIndex: dashContentList.currentIndex |
257 | 28 | readonly property bool processing: dashContentList.currentItem && dashContentList.currentItem.item | ||
258 | 29 | && dashContentList.currentItem.item.processing || false | ||
259 | 29 | 30 | ||
260 | 30 | signal scopeLoaded(string scopeId) | 31 | signal scopeLoaded(string scopeId) |
261 | 31 | signal gotoScope(string scopeId) | 32 | signal gotoScope(string scopeId) |
262 | @@ -89,10 +90,9 @@ | |||
263 | 89 | id: dashContentList | 90 | id: dashContentList |
264 | 90 | objectName: "dashContentList" | 91 | objectName: "dashContentList" |
265 | 91 | 92 | ||
267 | 92 | interactive: dashContent.scopes.loaded && currentItem && !currentItem.moving | 93 | interactive: dashContent.scopes.loaded && currentItem && !currentItem.moving && !currentItem.navigationShown |
268 | 93 | 94 | ||
269 | 94 | anchors.fill: parent | 95 | anchors.fill: parent |
270 | 95 | model: dashContent.model | ||
271 | 96 | orientation: ListView.Horizontal | 96 | orientation: ListView.Horizontal |
272 | 97 | boundsBehavior: Flickable.DragAndOvershootBounds | 97 | boundsBehavior: Flickable.DragAndOvershootBounds |
273 | 98 | flickDeceleration: units.gu(625) | 98 | flickDeceleration: units.gu(625) |
274 | @@ -130,6 +130,7 @@ | |||
275 | 130 | objectName: scope.id + " loader" | 130 | objectName: scope.id + " loader" |
276 | 131 | 131 | ||
277 | 132 | readonly property bool moving: item ? item.moving : false | 132 | readonly property bool moving: item ? item.moving : false |
278 | 133 | readonly property bool navigationShown: item ? item.navigationShown : false | ||
279 | 133 | readonly property var categoryView: item ? item.categoryView : null | 134 | readonly property var categoryView: item ? item.categoryView : null |
280 | 134 | readonly property var theScope: scope | 135 | readonly property var theScope: scope |
281 | 135 | 136 | ||
282 | 136 | 137 | ||
283 | === renamed file 'qml/Dash/DashDepartments.qml' => 'qml/Dash/DashNavigation.qml' | |||
284 | --- qml/Dash/DashDepartments.qml 2014-07-08 11:08:19 +0000 | |||
285 | +++ qml/Dash/DashNavigation.qml 2014-08-06 14:50:38 +0000 | |||
286 | @@ -15,17 +15,17 @@ | |||
287 | 15 | */ | 15 | */ |
288 | 16 | 16 | ||
289 | 17 | import QtQuick 2.2 | 17 | import QtQuick 2.2 |
291 | 18 | import Ubuntu.Components 0.1 | 18 | import Ubuntu.Components 1.1 |
292 | 19 | 19 | ||
293 | 20 | AbstractButton { | 20 | AbstractButton { |
294 | 21 | id: root | 21 | id: root |
296 | 22 | objectName: "dashDepartments" | 22 | objectName: "dashNavigation" |
297 | 23 | 23 | ||
298 | 24 | property var scope: null | 24 | property var scope: null |
299 | 25 | 25 | ||
300 | 26 | property bool showList: false | 26 | property bool showList: false |
301 | 27 | 27 | ||
303 | 28 | readonly property var currentDepartment: scope && scope.hasDepartments ? scope.getDepartment(scope.currentDepartmentId) : null | 28 | readonly property var currentNavigation: scope && scope.hasNavigation ? scope.getNavigation(scope.currentNavigationId) : null |
304 | 29 | 29 | ||
305 | 30 | property alias windowWidth: blackRect.width | 30 | property alias windowWidth: blackRect.width |
306 | 31 | property alias windowHeight: blackRect.height | 31 | property alias windowHeight: blackRect.height |
307 | @@ -34,20 +34,21 @@ | |||
308 | 34 | // Are we drilling down the tree or up? | 34 | // Are we drilling down the tree or up? |
309 | 35 | property bool isGoingBack: false | 35 | property bool isGoingBack: false |
310 | 36 | 36 | ||
312 | 37 | visible: root.currentDepartment != null | 37 | visible: root.currentNavigation != null |
313 | 38 | 38 | ||
314 | 39 | height: visible ? units.gu(5) : 0 | 39 | height: visible ? units.gu(5) : 0 |
315 | 40 | 40 | ||
316 | 41 | onClicked: { | 41 | onClicked: { |
317 | 42 | navigationListView.updateMaxHeight(); | ||
318 | 42 | root.showList = !root.showList; | 43 | root.showList = !root.showList; |
319 | 43 | } | 44 | } |
320 | 44 | 45 | ||
321 | 45 | Rectangle { | 46 | Rectangle { |
322 | 46 | id: blackRect | 47 | id: blackRect |
323 | 47 | color: "black" | 48 | color: "black" |
325 | 48 | opacity: departmentListView.currentItem && departmentListView.currentItem.visible ? 0.3 : 0 | 49 | opacity: navigationListView.currentItem && navigationListView.currentItem.visible ? 0.3 : 0 |
326 | 49 | Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } } | 50 | Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } } |
328 | 50 | anchors.top: departmentListView.top | 51 | anchors.top: navigationListView.top |
329 | 51 | anchors.right: parent.right | 52 | anchors.right: parent.right |
330 | 52 | visible: opacity != 0 | 53 | visible: opacity != 0 |
331 | 53 | } | 54 | } |
332 | @@ -78,7 +79,7 @@ | |||
333 | 78 | anchors.fill: parent | 79 | anchors.fill: parent |
334 | 79 | anchors.margins: units.gu(2) | 80 | anchors.margins: units.gu(2) |
335 | 80 | verticalAlignment: Text.AlignVCenter | 81 | verticalAlignment: Text.AlignVCenter |
337 | 81 | text: root.currentDepartment ? root.currentDepartment.label : "" | 82 | text: root.currentNavigation ? root.currentNavigation.label : "" |
338 | 82 | color: root.scopeStyle ? root.scopeStyle.foreground : "grey" | 83 | color: root.scopeStyle ? root.scopeStyle.foreground : "grey" |
339 | 83 | } | 84 | } |
340 | 84 | 85 | ||
341 | @@ -92,18 +93,18 @@ | |||
342 | 92 | color: root.scopeStyle ? root.scopeStyle.foreground : "grey" | 93 | color: root.scopeStyle ? root.scopeStyle.foreground : "grey" |
343 | 93 | } | 94 | } |
344 | 94 | 95 | ||
346 | 95 | // departmentListView is outside root | 96 | // navigationListView is outside root |
347 | 96 | ListView { | 97 | ListView { |
350 | 97 | id: departmentListView | 98 | id: navigationListView |
351 | 98 | objectName: "departmentListView" | 99 | objectName: "navigationListView" |
352 | 99 | orientation: ListView.Horizontal | 100 | orientation: ListView.Horizontal |
353 | 100 | interactive: false | 101 | interactive: false |
354 | 101 | clip: root.width != windowWidth | 102 | clip: root.width != windowWidth |
355 | 102 | model: ListModel { | 103 | model: ListModel { |
357 | 103 | id: departmentModel | 104 | id: navigationModel |
358 | 104 | // We have two roles | 105 | // We have two roles |
361 | 105 | // departmentId: the department id of the department the list represents | 106 | // navigationId: the navigation id of the navigation the list represents |
362 | 106 | // nullifyDepartment: overrides departmentId to be null | 107 | // nullifyNavigation: overrides navigationId to be null |
363 | 107 | // This is used to "clear" the delegate when going "right" on the tree | 108 | // This is used to "clear" the delegate when going "right" on the tree |
364 | 108 | } | 109 | } |
365 | 109 | anchors { | 110 | anchors { |
366 | @@ -111,7 +112,12 @@ | |||
367 | 111 | right: parent.right | 112 | right: parent.right |
368 | 112 | top: root.bottom | 113 | top: root.bottom |
369 | 113 | } | 114 | } |
371 | 114 | readonly property int maxHeight: (windowHeight - mapToItem(null, root.x, root.y).y) - units.gu(8) | 115 | property int maxHeight: -1 |
372 | 116 | Component.onCompleted: updateMaxHeight(); | ||
373 | 117 | function updateMaxHeight() | ||
374 | 118 | { | ||
375 | 119 | maxHeight = (windowHeight - mapToItem(null, 0, 0).y) - units.gu(8); | ||
376 | 120 | } | ||
377 | 115 | property int prevHeight: maxHeight | 121 | property int prevHeight: maxHeight |
378 | 116 | height: currentItem ? currentItem.height : maxHeight | 122 | height: currentItem ? currentItem.height : maxHeight |
379 | 117 | onHeightChanged: { | 123 | onHeightChanged: { |
380 | @@ -120,83 +126,84 @@ | |||
381 | 120 | } | 126 | } |
382 | 121 | } | 127 | } |
383 | 122 | highlightMoveDuration: UbuntuAnimation.FastDuration | 128 | highlightMoveDuration: UbuntuAnimation.FastDuration |
386 | 123 | delegate: DashDepartmentsList { | 129 | delegate: DashNavigationList { |
387 | 124 | objectName: "department" + index | 130 | objectName: "navigation" + index |
388 | 125 | visible: height != 0 | 131 | visible: height != 0 |
390 | 126 | width: departmentListView.width | 132 | width: navigationListView.width |
391 | 127 | scopeStyle: root.scopeStyle | 133 | scopeStyle: root.scopeStyle |
392 | 128 | property real desiredHeight: { | 134 | property real desiredHeight: { |
393 | 129 | if (root.showList) { | 135 | if (root.showList) { |
395 | 130 | if (department && department.loaded && x == departmentListView.contentX) | 136 | if (navigation && navigation.loaded && x == navigationListView.contentX) |
396 | 131 | { | 137 | { |
398 | 132 | return Math.min(implicitHeight, departmentListView.maxHeight); | 138 | navigationListView.updateMaxHeight(); |
399 | 139 | return Math.min(implicitHeight, navigationListView.maxHeight); | ||
400 | 133 | } else { | 140 | } else { |
402 | 134 | return departmentListView.prevHeight; | 141 | return navigationListView.prevHeight; |
403 | 135 | } | 142 | } |
404 | 136 | } else { | 143 | } else { |
405 | 137 | return 0; | 144 | return 0; |
406 | 138 | } | 145 | } |
407 | 139 | } | 146 | } |
408 | 140 | height: desiredHeight | 147 | height: desiredHeight |
413 | 141 | department: (nullifyDepartment || !scope) ? null : scope.getDepartment(departmentId) | 148 | navigation: (nullifyNavigation || !scope) ? null : scope.getNavigation(navigationId) |
414 | 142 | currentDepartment: root.currentDepartment | 149 | currentNavigation: root.currentNavigation |
415 | 143 | onEnterDepartment: { | 150 | onEnterNavigation: { |
416 | 144 | scope.loadDepartment(newDepartmentId); | 151 | scope.setNavigationState(newNavigationId, false); |
417 | 145 | // We only need to add a new item to the model | 152 | // We only need to add a new item to the model |
418 | 146 | // if we have children, otherwise just load it | 153 | // if we have children, otherwise just load it |
419 | 147 | if (hasChildren) { | 154 | if (hasChildren) { |
420 | 148 | isGoingBack = false; | 155 | isGoingBack = false; |
423 | 149 | departmentModel.append({"departmentId": newDepartmentId, "nullifyDepartment": false}); | 156 | navigationModel.append({"navigationId": newNavigationId, "nullifyNavigation": false}); |
424 | 150 | departmentListView.currentIndex++; | 157 | navigationListView.currentIndex++; |
425 | 151 | } else { | 158 | } else { |
426 | 152 | showList = false; | 159 | showList = false; |
427 | 153 | } | 160 | } |
428 | 154 | } | 161 | } |
429 | 155 | onGoBackToParentClicked: { | 162 | onGoBackToParentClicked: { |
431 | 156 | scope.loadDepartment(department.parentDepartmentId); | 163 | scope.setNavigationState(navigation.parentNavigationId, false); |
432 | 157 | isGoingBack = true; | 164 | isGoingBack = true; |
435 | 158 | departmentModel.setProperty(departmentListView.currentIndex - 1, "nullifyDepartment", false); | 165 | navigationModel.setProperty(navigationListView.currentIndex - 1, "nullifyNavigation", false); |
436 | 159 | departmentListView.currentIndex--; | 166 | navigationListView.currentIndex--; |
437 | 160 | } | 167 | } |
439 | 161 | onAllDepartmentClicked: { | 168 | onAllNavigationClicked: { |
440 | 162 | showList = false; | 169 | showList = false; |
442 | 163 | if (root.currentDepartment.parentDepartmentId == department.departmentId) { | 170 | if (root.currentNavigation.parentNavigationId == navigation.navigationId) { |
443 | 164 | // For leaves we have to go to the parent too | 171 | // For leaves we have to go to the parent too |
445 | 165 | scope.loadDepartment(root.currentDepartment.parentDepartmentId); | 172 | scope.setNavigationState(root.currentNavigation.parentNavigationId, false); |
446 | 166 | } | 173 | } |
447 | 167 | } | 174 | } |
448 | 168 | } | 175 | } |
449 | 169 | onContentXChanged: { | 176 | onContentXChanged: { |
451 | 170 | if (contentX == width * departmentListView.currentIndex) { | 177 | if (contentX == width * navigationListView.currentIndex) { |
452 | 171 | if (isGoingBack) { | 178 | if (isGoingBack) { |
454 | 172 | departmentModel.remove(departmentListView.currentIndex + 1); | 179 | navigationModel.remove(navigationListView.currentIndex + 1); |
455 | 173 | } else { | 180 | } else { |
457 | 174 | departmentModel.setProperty(departmentListView.currentIndex - 1, "nullifyDepartment", true); | 181 | navigationModel.setProperty(navigationListView.currentIndex - 1, "nullifyNavigation", true); |
458 | 175 | } | 182 | } |
459 | 176 | } | 183 | } |
460 | 177 | } | 184 | } |
461 | 178 | } | 185 | } |
462 | 179 | 186 | ||
463 | 180 | InverseMouseArea { | 187 | InverseMouseArea { |
465 | 181 | anchors.fill: departmentListView | 188 | anchors.fill: navigationListView |
466 | 182 | enabled: root.showList | 189 | enabled: root.showList |
467 | 183 | onClicked: root.showList = false | 190 | onClicked: root.showList = false |
468 | 184 | } | 191 | } |
469 | 185 | 192 | ||
470 | 186 | onScopeChanged: { | 193 | onScopeChanged: { |
474 | 187 | departmentModel.clear(); | 194 | navigationModel.clear(); |
475 | 188 | if (scope && scope.hasDepartments) { | 195 | if (scope && scope.hasNavigation) { |
476 | 189 | departmentModel.append({"departmentId": scope.currentDepartmentId, "nullifyDepartment": false}); | 196 | navigationModel.append({"navigationId": scope.currentNavigationId, "nullifyNavigation": false}); |
477 | 190 | } | 197 | } |
478 | 191 | } | 198 | } |
479 | 192 | 199 | ||
480 | 193 | Connections { | 200 | Connections { |
481 | 194 | target: scope | 201 | target: scope |
485 | 195 | onHasDepartmentsChanged: { | 202 | onHasNavigationChanged: { |
486 | 196 | if (scope.hasDepartments) { | 203 | if (scope.hasNavigation) { |
487 | 197 | departmentModel.append({"departmentId": scope.currentDepartmentId, "nullifyDepartment": false}); | 204 | navigationModel.append({"navigationId": scope.currentNavigationId, "nullifyNavigation": false}); |
488 | 198 | } else { | 205 | } else { |
490 | 199 | departmentModel.clear(); | 206 | navigationModel.clear(); |
491 | 200 | } | 207 | } |
492 | 201 | } | 208 | } |
493 | 202 | } | 209 | } |
494 | 203 | 210 | ||
495 | === renamed file 'qml/Dash/DashDepartmentsList.qml' => 'qml/Dash/DashNavigationList.qml' | |||
496 | --- qml/Dash/DashDepartmentsList.qml 2014-07-08 11:08:19 +0000 | |||
497 | +++ qml/Dash/DashNavigationList.qml 2014-08-06 14:50:38 +0000 | |||
498 | @@ -15,16 +15,16 @@ | |||
499 | 15 | */ | 15 | */ |
500 | 16 | 16 | ||
501 | 17 | import QtQuick 2.2 | 17 | import QtQuick 2.2 |
503 | 18 | import Ubuntu.Components 0.1 | 18 | import Ubuntu.Components 1.1 |
504 | 19 | 19 | ||
505 | 20 | Item { | 20 | Item { |
506 | 21 | id: root | 21 | id: root |
509 | 22 | property var department: null | 22 | property var navigation: null |
510 | 23 | property var currentDepartment: null | 23 | property var currentNavigation: null |
511 | 24 | property var scopeStyle: null | 24 | property var scopeStyle: null |
513 | 25 | signal enterDepartment(var newDepartmentId, bool hasChildren) | 25 | signal enterNavigation(var newNavigationId, bool hasChildren) |
514 | 26 | signal goBackToParentClicked() | 26 | signal goBackToParentClicked() |
516 | 27 | signal allDepartmentClicked() | 27 | signal allNavigationClicked() |
517 | 28 | 28 | ||
518 | 29 | readonly property int itemHeight: units.gu(5) | 29 | readonly property int itemHeight: units.gu(5) |
519 | 30 | readonly property color foregroundColor: root.scopeStyle ? root.scopeStyle.foreground : "grey" | 30 | readonly property color foregroundColor: root.scopeStyle ? root.scopeStyle.foreground : "grey" |
520 | @@ -35,11 +35,6 @@ | |||
521 | 35 | anchors.fill: parent | 35 | anchors.fill: parent |
522 | 36 | } | 36 | } |
523 | 37 | 37 | ||
524 | 38 | ActivityIndicator { | ||
525 | 39 | id: loadingIndicator | ||
526 | 40 | anchors.centerIn: parent | ||
527 | 41 | running: !(department && department.loaded) | ||
528 | 42 | } | ||
529 | 43 | clip: true | 38 | clip: true |
530 | 44 | 39 | ||
531 | 45 | Behavior on height { | 40 | Behavior on height { |
532 | @@ -54,6 +49,7 @@ | |||
533 | 54 | 49 | ||
534 | 55 | anchors.fill: parent | 50 | anchors.fill: parent |
535 | 56 | 51 | ||
536 | 52 | flickableDirection: Flickable.VerticalFlick | ||
537 | 57 | contentHeight: column.height | 53 | contentHeight: column.height |
538 | 58 | contentWidth: width | 54 | contentWidth: width |
539 | 59 | 55 | ||
540 | @@ -68,7 +64,7 @@ | |||
541 | 68 | id: backButton | 64 | id: backButton |
542 | 69 | objectName: "backButton" | 65 | objectName: "backButton" |
543 | 70 | width: parent.width | 66 | width: parent.width |
545 | 71 | visible: department && !department.isRoot || false | 67 | visible: navigation && !navigation.isRoot || false |
546 | 72 | height: itemHeight | 68 | height: itemHeight |
547 | 73 | 69 | ||
548 | 74 | onClicked: root.goBackToParentClicked(); | 70 | onClicked: root.goBackToParentClicked(); |
549 | @@ -92,7 +88,7 @@ | |||
550 | 92 | left: backImage.right | 88 | left: backImage.right |
551 | 93 | leftMargin: units.gu(0.5) | 89 | leftMargin: units.gu(0.5) |
552 | 94 | } | 90 | } |
554 | 95 | text: department ? department.parentLabel : "" | 91 | text: navigation ? navigation.parentLabel : "" |
555 | 96 | color: root.foregroundColor | 92 | color: root.foregroundColor |
556 | 97 | } | 93 | } |
557 | 98 | 94 | ||
558 | @@ -114,7 +110,7 @@ | |||
559 | 114 | id: allButton | 110 | id: allButton |
560 | 115 | objectName: "allButton" | 111 | objectName: "allButton" |
561 | 116 | width: parent.width | 112 | width: parent.width |
563 | 117 | visible: department && (!department.isRoot || (root.currentDepartment && !root.currentDepartment.isRoot && root.currentDepartment.parentDepartmentId == department.departmentId)) || false | 113 | visible: navigation && (!navigation.isRoot || (root.currentNavigation && !root.currentNavigation.isRoot && root.currentNavigation.parentNavigationId == navigation.navigationId)) || false |
564 | 118 | height: itemHeight | 114 | height: itemHeight |
565 | 119 | 115 | ||
566 | 120 | Label { | 116 | Label { |
567 | @@ -123,7 +119,7 @@ | |||
568 | 123 | left: parent.left | 119 | left: parent.left |
569 | 124 | leftMargin: units.gu(2) | 120 | leftMargin: units.gu(2) |
570 | 125 | } | 121 | } |
572 | 126 | text: department ? (department.allLabel != "" ? department.allLabel : department.label) : "" | 122 | text: navigation ? (navigation.allLabel != "" ? navigation.allLabel : navigation.label) : "" |
573 | 127 | font.bold: true | 123 | font.bold: true |
574 | 128 | color: root.foregroundColor | 124 | color: root.foregroundColor |
575 | 129 | } | 125 | } |
576 | @@ -141,18 +137,18 @@ | |||
577 | 141 | height: units.dp(1) | 137 | height: units.dp(1) |
578 | 142 | } | 138 | } |
579 | 143 | 139 | ||
581 | 144 | onClicked: root.allDepartmentClicked(); | 140 | onClicked: root.allNavigationClicked(); |
582 | 145 | } | 141 | } |
583 | 146 | 142 | ||
584 | 147 | Repeater { | 143 | Repeater { |
586 | 148 | model: department && department.loaded ? department : null | 144 | model: navigation && navigation.loaded ? navigation : null |
587 | 149 | clip: true | 145 | clip: true |
588 | 150 | delegate: AbstractButton { | 146 | delegate: AbstractButton { |
589 | 151 | objectName: root.objectName + "child" + index | 147 | objectName: root.objectName + "child" + index |
590 | 152 | height: root.itemHeight | 148 | height: root.itemHeight |
591 | 153 | width: root.width | 149 | width: root.width |
592 | 154 | 150 | ||
594 | 155 | onClicked: root.enterDepartment(departmentId, hasChildren) | 151 | onClicked: root.enterNavigation(navigationId, hasChildren) |
595 | 156 | 152 | ||
596 | 157 | Label { | 153 | Label { |
597 | 158 | anchors { | 154 | anchors { |
598 | @@ -188,7 +184,7 @@ | |||
599 | 188 | color: root.foregroundColor | 184 | color: root.foregroundColor |
600 | 189 | opacity: 0.1 | 185 | opacity: 0.1 |
601 | 190 | height: units.dp(1) | 186 | height: units.dp(1) |
603 | 191 | visible: index != department.count - 1 | 187 | visible: index != navigation.count - 1 |
604 | 192 | } | 188 | } |
605 | 193 | } | 189 | } |
606 | 194 | } | 190 | } |
607 | 195 | 191 | ||
608 | === modified file 'qml/Dash/GenericScopeView.qml' | |||
609 | --- qml/Dash/GenericScopeView.qml 2014-07-29 11:35:10 +0000 | |||
610 | +++ qml/Dash/GenericScopeView.qml 2014-08-06 14:50:38 +0000 | |||
611 | @@ -25,6 +25,7 @@ | |||
612 | 25 | FocusScope { | 25 | FocusScope { |
613 | 26 | id: scopeView | 26 | id: scopeView |
614 | 27 | 27 | ||
615 | 28 | readonly property alias navigationShown: dashNavigation.showList | ||
616 | 28 | property var scope: null | 29 | property var scope: null |
617 | 29 | property SortFilterProxyModel categories: categoryFilter | 30 | property SortFilterProxyModel categories: categoryFilter |
618 | 30 | property bool isCurrent: false | 31 | property bool isCurrent: false |
619 | @@ -37,18 +38,10 @@ | |||
620 | 37 | style: scope ? scope.customizations : {} | 38 | style: scope ? scope.customizations : {} |
621 | 38 | } | 39 | } |
622 | 39 | 40 | ||
623 | 41 | readonly property bool processing: scope ? scope.searchInProgress || previewListView.processing : false | ||
624 | 42 | |||
625 | 40 | signal backClicked() | 43 | signal backClicked() |
626 | 41 | 44 | ||
627 | 42 | onScopeChanged: { | ||
628 | 43 | if (scope) { | ||
629 | 44 | scope.activateApplication.connect(activateApp); | ||
630 | 45 | } | ||
631 | 46 | } | ||
632 | 47 | |||
633 | 48 | function activateApp(appId) { | ||
634 | 49 | Qt.openUrlExternally(appId); | ||
635 | 50 | } | ||
636 | 51 | |||
637 | 52 | function positionAtBeginning() { | 45 | function positionAtBeginning() { |
638 | 53 | categoryView.positionAtBeginning() | 46 | categoryView.positionAtBeginning() |
639 | 54 | } | 47 | } |
640 | @@ -119,6 +112,7 @@ | |||
641 | 119 | model: scopeView.categories | 112 | model: scopeView.categories |
642 | 120 | forceNoClip: previewListView.open | 113 | forceNoClip: previewListView.open |
643 | 121 | pixelAligned: true | 114 | pixelAligned: true |
644 | 115 | interactive: !dashNavigation.showList | ||
645 | 122 | 116 | ||
646 | 123 | property string expandedCategoryId: "" | 117 | property string expandedCategoryId: "" |
647 | 124 | 118 | ||
648 | @@ -387,10 +381,10 @@ | |||
649 | 387 | title: scopeView.scope ? scopeView.scope.name : "" | 381 | title: scopeView.scope ? scopeView.scope.name : "" |
650 | 388 | showBackButton: scopeView.hasBackAction | 382 | showBackButton: scopeView.hasBackAction |
651 | 389 | searchEntryEnabled: true | 383 | searchEntryEnabled: true |
652 | 390 | searchInProgress: scopeView.scope ? scopeView.scope.searchInProgress : false | ||
653 | 391 | scopeStyle: scopeView.scopeStyle | 384 | scopeStyle: scopeView.scopeStyle |
654 | 392 | 385 | ||
656 | 393 | bottomItem: DashDepartments { | 386 | bottomItem: DashNavigation { |
657 | 387 | id: dashNavigation | ||
658 | 394 | scope: scopeView.scope | 388 | scope: scopeView.scope |
659 | 395 | width: parent.width <= units.gu(60) ? parent.width : units.gu(40) | 389 | width: parent.width <= units.gu(60) ? parent.width : units.gu(40) |
660 | 396 | anchors.right: parent.right | 390 | anchors.right: parent.right |
661 | 397 | 391 | ||
662 | === modified file 'qml/Dash/PreviewListView.qml' | |||
663 | --- qml/Dash/PreviewListView.qml 2014-07-17 13:10:45 +0000 | |||
664 | +++ qml/Dash/PreviewListView.qml 2014-08-06 14:50:38 +0000 | |||
665 | @@ -32,6 +32,9 @@ | |||
666 | 32 | property alias currentItem: previewListView.currentItem | 32 | property alias currentItem: previewListView.currentItem |
667 | 33 | property alias count: previewListView.count | 33 | property alias count: previewListView.count |
668 | 34 | 34 | ||
669 | 35 | readonly property bool processing: currentItem && (!currentItem.previewModel.loaded | ||
670 | 36 | || currentItem.previewModel.processingAction) | ||
671 | 37 | |||
672 | 35 | PageHeader { | 38 | PageHeader { |
673 | 36 | id: header | 39 | id: header |
674 | 37 | objectName: "pageHeader" | 40 | objectName: "pageHeader" |
675 | @@ -83,39 +86,32 @@ | |||
676 | 83 | } | 86 | } |
677 | 84 | } | 87 | } |
678 | 85 | 88 | ||
681 | 86 | delegate: Item { | 89 | delegate: Previews.Preview { |
682 | 87 | objectName: "previewItem" + index | 90 | id: preview |
683 | 91 | objectName: "preview" + index | ||
684 | 88 | height: previewListView.height | 92 | height: previewListView.height |
685 | 89 | width: previewListView.width | 93 | width: previewListView.width |
686 | 90 | 94 | ||
716 | 91 | readonly property bool ready: preview.previewModel.loaded | 95 | isCurrent: ListView.isCurrentItem |
717 | 92 | 96 | ||
718 | 93 | Previews.Preview { | 97 | previewModel: { |
719 | 94 | id: preview | 98 | var previewStack = root.scope.preview(result); |
720 | 95 | objectName: "preview" + index | 99 | return previewStack.getPreviewModel(0); |
721 | 96 | anchors.fill: parent | 100 | } |
722 | 97 | 101 | scopeStyle: root.scopeStyle | |
723 | 98 | isCurrent: parent.ListView.isCurrentItem | 102 | } |
724 | 99 | 103 | } | |
725 | 100 | previewModel: { | 104 | |
726 | 101 | var previewStack = root.scope.preview(result); | 105 | MouseArea { |
727 | 102 | return previewStack.getPreviewModel(0); | 106 | id: processingMouseArea |
728 | 103 | } | 107 | objectName: "processingMouseArea" |
729 | 104 | scopeStyle: root.scopeStyle | 108 | anchors { |
730 | 105 | } | 109 | left: parent.left |
731 | 106 | 110 | right: parent.right | |
732 | 107 | MouseArea { | 111 | top: pageHeader.bottom |
733 | 108 | id: processingMouseArea | 112 | bottom: parent.bottom |
734 | 109 | objectName: "processingMouseArea" | 113 | } |
735 | 110 | anchors.fill: parent | 114 | |
736 | 111 | enabled: !preview.previewModel.loaded || preview.previewModel.processingAction | 115 | enabled: root.processing |
708 | 112 | |||
709 | 113 | ActivityIndicator { | ||
710 | 114 | anchors.centerIn: parent | ||
711 | 115 | visible: root.open && parent.enabled | ||
712 | 116 | running: visible | ||
713 | 117 | } | ||
714 | 118 | } | ||
715 | 119 | } | ||
737 | 120 | } | 116 | } |
738 | 121 | } | 117 | } |
739 | 122 | 118 | ||
740 | === modified file 'qml/ScopeTool.qml' | |||
741 | --- qml/ScopeTool.qml 2014-07-03 09:08:22 +0000 | |||
742 | +++ qml/ScopeTool.qml 2014-08-06 14:50:38 +0000 | |||
743 | @@ -45,16 +45,6 @@ | |||
744 | 45 | signal searchClicked | 45 | signal searchClicked |
745 | 46 | } | 46 | } |
746 | 47 | 47 | ||
747 | 48 | SortFilterProxyModel { | ||
748 | 49 | id: filteredScopes | ||
749 | 50 | model: Scopes { | ||
750 | 51 | id: scopes | ||
751 | 52 | } | ||
752 | 53 | dynamicSortFilter: true | ||
753 | 54 | |||
754 | 55 | filterRole: Scopes.RoleVisible | ||
755 | 56 | filterRegExp: RegExp("^true$") | ||
756 | 57 | } | ||
757 | 58 | 48 | ||
758 | 59 | Rectangle { | 49 | Rectangle { |
759 | 60 | anchors.fill: dashContent | 50 | anchors.fill: dashContent |
760 | @@ -72,8 +62,8 @@ | |||
761 | 72 | DashContent { | 62 | DashContent { |
762 | 73 | id: dashContent | 63 | id: dashContent |
763 | 74 | 64 | ||
764 | 75 | model: filteredScopes | ||
765 | 76 | property var scope: scopes.getScope(currentIndex) | 65 | property var scope: scopes.getScope(currentIndex) |
766 | 66 | scopes: Scopes { } | ||
767 | 77 | 67 | ||
768 | 78 | anchors { | 68 | anchors { |
769 | 79 | top: parent.top | 69 | top: parent.top |
770 | 80 | 70 | ||
771 | === modified file 'tests/autopilot/unity8/shell/emulators/dash.py' | |||
772 | --- tests/autopilot/unity8/shell/emulators/dash.py 2014-07-29 19:49:36 +0000 | |||
773 | +++ tests/autopilot/unity8/shell/emulators/dash.py 2014-08-06 14:50:38 +0000 | |||
774 | @@ -150,7 +150,7 @@ | |||
775 | 150 | headerContainer.contentY.wait_for(0) | 150 | headerContainer.contentY.wait_for(0) |
776 | 151 | search_text_field = self._get_search_text_field() | 151 | search_text_field = self._get_search_text_field() |
777 | 152 | search_text_field.write(query) | 152 | search_text_field.write(query) |
779 | 153 | current_header.select_single(objectName="searchIndicator").running.wait_for(False) | 153 | self.select_single(objectName="processingIndicator").visible.wait_for(False) |
780 | 154 | 154 | ||
781 | 155 | def _get_search_text_field(self): | 155 | def _get_search_text_field(self): |
782 | 156 | page_header = self._get_current_page_header() | 156 | page_header = self._get_current_page_header() |
783 | 157 | 157 | ||
784 | === modified file 'tests/mocks/Unity/CMakeLists.txt' | |||
785 | --- tests/mocks/Unity/CMakeLists.txt 2014-08-05 12:06:16 +0000 | |||
786 | +++ tests/mocks/Unity/CMakeLists.txt 2014-08-06 14:50:38 +0000 | |||
787 | @@ -7,7 +7,7 @@ | |||
788 | 7 | pkg_search_module(DEE dee-1.0 REQUIRED) | 7 | pkg_search_module(DEE dee-1.0 REQUIRED) |
789 | 8 | pkg_search_module(GOBJECT gobject-2.0 REQUIRED) | 8 | pkg_search_module(GOBJECT gobject-2.0 REQUIRED) |
790 | 9 | pkg_search_module(DEEQT libdee-qt5 REQUIRED) | 9 | pkg_search_module(DEEQT libdee-qt5 REQUIRED) |
792 | 10 | pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=3) | 10 | pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=4) |
793 | 11 | 11 | ||
794 | 12 | include_directories( | 12 | include_directories( |
795 | 13 | ${CMAKE_CURRENT_BINARY_DIR} | 13 | ${CMAKE_CURRENT_BINARY_DIR} |
796 | @@ -23,14 +23,14 @@ | |||
797 | 23 | fake_scope.cpp | 23 | fake_scope.cpp |
798 | 24 | fake_scopes.cpp | 24 | fake_scopes.cpp |
799 | 25 | fake_categories.cpp | 25 | fake_categories.cpp |
801 | 26 | fake_department.cpp | 26 | fake_navigation.cpp |
802 | 27 | fake_resultsmodel.cpp | 27 | fake_resultsmodel.cpp |
803 | 28 | fake_previewmodel.cpp | 28 | fake_previewmodel.cpp |
804 | 29 | fake_previewstack.cpp | 29 | fake_previewstack.cpp |
805 | 30 | fake_previewwidgetmodel.cpp | 30 | fake_previewwidgetmodel.cpp |
806 | 31 | fake_unity_plugin.cpp | 31 | fake_unity_plugin.cpp |
807 | 32 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/CategoriesInterface.h | 32 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/CategoriesInterface.h |
809 | 33 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/DepartmentInterface.h | 33 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/NavigationInterface.h |
810 | 34 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewModelInterface.h | 34 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewModelInterface.h |
811 | 35 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewStackInterface.h | 35 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewStackInterface.h |
812 | 36 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewWidgetModelInterface.h | 36 | ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewWidgetModelInterface.h |
813 | 37 | 37 | ||
814 | === modified file 'tests/mocks/Unity/Unity.qmltypes' | |||
815 | --- tests/mocks/Unity/Unity.qmltypes 2014-07-10 10:59:08 +0000 | |||
816 | +++ tests/mocks/Unity/Unity.qmltypes 2014-08-06 14:50:38 +0000 | |||
817 | @@ -24,6 +24,12 @@ | |||
818 | 24 | Parameter { name: "categoryId"; type: "string" } | 24 | Parameter { name: "categoryId"; type: "string" } |
819 | 25 | Parameter { name: "json"; type: "string" } | 25 | Parameter { name: "json"; type: "string" } |
820 | 26 | } | 26 | } |
821 | 27 | Method { | ||
822 | 28 | name: "data" | ||
823 | 29 | type: "QVariant" | ||
824 | 30 | Parameter { name: "row"; type: "int" } | ||
825 | 31 | Parameter { name: "role"; type: "int" } | ||
826 | 32 | } | ||
827 | 27 | } | 33 | } |
828 | 28 | Component { | 34 | Component { |
829 | 29 | name: "PreviewModel" | 35 | name: "PreviewModel" |
830 | @@ -62,6 +68,10 @@ | |||
831 | 62 | prototype: "unity::shell::scopes::ScopeInterface" | 68 | prototype: "unity::shell::scopes::ScopeInterface" |
832 | 63 | exports: ["Unity/MockScope 0.2"] | 69 | exports: ["Unity/MockScope 0.2"] |
833 | 64 | exportMetaObjectRevisions: [0] | 70 | exportMetaObjectRevisions: [0] |
834 | 71 | Signal { | ||
835 | 72 | name: "performQuery" | ||
836 | 73 | Parameter { name: "query"; type: "string" } | ||
837 | 74 | } | ||
838 | 65 | Method { | 75 | Method { |
839 | 66 | name: "setSearchInProgress" | 76 | name: "setSearchInProgress" |
840 | 67 | Parameter { name: "inProg"; type: "bool" } | 77 | Parameter { name: "inProg"; type: "bool" } |
841 | @@ -81,18 +91,21 @@ | |||
842 | 81 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } | 91 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } |
843 | 82 | } | 92 | } |
844 | 83 | Method { | 93 | Method { |
857 | 84 | name: "getDepartment" | 94 | name: "getNavigation" |
858 | 85 | type: "unity::shell::scopes::DepartmentInterface*" | 95 | type: "unity::shell::scopes::NavigationInterface*" |
859 | 86 | Parameter { name: "id"; type: "string" } | 96 | Parameter { name: "navigationId"; type: "string" } |
860 | 87 | } | 97 | } |
861 | 88 | Method { | 98 | Method { |
862 | 89 | name: "loadDepartment" | 99 | name: "getAltNavigation" |
863 | 90 | Parameter { name: "id"; type: "string" } | 100 | type: "unity::shell::scopes::NavigationInterface*" |
864 | 91 | } | 101 | Parameter { name: "altNavigationId"; type: "string" } |
865 | 92 | Method { | 102 | } |
866 | 93 | name: "performQuery" | 103 | Method { |
867 | 94 | Parameter { name: "query"; type: "string" } | 104 | name: "setNavigationState" |
868 | 95 | } | 105 | Parameter { name: "navigationId"; type: "string" } |
869 | 106 | Parameter { name: "isAltNavigation"; type: "bool" } | ||
870 | 107 | } | ||
871 | 108 | Method { name: "refresh" } | ||
872 | 96 | } | 109 | } |
873 | 97 | Component { | 110 | Component { |
874 | 98 | name: "Scopes" | 111 | name: "Scopes" |
875 | @@ -137,6 +150,7 @@ | |||
876 | 137 | "RoleRawRendererTemplate": 3, | 150 | "RoleRawRendererTemplate": 3, |
877 | 138 | "RoleRenderer": 4, | 151 | "RoleRenderer": 4, |
878 | 139 | "RoleComponents": 5, | 152 | "RoleComponents": 5, |
879 | 153 | "RoleHeaderLink": 6, | ||
880 | 140 | "RoleResults": 7, | 154 | "RoleResults": 7, |
881 | 141 | "RoleCount": 8 | 155 | "RoleCount": 8 |
882 | 142 | } | 156 | } |
883 | @@ -157,27 +171,28 @@ | |||
884 | 157 | } | 171 | } |
885 | 158 | } | 172 | } |
886 | 159 | Component { | 173 | Component { |
888 | 160 | name: "unity::shell::scopes::DepartmentInterface" | 174 | name: "unity::shell::scopes::NavigationInterface" |
889 | 161 | prototype: "QAbstractListModel" | 175 | prototype: "QAbstractListModel" |
891 | 162 | exports: ["Unity/Department 0.2"] | 176 | exports: ["Unity/Navigation 0.2"] |
892 | 163 | isCreatable: false | 177 | isCreatable: false |
893 | 164 | exportMetaObjectRevisions: [0] | 178 | exportMetaObjectRevisions: [0] |
894 | 165 | Enum { | 179 | Enum { |
895 | 166 | name: "Roles" | 180 | name: "Roles" |
896 | 167 | values: { | 181 | values: { |
898 | 168 | "RoleDepartmentId": 0, | 182 | "RoleNavigationId": 0, |
899 | 169 | "RoleLabel": 1, | 183 | "RoleLabel": 1, |
900 | 170 | "RoleHasChildren": 2, | 184 | "RoleHasChildren": 2, |
901 | 171 | "RoleIsActive": 3 | 185 | "RoleIsActive": 3 |
902 | 172 | } | 186 | } |
903 | 173 | } | 187 | } |
905 | 174 | Property { name: "departmentId"; type: "string"; isReadonly: true } | 188 | Property { name: "navigationId"; type: "string"; isReadonly: true } |
906 | 175 | Property { name: "label"; type: "string"; isReadonly: true } | 189 | Property { name: "label"; type: "string"; isReadonly: true } |
907 | 176 | Property { name: "allLabel"; type: "string"; isReadonly: true } | 190 | Property { name: "allLabel"; type: "string"; isReadonly: true } |
909 | 177 | Property { name: "parentDepartmentId"; type: "string"; isReadonly: true } | 191 | Property { name: "parentNavigationId"; type: "string"; isReadonly: true } |
910 | 178 | Property { name: "parentLabel"; type: "string"; isReadonly: true } | 192 | Property { name: "parentLabel"; type: "string"; isReadonly: true } |
911 | 179 | Property { name: "loaded"; type: "bool"; isReadonly: true } | 193 | Property { name: "loaded"; type: "bool"; isReadonly: true } |
912 | 180 | Property { name: "isRoot"; type: "bool"; isReadonly: true } | 194 | Property { name: "isRoot"; type: "bool"; isReadonly: true } |
913 | 195 | Property { name: "hidden"; type: "bool"; isReadonly: true } | ||
914 | 181 | Property { name: "count"; type: "int"; isReadonly: true } | 196 | Property { name: "count"; type: "int"; isReadonly: true } |
915 | 182 | } | 197 | } |
916 | 183 | Component { | 198 | Component { |
917 | @@ -247,7 +262,8 @@ | |||
918 | 247 | "RoleEmblem": 8, | 262 | "RoleEmblem": 8, |
919 | 248 | "RoleSummary": 9, | 263 | "RoleSummary": 9, |
920 | 249 | "RoleAttributes": 10, | 264 | "RoleAttributes": 10, |
922 | 250 | "RoleBackground": 11 | 265 | "RoleBackground": 11, |
923 | 266 | "RoleOverlayColor": 12 | ||
924 | 251 | } | 267 | } |
925 | 252 | } | 268 | } |
926 | 253 | Property { name: "categoryId"; type: "string" } | 269 | Property { name: "categoryId"; type: "string" } |
927 | @@ -259,13 +275,22 @@ | |||
928 | 259 | exports: ["Unity/Scope 0.2"] | 275 | exports: ["Unity/Scope 0.2"] |
929 | 260 | isCreatable: false | 276 | isCreatable: false |
930 | 261 | exportMetaObjectRevisions: [0] | 277 | exportMetaObjectRevisions: [0] |
931 | 278 | Enum { | ||
932 | 279 | name: "Status" | ||
933 | 280 | values: { | ||
934 | 281 | "Okay": 0, | ||
935 | 282 | "NoInternet": 1, | ||
936 | 283 | "NoLocationData": 2, | ||
937 | 284 | "Unknown": 3 | ||
938 | 285 | } | ||
939 | 286 | } | ||
940 | 262 | Property { name: "id"; type: "string"; isReadonly: true } | 287 | Property { name: "id"; type: "string"; isReadonly: true } |
941 | 263 | Property { name: "name"; type: "string"; isReadonly: true } | 288 | Property { name: "name"; type: "string"; isReadonly: true } |
942 | 264 | Property { name: "iconHint"; type: "string"; isReadonly: true } | 289 | Property { name: "iconHint"; type: "string"; isReadonly: true } |
943 | 265 | Property { name: "description"; type: "string"; isReadonly: true } | 290 | Property { name: "description"; type: "string"; isReadonly: true } |
944 | 266 | Property { name: "searchHint"; type: "string"; isReadonly: true } | 291 | Property { name: "searchHint"; type: "string"; isReadonly: true } |
945 | 267 | Property { name: "searchInProgress"; type: "bool"; isReadonly: true } | 292 | Property { name: "searchInProgress"; type: "bool"; isReadonly: true } |
947 | 268 | Property { name: "visible"; type: "bool"; isReadonly: true } | 293 | Property { name: "favorite"; type: "bool" } |
948 | 269 | Property { name: "shortcut"; type: "string"; isReadonly: true } | 294 | Property { name: "shortcut"; type: "string"; isReadonly: true } |
949 | 270 | Property { | 295 | Property { |
950 | 271 | name: "categories" | 296 | name: "categories" |
951 | @@ -273,13 +298,27 @@ | |||
952 | 273 | isReadonly: true | 298 | isReadonly: true |
953 | 274 | isPointer: true | 299 | isPointer: true |
954 | 275 | } | 300 | } |
955 | 301 | Property { | ||
956 | 302 | name: "settings" | ||
957 | 303 | type: "unity::shell::scopes::SettingsModelInterface" | ||
958 | 304 | isReadonly: true | ||
959 | 305 | isPointer: true | ||
960 | 306 | } | ||
961 | 276 | Property { name: "searchQuery"; type: "string" } | 307 | Property { name: "searchQuery"; type: "string" } |
962 | 277 | Property { name: "noResultsHint"; type: "string" } | 308 | Property { name: "noResultsHint"; type: "string" } |
963 | 278 | Property { name: "formFactor"; type: "string" } | 309 | Property { name: "formFactor"; type: "string" } |
964 | 279 | Property { name: "isActive"; type: "bool" } | 310 | Property { name: "isActive"; type: "bool" } |
967 | 280 | Property { name: "currentDepartmentId"; type: "string"; isReadonly: true } | 311 | Property { name: "currentNavigationId"; type: "string"; isReadonly: true } |
968 | 281 | Property { name: "hasDepartments"; type: "bool"; isReadonly: true } | 312 | Property { name: "hasNavigation"; type: "bool"; isReadonly: true } |
969 | 313 | Property { name: "currentAltNavigationId"; type: "string"; isReadonly: true } | ||
970 | 314 | Property { name: "hasAltNavigation"; type: "bool"; isReadonly: true } | ||
971 | 282 | Property { name: "customizations"; type: "QVariantMap"; isReadonly: true } | 315 | Property { name: "customizations"; type: "QVariantMap"; isReadonly: true } |
972 | 316 | Property { | ||
973 | 317 | name: "status" | ||
974 | 318 | type: "unity::shell::scopes::ScopeInterface::Status" | ||
975 | 319 | isReadonly: true | ||
976 | 320 | } | ||
977 | 321 | Signal { name: "detailsChanged" } | ||
978 | 283 | Signal { name: "showDash" } | 322 | Signal { name: "showDash" } |
979 | 284 | Signal { name: "hideDash" } | 323 | Signal { name: "hideDash" } |
980 | 285 | Signal { | 324 | Signal { |
981 | @@ -298,10 +337,6 @@ | |||
982 | 298 | name: "openScope" | 337 | name: "openScope" |
983 | 299 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } | 338 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } |
984 | 300 | } | 339 | } |
985 | 301 | Signal { | ||
986 | 302 | name: "activateApplication" | ||
987 | 303 | Parameter { name: "desktop"; type: "string" } | ||
988 | 304 | } | ||
989 | 305 | Method { | 340 | Method { |
990 | 306 | name: "activate" | 341 | name: "activate" |
991 | 307 | Parameter { name: "result"; type: "QVariant" } | 342 | Parameter { name: "result"; type: "QVariant" } |
992 | @@ -317,14 +352,25 @@ | |||
993 | 317 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } | 352 | Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true } |
994 | 318 | } | 353 | } |
995 | 319 | Method { | 354 | Method { |
1004 | 320 | name: "getDepartment" | 355 | name: "getNavigation" |
1005 | 321 | type: "unity::shell::scopes::DepartmentInterface*" | 356 | type: "unity::shell::scopes::NavigationInterface*" |
1006 | 322 | Parameter { name: "departmentId"; type: "string" } | 357 | Parameter { name: "navigationId"; type: "string" } |
1007 | 323 | } | 358 | } |
1008 | 324 | Method { | 359 | Method { |
1009 | 325 | name: "loadDepartment" | 360 | name: "getAltNavigation" |
1010 | 326 | Parameter { name: "departmentId"; type: "string" } | 361 | type: "unity::shell::scopes::NavigationInterface*" |
1011 | 327 | } | 362 | Parameter { name: "altNavigationId"; type: "string" } |
1012 | 363 | } | ||
1013 | 364 | Method { | ||
1014 | 365 | name: "setNavigationState" | ||
1015 | 366 | Parameter { name: "navId"; type: "string" } | ||
1016 | 367 | Parameter { name: "altNavigation"; type: "bool" } | ||
1017 | 368 | } | ||
1018 | 369 | Method { | ||
1019 | 370 | name: "performQuery" | ||
1020 | 371 | Parameter { name: "cannedQuery"; type: "string" } | ||
1021 | 372 | } | ||
1022 | 373 | Method { name: "refresh" } | ||
1023 | 328 | } | 374 | } |
1024 | 329 | Component { | 375 | Component { |
1025 | 330 | name: "unity::shell::scopes::ScopesInterface" | 376 | name: "unity::shell::scopes::ScopesInterface" |
1026 | @@ -334,11 +380,17 @@ | |||
1027 | 334 | values: { | 380 | values: { |
1028 | 335 | "RoleScope": 0, | 381 | "RoleScope": 0, |
1029 | 336 | "RoleId": 1, | 382 | "RoleId": 1, |
1032 | 337 | "RoleVisible": 2, | 383 | "RoleTitle": 2 |
1031 | 338 | "RoleTitle": 3 | ||
1033 | 339 | } | 384 | } |
1034 | 340 | } | 385 | } |
1035 | 341 | Property { name: "loaded"; type: "bool"; isReadonly: true } | 386 | Property { name: "loaded"; type: "bool"; isReadonly: true } |
1036 | 387 | Property { name: "count"; type: "int"; isReadonly: true } | ||
1037 | 388 | Property { | ||
1038 | 389 | name: "overviewScope" | ||
1039 | 390 | type: "unity::shell::scopes::ScopeInterface" | ||
1040 | 391 | isReadonly: true | ||
1041 | 392 | isPointer: true | ||
1042 | 393 | } | ||
1043 | 342 | Method { | 394 | Method { |
1044 | 343 | name: "getScope" | 395 | name: "getScope" |
1045 | 344 | type: "unity::shell::scopes::ScopeInterface*" | 396 | type: "unity::shell::scopes::ScopeInterface*" |
1046 | 345 | 397 | ||
1047 | === renamed file 'tests/mocks/Unity/fake_department.cpp' => 'tests/mocks/Unity/fake_navigation.cpp' | |||
1048 | --- tests/mocks/Unity/fake_department.cpp 2014-06-18 13:48:32 +0000 | |||
1049 | +++ tests/mocks/Unity/fake_navigation.cpp 2014-08-06 14:50:38 +0000 | |||
1050 | @@ -14,14 +14,15 @@ | |||
1051 | 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/>. |
1052 | 15 | */ | 15 | */ |
1053 | 16 | 16 | ||
1055 | 17 | #include "fake_department.h" | 17 | #include "fake_navigation.h" |
1056 | 18 | 18 | ||
1057 | 19 | #include "fake_scope.h" | 19 | #include "fake_scope.h" |
1058 | 20 | 20 | ||
1059 | 21 | #include <QDebug> | ||
1060 | 21 | #include <QTimer> | 22 | #include <QTimer> |
1061 | 22 | 23 | ||
1064 | 23 | Department::Department(const QString& departmentId, const QString& label, const QString& allLabel, const QString& parentId, const QString& parentLabel, Scope* scope) | 24 | Navigation::Navigation(const QString& navigationId, const QString& label, const QString& allLabel, const QString& parentId, const QString& parentLabel, Scope* scope) |
1065 | 24 | : m_departmentId(departmentId) | 25 | : m_navigationId(navigationId) |
1066 | 25 | , m_label(label) | 26 | , m_label(label) |
1067 | 26 | , m_allLabel(allLabel) | 27 | , m_allLabel(allLabel) |
1068 | 27 | , m_parentId(parentId) | 28 | , m_parentId(parentId) |
1069 | @@ -30,96 +31,87 @@ | |||
1070 | 30 | , m_scope(scope) | 31 | , m_scope(scope) |
1071 | 31 | { | 32 | { |
1072 | 32 | QTimer::singleShot(1500, this, SLOT(slotLoaded())); | 33 | QTimer::singleShot(1500, this, SLOT(slotLoaded())); |
1074 | 33 | connect(scope, SIGNAL(currentDepartmentIdChanged()), this, SLOT(slotCurrentDepartmentChanged())); | 34 | connect(scope, SIGNAL(currentNavigationIdChanged()), this, SLOT(slotCurrentNavigationChanged())); |
1075 | 34 | } | 35 | } |
1076 | 35 | 36 | ||
1078 | 36 | QString Department::departmentId() const | 37 | QString Navigation::navigationId() const |
1079 | 37 | { | 38 | { |
1081 | 38 | return m_departmentId; | 39 | return m_navigationId; |
1082 | 39 | } | 40 | } |
1083 | 40 | 41 | ||
1085 | 41 | QString Department::label() const | 42 | QString Navigation::label() const |
1086 | 42 | { | 43 | { |
1087 | 43 | return m_label; | 44 | return m_label; |
1088 | 44 | } | 45 | } |
1089 | 45 | 46 | ||
1091 | 46 | QString Department::allLabel() const | 47 | QString Navigation::allLabel() const |
1092 | 47 | { | 48 | { |
1093 | 48 | return m_allLabel; | 49 | return m_allLabel; |
1094 | 49 | } | 50 | } |
1095 | 50 | 51 | ||
1097 | 51 | QString Department::parentDepartmentId() const | 52 | QString Navigation::parentNavigationId() const |
1098 | 52 | { | 53 | { |
1099 | 53 | return m_parentId; | 54 | return m_parentId; |
1100 | 54 | } | 55 | } |
1101 | 55 | 56 | ||
1103 | 56 | QString Department::parentLabel() const | 57 | QString Navigation::parentLabel() const |
1104 | 57 | { | 58 | { |
1105 | 58 | return m_parentLabel; | 59 | return m_parentLabel; |
1106 | 59 | } | 60 | } |
1107 | 60 | 61 | ||
1109 | 61 | void Department::slotLoaded() | 62 | void Navigation::slotLoaded() |
1110 | 62 | { | 63 | { |
1111 | 63 | m_loaded = true; | 64 | m_loaded = true; |
1112 | 64 | Q_EMIT loadedChanged(); | 65 | Q_EMIT loadedChanged(); |
1113 | 65 | } | 66 | } |
1114 | 66 | 67 | ||
1116 | 67 | bool Department::loaded() const | 68 | bool Navigation::loaded() const |
1117 | 68 | { | 69 | { |
1118 | 69 | return m_loaded; | 70 | return m_loaded; |
1119 | 70 | } | 71 | } |
1120 | 71 | 72 | ||
1122 | 72 | int Department::count() const | 73 | int Navigation::count() const |
1123 | 73 | { | 74 | { |
1124 | 74 | return rowCount(); | 75 | return rowCount(); |
1125 | 75 | } | 76 | } |
1126 | 76 | 77 | ||
1135 | 77 | bool Department::isRoot() const | 78 | bool Navigation::isRoot() const |
1136 | 78 | { | 79 | { |
1137 | 79 | return m_departmentId == "root"; | 80 | return m_navigationId == "root" || m_navigationId == "altroot"; |
1138 | 80 | } | 81 | } |
1139 | 81 | 82 | ||
1140 | 82 | int Department::rowCount(const QModelIndex & /*parent*/) const | 83 | bool Navigation::hidden() const |
1141 | 83 | { | 84 | { |
1142 | 84 | if (!m_loaded || m_departmentId.startsWith("child") || m_departmentId == "middle3") | 85 | return m_navigationId == "altroot"; |
1143 | 86 | } | ||
1144 | 87 | |||
1145 | 88 | int Navigation::rowCount(const QModelIndex & /*parent*/) const | ||
1146 | 89 | { | ||
1147 | 90 | if (!m_loaded || m_navigationId.startsWith("child") || m_navigationId == "middle3") | ||
1148 | 85 | return 0; | 91 | return 0; |
1149 | 86 | else | 92 | else |
1150 | 87 | return 8; | 93 | return 8; |
1151 | 88 | } | 94 | } |
1152 | 89 | 95 | ||
1164 | 90 | QHash<int, QByteArray> Department::roleNames() const | 96 | QVariant Navigation::data(const QModelIndex &index, int role) const |
1154 | 91 | { | ||
1155 | 92 | QHash<int, QByteArray> res; | ||
1156 | 93 | res[RoleDepartmentId] = "departmentId"; | ||
1157 | 94 | res[RoleLabel] = "label"; | ||
1158 | 95 | res[RoleHasChildren] = "hasChildren"; | ||
1159 | 96 | res[RoleIsActive] = "isActive"; | ||
1160 | 97 | return res; | ||
1161 | 98 | } | ||
1162 | 99 | |||
1163 | 100 | QVariant Department::data(const QModelIndex &index, int role) const | ||
1165 | 101 | { | 97 | { |
1166 | 102 | switch (role) { | 98 | switch (role) { |
1169 | 103 | case RoleDepartmentId: | 99 | case RoleNavigationId: |
1170 | 104 | if (m_departmentId == "root") | 100 | if (m_navigationId == "root") |
1171 | 105 | return QString("middle%1").arg(index.row()); | 101 | return QString("middle%1").arg(index.row()); |
1175 | 106 | else if (m_departmentId.startsWith("middle")) | 102 | else if (m_navigationId.startsWith("middle")) |
1176 | 107 | return QString("child%1%2").arg(m_departmentId).arg(index.row()); | 103 | return QString("child%1%2").arg(m_navigationId).arg(index.row()); |
1174 | 108 | break; | ||
1177 | 109 | case RoleLabel: | 104 | case RoleLabel: |
1180 | 110 | return QString("%1Child%2").arg(m_departmentId).arg(index.row()); | 105 | return QString("%1Child%2").arg(m_navigationId).arg(index.row()); |
1179 | 111 | break; | ||
1181 | 112 | case RoleHasChildren: | 106 | case RoleHasChildren: |
1184 | 113 | return m_departmentId == "root" && index.row() != 3; | 107 | return m_navigationId == "root" && index.row() != 3; |
1183 | 114 | break; | ||
1185 | 115 | case RoleIsActive: | 108 | case RoleIsActive: |
1188 | 116 | return m_scope->currentDepartmentId() == data(index, RoleDepartmentId); | 109 | return m_scope->currentNavigationId() == data(index, RoleNavigationId); |
1187 | 117 | break; | ||
1189 | 118 | } | 110 | } |
1190 | 119 | return QVariant(); | 111 | return QVariant(); |
1191 | 120 | } | 112 | } |
1192 | 121 | 113 | ||
1194 | 122 | void Department::slotCurrentDepartmentChanged() | 114 | void Navigation::slotCurrentNavigationChanged() |
1195 | 123 | { | 115 | { |
1196 | 124 | // This is wasteful, should only emit it if really something changed in this | 116 | // This is wasteful, should only emit it if really something changed in this |
1197 | 125 | // deparment, but this is a mock, so no need to optimize | 117 | // deparment, but this is a mock, so no need to optimize |
1198 | 126 | 118 | ||
1199 | === renamed file 'tests/mocks/Unity/fake_department.h' => 'tests/mocks/Unity/fake_navigation.h' | |||
1200 | --- tests/mocks/Unity/fake_department.h 2014-05-29 10:25:21 +0000 | |||
1201 | +++ tests/mocks/Unity/fake_navigation.h 2014-08-06 14:50:38 +0000 | |||
1202 | @@ -14,48 +14,48 @@ | |||
1203 | 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/>. |
1204 | 15 | */ | 15 | */ |
1205 | 16 | 16 | ||
1208 | 17 | #ifndef FAKE_DEPARTMENT_H | 17 | #ifndef FAKE_NAVIGATION_H |
1209 | 18 | #define FAKE_DEPARTMENT_H | 18 | #define FAKE_NAVIGATION_H |
1210 | 19 | 19 | ||
1212 | 20 | #include <unity/shell/scopes/DepartmentInterface.h> | 20 | #include <unity/shell/scopes/NavigationInterface.h> |
1213 | 21 | 21 | ||
1214 | 22 | class Scope; | 22 | class Scope; |
1215 | 23 | 23 | ||
1217 | 24 | class Department : public unity::shell::scopes::DepartmentInterface | 24 | class Navigation : public unity::shell::scopes::NavigationInterface |
1218 | 25 | { | 25 | { |
1219 | 26 | Q_OBJECT | 26 | Q_OBJECT |
1220 | 27 | 27 | ||
1221 | 28 | public: | 28 | public: |
1223 | 29 | Department(const QString& departmentId, const QString& label, const QString& allLabel, const QString& parentId, const QString& parentLabel, Scope* scope); | 29 | Navigation(const QString& navigationId, const QString& label, const QString& allLabel, const QString& parentId, const QString& parentLabel, Scope* scope); |
1224 | 30 | 30 | ||
1226 | 31 | QString departmentId() const override; | 31 | QString navigationId() const override; |
1227 | 32 | QString label() const override; | 32 | QString label() const override; |
1228 | 33 | QString allLabel() const override; | 33 | QString allLabel() const override; |
1230 | 34 | QString parentDepartmentId() const override; | 34 | QString parentNavigationId() const override; |
1231 | 35 | QString parentLabel() const override; | 35 | QString parentLabel() const override; |
1232 | 36 | bool loaded() const override; | 36 | bool loaded() const override; |
1233 | 37 | bool isRoot() const override; | ||
1234 | 38 | bool hidden() const override; | ||
1235 | 37 | int count() const override; | 39 | int count() const override; |
1236 | 38 | bool isRoot() const override; | ||
1237 | 39 | 40 | ||
1238 | 40 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; | 41 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; |
1239 | 41 | QHash<int, QByteArray> roleNames() const; | ||
1240 | 42 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; | 42 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; |
1241 | 43 | 43 | ||
1242 | 44 | public Q_SLOTS: | 44 | public Q_SLOTS: |
1244 | 45 | void slotCurrentDepartmentChanged(); | 45 | void slotCurrentNavigationChanged(); |
1245 | 46 | 46 | ||
1246 | 47 | private Q_SLOTS: | 47 | private Q_SLOTS: |
1247 | 48 | void slotLoaded(); | 48 | void slotLoaded(); |
1248 | 49 | 49 | ||
1249 | 50 | private: | 50 | private: |
1251 | 51 | QString m_departmentId; | 51 | QString m_navigationId; |
1252 | 52 | QString m_label; | 52 | QString m_label; |
1253 | 53 | QString m_allLabel; | 53 | QString m_allLabel; |
1254 | 54 | QString m_parentId; | 54 | QString m_parentId; |
1255 | 55 | QString m_parentLabel; | 55 | QString m_parentLabel; |
1256 | 56 | bool m_loaded; | 56 | bool m_loaded; |
1258 | 57 | QString m_currentDepartment; | 57 | QString m_currentNavigation; |
1259 | 58 | Scope *m_scope; | 58 | Scope *m_scope; |
1260 | 59 | }; | 59 | }; |
1261 | 60 | 60 | ||
1263 | 61 | #endif // FAKE_DEPARTMENT_H | 61 | #endif // FAKE_NAVIGATION_H |
1264 | 62 | 62 | ||
1265 | === modified file 'tests/mocks/Unity/fake_scope.cpp' | |||
1266 | --- tests/mocks/Unity/fake_scope.cpp 2014-07-24 20:40:57 +0000 | |||
1267 | +++ tests/mocks/Unity/fake_scope.cpp 2014-08-06 14:50:38 +0000 | |||
1268 | @@ -14,24 +14,26 @@ | |||
1269 | 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/>. |
1270 | 15 | */ | 15 | */ |
1271 | 16 | 16 | ||
1272 | 17 | #include <QDebug> | ||
1273 | 17 | #include <QUrl> | 18 | #include <QUrl> |
1274 | 18 | 19 | ||
1275 | 19 | #include "fake_scope.h" | 20 | #include "fake_scope.h" |
1277 | 20 | #include "fake_department.h" | 21 | #include "fake_navigation.h" |
1278 | 21 | #include "fake_resultsmodel.h" | 22 | #include "fake_resultsmodel.h" |
1279 | 22 | 23 | ||
1280 | 23 | Scope::Scope(QObject* parent) : Scope(QString(), QString(), false, parent) | 24 | Scope::Scope(QObject* parent) : Scope(QString(), QString(), false, parent) |
1281 | 24 | { | 25 | { |
1282 | 25 | } | 26 | } |
1283 | 26 | 27 | ||
1285 | 27 | Scope::Scope(QString const& id, QString const& name, bool visible, QObject* parent, int categories) | 28 | Scope::Scope(QString const& id, QString const& name, bool favorite, QObject* parent, int categories) |
1286 | 28 | : unity::shell::scopes::ScopeInterface(parent) | 29 | : unity::shell::scopes::ScopeInterface(parent) |
1287 | 29 | , m_id(id) | 30 | , m_id(id) |
1288 | 30 | , m_name(name) | 31 | , m_name(name) |
1289 | 31 | , m_visible(visible) | ||
1290 | 32 | , m_searching(false) | 32 | , m_searching(false) |
1291 | 33 | , m_favorite(favorite) | ||
1292 | 33 | , m_isActive(false) | 34 | , m_isActive(false) |
1294 | 34 | , m_currentDeparment("root") | 35 | , m_currentNavigationId("root") |
1295 | 36 | , m_currentAltNavigationId("altroot") | ||
1296 | 35 | , m_previewRendererName("preview-generic") | 37 | , m_previewRendererName("preview-generic") |
1297 | 36 | , m_categories(new Categories(categories, this)) | 38 | , m_categories(new Categories(categories, this)) |
1298 | 37 | { | 39 | { |
1299 | @@ -77,6 +79,11 @@ | |||
1300 | 77 | return m_searching; | 79 | return m_searching; |
1301 | 78 | } | 80 | } |
1302 | 79 | 81 | ||
1303 | 82 | bool Scope::favorite() const | ||
1304 | 83 | { | ||
1305 | 84 | return m_favorite; | ||
1306 | 85 | } | ||
1307 | 86 | |||
1308 | 80 | unity::shell::scopes::CategoriesInterface* Scope::categories() const | 87 | unity::shell::scopes::CategoriesInterface* Scope::categories() const |
1309 | 81 | { | 88 | { |
1310 | 82 | return m_categories; | 89 | return m_categories; |
1311 | @@ -97,11 +104,6 @@ | |||
1312 | 97 | return m_formFactor; | 104 | return m_formFactor; |
1313 | 98 | } | 105 | } |
1314 | 99 | 106 | ||
1315 | 100 | bool Scope::visible() const | ||
1316 | 101 | { | ||
1317 | 102 | return m_visible; | ||
1318 | 103 | } | ||
1319 | 104 | |||
1320 | 105 | bool Scope::isActive() const | 107 | bool Scope::isActive() const |
1321 | 106 | { | 108 | { |
1322 | 107 | return m_isActive; | 109 | return m_isActive; |
1323 | @@ -131,6 +133,13 @@ | |||
1324 | 131 | } | 133 | } |
1325 | 132 | } | 134 | } |
1326 | 133 | 135 | ||
1327 | 136 | void Scope::setFavorite(const bool favorite) | ||
1328 | 137 | { | ||
1329 | 138 | if (favorite != m_favorite) { | ||
1330 | 139 | m_favorite = favorite; | ||
1331 | 140 | Q_EMIT favoriteChanged(); | ||
1332 | 141 | } | ||
1333 | 142 | } | ||
1334 | 134 | void Scope::setSearchInProgress(const bool inProg) | 143 | void Scope::setSearchInProgress(const bool inProg) |
1335 | 135 | { | 144 | { |
1336 | 136 | if (inProg != m_searching) { | 145 | if (inProg != m_searching) { |
1337 | @@ -170,14 +179,29 @@ | |||
1338 | 170 | qFatal("Scope::closeScope is not implemented"); | 179 | qFatal("Scope::closeScope is not implemented"); |
1339 | 171 | } | 180 | } |
1340 | 172 | 181 | ||
1349 | 173 | QString Scope::currentDepartmentId() const | 182 | QString Scope::currentNavigationId() const |
1350 | 174 | { | 183 | { |
1351 | 175 | return m_currentDeparment; | 184 | return m_currentNavigationId; |
1352 | 176 | } | 185 | } |
1353 | 177 | 186 | ||
1354 | 178 | bool Scope::hasDepartments() const | 187 | bool Scope::hasNavigation() const |
1355 | 179 | { | 188 | { |
1356 | 180 | return true; | 189 | return true; |
1357 | 190 | } | ||
1358 | 191 | |||
1359 | 192 | QString Scope::currentAltNavigationId() const | ||
1360 | 193 | { | ||
1361 | 194 | return m_currentAltNavigationId; | ||
1362 | 195 | } | ||
1363 | 196 | |||
1364 | 197 | bool Scope::hasAltNavigation() const | ||
1365 | 198 | { | ||
1366 | 199 | return true; | ||
1367 | 200 | } | ||
1368 | 201 | |||
1369 | 202 | Scope::Status Scope::status() const | ||
1370 | 203 | { | ||
1371 | 204 | return Status::Okay; | ||
1372 | 181 | } | 205 | } |
1373 | 182 | 206 | ||
1374 | 183 | QVariantMap Scope::customizations() const | 207 | QVariantMap Scope::customizations() const |
1375 | @@ -196,7 +220,12 @@ | |||
1376 | 196 | return m; | 220 | return m; |
1377 | 197 | } | 221 | } |
1378 | 198 | 222 | ||
1380 | 199 | unity::shell::scopes::DepartmentInterface* Scope::getDepartment(const QString& id) | 223 | void Scope::refresh() |
1381 | 224 | { | ||
1382 | 225 | qDebug() << "Scope::refresh is currently not implmented in the fake scopes plugin"; | ||
1383 | 226 | } | ||
1384 | 227 | |||
1385 | 228 | unity::shell::scopes::NavigationInterface* Scope::getNavigation(const QString& id) | ||
1386 | 200 | { | 229 | { |
1387 | 201 | if (id.isEmpty()) | 230 | if (id.isEmpty()) |
1388 | 202 | return nullptr; | 231 | return nullptr; |
1389 | @@ -210,11 +239,30 @@ | |||
1390 | 210 | parentId = id.mid(5, 7); | 239 | parentId = id.mid(5, 7); |
1391 | 211 | parentLabel = parentId; | 240 | parentLabel = parentId; |
1392 | 212 | } | 241 | } |
1400 | 213 | return new Department(id, id, "all"+id, parentId, parentLabel, this); | 242 | return new Navigation(id, id, "all"+id, parentId, parentLabel, this); |
1401 | 214 | } | 243 | } |
1402 | 215 | 244 | ||
1403 | 216 | void Scope::loadDepartment(const QString& id) | 245 | unity::shell::scopes::NavigationInterface* Scope::getAltNavigation(QString const& id) |
1404 | 217 | { | 246 | { |
1405 | 218 | m_currentDeparment = id; | 247 | if (id.isEmpty()) |
1406 | 219 | Q_EMIT currentDepartmentIdChanged(); | 248 | return nullptr; |
1407 | 249 | |||
1408 | 250 | QString parentId; | ||
1409 | 251 | QString parentLabel; | ||
1410 | 252 | if (id.startsWith("altmiddle")) { | ||
1411 | 253 | parentId = "altroot"; | ||
1412 | 254 | parentLabel = "altroot"; | ||
1413 | 255 | } | ||
1414 | 256 | return new Navigation(id, id, "all"+id, parentId, parentLabel, this); | ||
1415 | 257 | } | ||
1416 | 258 | |||
1417 | 259 | void Scope::setNavigationState(const QString &navigationId, bool isAltNavigation) | ||
1418 | 260 | { | ||
1419 | 261 | if (isAltNavigation) { | ||
1420 | 262 | m_currentAltNavigationId = navigationId; | ||
1421 | 263 | Q_EMIT currentAltNavigationIdChanged(); | ||
1422 | 264 | } else { | ||
1423 | 265 | m_currentNavigationId = navigationId; | ||
1424 | 266 | Q_EMIT currentNavigationIdChanged(); | ||
1425 | 267 | } | ||
1426 | 220 | } | 268 | } |
1427 | 221 | 269 | ||
1428 | === modified file 'tests/mocks/Unity/fake_scope.h' | |||
1429 | --- tests/mocks/Unity/fake_scope.h 2014-07-11 16:39:33 +0000 | |||
1430 | +++ tests/mocks/Unity/fake_scope.h 2014-08-06 14:50:38 +0000 | |||
1431 | @@ -30,7 +30,7 @@ | |||
1432 | 30 | 30 | ||
1433 | 31 | public: | 31 | public: |
1434 | 32 | Scope(QObject* parent = 0); | 32 | Scope(QObject* parent = 0); |
1436 | 33 | Scope(QString const& id, QString const& name, bool visible, QObject* parent = 0, int categories = 20); | 33 | Scope(QString const& id, QString const& name, bool favorite, QObject* parent = 0, int categories = 20); |
1437 | 34 | 34 | ||
1438 | 35 | /* getters */ | 35 | /* getters */ |
1439 | 36 | QString id() const override; | 36 | QString id() const override; |
1440 | @@ -38,9 +38,9 @@ | |||
1441 | 38 | QString iconHint() const override; | 38 | QString iconHint() const override; |
1442 | 39 | QString description() const override; | 39 | QString description() const override; |
1443 | 40 | QString searchHint() const override; | 40 | QString searchHint() const override; |
1444 | 41 | bool visible() const override; | ||
1445 | 42 | QString shortcut() const override; | 41 | QString shortcut() const override; |
1446 | 43 | bool searchInProgress() const override; | 42 | bool searchInProgress() const override; |
1447 | 43 | bool favorite() const override; | ||
1448 | 44 | unity::shell::scopes::CategoriesInterface* categories() const override; | 44 | unity::shell::scopes::CategoriesInterface* categories() const override; |
1449 | 45 | QString searchQuery() const override; | 45 | QString searchQuery() const override; |
1450 | 46 | QString noResultsHint() const override; | 46 | QString noResultsHint() const override; |
1451 | @@ -53,6 +53,7 @@ | |||
1452 | 53 | void setNoResultsHint(const QString& hint) override; | 53 | void setNoResultsHint(const QString& hint) override; |
1453 | 54 | void setFormFactor(const QString& form_factor) override; | 54 | void setFormFactor(const QString& form_factor) override; |
1454 | 55 | void setActive(const bool) override; | 55 | void setActive(const bool) override; |
1455 | 56 | void setFavorite(const bool) override; | ||
1456 | 56 | Q_INVOKABLE void setSearchInProgress(const bool inProg); // This is not invokable in the Interface, here for testing benefits | 57 | Q_INVOKABLE void setSearchInProgress(const bool inProg); // This is not invokable in the Interface, here for testing benefits |
1457 | 57 | 58 | ||
1458 | 58 | Q_INVOKABLE void activate(QVariant const& result) override; | 59 | Q_INVOKABLE void activate(QVariant const& result) override; |
1459 | @@ -60,14 +61,20 @@ | |||
1460 | 60 | Q_INVOKABLE void cancelActivation() override; | 61 | Q_INVOKABLE void cancelActivation() override; |
1461 | 61 | Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override; | 62 | Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override; |
1462 | 62 | 63 | ||
1467 | 63 | QString currentDepartmentId() const override; | 64 | QString currentNavigationId() const override; |
1468 | 64 | bool hasDepartments() const override; | 65 | bool hasNavigation() const override; |
1469 | 65 | Q_INVOKABLE unity::shell::scopes::DepartmentInterface* getDepartment(const QString& id) override; | 66 | QString currentAltNavigationId() const override; |
1470 | 66 | Q_INVOKABLE void loadDepartment(const QString& id) override; | 67 | bool hasAltNavigation() const override; |
1471 | 68 | Q_INVOKABLE unity::shell::scopes::NavigationInterface* getNavigation(QString const& navigationId) override; | ||
1472 | 69 | Q_INVOKABLE unity::shell::scopes::NavigationInterface* getAltNavigation(QString const& altNavigationId) override; | ||
1473 | 70 | Q_INVOKABLE void setNavigationState(const QString &navigationId, bool isAltNavigation) override; | ||
1474 | 67 | Q_SIGNAL void performQuery(const QString& query) override; | 71 | Q_SIGNAL void performQuery(const QString& query) override; |
1475 | 68 | 72 | ||
1476 | 73 | Status status() const override; | ||
1477 | 69 | QVariantMap customizations() const override; | 74 | QVariantMap customizations() const override; |
1478 | 70 | 75 | ||
1479 | 76 | Q_INVOKABLE void refresh() override; | ||
1480 | 77 | |||
1481 | 71 | protected: | 78 | protected: |
1482 | 72 | 79 | ||
1483 | 73 | QString m_id; | 80 | QString m_id; |
1484 | @@ -77,10 +84,11 @@ | |||
1485 | 77 | QString m_searchQuery; | 84 | QString m_searchQuery; |
1486 | 78 | QString m_noResultsHint; | 85 | QString m_noResultsHint; |
1487 | 79 | QString m_formFactor; | 86 | QString m_formFactor; |
1488 | 80 | bool m_visible; | ||
1489 | 81 | bool m_searching; | 87 | bool m_searching; |
1490 | 88 | bool m_favorite; | ||
1491 | 82 | bool m_isActive; | 89 | bool m_isActive; |
1493 | 83 | QString m_currentDeparment; | 90 | QString m_currentNavigationId; |
1494 | 91 | QString m_currentAltNavigationId; | ||
1495 | 84 | 92 | ||
1496 | 85 | QString m_previewRendererName; | 93 | QString m_previewRendererName; |
1497 | 86 | 94 | ||
1498 | 87 | 95 | ||
1499 | === modified file 'tests/mocks/Unity/fake_scopes.cpp' | |||
1500 | --- tests/mocks/Unity/fake_scopes.cpp 2014-07-25 13:25:45 +0000 | |||
1501 | +++ tests/mocks/Unity/fake_scopes.cpp 2014-08-06 14:50:38 +0000 | |||
1502 | @@ -32,6 +32,11 @@ | |||
1503 | 32 | timer.setSingleShot(true); | 32 | timer.setSingleShot(true); |
1504 | 33 | timer.setInterval(100); | 33 | timer.setInterval(100); |
1505 | 34 | QObject::connect(&timer, SIGNAL(timeout()), this, SLOT(updateScopes())); | 34 | QObject::connect(&timer, SIGNAL(timeout()), this, SLOT(updateScopes())); |
1506 | 35 | |||
1507 | 36 | QObject::connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SIGNAL(countChanged())); | ||
1508 | 37 | QObject::connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SIGNAL(countChanged())); | ||
1509 | 38 | QObject::connect(this, SIGNAL(modelReset()), this, SIGNAL(countChanged())); | ||
1510 | 39 | |||
1511 | 35 | load(); | 40 | load(); |
1512 | 36 | } | 41 | } |
1513 | 37 | 42 | ||
1514 | @@ -92,8 +97,6 @@ | |||
1515 | 92 | return QVariant::fromValue(scope); | 97 | return QVariant::fromValue(scope); |
1516 | 93 | } else if (role == Scopes::RoleId) { | 98 | } else if (role == Scopes::RoleId) { |
1517 | 94 | return QVariant::fromValue(scope->id()); | 99 | return QVariant::fromValue(scope->id()); |
1518 | 95 | } else if (role == Scopes::RoleVisible) { | ||
1519 | 96 | return QVariant::fromValue(scope->visible()); | ||
1520 | 97 | } else if (role == Scopes::RoleTitle) { | 100 | } else if (role == Scopes::RoleTitle) { |
1521 | 98 | return QVariant::fromValue(scope->name()); | 101 | return QVariant::fromValue(scope->name()); |
1522 | 99 | } else { | 102 | } else { |
1523 | @@ -125,6 +128,11 @@ | |||
1524 | 125 | return m_loaded; | 128 | return m_loaded; |
1525 | 126 | } | 129 | } |
1526 | 127 | 130 | ||
1527 | 131 | int Scopes::count() const | ||
1528 | 132 | { | ||
1529 | 133 | return rowCount(); | ||
1530 | 134 | } | ||
1531 | 135 | |||
1532 | 128 | unity::shell::scopes::ScopeInterface* Scopes::overviewScope() const | 136 | unity::shell::scopes::ScopeInterface* Scopes::overviewScope() const |
1533 | 129 | { | 137 | { |
1534 | 130 | return nullptr; | 138 | return nullptr; |
1535 | 131 | 139 | ||
1536 | === modified file 'tests/mocks/Unity/fake_scopes.h' | |||
1537 | --- tests/mocks/Unity/fake_scopes.h 2014-07-25 13:25:45 +0000 | |||
1538 | +++ tests/mocks/Unity/fake_scopes.h 2014-08-06 14:50:38 +0000 | |||
1539 | @@ -50,6 +50,7 @@ | |||
1540 | 50 | QModelIndex parent ( const QModelIndex & index ) const; | 50 | QModelIndex parent ( const QModelIndex & index ) const; |
1541 | 51 | 51 | ||
1542 | 52 | bool loaded() const override; | 52 | bool loaded() const override; |
1543 | 53 | int count() const override; | ||
1544 | 53 | unity::shell::scopes::ScopeInterface* overviewScope() const override; | 54 | unity::shell::scopes::ScopeInterface* overviewScope() const override; |
1545 | 54 | 55 | ||
1546 | 55 | private Q_SLOTS: | 56 | private Q_SLOTS: |
1547 | 56 | 57 | ||
1548 | === modified file 'tests/mocks/Unity/fake_unity_plugin.cpp' | |||
1549 | --- tests/mocks/Unity/fake_unity_plugin.cpp 2014-07-08 11:26:44 +0000 | |||
1550 | +++ tests/mocks/Unity/fake_unity_plugin.cpp 2014-08-06 14:50:38 +0000 | |||
1551 | @@ -22,7 +22,7 @@ | |||
1552 | 22 | // local | 22 | // local |
1553 | 23 | #include "fake_scopes.h" | 23 | #include "fake_scopes.h" |
1554 | 24 | #include "fake_categories.h" | 24 | #include "fake_categories.h" |
1556 | 25 | #include "fake_department.h" | 25 | #include "fake_navigation.h" |
1557 | 26 | #include "fake_previewmodel.h" | 26 | #include "fake_previewmodel.h" |
1558 | 27 | #include "fake_previewwidgetmodel.h" | 27 | #include "fake_previewwidgetmodel.h" |
1559 | 28 | #include "fake_resultsmodel.h" | 28 | #include "fake_resultsmodel.h" |
1560 | @@ -43,7 +43,7 @@ | |||
1561 | 43 | qmlRegisterType<Scopes>(uri, 0, 2, "Scopes"); | 43 | qmlRegisterType<Scopes>(uri, 0, 2, "Scopes"); |
1562 | 44 | qmlRegisterType<Scope>(uri, 0, 2, "MockScope"); | 44 | qmlRegisterType<Scope>(uri, 0, 2, "MockScope"); |
1563 | 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."); |
1565 | 46 | qmlRegisterUncreatableType<unity::shell::scopes::DepartmentInterface>(uri, 0, 2, "Department", "Can't create Department object in QML."); | 46 | qmlRegisterUncreatableType<unity::shell::scopes::NavigationInterface>(uri, 0, 2, "Navigation", "Can't create Navigation object in QML."); |
1566 | 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."); |
1567 | 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."); |
1568 | 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."); |
1569 | 50 | 50 | ||
1570 | === modified file 'tests/plugins/Dash/tst_ScopeStyle.qml' | |||
1571 | --- tests/plugins/Dash/tst_ScopeStyle.qml 2014-07-19 07:56:55 +0000 | |||
1572 | +++ tests/plugins/Dash/tst_ScopeStyle.qml 2014-08-06 14:50:38 +0000 | |||
1573 | @@ -54,6 +54,9 @@ | |||
1574 | 54 | { tag: "lightgrey", luminance: 0.8275 }, | 54 | { tag: "lightgrey", luminance: 0.8275 }, |
1575 | 55 | { tag: "grey", luminance: 0.5020 }, | 55 | { tag: "grey", luminance: 0.5020 }, |
1576 | 56 | { tag: "darkgrey", luminance: 0.6627 }, | 56 | { tag: "darkgrey", luminance: 0.6627 }, |
1577 | 57 | { tag: "red", luminance: 0.2126 }, | ||
1578 | 58 | { tag: "green", luminance: 0.3590 }, | ||
1579 | 59 | { tag: "blue", luminance: 0.0722 }, | ||
1580 | 57 | ]; | 60 | ]; |
1581 | 58 | } | 61 | } |
1582 | 59 | 62 | ||
1583 | @@ -64,10 +67,10 @@ | |||
1584 | 64 | 67 | ||
1585 | 65 | function test_foreground_data() { | 68 | function test_foreground_data() { |
1586 | 66 | return [ | 69 | return [ |
1591 | 67 | { tag: "default", index: 0, foreground: "grey" }, | 70 | { tag: "default", index: 0, foreground: "grey", luminance: 0.5020 }, |
1592 | 68 | { tag: "red on black", index: 1, foreground: "red" }, | 71 | { tag: "red on black", index: 1, foreground: "red", luminance: 0.2126 }, |
1593 | 69 | { tag: "green on white", index: 2, foreground: "green" }, | 72 | { tag: "green on white", index: 2, foreground: "green", luminance: 0.3590 }, |
1594 | 70 | { tag: "blue on darkgrey", index: 3, foreground: "blue" }, | 73 | { tag: "blue on darkgrey", index: 3, foreground: "blue", luminance: 0.0722 }, |
1595 | 71 | ]; | 74 | ]; |
1596 | 72 | } | 75 | } |
1597 | 73 | 76 | ||
1598 | @@ -75,14 +78,15 @@ | |||
1599 | 75 | tool.style = testCase.styles[data.index]; | 78 | tool.style = testCase.styles[data.index]; |
1600 | 76 | verify(Qt.colorEqual(tool.foreground, data.foreground), | 79 | verify(Qt.colorEqual(tool.foreground, data.foreground), |
1601 | 77 | "Foreground color not equal: %1 != %2".arg(tool.foreground).arg(data.foreground)); | 80 | "Foreground color not equal: %1 != %2".arg(tool.foreground).arg(data.foreground)); |
1602 | 81 | compare(tool.foregroundLuminance.toFixed(4), data.luminance.toFixed(4)); | ||
1603 | 78 | } | 82 | } |
1604 | 79 | 83 | ||
1605 | 80 | function test_background_data() { | 84 | function test_background_data() { |
1606 | 81 | return [ | 85 | return [ |
1607 | 82 | { tag: "default", index: 0, background: "transparent" }, | 86 | { tag: "default", index: 0, background: "transparent" }, |
1611 | 83 | { tag: "red on black", index: 1, background: "black" }, | 87 | { tag: "red on black", index: 1, background: "black", luminance: 0 }, |
1612 | 84 | { tag: "green on white", index: 2, background: "white" }, | 88 | { tag: "green on white", index: 2, background: "white", luminance: 1 }, |
1613 | 85 | { tag: "blue on darkgrey", index: 3, background: "darkgrey" }, | 89 | { tag: "blue on darkgrey", index: 3, background: "darkgrey", luminance: 0.6627 }, |
1614 | 86 | ]; | 90 | ]; |
1615 | 87 | } | 91 | } |
1616 | 88 | 92 | ||
1617 | @@ -90,6 +94,9 @@ | |||
1618 | 90 | tool.style = testCase.styles[data.index]; | 94 | tool.style = testCase.styles[data.index]; |
1619 | 91 | verify(Qt.colorEqual(tool.background, data.background), | 95 | verify(Qt.colorEqual(tool.background, data.background), |
1620 | 92 | "Background color not equal: %1 != %2".arg(tool.background).arg(data.background)); | 96 | "Background color not equal: %1 != %2".arg(tool.background).arg(data.background)); |
1621 | 97 | if (data.hasOwnProperty("luminance")) { | ||
1622 | 98 | compare(tool.backgroundLuminance.toFixed(4), data.luminance.toFixed(4)); | ||
1623 | 99 | } | ||
1624 | 93 | } | 100 | } |
1625 | 94 | 101 | ||
1626 | 95 | function test_threshold_data() { | 102 | function test_threshold_data() { |
1627 | 96 | 103 | ||
1628 | === modified file 'tests/qmltests/Components/tst_PageHeader.qml' | |||
1629 | --- tests/qmltests/Components/tst_PageHeader.qml 2014-07-28 09:14:23 +0000 | |||
1630 | +++ tests/qmltests/Components/tst_PageHeader.qml 2014-08-06 14:50:38 +0000 | |||
1631 | @@ -119,29 +119,6 @@ | |||
1632 | 119 | compare(pageHeader.searchHistory.get(0).query, "humppa4") | 119 | compare(pageHeader.searchHistory.get(0).query, "humppa4") |
1633 | 120 | } | 120 | } |
1634 | 121 | 121 | ||
1635 | 122 | function test_search_indicator() { | ||
1636 | 123 | var searchIndicator = findChild(pageHeader, "searchIndicator") | ||
1637 | 124 | var clearIcon = findChild(pageHeader, "clearIcon") | ||
1638 | 125 | |||
1639 | 126 | pageHeader.triggerSearch() | ||
1640 | 127 | |||
1641 | 128 | tryCompare(clearIcon, "visible", false) | ||
1642 | 129 | pageHeader.searchQuery = "ubuntu" | ||
1643 | 130 | tryCompare(clearIcon, "visible", true) | ||
1644 | 131 | |||
1645 | 132 | pageHeader.searchInProgress = false | ||
1646 | 133 | compare(searchIndicator.running, false, "Search indicator is running.") | ||
1647 | 134 | tryCompare(clearIcon, "visible", true) | ||
1648 | 135 | |||
1649 | 136 | pageHeader.searchInProgress = true | ||
1650 | 137 | compare(searchIndicator.running, true, "Search indicator isn't running.") | ||
1651 | 138 | tryCompare(clearIcon, "visible", false) | ||
1652 | 139 | |||
1653 | 140 | pageHeader.searchInProgress = false; | ||
1654 | 141 | compare(searchIndicator.running, false, "Search indicator is running.") | ||
1655 | 142 | tryCompare(clearIcon, "visible", true) | ||
1656 | 143 | } | ||
1657 | 144 | |||
1658 | 145 | function test_titleImage() { | 122 | function test_titleImage() { |
1659 | 146 | 123 | ||
1660 | 147 | var titleImage = findChild(pageHeader, "titleImage"); | 124 | var titleImage = findChild(pageHeader, "titleImage"); |
1661 | 148 | 125 | ||
1662 | === modified file 'tests/qmltests/Dash/tst_Dash.qml' | |||
1663 | --- tests/qmltests/Dash/tst_Dash.qml 2014-07-29 11:35:10 +0000 | |||
1664 | +++ tests/qmltests/Dash/tst_Dash.qml 2014-08-06 14:50:38 +0000 | |||
1665 | @@ -45,12 +45,8 @@ | |||
1666 | 45 | name: "Dash" | 45 | name: "Dash" |
1667 | 46 | when: windowShown | 46 | when: windowShown |
1668 | 47 | 47 | ||
1675 | 48 | property var scopes | 48 | readonly property Item dashContent: findChild(dash, "dashContent"); |
1676 | 49 | 49 | readonly property var scopes: dashContent.scopes | |
1671 | 50 | Component.onCompleted: { | ||
1672 | 51 | var dashContent = findChild(dash, "dashContent"); | ||
1673 | 52 | scopes = dashContent.scopes; | ||
1674 | 53 | } | ||
1677 | 54 | 50 | ||
1678 | 55 | function init() { | 51 | function init() { |
1679 | 56 | // clear and reload the scopes. | 52 | // clear and reload the scopes. |
1680 | @@ -64,10 +60,10 @@ | |||
1681 | 64 | 60 | ||
1682 | 65 | function get_scope_data() { | 61 | function get_scope_data() { |
1683 | 66 | return [ | 62 | return [ |
1688 | 67 | { tag: "MockScope1", visualIndex: 0, shouldBeVisible: true }, | 63 | { tag: "MockScope1", visualIndex: 0 }, |
1689 | 68 | { tag: "MockScope2", visualIndex: -1, shouldBeVisible: false }, | 64 | { tag: "MockScope2", visualIndex: 1 }, |
1690 | 69 | { tag: "clickscope", visualIndex: 1, shouldBeVisible: true }, | 65 | { tag: "clickscope", visualIndex: 2 }, |
1691 | 70 | { tag: "MockScope5", visualIndex: 2, shouldBeVisible: true }, | 66 | { tag: "MockScope5", visualIndex: 3 }, |
1692 | 71 | ] | 67 | ] |
1693 | 72 | } | 68 | } |
1694 | 73 | 69 | ||
1695 | @@ -76,10 +72,6 @@ | |||
1696 | 76 | } | 72 | } |
1697 | 77 | 73 | ||
1698 | 78 | function test_show_scope_on_load(data) { | 74 | function test_show_scope_on_load(data) { |
1699 | 79 | if (data.shouldBeVisible == false) { | ||
1700 | 80 | console.log("Not testing " + data.tag + ": not visible"); | ||
1701 | 81 | return; | ||
1702 | 82 | } | ||
1703 | 83 | var dashContentList = findChild(dash, "dashContentList"); | 75 | var dashContentList = findChild(dash, "dashContentList"); |
1704 | 84 | 76 | ||
1705 | 85 | dash.showScopeOnLoaded = data.tag | 77 | dash.showScopeOnLoaded = data.tag |
1706 | @@ -87,7 +79,7 @@ | |||
1707 | 87 | tryCompare(dashContentList, "count", 0); | 79 | tryCompare(dashContentList, "count", 0); |
1708 | 88 | scopes.load(); | 80 | scopes.load(); |
1709 | 89 | tryCompare(scopes, "loaded", true); | 81 | tryCompare(scopes, "loaded", true); |
1711 | 90 | tryCompare(dashContentList, "count", 4); | 82 | tryCompare(dashContentList, "count", 5); |
1712 | 91 | 83 | ||
1713 | 92 | verify(dashContentList != undefined); | 84 | verify(dashContentList != undefined); |
1714 | 93 | tryCompare(dashContentList, "currentIndex", data.visualIndex); | 85 | tryCompare(dashContentList, "currentIndex", data.visualIndex); |
1715 | @@ -110,5 +102,26 @@ | |||
1716 | 110 | dashCommunicatorService.mockSetCurrentScope("clickscope", true, true); | 102 | dashCommunicatorService.mockSetCurrentScope("clickscope", true, true); |
1717 | 111 | tryCompare(dashContentList, "currentIndex", 1) | 103 | tryCompare(dashContentList, "currentIndex", 1) |
1718 | 112 | } | 104 | } |
1719 | 105 | |||
1720 | 106 | function test_processing_indicator() { | ||
1721 | 107 | tryCompare(scopes, "loaded", true); | ||
1722 | 108 | |||
1723 | 109 | var processingIndicator = findChild(dash, "processingIndicator"); | ||
1724 | 110 | verify(processingIndicator, "Can't find the processing indicator."); | ||
1725 | 111 | |||
1726 | 112 | verify(!processingIndicator.visible, "Processing indicator should be visible."); | ||
1727 | 113 | |||
1728 | 114 | tryCompareFunction(function() { | ||
1729 | 115 | return scopes.getScope(dashContent.currentIndex) != null; | ||
1730 | 116 | }, true); | ||
1731 | 117 | var currentScope = scopes.getScope(dashContent.currentIndex); | ||
1732 | 118 | verify(currentScope, "Can't find the current scope."); | ||
1733 | 119 | |||
1734 | 120 | currentScope.setSearchInProgress(true); | ||
1735 | 121 | tryCompare(processingIndicator, "visible", true); | ||
1736 | 122 | |||
1737 | 123 | currentScope.setSearchInProgress(false); | ||
1738 | 124 | tryCompare(processingIndicator, "visible", false); | ||
1739 | 125 | } | ||
1740 | 113 | } | 126 | } |
1741 | 114 | } | 127 | } |
1742 | 115 | 128 | ||
1743 | === modified file 'tests/qmltests/Dash/tst_DashContent.qml' | |||
1744 | --- tests/qmltests/Dash/tst_DashContent.qml 2014-07-21 13:28:35 +0000 | |||
1745 | +++ tests/qmltests/Dash/tst_DashContent.qml 2014-08-06 14:50:38 +0000 | |||
1746 | @@ -43,9 +43,6 @@ | |||
1747 | 43 | id: dashContent | 43 | id: dashContent |
1748 | 44 | anchors.fill: parent | 44 | anchors.fill: parent |
1749 | 45 | 45 | ||
1750 | 46 | model: SortFilterProxyModel { | ||
1751 | 47 | model: scopesModel | ||
1752 | 48 | } | ||
1753 | 49 | scopes : scopesModel | 46 | scopes : scopesModel |
1754 | 50 | } | 47 | } |
1755 | 51 | 48 | ||
1756 | @@ -268,117 +265,119 @@ | |||
1757 | 268 | verify(carouselLV.tileWidth / carouselLV.tileHeight == cardTool.components["art"]["aspect-ratio"]); | 265 | verify(carouselLV.tileWidth / carouselLV.tileHeight == cardTool.components["art"]["aspect-ratio"]); |
1758 | 269 | } | 266 | } |
1759 | 270 | 267 | ||
1850 | 271 | function test_departments() { | 268 | function test_navigations() { |
1851 | 272 | var dashDepartments = findChild(dashContent, "dashDepartments"); | 269 | var dashContentList = findChild(dashContent, "dashContentList"); |
1852 | 273 | compare(dashDepartments.visible, true); | 270 | tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true); |
1853 | 274 | compare(dashDepartments.showList, false); | 271 | var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation"); |
1854 | 275 | waitForRendering(dashDepartments); | 272 | tryCompare(dashNavigation, "visible", true); |
1855 | 276 | mouseClick(dashDepartments, 0, 0); | 273 | compare(dashNavigation.showList, false); |
1856 | 277 | compare(dashDepartments.showList, true); | 274 | waitForRendering(dashNavigation); |
1857 | 278 | 275 | mouseClick(dashNavigation, 0, 0); | |
1858 | 279 | var departmentListView = findChild(dashDepartments, "departmentListView"); | 276 | compare(dashNavigation.showList, true); |
1859 | 280 | compare(departmentListView.count, 1); | 277 | |
1860 | 281 | tryCompare(departmentListView.currentItem.department, "loaded", true); | 278 | var navigationListView = findChild(dashNavigation, "navigationListView"); |
1861 | 282 | 279 | compare(navigationListView.count, 1); | |
1862 | 283 | waitForRendering(departmentListView); | 280 | tryCompare(navigationListView.currentItem.navigation, "loaded", true); |
1863 | 284 | waitForRendering(departmentListView.currentItem); | 281 | |
1864 | 285 | 282 | waitForRendering(navigationListView); | |
1865 | 286 | var allButton = findChild(dashDepartments, "allButton"); | 283 | waitForRendering(navigationListView.currentItem); |
1866 | 287 | compare(allButton.visible, false); | 284 | |
1867 | 288 | 285 | var allButton = findChild(dashNavigation, "allButton"); | |
1868 | 289 | var department = findChild(dashDepartments, "department0child3"); | 286 | compare(allButton.visible, false); |
1869 | 290 | mouseClick(department, 0, 0); | 287 | |
1870 | 291 | compare(dashDepartments.showList, false); | 288 | var navigation = findChild(dashNavigation, "navigation0child3"); |
1871 | 292 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle3"); | 289 | mouseClick(navigation, 0, 0); |
1872 | 293 | tryCompare(departmentListView.currentItem.department, "departmentId", "root"); | 290 | compare(dashNavigation.showList, false); |
1873 | 294 | 291 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle3"); | |
1874 | 295 | mouseClick(dashDepartments, 0, 0); | 292 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "root"); |
1875 | 296 | compare(dashDepartments.showList, true); | 293 | |
1876 | 297 | waitForRendering(departmentListView); | 294 | mouseClick(dashNavigation, 0, 0); |
1877 | 298 | waitForRendering(departmentListView.currentItem); | 295 | compare(dashNavigation.showList, true); |
1878 | 299 | compare(allButton.visible, true); | 296 | waitForRendering(navigationListView); |
1879 | 300 | 297 | waitForRendering(navigationListView.currentItem); | |
1880 | 301 | mouseClick(allButton, 0, 0); | 298 | compare(allButton.visible, true); |
1881 | 302 | compare(dashDepartments.showList, false); | 299 | |
1882 | 303 | tryCompare(dashDepartments.currentDepartment, "departmentId", "root"); | 300 | mouseClick(allButton, 0, 0); |
1883 | 304 | tryCompare(departmentListView.currentItem.department, "departmentId", "root"); | 301 | compare(dashNavigation.showList, false); |
1884 | 305 | 302 | tryCompare(dashNavigation.currentNavigation, "navigationId", "root"); | |
1885 | 306 | mouseClick(dashDepartments, 0, 0); | 303 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "root"); |
1886 | 307 | compare(dashDepartments.showList, true); | 304 | |
1887 | 308 | waitForRendering(departmentListView); | 305 | mouseClick(dashNavigation, 0, 0); |
1888 | 309 | waitForRendering(departmentListView.currentItem); | 306 | compare(dashNavigation.showList, true); |
1889 | 310 | compare(allButton.visible, false); | 307 | waitForRendering(navigationListView); |
1890 | 311 | 308 | waitForRendering(navigationListView.currentItem); | |
1891 | 312 | department = findChild(dashDepartments, "department0child2"); | 309 | compare(allButton.visible, false); |
1892 | 313 | mouseClick(department, 0, 0); | 310 | |
1893 | 314 | compare(dashDepartments.showList, true); | 311 | navigation = findChild(dashNavigation, "navigation0child2"); |
1894 | 315 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); | 312 | mouseClick(navigation, 0, 0); |
1895 | 316 | tryCompare(departmentListView.currentItem.department, "departmentId", "middle2"); | 313 | compare(dashNavigation.showList, true); |
1896 | 317 | 314 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); | |
1897 | 318 | var departmentList1 = findChild(dashDepartments, "department1"); | 315 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2"); |
1898 | 319 | allButton = findChild(departmentList1, "allButton"); | 316 | |
1899 | 320 | var backButton = findChild(findChild(departmentList1, "department1"), "backButton"); | 317 | var navigationList1 = findChild(dashNavigation, "navigation1"); |
1900 | 321 | compare(allButton.visible, true); | 318 | allButton = findChild(navigationList1, "allButton"); |
1901 | 322 | compare(backButton.visible, true); | 319 | var backButton = findChild(findChild(navigationList1, "navigation1"), "backButton"); |
1902 | 323 | 320 | compare(allButton.visible, true); | |
1903 | 324 | tryCompare(departmentListView, "contentX", departmentList1.x); | 321 | compare(backButton.visible, true); |
1904 | 325 | waitForRendering(departmentListView); | 322 | |
1905 | 326 | mouseClick(allButton, 0, 0); | 323 | tryCompare(navigationListView, "contentX", navigationList1.x); |
1906 | 327 | compare(dashDepartments.showList, false); | 324 | waitForRendering(navigationListView); |
1907 | 328 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); | 325 | mouseClick(allButton, 0, 0); |
1908 | 329 | tryCompare(departmentListView.currentItem.department, "departmentId", "middle2"); | 326 | compare(dashNavigation.showList, false); |
1909 | 330 | 327 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); | |
1910 | 331 | mouseClick(dashDepartments, 0, 0); | 328 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2"); |
1911 | 332 | compare(dashDepartments.showList, true); | 329 | |
1912 | 333 | waitForRendering(departmentListView); | 330 | mouseClick(dashNavigation, 0, 0); |
1913 | 334 | waitForRendering(departmentListView.currentItem); | 331 | compare(dashNavigation.showList, true); |
1914 | 335 | compare(allButton.visible, true); | 332 | waitForRendering(navigationListView); |
1915 | 336 | compare(backButton.visible, true); | 333 | waitForRendering(navigationListView.currentItem); |
1916 | 337 | 334 | compare(allButton.visible, true); | |
1917 | 338 | tryCompare(departmentList1.department, "loaded", true); | 335 | compare(backButton.visible, true); |
1918 | 339 | department = findChild(dashDepartments, "department1child2"); | 336 | |
1919 | 340 | mouseClick(department, 0, 0); | 337 | tryCompare(navigationList1.navigation, "loaded", true); |
1920 | 341 | compare(dashDepartments.showList, false); | 338 | navigation = findChild(dashNavigation, "navigation1child2"); |
1921 | 342 | tryCompare(dashDepartments.currentDepartment, "departmentId", "childmiddle22"); | 339 | mouseClick(navigation, 0, 0); |
1922 | 343 | tryCompare(departmentListView.currentItem.department, "departmentId", "middle2"); | 340 | compare(dashNavigation.showList, false); |
1923 | 344 | 341 | tryCompare(dashNavigation.currentNavigation, "navigationId", "childmiddle22"); | |
1924 | 345 | mouseClick(dashDepartments, 0, 0); | 342 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2"); |
1925 | 346 | compare(dashDepartments.showList, true); | 343 | |
1926 | 347 | waitForRendering(departmentListView); | 344 | mouseClick(dashNavigation, 0, 0); |
1927 | 348 | waitForRendering(departmentListView.currentItem); | 345 | compare(dashNavigation.showList, true); |
1928 | 349 | 346 | waitForRendering(navigationListView); | |
1929 | 350 | tryCompare(departmentList1.department, "loaded", true); | 347 | waitForRendering(navigationListView.currentItem); |
1930 | 351 | department = findChild(dashDepartments, "department1child3"); | 348 | |
1931 | 352 | mouseClick(department, 0, 0); | 349 | tryCompare(navigationList1.navigation, "loaded", true); |
1932 | 353 | compare(dashDepartments.showList, false); | 350 | navigation = findChild(dashNavigation, "navigation1child3"); |
1933 | 354 | tryCompare(dashDepartments.currentDepartment, "departmentId", "childmiddle23"); | 351 | mouseClick(navigation, 0, 0); |
1934 | 355 | tryCompare(departmentListView.currentItem.department, "departmentId", "middle2"); | 352 | compare(dashNavigation.showList, false); |
1935 | 356 | 353 | tryCompare(dashNavigation.currentNavigation, "navigationId", "childmiddle23"); | |
1936 | 357 | mouseClick(dashDepartments, 0, 0); | 354 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2"); |
1937 | 358 | compare(dashDepartments.showList, true); | 355 | |
1938 | 359 | waitForRendering(departmentListView); | 356 | mouseClick(dashNavigation, 0, 0); |
1939 | 360 | waitForRendering(departmentListView.currentItem); | 357 | compare(dashNavigation.showList, true); |
1940 | 358 | waitForRendering(navigationListView); | ||
1941 | 359 | waitForRendering(navigationListView.currentItem); | ||
1942 | 361 | mouseClick(backButton, 0, 0); | 360 | mouseClick(backButton, 0, 0); |
1943 | 362 | 361 | ||
1949 | 363 | tryCompare(dashDepartments.currentDepartment, "departmentId", "root"); | 362 | tryCompare(dashNavigation.currentNavigation, "navigationId", "root"); |
1950 | 364 | tryCompare(departmentListView.currentItem.department, "departmentId", "root"); | 363 | tryCompare(navigationListView.currentItem.navigation, "navigationId", "root"); |
1951 | 365 | compare(dashDepartments.showList, true); | 364 | compare(dashNavigation.showList, true); |
1952 | 366 | mouseClick(dashDepartments, 0, 0); | 365 | mouseClick(dashNavigation, 0, 0); |
1953 | 367 | compare(dashDepartments.showList, false); | 366 | compare(dashNavigation.showList, false); |
1954 | 368 | 367 | ||
1966 | 369 | mouseClick(dashDepartments, 0, 0); | 368 | mouseClick(dashNavigation, 0, 0); |
1967 | 370 | compare(dashDepartments.showList, true); | 369 | compare(dashNavigation.showList, true); |
1968 | 371 | tryCompare(departmentListView.currentItem.department, "loaded", true); | 370 | tryCompare(navigationListView.currentItem.navigation, "loaded", true); |
1969 | 372 | department = findChild(dashDepartments, "department0child2"); | 371 | navigation = findChild(dashNavigation, "navigation0child2"); |
1970 | 373 | mouseClick(department, 0, 0); | 372 | mouseClick(navigation, 0, 0); |
1971 | 374 | compare(dashDepartments.showList, true); | 373 | compare(dashNavigation.showList, true); |
1972 | 375 | departmentList1 = findChild(dashDepartments, "department1"); | 374 | navigationList1 = findChild(dashNavigation, "navigation1"); |
1973 | 376 | compare(departmentList1.department.loaded, false); | 375 | compare(navigationList1.navigation.loaded, false); |
1974 | 377 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); | 376 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); |
1975 | 378 | allButton = findChild(departmentList1, "allButton"); | 377 | allButton = findChild(navigationList1, "allButton"); |
1976 | 379 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); | 378 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); |
1977 | 380 | mouseClick(allButton, 0, 0); | 379 | mouseClick(allButton, 0, 0); |
1979 | 381 | tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2"); | 380 | tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2"); |
1980 | 382 | } | 381 | } |
1981 | 383 | } | 382 | } |
1982 | 384 | } | 383 | } |
1983 | 385 | 384 | ||
1984 | === modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml' | |||
1985 | --- tests/qmltests/Dash/tst_GenericScopeView.qml 2014-07-24 20:40:57 +0000 | |||
1986 | +++ tests/qmltests/Dash/tst_GenericScopeView.qml 2014-08-06 14:50:38 +0000 | |||
1987 | @@ -319,7 +319,7 @@ | |||
1988 | 319 | units.gu(2), | 319 | units.gu(2), |
1989 | 320 | testCase.previewListView.height / 2); | 320 | testCase.previewListView.height / 2); |
1990 | 321 | tryCompare(previewListViewList, "moving", false); | 321 | tryCompare(previewListViewList, "moving", false); |
1992 | 322 | tryCompare(testCase.previewListView.currentItem, "objectName", "previewItem" + i); | 322 | tryCompare(testCase.previewListView.currentItem, "objectName", "preview" + i); |
1993 | 323 | 323 | ||
1994 | 324 | } | 324 | } |
1995 | 325 | closePreview(); | 325 | closePreview(); |
FAILED: Continuous integration, rev:1078 /code.launchpad .net/~saviq/ unity8/ dash-activity- indicator/ +merge/ 228718/ +edit-commit- message
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http:// jenkins. qa.ubuntu. com/job/ unity8- ci/3664/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/2670 jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- utopic/ 666 jenkins. qa.ubuntu. com/job/ unity8- utopic- amd64-ci/ 758 jenkins. qa.ubuntu. com/job/ unity8- utopic- armhf-ci/ 758 jenkins. qa.ubuntu. com/job/ unity8- utopic- armhf-ci/ 758/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ unity8- utopic- i386-ci/ 758 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- mako/2793 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/3913 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/3913/ artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 10636
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity8- ci/3664/ rebuild
http://