unload post capture and settings views when we are in camera view
[harmattan/cameraplus] / qml / CameraSettings.qml
index e2bf74d..c25a722 100644 (file)
  * 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 {
+    property Camera camera: null
+
     id: col
     spacing: 10
     width: parent.width
 
-    Label {
+    CameraLabel {
         font.pixelSize: 36
         text: qsTr("Camera settings")
         width: parent.width
     }
 
-    TextSwitch {
+    SectionHeader {
+        text: qsTr("Camera")
+        width: parent.width
+    }
+
+    CameraButtonRow {
+        anchors.horizontalCenter: parent.horizontalCenter
+        enabled: camera != null && camera.running && camera.idle
+
+        CameraButton {
+            text: qsTr("Back (Primary)");
+            checkable: true
+            checked: settings.device == 0
+            onClicked: settings.device = 0
+        }
+
+        CameraButton {
+            text: qsTr("Front (Secondary)");
+            checkable: true
+            checked: settings.device == 1
+            onClicked: settings.device = 1
+        }
+    }
+
+    CameraTextSwitch {
         text: qsTr("Show grid lines")
 
         // We have to do it that way because QML complains about a binding
@@ -49,14 +75,14 @@ Column {
         width: parent.width
     }
 
-    TextField {
+    CameraTextField {
         placeholderText: qsTr("Name or copyright")
         width: parent.width
         text: settings.creatorName
         onTextChanged: settings.creatorName = text
     }
 
-    TextSwitch {
+    CameraTextSwitch {
         text: qsTr("Use zoom keys for capture")
 
         // We have to do it that way because QML complains about a binding
@@ -65,7 +91,16 @@ Column {
         onCheckedChanged: settings.zoomAsShutter = checked
     }
 
-    TextSwitch {
+    CameraTextSwitch {
+        text: qsTr("Use proximity sensor for capture")
+
+        // We have to do it that way because QML complains about a binding
+        // loop for checked if we bind the checked property to the settings value.
+        Component.onCompleted: checked = settings.proximityAsShutter
+        onCheckedChanged: settings.proximityAsShutter = checked
+    }
+
+    CameraTextSwitch {
         text: qsTr("Enable camera sounds")
 
         // We have to do it that way because QML complains about a binding
@@ -74,7 +109,16 @@ Column {
         onCheckedChanged: settings.soundEnabled = checked
     }
 
-    TextSwitch {
+    CameraTextSwitch {
+        text: qsTr("Preview images and videos after capturing")
+        visible: false
+        // We have to do it that way because QML complains about a binding
+        // loop for checked if we bind the checked property to the settings value.
+        Component.onCompleted: checked = settings.enablePreview
+        onCheckedChanged: settings.enablePreview = checked
+    }
+
+    CameraTextSwitch {
         id: useGps
         text: qsTr("Use GPS")
 
@@ -84,7 +128,7 @@ Column {
         onCheckedChanged: settings.useGps = checked
     }
 
-    TextSwitch {
+    CameraTextSwitch {
         // TODO: transition when hiding/showing and we should scroll a bit to show it
         visible: useGps.checked