@@ -17,6 +17,7 @@
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19import Ubuntu.Components.Popups 0.1
19import Ubuntu.Components.Popups 0.1
20import Unity 0.1
21import Unity 0.1
21import "Dash"
22import "Dash"
@@ -43,18 +44,27 @@ Rectangle {
43 signal searchClicked
44 signal searchClicked
47+ SortFilterProxyModel {
52+ dynamicSortFilter: true
47− Scopes {
54+ filterRole: Scopes.RoleVisible
48− id: scopes
55+ filterRegExp: RegExp("^true$")
51 Rectangle {
58 Rectangle {
52− anchors.fill: scopeView
59+ anchors.fill: dashContent
53 color: "#FCFCFC"
60 color: "#FCFCFC"
56− GenericScopeView {
63+ DashContent {
57− id: scopeView
64+ id: dashContent
66+ model: filteredScopes
67+ property Scope scope: scopes.get(currentIndex)
60 top: parent.top
70 top: parent.top
@@ -62,8 +72,6 @@ Rectangle {
62 left: parent.left
72 left: parent.left
63 right: controls.left
73 right: controls.left
66− scope: scopes.loaded ? scopes.get(scopeSelector.selectedIndex) : undefined
69 Rectangle {
77 Rectangle {
@@ -76,6 +84,10 @@ Rectangle {
76 right: parent.right
84 right: parent.right
80 anchors { fill: parent; margins: units.gu(1) }
92 anchors { fill: parent; margins: units.gu(1) }
81 spacing: units.gu(1)
93 spacing: units.gu(1)
@@ -88,27 +100,11 @@ Rectangle {
88 id: searchField
100 id: searchField
89 anchors { left: parent.left; right: parent.right }
101 anchors { left: parent.left; right: parent.right }
91− onTextChanged: scopeView.scope.searchQuery = text
103+ onTextChanged: dashContent.scope.searchQuery = text
93 Connections {
105 Connections {
94− target: scopeView.scope
106+ target: dashContent.scope
95− onSearchQueryChanged: searchField.text = scopeView.scope.searchQuery
107+ onSearchQueryChanged: searchField.text = dashContent.scope.searchQuery
100− text: "Scope selection"
102− verticalAlignment: Text.AlignBottom
107− anchors { left: parent.left; right: parent.right }
110− delegate: OptionSelectorDelegate {
@@ -121,7 +117,7 @@ Rectangle {
121 OptionSelector {
117 OptionSelector {
122 id: categorySelector
118 id: categorySelector
123 anchors { left: parent.left; right: parent.right }
119 anchors { left: parent.left; right: parent.right }
124− model: scopeView.scope ? scopeView.scope.categories : null
120+ model: dashContent.scope ? dashContent.scope.categories : null
126 property Item selectedItem
122 property Item selectedItem
@@ -140,7 +136,7 @@ Rectangle {
140 width: parent.width
136 width: parent.width
141 autoSize: true
137 autoSize: true
142 readOnly: true
138 readOnly: true
143− text: categorySelector.selectedItem && categorySelector.selectedItem.template
139+ text: categorySelector.selectedItem > 0 && categorySelector.selectedItem.template
@@ -170,7 +166,7 @@ Rectangle {
170 onCancelClicked: PopupUtils.close(sheet)
166 onCancelClicked: PopupUtils.close(sheet)
171 onConfirmClicked: {
167 onConfirmClicked: {
172 PopupUtils.close(sheet);
168 PopupUtils.close(sheet);
173− scopeView.scope.categories.overrideCategoryJson(categorySelector.selectedItem.categoryId, categoryEditorArea.text);
169+ dashContent.scope.categories.overrideCategoryJson(categorySelector.selectedItem.categoryId, categoryEditorArea.text);