Default value for the property is null. No need to assign it explicitly
[harmattan/cameraplus] / qml / CameraSettings.qml
index 993c262..c25a722 100644 (file)
@@ -60,7 +60,7 @@ Column {
         }
     }
 
-    TextSwitch {
+    CameraTextSwitch {
         text: qsTr("Show grid lines")
 
         // We have to do it that way because QML complains about a binding
@@ -82,7 +82,7 @@ Column {
         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
@@ -91,7 +91,7 @@ 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
@@ -100,7 +100,7 @@ Column {
         onCheckedChanged: settings.proximityAsShutter = checked
     }
 
-    TextSwitch {
+    CameraTextSwitch {
         text: qsTr("Enable camera sounds")
 
         // We have to do it that way because QML complains about a binding
@@ -109,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")
 
@@ -119,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