Convert TextSwitch to a platform specific component and rename it to CameraTextSwitch
authorMohammed Sameer <msameer@foolab.org>
Mon, 26 Aug 2013 23:21:33 +0000 (02:21 +0300)
committerMohammed Sameer <msameer@foolab.org>
Mon, 26 Aug 2013 23:21:33 +0000 (02:21 +0300)
Sailfish Silica has a native TextSwitch which can be used directly

qml/CameraSettings.qml
qml/ImageModeSettings.qml
qml/harmattan/CameraTextSwitch.qml [moved from qml/TextSwitch.qml with 98% similarity]
qml/harmattan/harmattan.qrc
qml/qml.qrc
qml/sailfish/CameraTextSwitch.qml [new file with mode: 0644]
qml/sailfish/sailfish.qrc

index 993c262..cf17969 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
         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
     }
 
         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
         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
     }
 
         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
         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
     }
 
         onCheckedChanged: settings.proximityAsShutter = checked
     }
 
-    TextSwitch {
+    CameraTextSwitch {
         text: qsTr("Enable camera sounds")
 
         // We have to do it that way because QML complains about a binding
         text: qsTr("Enable camera sounds")
 
         // We have to do it that way because QML complains about a binding
@@ -109,7 +109,7 @@ Column {
         onCheckedChanged: settings.soundEnabled = checked
     }
 
         onCheckedChanged: settings.soundEnabled = checked
     }
 
-    TextSwitch {
+    CameraTextSwitch {
         id: useGps
         text: qsTr("Use GPS")
 
         id: useGps
         text: qsTr("Use GPS")
 
@@ -119,7 +119,7 @@ Column {
         onCheckedChanged: settings.useGps = checked
     }
 
         onCheckedChanged: settings.useGps = checked
     }
 
-    TextSwitch {
+    CameraTextSwitch {
         // TODO: transition when hiding/showing and we should scroll a bit to show it
         visible: useGps.checked
 
         // TODO: transition when hiding/showing and we should scroll a bit to show it
         visible: useGps.checked
 
index 66bbf7d..a0ef4aa 100644 (file)
@@ -47,7 +47,7 @@ Flickable {
             width: parent.width
         }
 
             width: parent.width
         }
 
-        TextSwitch {
+        CameraTextSwitch {
             text: qsTr("Enable face detection")
             // 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.
             text: qsTr("Enable face detection")
             // 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.
similarity index 98%
rename from qml/TextSwitch.qml
rename to qml/harmattan/CameraTextSwitch.qml
index 4d95d8b..de664ac 100644 (file)
@@ -20,7 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-import QtQuick 2.0
+import QtQuick 1.1
 
 Item {
     property alias text: label.text
 
 Item {
     property alias text: label.text
index be7d401..f4d4ac1 100644 (file)
@@ -16,5 +16,6 @@
        <file>CameraPositionSource.qml</file>
        <file>CameraPage.qml</file>
        <file>CameraProximitySensor.qml</file>
        <file>CameraPositionSource.qml</file>
        <file>CameraPage.qml</file>
        <file>CameraProximitySensor.qml</file>
+       <file>CameraTextSwitch.qml</file>
     </qresource>
 </RCC>
     </qresource>
 </RCC>
index 3875f11..64101e9 100644 (file)
@@ -32,7 +32,6 @@
        <file>SectionHeader.qml</file>
        <file>SettingsView.qml</file>
        <file>Standby.qml</file>
        <file>SectionHeader.qml</file>
        <file>SettingsView.qml</file>
        <file>Standby.qml</file>
-       <file>TextSwitch.qml</file>
        <file>ToolsModelItem.qml</file>
        <file>VideoColorFilterButton.qml</file>
        <file>VideoEvCompButton.qml</file>
        <file>ToolsModelItem.qml</file>
        <file>VideoColorFilterButton.qml</file>
        <file>VideoEvCompButton.qml</file>
diff --git a/qml/sailfish/CameraTextSwitch.qml b/qml/sailfish/CameraTextSwitch.qml
new file mode 100644 (file)
index 0000000..13ef8eb
--- /dev/null
@@ -0,0 +1,28 @@
+// -*- qml -*-
+
+/*!
+ * This file is part of CameraPlus.
+ *
+ * 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
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+
+TextSwitch {
+
+}
index bbe0dfe..cf3b131 100644 (file)
@@ -15,5 +15,6 @@
        <file>FullScreenThumbnail.qml</file>
        <file>CameraPositionSource.qml</file>
        <file>CameraPage.qml</file>
        <file>FullScreenThumbnail.qml</file>
        <file>CameraPositionSource.qml</file>
        <file>CameraPage.qml</file>
+       <file>CameraTextSwitch.qml</file>
     </qresource>
 </RCC>
     </qresource>
 </RCC>