on xenial help sign in
Use full DashContent, not just GenericScopeView in ScopeTool.qml.

Approved by PS Jenkins bot, Albert Astals Cid.

commiteb43f0e240e299818ceb41367e76f03d24eec2e0 authorMichał Sawicz <michal.sawicz@canonical.com> dateFri 10 Jan 2014, 12:16 (13 years ago) parent9d3a0070e9c4cd
1 file changed+26−28
qml/ScopeTool.qml+26−28
qml/ScopeTool.qml+26−28
@@ -17,7 +17,9 @@
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
1919import Ubuntu.Components.Popups 0.1
20+import Utils 0.1
2021import Unity 0.1
22+import "Components"
2123import "Dash"
2224
2325Rectangle {
@@ -43,18 +45,28 @@ Rectangle {
4345 signal searchClicked
4446 }
4547
48+ SortFilterProxyModel {
49+ id: filteredScopes
50+ model: Scopes {
51+ id: scopes
52+ }
53+ dynamicSortFilter: true
4654
47− Scopes {
48− id: scopes
55+ filterRole: Scopes.RoleVisible
56+ filterRegExp: RegExp("^true$")
4957 }
5058
5159 Rectangle {
52− anchors.fill: scopeView
60+ anchors.fill: dashContent
5361 color: "#FCFCFC"
5462 }
5563
56− GenericScopeView {
57− id: scopeView
64+ DashContent {
65+ id: dashContent
66+
67+ model: filteredScopes
68+ searchHistory: SearchHistoryModel { }
69+ property Scope scope: scopes.get(currentIndex)
5870
5971 anchors {
6072 top: parent.top
@@ -62,8 +74,6 @@ Rectangle {
6274 left: parent.left
6375 right: controls.left
6476 }
65−
66− scope: scopes.loaded ? scopes.get(scopeSelector.selectedIndex) : undefined
6777 }
6878
6979 Rectangle {
@@ -76,6 +86,10 @@ Rectangle {
7686 right: parent.right
7787 }
7888
89+ MouseArea {
90+ anchors.fill: parent
91+ }
92+
7993 Column {
8094 anchors { fill: parent; margins: units.gu(1) }
8195 spacing: units.gu(1)
@@ -88,27 +102,11 @@ Rectangle {
88102 id: searchField
89103 anchors { left: parent.left; right: parent.right }
90104
91− onTextChanged: scopeView.scope.searchQuery = text
105+ onTextChanged: dashContent.scope.searchQuery = text
92106
93107 Connections {
94− target: scopeView.scope
95− onSearchQueryChanged: searchField.text = scopeView.scope.searchQuery
96− }
97− }
98−
99− Label {
100− text: "Scope selection"
101− height: units.gu(4)
102− verticalAlignment: Text.AlignBottom
103− }
104−
105− OptionSelector {
106− id: scopeSelector
107− anchors { left: parent.left; right: parent.right }
108−
109− model: scopes
110− delegate: OptionSelectorDelegate {
111− text: model.title
108+ target: dashContent.scope
109+ onSearchQueryChanged: searchField.text = dashContent.scope.searchQuery
112110 }
113111 }
114112
@@ -121,7 +119,7 @@ Rectangle {
121119 OptionSelector {
122120 id: categorySelector
123121 anchors { left: parent.left; right: parent.right }
124− model: scopeView.scope ? scopeView.scope.categories : null
122+ model: dashContent.scope ? dashContent.scope.categories : null
125123
126124 property Item selectedItem
127125
@@ -170,7 +168,7 @@ Rectangle {
170168 onCancelClicked: PopupUtils.close(sheet)
171169 onConfirmClicked: {
172170 PopupUtils.close(sheet);
173− scopeView.scope.categories.overrideCategoryJson(categorySelector.selectedItem.categoryId, categoryEditorArea.text);
171+ dashContent.scope.categories.overrideCategoryJson(categorySelector.selectedItem.categoryId, categoryEditorArea.text);
174172 }
175173 }
176174 }