on xenial help sign in
Merge
bb4b2e5Albert Astals
debian/control+2−2
@@ -24,7 +24,7 @@ Build-Depends: cmake,
24 libpulse-dev,
24 libpulse-dev,
25 libqmenumodel-dev (>= 0.2.8),
25 libqmenumodel-dev (>= 0.2.8),
26 libqt5xmlpatterns5-dev,
26 libqt5xmlpatterns5-dev,
27− libunity-api-dev (>= 7.87),
27+ libunity-api-dev (>= 7.88),
28 libusermetricsoutput1-dev,
28 libusermetricsoutput1-dev,
29 libxcb1-dev,
29 libxcb1-dev,
30 pkg-config,
30 pkg-config,
@@ -112,7 +112,7 @@ Depends: qtdeclarative5-ubuntu-thumbnailer0.1 | ubuntu-thumbnailer-impl,
112 unity-application-impl-2,
112 unity-application-impl-2,
113 unity-notifications-impl-3,
113 unity-notifications-impl-3,
114 unity-plugin-scopes | unity-scopes-impl,
114 unity-plugin-scopes | unity-scopes-impl,
115− unity-scopes-impl-3,
115+ unity-scopes-impl-4,
116 unity8-fake-env | unity-application-impl,
116 unity8-fake-env | unity-application-impl,
117 ${misc:Depends},
117 ${misc:Depends},
118Breaks: unity8 (<< 7.86),
118Breaks: unity8 (<< 7.86),
qml/Dash/Dash.qml+9−11
@@ -39,7 +39,13 @@ Showable {
39 }
39 }
40
40
41 function setCurrentScope(scopeId, animate, reset) {
41 function setCurrentScope(scopeId, animate, reset) {
42− var scopeIndex = filteredScopes.findFirst(Scopes.RoleId, scopeId)
42+ var scopeIndex = -1;
43+ for (var i = 0; i < scopes.count; ++i) {
44+ if (scopes.getScope(i).id == scopeId) {
45+ scopeIndex = i;
46+ break;
47+ }
48+ }
43
49
44 if (scopeIndex == -1) {
50 if (scopeIndex == -1) {
45 console.warn("No match for scope with id: %1".arg(scopeId))
51 console.warn("No match for scope with id: %1".arg(scopeId))
@@ -64,15 +70,8 @@ Showable {
64 }
70 }
65 }
71 }
66
72
67− SortFilterProxyModel {
73+ Scopes {
68− id: filteredScopes
69− model: Scopes {
70− id: scopes
74+ id: scopes
71− }
72− dynamicSortFilter: true
73−
74− filterRole: Scopes.RoleVisible
75− filterRegExp: RegExp("^true$")
76 }
75 }
77
76
78 QtObject {
77 QtObject {
@@ -157,7 +156,6 @@ Showable {
157 objectName: "dashContent"
156 objectName: "dashContent"
158 width: dash.width
157 width: dash.width
159 height: dash.height
158 height: dash.height
160− model: filteredScopes
161 scopes: scopes
159 scopes: scopes
162 visible: !scopesOverview.showingNonFavoriteScope && x != -width
160 visible: !scopesOverview.showingNonFavoriteScope && x != -width
163 onGotoScope: {
161 onGotoScope: {
qml/Dash/DashContent.qml+3−5
@@ -23,8 +23,7 @@ import "../Components"
23Item {
23Item {
24 id: dashContent
24 id: dashContent
25
25
26− property var model: null
26+ property alias scopes: dashContentList.model
27− property var scopes: null
28 readonly property alias currentIndex: dashContentList.currentIndex
27 readonly property alias currentIndex: dashContentList.currentIndex
29 readonly property string currentScopeId: dashContentList.currentItem ? dashContentList.currentItem.scopeId : ""
28 readonly property string currentScopeId: dashContentList.currentItem ? dashContentList.currentItem.scopeId : ""
30 readonly property var currentScope: dashContentList.currentItem ? dashContentList.currentItem.theScope : null
29 readonly property var currentScope: dashContentList.currentItem ? dashContentList.currentItem.theScope : null
@@ -93,10 +92,9 @@ Item {
93 id: dashContentList
92 id: dashContentList
94 objectName: "dashContentList"
93 objectName: "dashContentList"
95
94
96− interactive: dashContent.scopes.loaded && currentItem && !currentItem.moving && !currentItem.departmentsShown
95+ interactive: dashContent.scopes.loaded && currentItem && !currentItem.moving && !currentItem.navigationShown
97
96
98 anchors.fill: parent
97 anchors.fill: parent
99− model: dashContent.model
100 orientation: ListView.Horizontal
98 orientation: ListView.Horizontal
101 boundsBehavior: Flickable.DragAndOvershootBounds
99 boundsBehavior: Flickable.DragAndOvershootBounds
102 flickDeceleration: units.gu(625)
100 flickDeceleration: units.gu(625)
@@ -134,7 +132,7 @@ Item {
134 objectName: scope.id + " loader"
132 objectName: scope.id + " loader"
135
133
136 readonly property bool moving: item ? item.moving : false
134 readonly property bool moving: item ? item.moving : false
137− readonly property bool departmentsShown: item ? item.departmentsShown : false
135+ readonly property bool navigationShown: item ? item.navigationShown : false
138 readonly property var categoryView: item ? item.categoryView : null
136 readonly property var categoryView: item ? item.categoryView : null
139 readonly property var theScope: scope
137 readonly property var theScope: scope
140
138
qml/Dash/DashDepartments.qml → qml/Dash/DashNavigation.qmlrenamed+44−44
@@ -15,17 +15,17 @@
15 */
15 */
16
16
17import QtQuick 2.2
17import QtQuick 2.2
18−import Ubuntu.Components 0.1
18+import Ubuntu.Components 1.1
19
19
20AbstractButton {
20AbstractButton {
21 id: root
21 id: root
22− objectName: "dashDepartments"
22+ objectName: "dashNavigation"
23
23
24 property var scope: null
24 property var scope: null
25
25
26 property bool showList: false
26 property bool showList: false
27
27
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
29
29
30 property alias windowWidth: blackRect.width
30 property alias windowWidth: blackRect.width
31 property alias windowHeight: blackRect.height
31 property alias windowHeight: blackRect.height
@@ -34,21 +34,21 @@ AbstractButton {
34 // Are we drilling down the tree or up?
34 // Are we drilling down the tree or up?
35 property bool isGoingBack: false
35 property bool isGoingBack: false
36
36
37− visible: root.currentDepartment != null
37+ visible: root.currentNavigation != null
38
38
39 height: visible ? units.gu(5) : 0
39 height: visible ? units.gu(5) : 0
40
40
41 onClicked: {
41 onClicked: {
42− departmentListView.updateMaxHeight();
42+ navigationListView.updateMaxHeight();
43 root.showList = !root.showList;
43 root.showList = !root.showList;
44 }
44 }
45
45
46 Rectangle {
46 Rectangle {
47 id: blackRect
47 id: blackRect
48 color: "black"
48 color: "black"
49− opacity: departmentListView.currentItem && departmentListView.currentItem.visible ? 0.3 : 0
49+ opacity: navigationListView.currentItem && navigationListView.currentItem.visible ? 0.3 : 0
50 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
50 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
51− anchors.top: departmentListView.top
51+ anchors.top: navigationListView.top
52 anchors.right: parent.right
52 anchors.right: parent.right
53 visible: opacity != 0
53 visible: opacity != 0
54 }
54 }
@@ -79,7 +79,7 @@ AbstractButton {
79 anchors.fill: parent
79 anchors.fill: parent
80 anchors.margins: units.gu(2)
80 anchors.margins: units.gu(2)
81 verticalAlignment: Text.AlignVCenter
81 verticalAlignment: Text.AlignVCenter
82− text: root.currentDepartment ? root.currentDepartment.label : ""
82+ text: root.currentNavigation ? root.currentNavigation.label : ""
83 color: root.scopeStyle ? root.scopeStyle.foreground : "grey"
83 color: root.scopeStyle ? root.scopeStyle.foreground : "grey"
84 }
84 }
85
85
@@ -93,18 +93,18 @@ AbstractButton {
93 color: root.scopeStyle ? root.scopeStyle.foreground : "grey"
93 color: root.scopeStyle ? root.scopeStyle.foreground : "grey"
94 }
94 }
95
95
96− // departmentListView is outside root
96+ // navigationListView is outside root
97 ListView {
97 ListView {
98− id: departmentListView
98+ id: navigationListView
99− objectName: "departmentListView"
99+ objectName: "navigationListView"
100 orientation: ListView.Horizontal
100 orientation: ListView.Horizontal
101 interactive: false
101 interactive: false
102 clip: root.width != windowWidth
102 clip: root.width != windowWidth
103 model: ListModel {
103 model: ListModel {
104− id: departmentModel
104+ id: navigationModel
105 // We have two roles
105 // We have two roles
106− // departmentId: the department id of the department the list represents
106+ // navigationId: the navigation id of the navigation the list represents
107− // nullifyDepartment: overrides departmentId to be null
107+ // nullifyNavigation: overrides navigationId to be null
108 // This is used to "clear" the delegate when going "right" on the tree
108 // This is used to "clear" the delegate when going "right" on the tree
109 }
109 }
110 anchors {
110 anchors {
@@ -126,84 +126,84 @@ AbstractButton {
126 }
126 }
127 }
127 }
128 highlightMoveDuration: UbuntuAnimation.FastDuration
128 highlightMoveDuration: UbuntuAnimation.FastDuration
129− delegate: DashDepartmentsList {
129+ delegate: DashNavigationList {
130− objectName: "department" + index
130+ objectName: "navigation" + index
131 visible: height != 0
131 visible: height != 0
132− width: departmentListView.width
132+ width: navigationListView.width
133 scopeStyle: root.scopeStyle
133 scopeStyle: root.scopeStyle
134 property real desiredHeight: {
134 property real desiredHeight: {
135 if (root.showList) {
135 if (root.showList) {
136− if (department && department.loaded && x == departmentListView.contentX)
136+ if (navigation && navigation.loaded && x == navigationListView.contentX)
137 {
137 {
138− departmentListView.updateMaxHeight();
138+ navigationListView.updateMaxHeight();
139− return Math.min(implicitHeight, departmentListView.maxHeight);
139+ return Math.min(implicitHeight, navigationListView.maxHeight);
140 } else {
140 } else {
141− return departmentListView.prevHeight;
141+ return navigationListView.prevHeight;
142 }
142 }
143 } else {
143 } else {
144 return 0;
144 return 0;
145 }
145 }
146 }
146 }
147 height: desiredHeight
147 height: desiredHeight
148− department: (nullifyDepartment || !scope) ? null : scope.getDepartment(departmentId)
148+ navigation: (nullifyNavigation || !scope) ? null : scope.getNavigation(navigationId)
149− currentDepartment: root.currentDepartment
149+ currentNavigation: root.currentNavigation
150− onEnterDepartment: {
150+ onEnterNavigation: {
151− scope.loadDepartment(newDepartmentId);
151+ scope.setNavigationState(newNavigationId, false);
152 // We only need to add a new item to the model
152 // We only need to add a new item to the model
153 // if we have children, otherwise just load it
153 // if we have children, otherwise just load it
154 if (hasChildren) {
154 if (hasChildren) {
155 isGoingBack = false;
155 isGoingBack = false;
156− departmentModel.append({"departmentId": newDepartmentId, "nullifyDepartment": false});
156+ navigationModel.append({"navigationId": newNavigationId, "nullifyNavigation": false});
157− departmentListView.currentIndex++;
157+ navigationListView.currentIndex++;
158 } else {
158 } else {
159 showList = false;
159 showList = false;
160 }
160 }
161 }
161 }
162 onGoBackToParentClicked: {
162 onGoBackToParentClicked: {
163− scope.loadDepartment(department.parentDepartmentId);
163+ scope.setNavigationState(navigation.parentNavigationId, false);
164 isGoingBack = true;
164 isGoingBack = true;
165− departmentModel.setProperty(departmentListView.currentIndex - 1, "nullifyDepartment", false);
165+ navigationModel.setProperty(navigationListView.currentIndex - 1, "nullifyNavigation", false);
166− departmentListView.currentIndex--;
166+ navigationListView.currentIndex--;
167 }
167 }
168− onAllDepartmentClicked: {
168+ onAllNavigationClicked: {
169 showList = false;
169 showList = false;
170− if (root.currentDepartment.parentDepartmentId == department.departmentId) {
170+ if (root.currentNavigation.parentNavigationId == navigation.navigationId) {
171 // For leaves we have to go to the parent too
171 // For leaves we have to go to the parent too
172− scope.loadDepartment(root.currentDepartment.parentDepartmentId);
172+ scope.setNavigationState(root.currentNavigation.parentNavigationId, false);
173 }
173 }
174 }
174 }
175 }
175 }
176 onContentXChanged: {
176 onContentXChanged: {
177− if (contentX == width * departmentListView.currentIndex) {
177+ if (contentX == width * navigationListView.currentIndex) {
178 if (isGoingBack) {
178 if (isGoingBack) {
179− departmentModel.remove(departmentListView.currentIndex + 1);
179+ navigationModel.remove(navigationListView.currentIndex + 1);
180 } else {
180 } else {
181− departmentModel.setProperty(departmentListView.currentIndex - 1, "nullifyDepartment", true);
181+ navigationModel.setProperty(navigationListView.currentIndex - 1, "nullifyNavigation", true);
182 }
182 }
183 }
183 }
184 }
184 }
185 }
185 }
186
186
187 InverseMouseArea {
187 InverseMouseArea {
188− anchors.fill: departmentListView
188+ anchors.fill: navigationListView
189 enabled: root.showList
189 enabled: root.showList
190 onClicked: root.showList = false
190 onClicked: root.showList = false
191 }
191 }
192
192
193 onScopeChanged: {
193 onScopeChanged: {
194− departmentModel.clear();
194+ navigationModel.clear();
195− if (scope && scope.hasDepartments) {
195+ if (scope && scope.hasNavigation) {
196− departmentModel.append({"departmentId": scope.currentDepartmentId, "nullifyDepartment": false});
196+ navigationModel.append({"navigationId": scope.currentNavigationId, "nullifyNavigation": false});
197 }
197 }
198 }
198 }
199
199
200 Connections {
200 Connections {
201 target: scope
201 target: scope
202− onHasDepartmentsChanged: {
202+ onHasNavigationChanged: {
203− if (scope.hasDepartments) {
203+ if (scope.hasNavigation) {
204− departmentModel.append({"departmentId": scope.currentDepartmentId, "nullifyDepartment": false});
204+ navigationModel.append({"navigationId": scope.currentNavigationId, "nullifyNavigation": false});
205 } else {
205 } else {
206− departmentModel.clear();
206+ navigationModel.clear();
207 }
207 }
208 }
208 }
209 }
209 }
qml/Dash/DashDepartmentsList.qml → qml/Dash/DashNavigationList.qmlrenamed+14−14
@@ -15,16 +15,16 @@
15 */
15 */
16
16
17import QtQuick 2.2
17import QtQuick 2.2
18−import Ubuntu.Components 0.1
18+import Ubuntu.Components 1.1
19
19
20Item {
20Item {
21 id: root
21 id: root
22− property var department: null
22+ property var navigation: null
23− property var currentDepartment: null
23+ property var currentNavigation: null
24 property var scopeStyle: null
24 property var scopeStyle: null
25− signal enterDepartment(var newDepartmentId, bool hasChildren)
25+ signal enterNavigation(var newNavigationId, bool hasChildren)
26 signal goBackToParentClicked()
26 signal goBackToParentClicked()
27− signal allDepartmentClicked()
27+ signal allNavigationClicked()
28
28
29 readonly property int itemHeight: units.gu(5)
29 readonly property int itemHeight: units.gu(5)
30 readonly property color foregroundColor: root.scopeStyle ? root.scopeStyle.foreground : "grey"
30 readonly property color foregroundColor: root.scopeStyle ? root.scopeStyle.foreground : "grey"
@@ -38,7 +38,7 @@ Item {
38 ActivityIndicator {
38 ActivityIndicator {
39 id: loadingIndicator
39 id: loadingIndicator
40 anchors.centerIn: parent
40 anchors.centerIn: parent
41− running: !(department && department.loaded)
41+ running: !(navigation && navigation.loaded)
42 }
42 }
43 clip: true
43 clip: true
44
44
@@ -69,7 +69,7 @@ Item {
69 id: backButton
69 id: backButton
70 objectName: "backButton"
70 objectName: "backButton"
71 width: parent.width
71 width: parent.width
72− visible: department && !department.isRoot || false
72+ visible: navigation && !navigation.isRoot || false
73 height: itemHeight
73 height: itemHeight
74
74
75 onClicked: root.goBackToParentClicked();
75 onClicked: root.goBackToParentClicked();
@@ -93,7 +93,7 @@ Item {
93 left: backImage.right
93 left: backImage.right
94 leftMargin: units.gu(0.5)
94 leftMargin: units.gu(0.5)
95 }
95 }
96− text: department ? department.parentLabel : ""
96+ text: navigation ? navigation.parentLabel : ""
97 color: root.foregroundColor
97 color: root.foregroundColor
98 }
98 }
99
99
@@ -115,7 +115,7 @@ Item {
115 id: allButton
115 id: allButton
116 objectName: "allButton"
116 objectName: "allButton"
117 width: parent.width
117 width: parent.width
118− visible: department && (!department.isRoot || (root.currentDepartment && !root.currentDepartment.isRoot && root.currentDepartment.parentDepartmentId == department.departmentId)) || false
118+ visible: navigation && (!navigation.isRoot || (root.currentNavigation && !root.currentNavigation.isRoot && root.currentNavigation.parentNavigationId == navigation.navigationId)) || false
119 height: itemHeight
119 height: itemHeight
120
120
121 Label {
121 Label {
@@ -124,7 +124,7 @@ Item {
124 left: parent.left
124 left: parent.left
125 leftMargin: units.gu(2)
125 leftMargin: units.gu(2)
126 }
126 }
127− text: department ? (department.allLabel != "" ? department.allLabel : department.label) : ""
127+ text: navigation ? (navigation.allLabel != "" ? navigation.allLabel : navigation.label) : ""
128 font.bold: true
128 font.bold: true
129 color: root.foregroundColor
129 color: root.foregroundColor
130 }
130 }
@@ -142,18 +142,18 @@ Item {
142 height: units.dp(1)
142 height: units.dp(1)
143 }
143 }
144
144
145− onClicked: root.allDepartmentClicked();
145+ onClicked: root.allNavigationClicked();
146 }
146 }
147
147
148 Repeater {
148 Repeater {
149− model: department && department.loaded ? department : null
149+ model: navigation && navigation.loaded ? navigation : null
150 clip: true
150 clip: true
151 delegate: AbstractButton {
151 delegate: AbstractButton {
152 objectName: root.objectName + "child" + index
152 objectName: root.objectName + "child" + index
153 height: root.itemHeight
153 height: root.itemHeight
154 width: root.width
154 width: root.width
155
155
156− onClicked: root.enterDepartment(departmentId, hasChildren)
156+ onClicked: root.enterNavigation(navigationId, hasChildren)
157
157
158 Label {
158 Label {
159 anchors {
159 anchors {
@@ -189,7 +189,7 @@ Item {
189 color: root.foregroundColor
189 color: root.foregroundColor
190 opacity: 0.1
190 opacity: 0.1
191 height: units.dp(1)
191 height: units.dp(1)
192− visible: index != department.count - 1
192+ visible: index != navigation.count - 1
193 }
193 }
194 }
194 }
195 }
195 }
qml/Dash/GenericScopeView.qml+3−13
@@ -25,7 +25,7 @@ import "../Components/ListItems" as ListItems
25FocusScope {
25FocusScope {
26 id: scopeView
26 id: scopeView
27
27
28− readonly property bool departmentsShown: pageHeaderLoader.item ? pageHeaderLoader.item.bottomItem.showList : false
28+ readonly property bool navigationShown: pageHeaderLoader.item ? pageHeaderLoader.item.bottomItem.showList : false
29 property var scope: null
29 property var scope: null
30 property SortFilterProxyModel categories: categoryFilter
30 property SortFilterProxyModel categories: categoryFilter
31 property bool isCurrent: false
31 property bool isCurrent: false
@@ -44,16 +44,6 @@ FocusScope {
44
44
45 signal backClicked()
45 signal backClicked()
46
46
47− onScopeChanged: {
48− if (scope) {
49− scope.activateApplication.connect(activateApp);
50− }
51− }
52−
53− function activateApp(appId) {
54− Qt.openUrlExternally(appId);
55− }
56−
57 function positionAtBeginning() {
47 function positionAtBeginning() {
58 categoryView.positionAtBeginning()
48 categoryView.positionAtBeginning()
59 }
49 }
@@ -154,7 +144,7 @@ FocusScope {
154 model: scopeView.categories
144 model: scopeView.categories
155 forceNoClip: previewListView.open
145 forceNoClip: previewListView.open
156 pixelAligned: true
146 pixelAligned: true
157− interactive: !departmentsShown
147+ interactive: !navigationShown
158
148
159 property string expandedCategoryId: ""
149 property string expandedCategoryId: ""
160
150
@@ -427,7 +417,7 @@ FocusScope {
427 searchInProgress: scopeView.scope ? scopeView.scope.searchInProgress : false
417 searchInProgress: scopeView.scope ? scopeView.scope.searchInProgress : false
428 scopeStyle: scopeView.scopeStyle
418 scopeStyle: scopeView.scopeStyle
429
419
430− bottomItem: DashDepartments {
420+ bottomItem: DashNavigation {
431 scope: scopeView.scope
421 scope: scopeView.scope
432 width: parent.width <= units.gu(60) ? parent.width : units.gu(40)
422 width: parent.width <= units.gu(60) ? parent.width : units.gu(40)
433 anchors.right: parent.right
423 anchors.right: parent.right
qml/ScopeTool.qml+1−11
@@ -45,16 +45,6 @@ Rectangle {
45 signal searchClicked
45 signal searchClicked
46 }
46 }
47
47
48− SortFilterProxyModel {
49− id: filteredScopes
50− model: Scopes {
51− id: scopes
52− }
53− dynamicSortFilter: true
54−
55− filterRole: Scopes.RoleVisible
56− filterRegExp: RegExp("^true$")
57− }
58
48
59 Rectangle {
49 Rectangle {
60 anchors.fill: dashContent
50 anchors.fill: dashContent
@@ -72,8 +62,8 @@ Rectangle {
72 DashContent {
62 DashContent {
73 id: dashContent
63 id: dashContent
74
64
75− model: filteredScopes
76 property var scope: scopes.getScope(currentIndex)
65 property var scope: scopes.getScope(currentIndex)
66+ scopes: Scopes { }
77
67
78 anchors {
68 anchors {
79 top: parent.top
69 top: parent.top
tests/mocks/Unity/CMakeLists.txt+3−3
@@ -7,7 +7,7 @@ add_subdirectory(DashCommunicator)
7pkg_search_module(DEE dee-1.0 REQUIRED)
7pkg_search_module(DEE dee-1.0 REQUIRED)
8pkg_search_module(GOBJECT gobject-2.0 REQUIRED)
8pkg_search_module(GOBJECT gobject-2.0 REQUIRED)
9pkg_search_module(DEEQT libdee-qt5 REQUIRED)
9pkg_search_module(DEEQT libdee-qt5 REQUIRED)
10−pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=3)
10+pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=4)
11
11
12include_directories(
12include_directories(
13 ${CMAKE_CURRENT_BINARY_DIR}
13 ${CMAKE_CURRENT_BINARY_DIR}
@@ -24,14 +24,14 @@ set(UnityQML_SOURCES
24 fake_scopes.cpp
24 fake_scopes.cpp
25 fake_scopesoverview.cpp
25 fake_scopesoverview.cpp
26 fake_categories.cpp
26 fake_categories.cpp
27− fake_department.cpp
27+ fake_navigation.cpp
28 fake_resultsmodel.cpp
28 fake_resultsmodel.cpp
29 fake_previewmodel.cpp
29 fake_previewmodel.cpp
30 fake_previewstack.cpp
30 fake_previewstack.cpp
31 fake_previewwidgetmodel.cpp
31 fake_previewwidgetmodel.cpp
32 fake_unity_plugin.cpp
32 fake_unity_plugin.cpp
33 ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/CategoriesInterface.h
33 ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/CategoriesInterface.h
34− ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/DepartmentInterface.h
34+ ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/NavigationInterface.h
35 ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewModelInterface.h
35 ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewModelInterface.h
36 ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewStackInterface.h
36 ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewStackInterface.h
37 ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewWidgetModelInterface.h
37 ${SCOPES_API_INCLUDEDIR}/unity/shell/scopes/PreviewWidgetModelInterface.h
tests/mocks/Unity/Unity.qmltypes+79−27
@@ -24,6 +24,12 @@ Module {
24 Parameter { name: "categoryId"; type: "string" }
24 Parameter { name: "categoryId"; type: "string" }
25 Parameter { name: "json"; type: "string" }
25 Parameter { name: "json"; type: "string" }
26 }
26 }
27+ Method {
28+ name: "data"
29+ type: "QVariant"
30+ Parameter { name: "row"; type: "int" }
31+ Parameter { name: "role"; type: "int" }
32+ }
27 }
33 }
28 Component {
34 Component {
29 name: "PreviewModel"
35 name: "PreviewModel"
@@ -62,6 +68,10 @@ Module {
62 prototype: "unity::shell::scopes::ScopeInterface"
68 prototype: "unity::shell::scopes::ScopeInterface"
63 exports: ["Unity/MockScope 0.2"]
69 exports: ["Unity/MockScope 0.2"]
64 exportMetaObjectRevisions: [0]
70 exportMetaObjectRevisions: [0]
71+ Signal {
72+ name: "performQuery"
73+ Parameter { name: "query"; type: "string" }
74+ }
65 Method {
75 Method {
66 name: "setSearchInProgress"
76 name: "setSearchInProgress"
67 Parameter { name: "inProg"; type: "bool" }
77 Parameter { name: "inProg"; type: "bool" }
@@ -81,18 +91,21 @@ Module {
81 Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true }
91 Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true }
82 }
92 }
83 Method {
93 Method {
84− name: "getDepartment"
94+ name: "getNavigation"
85− type: "unity::shell::scopes::DepartmentInterface*"
95+ type: "unity::shell::scopes::NavigationInterface*"
86− Parameter { name: "id"; type: "string" }
96+ Parameter { name: "navigationId"; type: "string" }
87 }
97 }
88 Method {
98 Method {
89− name: "loadDepartment"
99+ name: "getAltNavigation"
100+ type: "unity::shell::scopes::NavigationInterface*"
90− Parameter { name: "id"; type: "string" }
101+ Parameter { name: "altNavigationId"; type: "string" }
91 }
102 }
92 Method {
103 Method {
93− name: "performQuery"
104+ name: "setNavigationState"
94− Parameter { name: "query"; type: "string" }
105+ Parameter { name: "navigationId"; type: "string" }
106+ Parameter { name: "isAltNavigation"; type: "bool" }
95 }
107 }
108+ Method { name: "refresh" }
96 }
109 }
97 Component {
110 Component {
98 name: "Scopes"
111 name: "Scopes"
@@ -137,6 +150,7 @@ Module {
137 "RoleRawRendererTemplate": 3,
150 "RoleRawRendererTemplate": 3,
138 "RoleRenderer": 4,
151 "RoleRenderer": 4,
139 "RoleComponents": 5,
152 "RoleComponents": 5,
153+ "RoleHeaderLink": 6,
140 "RoleResults": 7,
154 "RoleResults": 7,
141 "RoleCount": 8
155 "RoleCount": 8
142 }
156 }
@@ -157,27 +171,28 @@ Module {
157 }
171 }
158 }
172 }
159 Component {
173 Component {
160− name: "unity::shell::scopes::DepartmentInterface"
174+ name: "unity::shell::scopes::NavigationInterface"
161 prototype: "QAbstractListModel"
175 prototype: "QAbstractListModel"
162− exports: ["Unity/Department 0.2"]
176+ exports: ["Unity/Navigation 0.2"]
163 isCreatable: false
177 isCreatable: false
164 exportMetaObjectRevisions: [0]
178 exportMetaObjectRevisions: [0]
165 Enum {
179 Enum {
166 name: "Roles"
180 name: "Roles"
167 values: {
181 values: {
168− "RoleDepartmentId": 0,
182+ "RoleNavigationId": 0,
169 "RoleLabel": 1,
183 "RoleLabel": 1,
170 "RoleHasChildren": 2,
184 "RoleHasChildren": 2,
171 "RoleIsActive": 3
185 "RoleIsActive": 3
172 }
186 }
173 }
187 }
174− Property { name: "departmentId"; type: "string"; isReadonly: true }
188+ Property { name: "navigationId"; type: "string"; isReadonly: true }
175 Property { name: "label"; type: "string"; isReadonly: true }
189 Property { name: "label"; type: "string"; isReadonly: true }
176 Property { name: "allLabel"; type: "string"; isReadonly: true }
190 Property { name: "allLabel"; type: "string"; isReadonly: true }
177− Property { name: "parentDepartmentId"; type: "string"; isReadonly: true }
191+ Property { name: "parentNavigationId"; type: "string"; isReadonly: true }
178 Property { name: "parentLabel"; type: "string"; isReadonly: true }
192 Property { name: "parentLabel"; type: "string"; isReadonly: true }
179 Property { name: "loaded"; type: "bool"; isReadonly: true }
193 Property { name: "loaded"; type: "bool"; isReadonly: true }
180 Property { name: "isRoot"; type: "bool"; isReadonly: true }
194 Property { name: "isRoot"; type: "bool"; isReadonly: true }
195+ Property { name: "hidden"; type: "bool"; isReadonly: true }
181 Property { name: "count"; type: "int"; isReadonly: true }
196 Property { name: "count"; type: "int"; isReadonly: true }
182 }
197 }
183 Component {
198 Component {
@@ -247,7 +262,8 @@ Module {
247 "RoleEmblem": 8,
262 "RoleEmblem": 8,
248 "RoleSummary": 9,
263 "RoleSummary": 9,
249 "RoleAttributes": 10,
264 "RoleAttributes": 10,
250− "RoleBackground": 11
265+ "RoleBackground": 11,
266+ "RoleOverlayColor": 12
251 }
267 }
252 }
268 }
253 Property { name: "categoryId"; type: "string" }
269 Property { name: "categoryId"; type: "string" }
@@ -259,13 +275,22 @@ Module {
259 exports: ["Unity/Scope 0.2"]
275 exports: ["Unity/Scope 0.2"]
260 isCreatable: false
276 isCreatable: false
261 exportMetaObjectRevisions: [0]
277 exportMetaObjectRevisions: [0]
278+ Enum {
279+ name: "Status"
280+ values: {
281+ "Okay": 0,
282+ "NoInternet": 1,
283+ "NoLocationData": 2,
284+ "Unknown": 3
285+ }
286+ }
262 Property { name: "id"; type: "string"; isReadonly: true }
287 Property { name: "id"; type: "string"; isReadonly: true }
263 Property { name: "name"; type: "string"; isReadonly: true }
288 Property { name: "name"; type: "string"; isReadonly: true }
264 Property { name: "iconHint"; type: "string"; isReadonly: true }
289 Property { name: "iconHint"; type: "string"; isReadonly: true }
265 Property { name: "description"; type: "string"; isReadonly: true }
290 Property { name: "description"; type: "string"; isReadonly: true }
266 Property { name: "searchHint"; type: "string"; isReadonly: true }
291 Property { name: "searchHint"; type: "string"; isReadonly: true }
267 Property { name: "searchInProgress"; type: "bool"; isReadonly: true }
292 Property { name: "searchInProgress"; type: "bool"; isReadonly: true }
268− Property { name: "visible"; type: "bool"; isReadonly: true }
293+ Property { name: "favorite"; type: "bool" }
269 Property { name: "shortcut"; type: "string"; isReadonly: true }
294 Property { name: "shortcut"; type: "string"; isReadonly: true }
270 Property {
295 Property {
271 name: "categories"
296 name: "categories"
@@ -273,13 +298,27 @@ Module {
273 isReadonly: true
298 isReadonly: true
274 isPointer: true
299 isPointer: true
275 }
300 }
301+ Property {
302+ name: "settings"
303+ type: "unity::shell::scopes::SettingsModelInterface"
304+ isReadonly: true
305+ isPointer: true
306+ }
276 Property { name: "searchQuery"; type: "string" }
307 Property { name: "searchQuery"; type: "string" }
277 Property { name: "noResultsHint"; type: "string" }
308 Property { name: "noResultsHint"; type: "string" }
278 Property { name: "formFactor"; type: "string" }
309 Property { name: "formFactor"; type: "string" }
279 Property { name: "isActive"; type: "bool" }
310 Property { name: "isActive"; type: "bool" }
311+ Property { name: "currentNavigationId"; type: "string"; isReadonly: true }
312+ Property { name: "hasNavigation"; type: "bool"; isReadonly: true }
280− Property { name: "currentDepartmentId"; type: "string"; isReadonly: true }
313+ Property { name: "currentAltNavigationId"; type: "string"; isReadonly: true }
281− Property { name: "hasDepartments"; type: "bool"; isReadonly: true }
314+ Property { name: "hasAltNavigation"; type: "bool"; isReadonly: true }
282 Property { name: "customizations"; type: "QVariantMap"; isReadonly: true }
315 Property { name: "customizations"; type: "QVariantMap"; isReadonly: true }
316+ Property {
317+ name: "status"
318+ type: "unity::shell::scopes::ScopeInterface::Status"
319+ isReadonly: true
320+ }
321+ Signal { name: "detailsChanged" }
283 Signal { name: "showDash" }
322 Signal { name: "showDash" }
284 Signal { name: "hideDash" }
323 Signal { name: "hideDash" }
285 Signal {
324 Signal {
@@ -298,10 +337,6 @@ Module {
298 name: "openScope"
337 name: "openScope"
299 Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true }
338 Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true }
300 }
339 }
301− Signal {
302− name: "activateApplication"
303− Parameter { name: "desktop"; type: "string" }
304− }
305 Method {
340 Method {
306 name: "activate"
341 name: "activate"
307 Parameter { name: "result"; type: "QVariant" }
342 Parameter { name: "result"; type: "QVariant" }
@@ -317,14 +352,25 @@ Module {
317 Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true }
352 Parameter { name: "scope"; type: "unity::shell::scopes::ScopeInterface"; isPointer: true }
318 }
353 }
319 Method {
354 Method {
320− name: "getDepartment"
355+ name: "getNavigation"
321− type: "unity::shell::scopes::DepartmentInterface*"
356+ type: "unity::shell::scopes::NavigationInterface*"
322− Parameter { name: "departmentId"; type: "string" }
357+ Parameter { name: "navigationId"; type: "string" }
358+ }
359+ Method {
360+ name: "getAltNavigation"
361+ type: "unity::shell::scopes::NavigationInterface*"
362+ Parameter { name: "altNavigationId"; type: "string" }
323 }
363 }
324 Method {
364 Method {
325− name: "loadDepartment"
365+ name: "setNavigationState"
326− Parameter { name: "departmentId"; type: "string" }
366+ Parameter { name: "navId"; type: "string" }
367+ Parameter { name: "altNavigation"; type: "bool" }
327 }
368 }
369+ Method {
370+ name: "performQuery"
371+ Parameter { name: "cannedQuery"; type: "string" }
372+ }
373+ Method { name: "refresh" }
328 }
374 }
329 Component {
375 Component {
330 name: "unity::shell::scopes::ScopesInterface"
376 name: "unity::shell::scopes::ScopesInterface"
@@ -334,11 +380,17 @@ Module {
334 values: {
380 values: {
335 "RoleScope": 0,
381 "RoleScope": 0,
336 "RoleId": 1,
382 "RoleId": 1,
337− "RoleVisible": 2,
338− "RoleTitle": 3
383+ "RoleTitle": 2
339 }
384 }
340 }
385 }
341 Property { name: "loaded"; type: "bool"; isReadonly: true }
386 Property { name: "loaded"; type: "bool"; isReadonly: true }
387+ Property { name: "count"; type: "int"; isReadonly: true }
388+ Property {
389+ name: "overviewScope"
390+ type: "unity::shell::scopes::ScopeInterface"
391+ isReadonly: true
392+ isPointer: true
393+ }
342 Method {
394 Method {
343 name: "getScope"
395 name: "getScope"
344 type: "unity::shell::scopes::ScopeInterface*"
396 type: "unity::shell::scopes::ScopeInterface*"
tests/mocks/Unity/fake_department.cpp → tests/mocks/Unity/fake_navigation.cpprenamed+32−40
@@ -14,14 +14,15 @@
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/>.
15 */
15 */
16
16
17−#include "fake_department.h"
17+#include "fake_navigation.h"
18
18
19#include "fake_scope.h"
19#include "fake_scope.h"
20
20
21+#include <QDebug>
21#include <QTimer>
22#include <QTimer>
22
23
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)
24− : m_departmentId(departmentId)
25+ : m_navigationId(navigationId)
25 , m_label(label)
26 , m_label(label)
26 , m_allLabel(allLabel)
27 , m_allLabel(allLabel)
27 , m_parentId(parentId)
28 , m_parentId(parentId)
@@ -30,96 +31,87 @@ Department::Department(const QString& departmentId, const QString& label, const
30 , m_scope(scope)
31 , m_scope(scope)
31{
32{
32 QTimer::singleShot(1500, this, SLOT(slotLoaded()));
33 QTimer::singleShot(1500, this, SLOT(slotLoaded()));
33− connect(scope, SIGNAL(currentDepartmentIdChanged()), this, SLOT(slotCurrentDepartmentChanged()));
34+ connect(scope, SIGNAL(currentNavigationIdChanged()), this, SLOT(slotCurrentNavigationChanged()));
34}
35}
35
36
36−QString Department::departmentId() const
37+QString Navigation::navigationId() const
37{
38{
38− return m_departmentId;
39+ return m_navigationId;
39}
40}
40
41
41−QString Department::label() const
42+QString Navigation::label() const
42{
43{
43 return m_label;
44 return m_label;
44}
45}
45
46
46−QString Department::allLabel() const
47+QString Navigation::allLabel() const
47{
48{
48 return m_allLabel;
49 return m_allLabel;
49}
50}
50
51
51−QString Department::parentDepartmentId() const
52+QString Navigation::parentNavigationId() const
52{
53{
53 return m_parentId;
54 return m_parentId;
54}
55}
55
56
56−QString Department::parentLabel() const
57+QString Navigation::parentLabel() const
57{
58{
58 return m_parentLabel;
59 return m_parentLabel;
59}
60}
60
61
61−void Department::slotLoaded()
62+void Navigation::slotLoaded()
62{
63{
63 m_loaded = true;
64 m_loaded = true;
64 Q_EMIT loadedChanged();
65 Q_EMIT loadedChanged();
65}
66}
66
67
67−bool Department::loaded() const
68+bool Navigation::loaded() const
68{
69{
69 return m_loaded;
70 return m_loaded;
70}
71}
71
72
72−int Department::count() const
73+int Navigation::count() const
73{
74{
74 return rowCount();
75 return rowCount();
75}
76}
76
77
77−bool Department::isRoot() const
78+bool Navigation::isRoot() const
78{
79{
79− return m_departmentId == "root";
80+ return m_navigationId == "root" || m_navigationId == "altroot";
80}
81}
81
82
82−int Department::rowCount(const QModelIndex & /*parent*/) const
83+bool Navigation::hidden() const
83{
84{
84− if (!m_loaded || m_departmentId.startsWith("child") || m_departmentId == "middle3")
85+ return m_navigationId == "altroot";
85− return 0;
86− else
87− return 8;
88}
86}
89
87
90−QHash<int, QByteArray> Department::roleNames() const
88+int Navigation::rowCount(const QModelIndex & /*parent*/) const
91{
89{
92− QHash<int, QByteArray> res;
90+ if (!m_loaded || m_navigationId.startsWith("child") || m_navigationId == "middle3")
93− res[RoleDepartmentId] = "departmentId";
91+ return 0;
94− res[RoleLabel] = "label";
92+ else
95− res[RoleHasChildren] = "hasChildren";
96− res[RoleIsActive] = "isActive";
97− return res;
93+ return 8;
98}
94}
99
95
100−QVariant Department::data(const QModelIndex &index, int role) const
96+QVariant Navigation::data(const QModelIndex &index, int role) const
101{
97{
102 switch (role) {
98 switch (role) {
103− case RoleDepartmentId:
99+ case RoleNavigationId:
104− if (m_departmentId == "root")
100+ if (m_navigationId == "root")
105 return QString("middle%1").arg(index.row());
101 return QString("middle%1").arg(index.row());
106− else if (m_departmentId.startsWith("middle"))
102+ else if (m_navigationId.startsWith("middle"))
107− return QString("child%1%2").arg(m_departmentId).arg(index.row());
103+ return QString("child%1%2").arg(m_navigationId).arg(index.row());
108− break;
109 case RoleLabel:
104 case RoleLabel:
110− return QString("%1Child%2").arg(m_departmentId).arg(index.row());
105+ return QString("%1Child%2").arg(m_navigationId).arg(index.row());
111− break;
112 case RoleHasChildren:
106 case RoleHasChildren:
113− return m_departmentId == "root" && index.row() != 3;
107+ return m_navigationId == "root" && index.row() != 3;
114− break;
115 case RoleIsActive:
108 case RoleIsActive:
116− return m_scope->currentDepartmentId() == data(index, RoleDepartmentId);
109+ return m_scope->currentNavigationId() == data(index, RoleNavigationId);
117− break;
118 }
110 }
119 return QVariant();
111 return QVariant();
120}
112}
121
113
122−void Department::slotCurrentDepartmentChanged()
114+void Navigation::slotCurrentNavigationChanged()
123{
115{
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
125 // deparment, but this is a mock, so no need to optimize
117 // deparment, but this is a mock, so no need to optimize
tests/mocks/Unity/fake_department.h → tests/mocks/Unity/fake_navigation.hrenamed+13−13
@@ -14,48 +14,48 @@
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/>.
15 */
15 */
16
16
17−#ifndef FAKE_DEPARTMENT_H
17+#ifndef FAKE_NAVIGATION_H
18−#define FAKE_DEPARTMENT_H
18+#define FAKE_NAVIGATION_H
19
19
20−#include <unity/shell/scopes/DepartmentInterface.h>
20+#include <unity/shell/scopes/NavigationInterface.h>
21
21
22class Scope;
22class Scope;
23
23
24−class Department : public unity::shell::scopes::DepartmentInterface
24+class Navigation : public unity::shell::scopes::NavigationInterface
25{
25{
26 Q_OBJECT
26 Q_OBJECT
27
27
28public:
28public:
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);
30
30
31− QString departmentId() const override;
31+ QString navigationId() const override;
32 QString label() const override;
32 QString label() const override;
33 QString allLabel() const override;
33 QString allLabel() const override;
34− QString parentDepartmentId() const override;
34+ QString parentNavigationId() const override;
35 QString parentLabel() const override;
35 QString parentLabel() const override;
36 bool loaded() const override;
36 bool loaded() const override;
37− int count() const override;
38 bool isRoot() const override;
37 bool isRoot() const override;
38+ bool hidden() const override;
39+ int count() const override;
39
40
40 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
41 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
41− QHash<int, QByteArray> roleNames() const;
42 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
42 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
43
43
44public Q_SLOTS:
44public Q_SLOTS:
45− void slotCurrentDepartmentChanged();
45+ void slotCurrentNavigationChanged();
46
46
47private Q_SLOTS:
47private Q_SLOTS:
48 void slotLoaded();
48 void slotLoaded();
49
49
50private:
50private:
51− QString m_departmentId;
51+ QString m_navigationId;
52 QString m_label;
52 QString m_label;
53 QString m_allLabel;
53 QString m_allLabel;
54 QString m_parentId;
54 QString m_parentId;
55 QString m_parentLabel;
55 QString m_parentLabel;
56 bool m_loaded;
56 bool m_loaded;
57− QString m_currentDepartment;
57+ QString m_currentNavigation;
58 Scope *m_scope;
58 Scope *m_scope;
59};
59};
60
60
61−#endif // FAKE_DEPARTMENT_H
61+#endif // FAKE_NAVIGATION_H
tests/mocks/Unity/fake_scope.cpp+64−17
@@ -19,7 +19,7 @@
19
19
20#include "fake_scope.h"
20#include "fake_scope.h"
21
21
22−#include "fake_department.h"
22+include "fake_navigation.h"
23#include "fake_resultsmodel.h"
23#include "fake_resultsmodel.h"
24#include "fake_scopes.h"
24#include "fake_scopes.h"
25
25
@@ -27,14 +27,15 @@ Scope::Scope(Scopes* parent) : Scope(QString(), QString(), false, parent)
27{
27{
28}
28}
29
29
30−Scope::Scope(QString const& id, QString const& name, bool visible, Scopes* parent, int categories)
30+Scope::Scope(QString const& id, QString const& name, bool favorite, Scopes* parent, int categories)
31 : unity::shell::scopes::ScopeInterface(parent)
31 : unity::shell::scopes::ScopeInterface(parent)
32 , m_id(id)
32 , m_id(id)
33 , m_name(name)
33 , m_name(name)
34− , m_visible(visible)
35 , m_searching(false)
34 , m_searching(false)
35+ , m_favorite(favorite)
36 , m_isActive(false)
36 , m_isActive(false)
37− , m_currentDeparment("root")
37+ , m_currentNavigationId("root")
38+ , m_currentAltNavigationId("altroot")
38 , m_previewRendererName("preview-generic")
39 , m_previewRendererName("preview-generic")
39 , m_categories(new Categories(categories, this))
40 , m_categories(new Categories(categories, this))
40 , m_openScope(nullptr)
41 , m_openScope(nullptr)
@@ -81,6 +82,11 @@ bool Scope::searchInProgress() const
81 return m_searching;
82 return m_searching;
82}
83}
83
84
85+bool Scope::favorite() const
86+{
87+ return m_favorite;
88+}
89+
84unity::shell::scopes::CategoriesInterface* Scope::categories() const
90unity::shell::scopes::CategoriesInterface* Scope::categories() const
85{
91{
86 return m_categories;
92 return m_categories;
@@ -101,11 +107,6 @@ QString Scope::formFactor() const
101 return m_formFactor;
107 return m_formFactor;
102}
108}
103
109
104−bool Scope::visible() const
105−{
106− return m_visible;
107−}
108−
109bool Scope::isActive() const
110bool Scope::isActive() const
110{
111{
111 return m_isActive;
112 return m_isActive;
@@ -135,6 +136,13 @@ void Scope::setActive(const bool active)
135 }
136 }
136}
137}
137
138
139+void Scope::setFavorite(const bool favorite)
140+{
141+ if (favorite != m_favorite) {
142+ m_favorite = favorite;
143+ Q_EMIT favoriteChanged();
144+ }
145+}
138void Scope::setSearchInProgress(const bool inProg)
146void Scope::setSearchInProgress(const bool inProg)
139{
147{
140 if (inProg != m_searching) {
148 if (inProg != m_searching) {
@@ -183,16 +191,31 @@ void Scope::closeScope(unity::shell::scopes::ScopeInterface* scope)
183 m_openScope = nullptr;
191 m_openScope = nullptr;
184}
192}
185
193
186−QString Scope::currentDepartmentId() const
194+QString Scope::currentNavigationId() const
195+{
196+ return m_currentNavigationId;
197+}
198+
199+bool Scope::hasNavigation() const
200+{
201+ return true;
202+}
203+
204+QString Scope::currentAltNavigationId() const
187{
205{
188− return m_currentDeparment;
206+ return m_currentAltNavigationId;
189}
207}
190
208
191−bool Scope::hasDepartments() const
209+bool Scope::hasAltNavigation() const
192{
210{
193 return true;
211 return true;
194}
212}
195
213
214+Scope::Status Scope::status() const
215+{
216+ return Status::Okay;
217+}
218+
196QVariantMap Scope::customizations() const
219QVariantMap Scope::customizations() const
197{
220{
198 QVariantMap m, h;
221 QVariantMap m, h;
@@ -209,7 +232,12 @@ QVariantMap Scope::customizations() const
209 return m;
232 return m;
210}
233}
211
234
235+void Scope::refresh()
236+{
237+ qDebug() << "Scope::refresh is currently not implmented in the fake scopes plugin";
238+}
239+
212−unity::shell::scopes::DepartmentInterface* Scope::getDepartment(const QString& id)
240+unity::shell::scopes::NavigationInterface* Scope::getNavigation(const QString& id)
213{
241{
214 if (id.isEmpty())
242 if (id.isEmpty())
215 return nullptr;
243 return nullptr;
@@ -223,11 +251,30 @@ unity::shell::scopes::DepartmentInterface* Scope::getDepartment(const QString& i
223 parentId = id.mid(5, 7);
251 parentId = id.mid(5, 7);
224 parentLabel = parentId;
252 parentLabel = parentId;
225 }
253 }
254+ return new Navigation(id, id, "all"+id, parentId, parentLabel, this);
255+}
256+
257+unity::shell::scopes::NavigationInterface* Scope::getAltNavigation(QString const& id)
258+{
259+ if (id.isEmpty())
260+ return nullptr;
261+
262+ QString parentId;
263+ QString parentLabel;
264+ if (id.startsWith("altmiddle")) {
265+ parentId = "altroot";
266+ parentLabel = "altroot";
267+ }
226− return new Department(id, id, "all"+id, parentId, parentLabel, this);
268+ return new Navigation(id, id, "all"+id, parentId, parentLabel, this);
227}
269}
228
270
229−void Scope::loadDepartment(const QString& id)
271+void Scope::setNavigationState(const QString &navigationId, bool isAltNavigation)
230{
272{
231− m_currentDeparment = id;
273+ if (isAltNavigation) {
232− Q_EMIT currentDepartmentIdChanged();
274+ m_currentAltNavigationId = navigationId;
275+ Q_EMIT currentAltNavigationIdChanged();
276+ } else {
277+ m_currentNavigationId = navigationId;
278+ Q_EMIT currentNavigationIdChanged();
279+ }
233}
280}
tests/mocks/Unity/fake_scope.h+17−9
@@ -31,8 +31,8 @@ class Scope : public unity::shell::scopes::ScopeInterface
31 Q_OBJECT
31 Q_OBJECT
32
32
33public:
33public:
34− Scope(Scopes* parent = 0);
34+ Scope(QObject* parent = 0);
35− Scope(QString const& id, QString const& name, bool visible, Scopes* parent = 0, int categories = 20);
35+ Scope(QString const& id, QString const& name, bool favorite, Scopes* parent = 0, int categories = 20);
36
36
37 /* getters */
37 /* getters */
38 QString id() const override;
38 QString id() const override;
@@ -40,9 +40,9 @@ public:
40 QString iconHint() const override;
40 QString iconHint() const override;
41 QString description() const override;
41 QString description() const override;
42 QString searchHint() const override;
42 QString searchHint() const override;
43− bool visible() const override;
44 QString shortcut() const override;
43 QString shortcut() const override;
45 bool searchInProgress() const override;
44 bool searchInProgress() const override;
45+ bool favorite() const override;
46 unity::shell::scopes::CategoriesInterface* categories() const override;
46 unity::shell::scopes::CategoriesInterface* categories() const override;
47 QString searchQuery() const override;
47 QString searchQuery() const override;
48 QString noResultsHint() const override;
48 QString noResultsHint() const override;
@@ -55,6 +55,7 @@ public:
55 void setNoResultsHint(const QString& hint) override;
55 void setNoResultsHint(const QString& hint) override;
56 void setFormFactor(const QString& form_factor) override;
56 void setFormFactor(const QString& form_factor) override;
57 void setActive(const bool) override;
57 void setActive(const bool) override;
58+ void setFavorite(const bool) override;
58 Q_INVOKABLE void setSearchInProgress(const bool inProg); // This is not invokable in the Interface, here for testing benefits
59 Q_INVOKABLE void setSearchInProgress(const bool inProg); // This is not invokable in the Interface, here for testing benefits
59
60
60 Q_INVOKABLE void activate(QVariant const& result) override;
61 Q_INVOKABLE void activate(QVariant const& result) override;
@@ -62,14 +63,20 @@ public:
62 Q_INVOKABLE void cancelActivation() override;
63 Q_INVOKABLE void cancelActivation() override;
63 Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override;
64 Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override;
64
65
65− QString currentDepartmentId() const override;
66+ QString currentNavigationId() const override;
66− bool hasDepartments() const override;
67+ bool hasNavigation() const override;
67− Q_INVOKABLE unity::shell::scopes::DepartmentInterface* getDepartment(const QString& id) override;
68+ QString currentAltNavigationId() const override;
69+ bool hasAltNavigation() const override;
70+ Q_INVOKABLE unity::shell::scopes::NavigationInterface* getNavigation(QString const& navigationId) override;
71+ Q_INVOKABLE unity::shell::scopes::NavigationInterface* getAltNavigation(QString const& altNavigationId) override;
68− Q_INVOKABLE void loadDepartment(const QString& id) override;
72+ Q_INVOKABLE void setNavigationState(const QString &navigationId, bool isAltNavigation) override;
69 Q_SIGNAL void performQuery(const QString& query) override;
73 Q_SIGNAL void performQuery(const QString& query) override;
70
74
75+ Status status() const override;
71 QVariantMap customizations() const override;
76 QVariantMap customizations() const override;
72
77
78+ Q_INVOKABLE void refresh() override;
79+
73protected:
80protected:
74
81
75 QString m_id;
82 QString m_id;
@@ -79,10 +86,11 @@ protected:
79 QString m_searchQuery;
86 QString m_searchQuery;
80 QString m_noResultsHint;
87 QString m_noResultsHint;
81 QString m_formFactor;
88 QString m_formFactor;
82− bool m_visible;
83 bool m_searching;
89 bool m_searching;
90+ bool m_favorite;
84 bool m_isActive;
91 bool m_isActive;
85− QString m_currentDeparment;
92+ QString m_currentNavigationId;
93+ QString m_currentAltNavigationId;
86
94
87 QString m_previewRendererName;
95 QString m_previewRendererName;
88
96
tests/mocks/Unity/fake_scopes.cpp+10−2
@@ -34,6 +34,11 @@ Scopes::Scopes(QObject *parent)
34 timer.setSingleShot(true);
34 timer.setSingleShot(true);
35 timer.setInterval(100);
35 timer.setInterval(100);
36 QObject::connect(&timer, SIGNAL(timeout()), this, SLOT(updateScopes()));
36 QObject::connect(&timer, SIGNAL(timeout()), this, SLOT(updateScopes()));
37+
38+ QObject::connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
39+ QObject::connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
40+ QObject::connect(this, SIGNAL(modelReset()), this, SIGNAL(countChanged()));
41+
37 load();
42 load();
38}
43}
39
44
@@ -103,8 +108,6 @@ QVariant Scopes::data(const QModelIndex& index, int role) const
103 return QVariant::fromValue(scope);
108 return QVariant::fromValue(scope);
104 } else if (role == Scopes::RoleId) {
109 } else if (role == Scopes::RoleId) {
105 return QVariant::fromValue(scope->id());
110 return QVariant::fromValue(scope->id());
106− } else if (role == Scopes::RoleVisible) {
107− return QVariant::fromValue(scope->visible());
108 } else if (role == Scopes::RoleTitle) {
111 } else if (role == Scopes::RoleTitle) {
109 return QVariant::fromValue(scope->name());
112 return QVariant::fromValue(scope->name());
110 } else {
113 } else {
@@ -150,6 +153,11 @@ bool Scopes::loaded() const
150 return m_loaded;
153 return m_loaded;
151}
154}
152
155
156+int Scopes::count() const
157+{
158+ return rowCount();
159+}
160+
153unity::shell::scopes::ScopeInterface* Scopes::overviewScope() const
161unity::shell::scopes::ScopeInterface* Scopes::overviewScope() const
154{
162{
155 return m_scopesOverview;
163 return m_scopesOverview;
tests/mocks/Unity/fake_scopes.h+1
@@ -50,6 +50,7 @@ public:
50 QModelIndex parent ( const QModelIndex & index ) const;
50 QModelIndex parent ( const QModelIndex & index ) const;
51
51
52 bool loaded() const override;
52 bool loaded() const override;
53+ int count() const override;
53 unity::shell::scopes::ScopeInterface* overviewScope() const override;
54 unity::shell::scopes::ScopeInterface* overviewScope() const override;
54
55
55 // This is used as part of implementation of the other C++ code, not API
56 // This is used as part of implementation of the other C++ code, not API
tests/mocks/Unity/fake_unity_plugin.cpp+2−2
@@ -22,7 +22,7 @@
22// local
22// local
23#include "fake_scopes.h"
23#include "fake_scopes.h"
24#include "fake_categories.h"
24#include "fake_categories.h"
25−#include "fake_department.h"
25+#include "fake_navigation.h"
26#include "fake_previewmodel.h"
26#include "fake_previewmodel.h"
27#include "fake_previewwidgetmodel.h"
27#include "fake_previewwidgetmodel.h"
28#include "fake_resultsmodel.h"
28#include "fake_resultsmodel.h"
@@ -43,7 +43,7 @@ void FakeUnityPlugin::registerTypes(const char *uri)
43 qmlRegisterType<Scopes>(uri, 0, 2, "Scopes");
43 qmlRegisterType<Scopes>(uri, 0, 2, "Scopes");
44 qmlRegisterType<Scope>(uri, 0, 2, "MockScope");
44 qmlRegisterType<Scope>(uri, 0, 2, "MockScope");
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.");
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.");
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.");
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.");
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.");
tests/qmltests/Dash/tst_Dash.qml+4−8
@@ -62,10 +62,10 @@ Item {
62
62
63 function get_scope_data() {
63 function get_scope_data() {
64 return [
64 return [
65− { tag: "MockScope1", visualIndex: 0, shouldBeVisible: true },
65+ { tag: "MockScope1", visualIndex: 0 },
66− { tag: "MockScope2", visualIndex: -1, shouldBeVisible: false },
66+ { tag: "MockScope2", visualIndex: 1 },
67− { tag: "clickscope", visualIndex: 1, shouldBeVisible: true },
67+ { tag: "clickscope", visualIndex: 2 },
68− { tag: "MockScope5", visualIndex: 2, shouldBeVisible: true },
68+ { tag: "MockScope5", visualIndex: 3 },
69 ]
69 ]
70 }
70 }
71
71
@@ -74,10 +74,6 @@ Item {
74 }
74 }
75
75
76 function test_show_scope_on_load(data) {
76 function test_show_scope_on_load(data) {
77− if (data.shouldBeVisible == false) {
78− console.log("Not testing " + data.tag + ": not visible");
79− return;
80− }
81 var dashContentList = findChild(dash, "dashContentList");
77 var dashContentList = findChild(dash, "dashContentList");
82
78
83 dash.showScopeOnLoaded = data.tag
79 dash.showScopeOnLoaded = data.tag
tests/qmltests/Dash/tst_DashContent.qml+93−96
@@ -43,9 +43,6 @@ Item {
43 id: dashContent
43 id: dashContent
44 anchors.fill: parent
44 anchors.fill: parent
45
45
46− model: SortFilterProxyModel {
47− model: scopesModel
48− }
49 scopes : scopesModel
46 scopes : scopesModel
50 }
47 }
51
48
@@ -269,119 +266,119 @@ Item {
269 verify(carouselLV.tileWidth / carouselLV.tileHeight == cardTool.components["art"]["aspect-ratio"]);
266 verify(carouselLV.tileWidth / carouselLV.tileHeight == cardTool.components["art"]["aspect-ratio"]);
270 }
267 }
271
268
272− function test_departments() {
269+ function test_navigations() {
273 var dashContentList = findChild(dashContent, "dashContentList");
270 var dashContentList = findChild(dashContent, "dashContentList");
274− tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashDepartments") != null; }, true);
271+ tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
275− var dashDepartments = findChild(dashContentList.currentItem, "dashDepartments");
272+ var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
276− tryCompare(dashDepartments, "visible", true);
273+ tryCompare(dashNavigation, "visible", true);
277− compare(dashDepartments.showList, false);
274+ compare(dashNavigation.showList, false);
278− waitForRendering(dashDepartments);
275+ waitForRendering(dashNavigation);
279− mouseClick(dashDepartments, 0, 0);
276+ mouseClick(dashNavigation, 0, 0);
280− compare(dashDepartments.showList, true);
277+ compare(dashNavigation.showList, true);
281−
278+
282− var departmentListView = findChild(dashDepartments, "departmentListView");
279+ var navigationListView = findChild(dashNavigation, "navigationListView");
283− compare(departmentListView.count, 1);
280+ compare(navigationListView.count, 1);
284− tryCompare(departmentListView.currentItem.department, "loaded", true);
281+ tryCompare(navigationListView.currentItem.navigation, "loaded", true);
285−
282+
286− waitForRendering(departmentListView);
283+ waitForRendering(navigationListView);
287− waitForRendering(departmentListView.currentItem);
284+ waitForRendering(navigationListView.currentItem);
288−
285+
289− var allButton = findChild(dashDepartments, "allButton");
286+ var allButton = findChild(dashNavigation, "allButton");
290 compare(allButton.visible, false);
287 compare(allButton.visible, false);
291
288
292− var department = findChild(dashDepartments, "department0child3");
289+ var navigation = findChild(dashNavigation, "navigation0child3");
293− mouseClick(department, 0, 0);
290+ mouseClick(navigation, 0, 0);
294− compare(dashDepartments.showList, false);
291+ compare(dashNavigation.showList, false);
295− tryCompare(dashDepartments.currentDepartment, "departmentId", "middle3");
292+ tryCompare(dashNavigation.currentNavigation, "navigationId", "middle3");
296− tryCompare(departmentListView.currentItem.department, "departmentId", "root");
293+ tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
297
294
298− mouseClick(dashDepartments, 0, 0);
295+ mouseClick(dashNavigation, 0, 0);
299− compare(dashDepartments.showList, true);
296+ compare(dashNavigation.showList, true);
300− waitForRendering(departmentListView);
297+ waitForRendering(navigationListView);
301− waitForRendering(departmentListView.currentItem);
298+ waitForRendering(navigationListView.currentItem);
302 compare(allButton.visible, true);
299 compare(allButton.visible, true);
303
300
304 mouseClick(allButton, 0, 0);
301 mouseClick(allButton, 0, 0);
305− compare(dashDepartments.showList, false);
302+ compare(dashNavigation.showList, false);
306− tryCompare(dashDepartments.currentDepartment, "departmentId", "root");
303+ tryCompare(dashNavigation.currentNavigation, "navigationId", "root");
307− tryCompare(departmentListView.currentItem.department, "departmentId", "root");
304+ tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
308−
305+
309− mouseClick(dashDepartments, 0, 0);
306+ mouseClick(dashNavigation, 0, 0);
310− compare(dashDepartments.showList, true);
307+ compare(dashNavigation.showList, true);
311− waitForRendering(departmentListView);
308+ waitForRendering(navigationListView);
312− waitForRendering(departmentListView.currentItem);
309+ waitForRendering(navigationListView.currentItem);
313 compare(allButton.visible, false);
310 compare(allButton.visible, false);
314
311
315− department = findChild(dashDepartments, "department0child2");
312+ navigation = findChild(dashNavigation, "navigation0child2");
316− mouseClick(department, 0, 0);
313+ mouseClick(navigation, 0, 0);
317− compare(dashDepartments.showList, true);
314+ compare(dashNavigation.showList, true);
318− tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2");
315+ tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2");
319− tryCompare(departmentListView.currentItem.department, "departmentId", "middle2");
316+ tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
320
317
321− var departmentList1 = findChild(dashDepartments, "department1");
318+ var navigationList1 = findChild(dashNavigation, "navigation1");
322− allButton = findChild(departmentList1, "allButton");
319+ allButton = findChild(navigationList1, "allButton");
323− var backButton = findChild(findChild(departmentList1, "department1"), "backButton");
320+ var backButton = findChild(findChild(navigationList1, "navigation1"), "backButton");
324 compare(allButton.visible, true);
321 compare(allButton.visible, true);
325 compare(backButton.visible, true);
322 compare(backButton.visible, true);
326
323
327− tryCompare(departmentListView, "contentX", departmentList1.x);
324+ tryCompare(navigationListView, "contentX", navigationList1.x);
328− waitForRendering(departmentListView);
325+ waitForRendering(navigationListView);
329 mouseClick(allButton, 0, 0);
326 mouseClick(allButton, 0, 0);
330− compare(dashDepartments.showList, false);
327+ compare(dashNavigation.showList, false);
331− tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2");
328+ tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2");
332− tryCompare(departmentListView.currentItem.department, "departmentId", "middle2");
329+ tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
333−
330+
334− mouseClick(dashDepartments, 0, 0);
331+ mouseClick(dashNavigation, 0, 0);
335− compare(dashDepartments.showList, true);
332+ compare(dashNavigation.showList, true);
336− waitForRendering(departmentListView);
333+ waitForRendering(navigationListView);
337− waitForRendering(departmentListView.currentItem);
334+ waitForRendering(navigationListView.currentItem);
338 compare(allButton.visible, true);
335 compare(allButton.visible, true);
339 compare(backButton.visible, true);
336 compare(backButton.visible, true);
340
337
341− tryCompare(departmentList1.department, "loaded", true);
338+ tryCompare(navigationList1.navigation, "loaded", true);
342− department = findChild(dashDepartments, "department1child2");
339+ navigation = findChild(dashNavigation, "navigation1child2");
343− mouseClick(department, 0, 0);
340+ mouseClick(navigation, 0, 0);
344− compare(dashDepartments.showList, false);
341+ compare(dashNavigation.showList, false);
345− tryCompare(dashDepartments.currentDepartment, "departmentId", "childmiddle22");
342+ tryCompare(dashNavigation.currentNavigation, "navigationId", "childmiddle22");
346− tryCompare(departmentListView.currentItem.department, "departmentId", "middle2");
343+ tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
347−
344+
348− mouseClick(dashDepartments, 0, 0);
345+ mouseClick(dashNavigation, 0, 0);
349− compare(dashDepartments.showList, true);
346+ compare(dashNavigation.showList, true);
350− waitForRendering(departmentListView);
347+ waitForRendering(navigationListView);
351− waitForRendering(departmentListView.currentItem);
348+ waitForRendering(navigationListView.currentItem);
352−
349+
353− tryCompare(departmentList1.department, "loaded", true);
350+ tryCompare(navigationList1.navigation, "loaded", true);
354− department = findChild(dashDepartments, "department1child3");
351+ navigation = findChild(dashNavigation, "navigation1child3");
355− mouseClick(department, 0, 0);
352+ mouseClick(navigation, 0, 0);
356− compare(dashDepartments.showList, false);
353+ compare(dashNavigation.showList, false);
357− tryCompare(dashDepartments.currentDepartment, "departmentId", "childmiddle23");
354+ tryCompare(dashNavigation.currentNavigation, "navigationId", "childmiddle23");
358− tryCompare(departmentListView.currentItem.department, "departmentId", "middle2");
355+ tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
359−
356+
360− mouseClick(dashDepartments, 0, 0);
357+ mouseClick(dashNavigation, 0, 0);
361− compare(dashDepartments.showList, true);
358+ compare(dashNavigation.showList, true);
362− waitForRendering(departmentListView);
359+ waitForRendering(navigationListView);
363− waitForRendering(departmentListView.currentItem);
360+ waitForRendering(navigationListView.currentItem);
364 mouseClick(backButton, 0, 0);
361 mouseClick(backButton, 0, 0);
365
362
366− tryCompare(dashDepartments.currentDepartment, "departmentId", "root");
363+ tryCompare(dashNavigation.currentNavigation, "navigationId", "root");
367− tryCompare(departmentListView.currentItem.department, "departmentId", "root");
364+ tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
368− compare(dashDepartments.showList, true);
365+ compare(dashNavigation.showList, true);
369− mouseClick(dashDepartments, 0, 0);
366+ mouseClick(dashNavigation, 0, 0);
370− compare(dashDepartments.showList, false);
367+ compare(dashNavigation.showList, false);
371−
368+
372− mouseClick(dashDepartments, 0, 0);
369+ mouseClick(dashNavigation, 0, 0);
373− compare(dashDepartments.showList, true);
370+ compare(dashNavigation.showList, true);
374− tryCompare(departmentListView.currentItem.department, "loaded", true);
371+ tryCompare(navigationListView.currentItem.navigation, "loaded", true);
375− department = findChild(dashDepartments, "department0child2");
372+ navigation = findChild(dashNavigation, "navigation0child2");
376− mouseClick(department, 0, 0);
373+ mouseClick(navigation, 0, 0);
377− compare(dashDepartments.showList, true);
374+ compare(dashNavigation.showList, true);
378− departmentList1 = findChild(dashDepartments, "department1");
375+ navigationList1 = findChild(dashNavigation, "navigation1");
379− compare(departmentList1.department.loaded, false);
376+ compare(navigationList1.navigation.loaded, false);
380− tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2");
377+ tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2");
381− allButton = findChild(departmentList1, "allButton");
378+ allButton = findChild(navigationList1, "allButton");
382− tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2");
379+ tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2");
383 mouseClick(allButton, 0, 0);
380 mouseClick(allButton, 0, 0);
384− tryCompare(dashDepartments.currentDepartment, "departmentId", "middle2");
381+ tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2");
385 }
382 }
386 }
383 }
387}
384}