Moved standby to its own component
[harmattan/cameraplus] / qml / CameraSettings.qml
1 // -*- qml -*-
2
3 /*!
4  * This file is part of CameraPlus.
5  *
6  * Copyright (C) 2012 Mohammed Sameer <msameer@foolab.org>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21  */
22
23 import QtQuick 1.1
24 import com.nokia.meego 1.1
25
26 Column {
27         id: col
28         spacing: 10
29         width: parent.width
30
31         Label {
32                 font.pixelSize: 36
33                 text: qsTr("Camera settings");
34         }
35 /*
36         SectionHeader {
37                 text: qsTr("Show captured content");
38         }
39
40         ButtonRow {
41                 anchors.horizontalCenter: parent.horizontalCenter
42
43                 Button {
44                         text: qsTr("Disabled");
45                         checked: settings.postCaptureTimeout == 0;
46                         onClicked: settings.postCaptureTimeout = 0;
47                 }
48
49                 Button {
50                         text: qsTr("2 seconds");
51                         checked: settings.postCaptureTimeout == 2;
52                         onClicked: settings.postCaptureTimeout = 2;
53                 }
54
55                 Button {
56                         text: qsTr("5 seconds");
57                         checked: settings.postCaptureTimeout == 10;
58                         onClicked: settings.postCaptureTimeout = 10;
59                 }
60
61                 Button {
62                         text: qsTr("No timeout");
63                         checked: settings.postCaptureTimeout == -1;
64                         onClicked: settings.postCaptureTimeout = -1;
65                 }
66         }
67 */
68         SectionHeader {
69                 text: qsTr("Creator name");
70         }
71
72         TextField {
73                 placeholderText: qsTr("Name or copyright");
74                 width: parent.width
75                 text: settings.creatorName
76                 onTextChanged: settings.creatorName = text;
77         }
78
79         Item {
80                 width: parent.width
81                 height: Math.max(enableCameraSoundsLabel.height, enableCameraSounds.height);
82
83                 Label {
84                         id: enableCameraSoundsLabel
85                         anchors.left: parent.left
86                         text: qsTr("Enable camera sounds");
87                 }
88
89                 Switch {
90                         id: enableCameraSounds
91                         anchors.right: parent.right
92                         // We have to do it that way because QML complains about a binding
93                         // loop for checked if we bind the checked property to the settings value.
94                         Component.onCompleted: checked = settings.soundEnabled;
95                         onCheckedChanged: settings.soundEnabled = checked;
96                 }
97         }
98
99         Item {
100                 width: parent.width
101                 height: Math.max(useGpsLabel.height, useGps.height);
102
103                 Label {
104                         id: useGpsLabel
105                         anchors.left: parent.left
106                         text: qsTr("Use GPS");
107                 }
108
109                 Switch {
110                         id: useGps
111                         anchors.right: parent.right
112                         // We have to do it that way because QML complains about a binding
113                         // loop for checked if we bind the checked property to the settings value.
114                         Component.onCompleted: checked = settings.useGps;
115                         onCheckedChanged: settings.useGps = checked;
116                 }
117         }
118
119         Item {
120                 width: parent.width
121                 height: Math.max(useGeotagsLabel.height, useGeotags.height);
122
123                 // TODO: transition when hiding/showing and we should scroll a bit to show it
124                 visible: useGps.checked
125
126                 Label {
127                         id: useGeotagsLabel
128                         anchors.left: parent.left
129                         text: qsTr("Use geotags");
130                 }
131
132                 Switch {
133                         id: useGeotags
134                         anchors.right: parent.right
135                         // We have to do it that way because QML complains about a binding
136                         // loop for checked if we bind the checked property to the settings value.
137                         Component.onCompleted: checked = settings.useGeotags;
138                         onCheckedChanged: settings.useGeotags = checked;
139                 }
140         }
141 }