Implemented file deletion
[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                 width: parent.width
35         }
36 /*
37 // TODO:
38         SectionHeader {
39                 text: qsTr("Show captured content");
40         }
41
42         ButtonRow {
43                 anchors.horizontalCenter: parent.horizontalCenter
44
45                 Button {
46                         text: qsTr("Disabled");
47                         checked: settings.postCaptureTimeout == 0;
48                         onClicked: settings.postCaptureTimeout = 0;
49                 }
50
51                 Button {
52                         text: qsTr("2 seconds");
53                         checked: settings.postCaptureTimeout == 2;
54                         onClicked: settings.postCaptureTimeout = 2;
55                 }
56
57                 Button {
58                         text: qsTr("5 seconds");
59                         checked: settings.postCaptureTimeout == 10;
60                         onClicked: settings.postCaptureTimeout = 10;
61                 }
62
63                 Button {
64                         text: qsTr("No timeout");
65                         checked: settings.postCaptureTimeout == -1;
66                         onClicked: settings.postCaptureTimeout = -1;
67                 }
68         }
69 */
70         SectionHeader {
71                 text: qsTr("Creator name");
72                 width: parent.width
73         }
74
75         TextField {
76                 placeholderText: qsTr("Name or copyright");
77                 width: parent.width
78                 text: settings.creatorName
79                 onTextChanged: settings.creatorName = text;
80         }
81
82         Item {
83                 width: parent.width
84                 height: Math.max(enableCameraSoundsLabel.height, enableCameraSounds.height);
85
86                 Label {
87                         id: enableCameraSoundsLabel
88                         anchors.left: parent.left
89                         text: qsTr("Enable camera sounds");
90                 }
91
92                 Switch {
93                         id: enableCameraSounds
94                         anchors.right: parent.right
95                         // We have to do it that way because QML complains about a binding
96                         // loop for checked if we bind the checked property to the settings value.
97                         Component.onCompleted: checked = settings.soundEnabled;
98                         onCheckedChanged: settings.soundEnabled = checked;
99                 }
100         }
101
102         Item {
103                 width: parent.width
104                 height: Math.max(useGpsLabel.height, useGps.height);
105
106                 Label {
107                         id: useGpsLabel
108                         anchors.left: parent.left
109                         text: qsTr("Use GPS");
110                 }
111
112                 Switch {
113                         id: useGps
114                         anchors.right: parent.right
115                         // We have to do it that way because QML complains about a binding
116                         // loop for checked if we bind the checked property to the settings value.
117                         Component.onCompleted: checked = settings.useGps;
118                         onCheckedChanged: settings.useGps = checked;
119                 }
120         }
121
122         Item {
123                 width: parent.width
124                 height: Math.max(useGeotagsLabel.height, useGeotags.height);
125
126                 // TODO: transition when hiding/showing and we should scroll a bit to show it
127                 visible: useGps.checked
128
129                 Label {
130                         id: useGeotagsLabel
131                         anchors.left: parent.left
132                         text: qsTr("Use geotags");
133                 }
134
135                 Switch {
136                         id: useGeotags
137                         anchors.right: parent.right
138                         // We have to do it that way because QML complains about a binding
139                         // loop for checked if we bind the checked property to the settings value.
140                         Component.onCompleted: checked = settings.useGeotags;
141                         onCheckedChanged: settings.useGeotags = checked;
142                 }
143         }
144 }