+ function captureImage() {
+ if (!checkBattery()) {
+ showError(qsTr("Not enough battery to capture images."));
+ return;
+ }
+
+ if (!checkDiskSpace()) {
+ showError(qsTr("Not enough space to capture images."));
+ return;
+ }
+
+ if (!fileSystem.available) {
+ showError(qsTr("Camera cannot capture images in mass storage mode."));
+ return;
+ }
+
+ if (!mountProtector.lock()) {
+ showError(qsTr("Failed to lock images directory."));
+ return;
+ }
+
+ metaData.setMetaData();
+
+ var fileName = fileNaming.imageFileName();
+ if (!imageMode.capture(fileName)) {
+ showError(qsTr("Failed to capture image. Please restart the camera."));
+ return;
+ }
+
+ trackerStore.storeImage(fileName);
+ }
+
+ CaptureButton {