4 * This file is part of CameraPlus.
6 * Copyright (C) 2012-2013 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
27 property Camera camera: null
31 property string __aspectRatio: settings.device == 1 ?
32 settings.secondaryImageAspectRatio : settings.primaryImageAspectRatio
33 property string __resolution: settings.device == 1 ?
34 settings.secondaryImageResolution : settings.primaryImageResolution
37 text: qsTr("Aspect ratio")
38 visible: aspectRatioRow.visible
44 enabled: camera ? camera.idle : false
46 visible: imageSettings.aspectRatioCount > 1
49 model: imageSettings.aspectRatios
50 delegate: CameraButton {
52 checked: __aspectRatio == modelData
54 if (settings.device == 1) {
55 settings.secondaryImageAspectRatio = modelData
57 settings.primaryImageAspectRatio = modelData
65 text: qsTr("Resolution")
66 visible: resolutionsRow.visible
72 enabled: camera ? camera.idle : false
74 visible: imageSettings.resolutions.count > 1
77 target: imageSettings.resolutions
78 property: "aspectRatio"
79 value: settings.primaryImageAspectRatio
80 when: settings.device == 0
84 target: imageSettings.resolutions
85 property: "aspectRatio"
86 value: settings.secondaryImageAspectRatio
87 when: settings.device == 1
93 model: imageSettings.resolutions.aspectRatio == __aspectRatio ?
94 imageSettings.resolutions : undefined
96 delegate: CameraButton {
98 text: qsTr("%1 %2 Mpx").arg(resolutionName).arg(megaPixels)
99 checked: __resolution == resolutionName
101 if (settings.device == 1) {
102 settings.secondaryImageResolution = resolutionName
104 settings.primaryImageResolution = resolutionName