summaryrefslogtreecommitdiff
path: root/sowatchui/qml/WatchPage.qml
blob: 83932eb1cd5a4cce00bcda9547924a2138d73fec (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import QtQuick 1.1
import com.nokia.meego 1.1
import com.nokia.extras 1.1
import com.javispedro.sowatch 1.0

Page {
	id: watchPage
	anchors.leftMargin: UiConstants.DefaultMargin
	anchors.rightMargin: UiConstants.DefaultMargin
	orientationLock: PageOrientation.LockPortrait

	property string configKey;
	property url configQmlUrl;

	tools: ToolBarLayout {
		ToolIcon {
			platformIconId: "toolbar-back"
			anchors.left: parent.left
			onClicked: pageStack.pop()
		}
	}

	GConfKey {
		id: nameKey
		key: configKey + "/name"
	}

	Flickable {
		id: mainFlickable
		anchors.fill: parent
		contentHeight: mainColumn.height

		Column {
			id: mainColumn
			width: parent.width

			Item {
				id: enableItem
				width: parent.width
				height: UiConstants.ListItemHeightDefault

				Label {
					text: qsTr("Enabled")
					font: UiConstants.TitleFont
					anchors.verticalCenter: parent.verticalCenter
					anchors.left: parent.left
				}
				Switch {
					anchors.verticalCenter: parent.verticalCenter
					anchors.right: parent.right
					checked: true
				}
			}

			GroupHeader {
				width: parent.width
				text: "Watch settings"
				visible: configQmlLoader.status === Loader.Ready
			}

			Loader {
				id: configQmlLoader
				source: configQmlUrl
				width: parent.width
				onLoaded: item.configKey = configKey;
			}

			GroupHeader {
				width: parent.width
				text: "Watchlets"
				visible: configQmlLoader.status === Loader.Ready
			}

			GroupHeader {
				width: parent.width
				text: "Notification sources"
				visible: configQmlLoader.status === Loader.Ready
			}
		}
	}
	ScrollDecorator {
		flickableItem: mainFlickable
	}
}