low space handling:
[harmattan/cameraplus] / qml / VideoPage.qml
index 9b861ba..cedab0c 100644 (file)
@@ -26,8 +26,6 @@ import QtCamera 1.0
 import CameraPlus 1.0
 import "data.js" as Data
 
-// TODO: stop recording when disk is low
-
 CameraPage {
         id: page
 
@@ -80,6 +78,11 @@ CameraPage {
                                         return;
                                 }
 
+                                if (!checkDiskSpace()) {
+                                        showError(qsTr("Not enough space to record video."));
+                                        return;
+                                }
+
                                 policyMode = CameraResources.Recording;
                         }
                         else if (videoMode.recording) {
@@ -262,6 +265,10 @@ CameraPage {
                                         videoMode.stopRecording();
                                         showError(qsTr("Maximum recording time reached."));
                                 }
+                                else if (!checkDiskSpace()) {
+                                        videoMode.stopRecording();
+                                        showError(qsTr("Not enough space to continue recording."));
+                                }
                         }
 
                         onRunningChanged: {