summaryrefslogtreecommitdiff
path: root/metawatch/qml/metawatch-digital-config.qml
blob: 72912f4e4e89e4e4ae0cf6053b77182c6ba6547c (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
import QtQuick 1.1
import com.nokia.meego 1.1
import com.javispedro.sowatch 1.0

Column {
	property string configKey;

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

		GConfKey {
			id: hourModeKey
			key: configKey + "/24h-mode"
		}
		MouseArea {
			id: hourModeArea
			anchors.fill: parent
			onClicked: hourModeSelect.open();
		}
		SelectionDialog {
			id: hourModeSelect
			titleText: qsTr("Time format")
			selectedIndex: hourModeKey.value ? 1 : 0
			model: ListModel {
				ListElement { name: QT_TR_NOOP("12 hour") }
				ListElement { name: QT_TR_NOOP("24 hour") }
			}
			onSelectedIndexChanged: hourModeKey.value = selectedIndex == 1
		}
		Column {
			anchors.verticalCenter: parent.verticalCenter
			anchors.left: parent.left

			Label {
				text: qsTr("Time format")
				font: UiConstants.TitleFont
			}

			Label {
				text: qsTr(hourModeSelect.model.get(hourModeSelect.selectedIndex).name)
				font: UiConstants.FieldLabelFont
				color: UiConstants.FieldLabelColor
			}
		}
		Image {
			anchors.verticalCenter: parent.verticalCenter
			anchors.right: parent.right
			source: "image://theme/meegotouch-combobox-indicator" + (theme.inverted ? "-inverted" : "")
		}
	}

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

		GConfKey {
			id: dayMonthOrderKey
			key: configKey + "/day-month-order"
		}
		MouseArea {
			id: dayMonthOrderArea
			anchors.fill: parent
			onClicked: dayMonthOrderSelect.open();
		}
		SelectionDialog {
			id: dayMonthOrderSelect
			titleText: qsTr("Date format")
			selectedIndex: dayMonthOrderKey.value ? 1 : 0
			model: ListModel {
				ListElement { name: QT_TR_NOOP("Month/Day") }
				ListElement { name: QT_TR_NOOP("Day/Month") }
			}
			onSelectedIndexChanged: dayMonthOrderKey.value = selectedIndex == 1
		}
		Column {
			anchors.verticalCenter: parent.verticalCenter
			anchors.left: parent.left

			Label {
				text: qsTr("Date format")
				font: UiConstants.TitleFont
			}

			Label {
				text: qsTr(dayMonthOrderSelect.model.get(dayMonthOrderSelect.selectedIndex).name)
				font: UiConstants.FieldLabelFont
				color: UiConstants.FieldLabelColor
			}
		}
		Image {
			anchors.verticalCenter: parent.verticalCenter
			anchors.right: parent.right
			source: "image://theme/meegotouch-combobox-indicator" + (theme.inverted ? "-inverted" : "")
		}
	}

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

		GConfKey {
			id: autoBacklightKey
			key: configKey + "/auto-backlight"
		}
		Column {
			anchors.verticalCenter: parent.verticalCenter
			anchors.left: parent.left

			Label {
				text: qsTr("Automatic backlight")
				font: UiConstants.TitleFont
			}

			Label {
				text: qsTr("Turn backlight on during notifications")
				font: UiConstants.SubtitleFont
				color: UiConstants.FieldLabelColor
			}
		}
		CheckBox {
			id: autoBacklightSwitch
			anchors.verticalCenter: parent.verticalCenter
			anchors.right: parent.right
			checked: autoBacklightKey.value
			onCheckedChanged: autoBacklightKey.value = checked
		}
	}
}