/*!
* This file is part of CameraPlus.
*
- * Copyright (C) 2012 Mohammed Sameer <msameer@foolab.org>
+ * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-import QtQuick 1.1
-import com.nokia.meego 1.1
+import QtQuick 2.0
+import QtCamera 1.0
Column {
- spacing: 10
+ property Camera camera: null
- SectionHeader {
- text: qsTr("Resolution");
- }
+ spacing: 10
+
+ property string __resolution: settings.device == 1 ?
+ settings.secondaryVideoResolution : settings.primaryVideoResolution
+ visible: videoSettings.resolutions.count > 1
- ButtonRow {
- width: parent.width
- enabled: cam.idle
- exclusive: false
+ SectionHeader {
+ text: qsTr("Resolution")
+ }
- Repeater {
- id: resolutions
+ CameraButtonRow {
+ width: parent.width
+ enabled: camera ? camera.idle : false
+ exclusive: false
- model: videoSettings.resolutions
+ Repeater {
+ id: resolutions
- function name(name, res) {
- return name.charAt(0).toUpperCase() + name.slice(1) + " " + res;
- }
+ model: videoSettings.resolutions
- delegate: Button {
- text: resolutions.name(resolutionName, resolution);
- checked: settings.videoResolution == resolutionName;
- onClicked: settings.videoResolution = resolutionName;
- }
+ delegate: CameraButton {
+ capitalize: true
+ text: qsTr("%1 %2").arg(resolutionName).arg(resolution)
+ checked: __resolution == resolutionName
+ onClicked: {
+ if (settings.device == 1) {
+ settings.secondaryVideoResolution = resolutionName
+ } else {
+ settings.primaryVideoResolution = resolutionName
+ }
}
+ }
}
+ }
}