summaryrefslogtreecommitdiff
path: root/sowatchui/qml/AddWatchletSheet.qml
blob: e052350bc5b9c0a8a15e50e8a04481639070d5b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import QtQuick 1.1
import com.nokia.meego 1.1
import com.nokia.extras 1.1
import com.javispedro.sowatch 1.0

Sheet {
	id: sheet
	anchors.margins: UiConstants.DefaultMargin

	property string configKey;

	rejectButtonText: qsTr("Cancel")

	content: ListView {
		id: listView
		anchors.fill: parent
		anchors.margins: UiConstants.DefaultMargin

		flickableDirection: Flickable.VerticalFlick

		model: WatchletsModel {
			id: watchletsModel
			configKey: sheet.configKey
			displayUnadded: true
		}

		header: Column {
			width: parent.width

			GroupHeader {
				width: parent.width
				text: qsTr("Available watchlets")
			}
		}

		delegate: ListDelegate {
			onClicked: {
				watchletsModel.addWatchlet(model.name);
				close();
				accepted();
			}
		}

		ScrollDecorator {
			flickableItem: listView
		}
	}
}