@@ -17,7 +17,9 @@
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"
23import "Dash"
23Rectangle {
25Rectangle {
@@ -43,18 +45,28 @@ Rectangle {
43 signal searchClicked
45 signal searchClicked
48+ SortFilterProxyModel {
53+ dynamicSortFilter: true
47− Scopes {
55+ filterRole: Scopes.RoleVisible
48− id: scopes
56+ filterRegExp: RegExp("^true$")
51 Rectangle {
59 Rectangle {
52− anchors.fill: scopeView
60+ anchors.fill: dashContent
53 color: "#FCFCFC"
61 color: "#FCFCFC"
56− GenericScopeView {
64+ DashContent {
57− id: scopeView
65+ id: dashContent
67+ model: filteredScopes
68+ searchHistory: SearchHistoryModel { }
69+ property Scope scope: scopes.get(currentIndex)
60 top: parent.top
72 top: parent.top
@@ -62,8 +74,6 @@ Rectangle {
62 left: parent.left
74 left: parent.left
63 right: controls.left
75 right: controls.left
66− scope: scopes.loaded ? scopes.get(scopeSelector.selectedIndex) : undefined
69 Rectangle {
79 Rectangle {
@@ -76,6 +86,10 @@ Rectangle {
76 right: parent.right
86 right: parent.right
80 anchors { fill: parent; margins: units.gu(1) }
94 anchors { fill: parent; margins: units.gu(1) }
81 spacing: units.gu(1)
95 spacing: units.gu(1)
@@ -88,27 +102,11 @@ Rectangle {
88 id: searchField
102 id: searchField
89 anchors { left: parent.left; right: parent.right }
103 anchors { left: parent.left; right: parent.right }
91− onTextChanged: scopeView.scope.searchQuery = text
105+ onTextChanged: dashContent.scope.searchQuery = text
93 Connections {
107 Connections {
94− target: scopeView.scope
108+ target: dashContent.scope
95− onSearchQueryChanged: searchField.text = scopeView.scope.searchQuery
109+ 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 +119,7 @@ Rectangle {
121 OptionSelector {
119 OptionSelector {
122 id: categorySelector
120 id: categorySelector
123 anchors { left: parent.left; right: parent.right }
121 anchors { left: parent.left; right: parent.right }
124− model: scopeView.scope ? scopeView.scope.categories : null
122+ model: dashContent.scope ? dashContent.scope.categories : null
126 property Item selectedItem
124 property Item selectedItem
@@ -170,7 +168,7 @@ Rectangle {
170 onCancelClicked: PopupUtils.close(sheet)
168 onCancelClicked: PopupUtils.close(sheet)
171 onConfirmClicked: {
169 onConfirmClicked: {
172 PopupUtils.close(sheet);
170 PopupUtils.close(sheet);
173− scopeView.scope.categories.overrideCategoryJson(categorySelector.selectedItem.categoryId, categoryEditorArea.text);
171+ dashContent.scope.categories.overrideCategoryJson(categorySelector.selectedItem.categoryId, categoryEditorArea.text);