7194c45a8b774cbced91704777c178725d5ddda1
[harmattan/cameraplus] / qml / CameraSettings.qml
1 // -*- qml -*-
2 import QtQuick 1.1
3 import com.nokia.meego 1.1
4
5 Column {
6         id: col
7         spacing: 10
8
9         Label {
10                 // TODO:
11                 text: qsTr("Camera settings");
12         }
13
14         SectionHeader {
15                 text: qsTr("Show captured content");
16         }
17
18         ButtonRow {
19                 anchors.horizontalCenter: parent.horizontalCenter
20
21                 Button {
22                         text: qsTr("Disabled");
23                         checked: settings.postCaptureTimeout == 0;
24                         onClicked: settings.postCaptureTimeout = 0;
25                 }
26
27                 Button {
28                         text: qsTr("2 seconds");
29                         checked: settings.postCaptureTimeout == 2;
30                         onClicked: settings.postCaptureTimeout = 2;
31                 }
32
33                 Button {
34                         text: qsTr("5 seconds");
35                         checked: settings.postCaptureTimeout == 10;
36                         onClicked: settings.postCaptureTimeout = 10;
37                 }
38
39                 Button {
40                         text: qsTr("No timeout");
41                         checked: settings.postCaptureTimeout == -1;
42                         onClicked: settings.postCaptureTimeout = -1;
43                 }
44         }
45
46         SectionHeader {
47                 text: qsTr("Creator name");
48         }
49
50         TextField {
51                 placeholderText: qsTr("Name or copyright");
52                 width: parent.width
53                 text: settings.creatorName
54                 onTextChanged: settings.creatorName = text;
55         }
56
57         Item {
58                 width: parent.width
59                 height: Math.max(useGpsLabel.height, useGps.height);
60
61                 Label {
62                         id: useGpsLabel
63                         anchors.left: parent.left
64                         text: qsTr("Use GPS");
65                 }
66
67                 Switch {
68                         id: useGps
69                         anchors.right: parent.right
70                         // We have to do it that way because QML complains about a binding
71                         // loop for checked if we bind the checked property to the settings value.
72                         Component.onCompleted: checked = settings.useGps;
73                         onCheckedChanged: settings.useGps = checked;
74                 }
75         }
76
77         Item {
78                 width: parent.width
79                 height: Math.max(useGeotagsLabel.height, useGeotags.height);
80
81                 // TODO: transition when hiding/showing and we should scroll a bit to show it
82                 visible: useGps.checked
83
84                 Label {
85                         id: useGeotagsLabel
86                         anchors.left: parent.left
87                         text: qsTr("Use geotags");
88                 }
89
90                 Switch {
91                         id: useGeotags
92                         anchors.right: parent.right
93                         // We have to do it that way because QML complains about a binding
94                         // loop for checked if we bind the checked property to the settings value.
95                         Component.onCompleted: checked = settings.useGeotags;
96                         onCheckedChanged: settings.useGeotags = checked;
97                 }
98         }
99 }