4 * This file is part of CameraPlus.
6 * Copyright (C) 2012 Mohammed Sameer <msameer@foolab.org>
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.
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.
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
24 import com.nokia.meego 1.1
26 import "ImageSettingsDialog.js" as Util
34 target: Qt.application
36 if (!Qt.application.active) {
43 if (status == DialogStatus.Open) {
44 cam.renderingEnabled = false;
46 else if (status == DialogStatus.Closing) {
47 cam.renderingEnabled = true;
60 contentHeight: col.height
70 text: qsTr("Image settings");
74 text: qsTr("Aspect ratio");
82 onCheckedButtonChanged: {
83 // This is needed to initially setup the
84 // resolutions buttons
85 Util.resetAspectRatio(aspectRatioRow);
89 model: imageSettings.aspectRatios
91 property string aspect: modelData;
92 text: qsTr(modelData);
93 checked: settings.imageAspectRatio == modelData;
94 onClicked: Util.setAspectRatio(modelData);
100 text: qsTr("Resolution");
111 model: imageSettings.resolutions
113 // http://stackoverflow.com/questions/1026069/capitalize-the-first-letter-of-string-in-javascript
114 function name(name, mp) {
115 return name.charAt(0).toUpperCase() + name.slice(1) + " " + mp + " Mpx";
119 property string resolution: resolutionName
120 property string aspectRatio: resolutionAspectRatio
121 text: resolutions.name(resolutionName, megaPixels);
122 checked: settings.imageResolution == resolutionName
123 onClicked: Util.setResolution(resolutionName);
130 height: Math.max(enableFaceDetectionLabel.height, enableFaceDetection.height);
133 id: enableFaceDetectionLabel
134 anchors.left: parent.left
135 text: qsTr("Enable face detection");
139 id: enableFaceDetection
140 anchors.right: parent.right
141 // We have to do it that way because QML complains about a binding
142 // loop for checked if we bind the checked property to the settings value.
143 Component.onCompleted: checked = settings.faceDetectionEnabled;
144 onCheckedChanged: settings.faceDetectionEnabled = checked;
149 anchors.horizontalCenter: parent.horizontalCenter