Fixed VideoPlayerPage.qml failure to set cameraConfig
[harmattan/cameraplus] / qml / ImageResolutionSettings.qml
index 671dea3..e287394 100644 (file)
@@ -3,7 +3,7 @@
 /*!
  * 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("Aspect ratio");
-        }
+    spacing: 10
 
-        ButtonRow {
-                id: aspectRatioRow
-                width: parent.width
-                enabled: cam.idle
-                exclusive: false
+    SectionHeader {
+        text: qsTr("Aspect ratio")
+    }
 
-                Repeater {
-                        model: imageSettings.aspectRatios
-                        delegate: Button {
-                                text: qsTr(modelData);
-                                checked: settings.imageAspectRatio == modelData;
-                                onClicked: settings.imageAspectRatio = modelData;
-                        }
-                }
-        }
+    CameraButtonRow {
+        id: aspectRatioRow
+        width: parent.width
+        enabled: camera ? camera.idle : false
+        exclusive: false
 
-        SectionHeader {
-                text: qsTr("Resolution");
+        Repeater {
+            model: imageSettings.aspectRatios
+            delegate: CameraButton {
+                text: qsTr(modelData)
+                checked: settings.imageAspectRatio == modelData
+                onClicked: settings.imageAspectRatio = modelData
+            }
         }
+    }
 
-        ButtonRow {
-                id: resolutionsRow
-                width: parent.width
-                enabled: cam.idle
-                exclusive: false
+    SectionHeader {
+        text: qsTr("Resolution")
+    }
 
-                Binding {
-                        target: imageSettings.resolutions
-                        property: "aspectRatio"
-                        value: settings.imageAspectRatio
-                }
+    CameraButtonRow {
+        id: resolutionsRow
+        width: parent.width
+        enabled: camera ? camera.idle : false
+        exclusive: false
+
+        Binding {
+            target: imageSettings.resolutions
+            property: "aspectRatio"
+            value: settings.imageAspectRatio
+        }
 
-                Repeater {
-                        id: resolutions
-                        model: imageSettings.resolutions
+        Repeater {
+            id: resolutions
+            model: imageSettings.resolutions.aspectRatio == settings.imageAspectRatio ?
+                imageSettings.resolutions : undefined
 
-                        delegate: Button {
-                                font.capitalization: Font.Capitalize
-                                text: qsTr("%1 %2 Mpx").arg(resolutionName).arg(megaPixels);
-                                checked: settings.imageResolution == resolutionName
-                                onClicked: settings.imageResolution = resolutionName;
-                        }
-                }
+            delegate: CameraButton {
+                font.capitalization: Font.Capitalize
+                text: qsTr("%1 %2 Mpx").arg(resolutionName).arg(megaPixels)
+                checked: settings.imageResolution == resolutionName
+                onClicked: settings.imageResolution = resolutionName
+            }
         }
+    }
 }