2 * Copyright (C) 2014 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 // Properties set by parent
24 property var scope: null
26 // Properties used by parent
27 readonly property bool processing: scope ? scope.searchInProgress : false
32 signal requestFavorite(string scopeId, bool favorite)
33 signal requestFavoriteMoveTo(string scopeId, int index)
34 signal requestRestore(string scopeId)
38 property var scopeStyle: ScopeStyle {
42 if (state == "edit") {
43 // As per design entering edit mode clears the possible existing search
44 header.resetSearch(false /* false == unfocus */);
54 property: "searchQuery"
55 value: header.searchQuery
60 property: "searchQuery"
61 value: root.scope ? root.scope.searchQuery : ""
66 objectName: "pageHeader"
67 title: i18n.tr("Manage")
71 backIsClose: root.state == "edit"
72 storeEntryEnabled: root.state == "browse"
73 searchEntryEnabled: false // Disable search for now
74 scopeStyle: root.scopeStyle
82 onStoreClicked: root.storeClicked();
94 contentWidth: root.width
95 contentHeight: column.height
96 onContentHeightChanged: returnToBounds();
100 model: scope ? scope.categories : null
105 active: results.count > 0
107 sourceComponent: ScopesListCategory {
108 objectName: "scopesListCategory" + categoryId
113 if (isFavoritesFeed) return i18n.tr("Home");
114 else if (isAlsoInstalled) return i18n.tr("Also installed");
118 editMode: root.state == "edit"
120 scopeStyle: root.scopeStyle
121 isFavoritesFeed: categoryId == "favorites"
122 isAlsoInstalled: categoryId == "other"
124 onRequestFavorite: root.requestFavorite(scopeId, favorite);
125 onRequestEditMode: root.state = "edit";
126 onRequestScopeMoveTo: root.requestFavoriteMoveTo(scopeId, index);
127 onRequestActivate: root.scope.activate(result, categoryId);
128 onRequestRestore: root.requestRestore(scopeId);