Move QuillItem to harmattan specific components.
[harmattan/cameraplus] / qml / PostCaptureItem.qml
index af18fdb..4d925b0 100644 (file)
@@ -20,8 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-import QtQuick 1.1
-import com.nokia.meego 1.1
+@IMPORT_QT_QUICK@
 import CameraPlus 1.0
 
 Item {
@@ -35,7 +34,16 @@ Item {
     function startPlayback() {
         loader.source = Qt.resolvedUrl("VideoPlayerPage.qml")
         loader.item.source = itemData.url
-        loader.item.play()
+        if (!loader.item.play()) {
+            showError(qsTr("Error playing video. Please try again."))
+            loader.source = ""
+        }
+    }
+
+    function stopPlayback() {
+        if (loader.item) {
+            loader.item.stop()
+        }
     }
 
     Loader {
@@ -48,23 +56,17 @@ Item {
         onFinished: loader.source = ""
     }
 
-    QuillItem {
+// TODO: rotation
+    FullScreenThumbnail {
         id: image
+        source: itemData.url
+        mimeType: itemData.mimeType
+
         width: parent.width - 10
         height: parent.height
         anchors.centerIn: parent
-        Component.onCompleted: initialize(itemData.url, itemData.mimetype)
         visible: loader.source == ""
 
-        Label {
-            anchors.fill: parent
-            visible: image.error
-            text: qsTr("Failed to load preview")
-            verticalAlignment: Text.AlignVCenter
-            horizontalAlignment: Text.AlignHCenter
-            font.pixelSize: 32
-        }
-
         MouseArea {
             id: mouse
             anchors.fill: parent
@@ -72,13 +74,27 @@ Item {
             onClicked: postCaptureItem.clicked()
         }
 
-        ToolIcon {
-            // TODO: this is overlapping with error.
-            id: playIcon
+        Column {
             anchors.centerIn: parent
-            iconSource: "image://theme/icon-s-music-video-play"
-            visible: isVideo
-            onClicked: startPlayback()
+            width: parent.width
+
+            CameraLabel {
+                id: errorLabel
+                width: parent.width
+                visible: image.error
+                text: qsTr("Failed to load preview")
+                verticalAlignment: Text.AlignVCenter
+                horizontalAlignment: Text.AlignHCenter
+                font.pixelSize: 32
+            }
+
+            CameraToolIcon {
+                id: playIcon
+                anchors.horizontalCenter: parent.horizontalCenter
+                iconSource: "image://theme/icon-s-music-video-play"
+                visible: isVideo
+                onClicked: startPlayback()
+            }
         }
     }
 }