2
* Copyright 2011 Marco Martin <mart@kde.org>
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Library General Public License as
6
* published by the Free Software Foundation; either version 2, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU Library General Public License for more details
14
* You should have received a copy of the GNU Library General Public
15
* License along with this program; if not, write to the
16
* Free Software Foundation, Inc.,
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
import org.kde.metadatamodels 0.1 as MetadataModels
22
import org.kde.plasma.components 0.1 as PlasmaComponents
23
import org.kde.plasma.mobilecomponents 0.1 as MobileComponents
26
PlasmaComponents.Page {
28
objectName: "introPage"
32
height: childrenRect.height
34
MobileComponents.ViewSearch {
36
anchors.centerIn: parent
38
onSearchQueryChanged: {
39
metadataModel.extraParameters["nfo:fileName"] = searchBox.searchQuery
40
busy = (searchBox.searchQuery.length > 0)
48
topMargin: toolBar.height
51
function push(category)
53
var page = mainStack.push(Qt.createComponent("Browser.qml"))
54
metadataModel.resourceType = category
57
function iconFor(category)
61
return "folder-bookmark"
67
return "folder-image-people"
69
return "folder-documents"
81
source: "image://appbackgrounds/standard"
85
MobileComponents.IconGrid {
89
model: MetadataModels.MetadataCloudModel {
90
cloudCategory: "rdf:type"
91
resourceType: "nfo:FileDataObject"
92
minimumRating: metadataModel.minimumRating
93
allowedCategories: userTypes.userTypes.filter(function(val) {
94
return val != "nfo:Application";
98
delegate: MobileComponents.ResourceDelegate {
99
className: "FileDataObject"
100
genericClassName: "FileDataObject"
101
property string decoration: iconFor(model["label"])
103
property string label: i18n("%1 (%2)", userTypes.typeNames[model["label"]], model["count"])
105
width: introGrid.delegateWidth
106
height: introGrid.delegateHeight
108
onClicked: push(model["label"])