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
}
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();