Show an error if we fail to capture an image or to record a video.
authorMohammed Sameer <msameer@foolab.org>
Sun, 9 Sep 2012 22:57:27 +0000 (01:57 +0300)
committerMohammed Sameer <msameer@foolab.org>
Sun, 9 Sep 2012 23:02:11 +0000 (02:02 +0300)
qml/ImagePage.qml
qml/VideoPage.qml

index b6cdba2..1b48b15 100644 (file)
@@ -17,8 +17,12 @@ CameraPage {
                 width: 75
                 height: 75
                 opacity: 0.5
-                // TODO: Show an error if file is empty or starting fails.
-                onClicked: imageMode.capture(fileNaming.imageFileName());
+                onClicked: {
+                        if (!imageMode.capture(fileNaming.imageFileName())) {
+                                showError("Failed to capture image. Please restart the camera.");
+                        }
+                }
+
                 visible: imageMode.canCapture && !cameraMode.animationRunning && !previewAnimationRunning
         }
 
index d77bd6c..ef983c7 100644 (file)
@@ -21,8 +21,9 @@ CameraPage {
                 opacity: 0.5
                 onClicked: {
                         if (!videoMode.recording) {
-                                // TODO: Show an error if file is empty or starting fails.
-                                videoMode.startRecording(fileNaming.videoFileName());
+                                if (!videoMode.startRecording(fileNaming.videoFileName())) {
+                                        showError("Failed to record video. Please restart the camera.");
+                                }
                         }
                         else {
                                 videoMode.stopRecording();