X-Git-Url: http://cgit.sxemacs.org/?p=harmattan%2Fcameraplus;a=blobdiff_plain;f=qml%2FMainPage.qml;h=c4f5de4a5cda6b179b9f44c4fe4fd79aff201889;hp=0f5c5172130640894a77dcbcac7fa2d47e14a263;hb=c54bd1327085d9e1d8a9ff3236aa805842545a3e;hpb=3a0a63499a4a2f1b19e5f444fcab2d9a26640b1d diff --git a/qml/MainPage.qml b/qml/MainPage.qml index 0f5c517..c4f5de4 100644 --- a/qml/MainPage.qml +++ b/qml/MainPage.qml @@ -25,11 +25,13 @@ import QtCamera 1.0 import CameraPlus 1.0 // TODO: flash not ready (battery low or flash not ready message) -// TODO: front camera +// TODO: front camera night mode CameraPage { id: root + property bool deviceChangeInProgress: false + CameraTheme { id: cameraTheme } @@ -80,14 +82,33 @@ CameraPage { Settings { id: settings + onDeviceAboutToChange: { + root.deviceChangeInProgress = true + } + onDeviceChanged: { + viewfinder.cameraDeviceChanged() + // Reset pipeline manager error pipelineManager.error = false if (root.resetCamera(settings.device, settings.mode)) { + root.deviceChangeInProgress = false pipelineManager.startCamera() } } + + onImageAspectRatioChanged: { + imageSettings.setImageResolution() + } + + onImageResolutionChanged: { + imageSettings.setImageResolution() + } + + onVideoResolutionChanged: { + videoSettings.setVideoResolution() + } } PipelineManager { @@ -102,6 +123,13 @@ CameraPage { return false } + if (mode == Camera.ImageMode) { + imageSettings.setImageResolution() + } + else if (mode == Camera.VideoMode) { + videoSettings.setVideoResolution() + } + return true } @@ -174,11 +202,13 @@ CameraPage { id: fileNaming imageSuffix: viewfinder.camera.imageSuffix videoSuffix: viewfinder.camera.videoSuffix + imagePath: platformSettings.imagePath + videoPath: platformSettings.videoPath + temporaryVideoPath: platformSettings.temporaryVideoPath } MountProtector { id: mountProtector - path: fileNaming.path } TrackerStore { @@ -188,10 +218,6 @@ CameraPage { model: deviceInfo.model } - function checkDiskSpace() { - return fileSystem.hasFreeSpace(fileNaming.path) - } - ImageSettings { id: imageSettings camera: viewfinder.camera @@ -201,12 +227,6 @@ CameraPage { showError(qsTr("Failed to set required resolution")) } } - - onReadyChanged: { - if (ready) { - imageSettings.setImageResolution() - } - } } VideoSettings { @@ -218,28 +238,6 @@ CameraPage { showError(qsTr("Failed to set required resolution")) } } - - onReadyChanged: { - if (ready) { - videoSettings.setVideoResolution() - } - } - } - - Connections { - target: settings - - onImageAspectRatioChanged: { - imageSettings.setImageResolution() - } - - onImageResolutionChanged: { - imageSettings.setImageResolution() - } - - onVideoResolutionChanged: { - videoSettings.setVideoResolution() - } } ModeController {