Added a label below the camera icon in standby page to indicate that resources were...
authorMohammed Sameer <msameer@foolab.org>
Thu, 13 Dec 2012 23:05:58 +0000 (01:05 +0200)
committerMohammed Sameer <msameer@foolab.org>
Thu, 13 Dec 2012 23:05:58 +0000 (01:05 +0200)
qml/CameraPage.qml
qml/PipelineManager.qml

index 24ba5e1..25f9b82 100644 (file)
@@ -61,9 +61,21 @@ Page {
                 visible: standbyVisible && page.status == PageStatus.Active && pipelineManager.showStandBy
 
                 Image {
+                        id: icon
                         source: "image://theme/icon-l-camera-standby"
                         anchors.centerIn: parent
                 }
+
+                Label {
+                        anchors.top: icon.bottom
+                        anchors.right: parent.right
+                        anchors.left: parent.left
+                        text: qsTr("Resources lost")
+                        color: "white"
+                        font.pixelSize: 36
+                        horizontalAlignment: Text.AlignHCenter
+                        visible: pipelineManager.state == "policyLost"
+                }
         }
 
         function setPreview(image) {
index 20b56c4..47152e1 100644 (file)
@@ -60,15 +60,22 @@ Item {
 
         function stopCamera() {
                 console.log("stop");
-                camera.stop(false);
+                if (camera.stop(false)) {
+                        console.log("stopped");
+                }
+                else {
+                        console.log("didn't stop");
+                }
+
                 policy.acquire(CameraResources.None);
+                console.log("acquired none");
         }
 
         function forceStopCamera() {
-                // We don't release resources here so we can get them back when they become available
+                // We don't release resources here so we can get them back
+                // when they become available
                 console.log("force");
                 camera.stop(true);
-                showError(qsTr("Resources lost. Stopping camera."));
         }
 
         state: "off"