4 * This file is part of CameraPlus.
6 * Copyright (C) 2012 Mohammed Sameer <msameer@foolab.org>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 import com.nokia.meego 1.1
27 import "data.js" as Data
32 policyMode: CameraResources.Image
33 controlsVisible: capture.visible && cam.running && !standbyWidget.visible
35 orientationLock: PageOrientation.LockLandscape
37 function captureImage() {
38 if (!checkBattery()) {
39 showError(qsTr("Not enough battery to capture images."));
43 if (!checkDiskSpace()) {
44 showError(qsTr("Not enough space to capture images."));
48 if (!fileSystem.available) {
49 showError(qsTr("Camera cannot capture images in mass storage mode."));
53 if (!mountProtector.lock()) {
54 showError(qsTr("Failed to lock images directory."));
58 metaData.setMetaData();
60 var fileName = fileNaming.imageFileName();
61 if (!imageMode.capture(fileName)) {
62 showError(qsTr("Failed to capture image. Please restart the camera."));
66 trackerStore.storeImage(fileName);
71 anchors.right: parent.right
72 anchors.rightMargin: 20
73 anchors.verticalCenter: parent.verticalCenter
74 iconSource: "image://theme/icon-m-camera-shutter"
78 onClicked: captureImage();
79 visible: imageMode.canCapture && !cameraMode.animationRunning && !previewAnimationRunning && cam.running && !standbyWidget.visible
82 if (mouseX <= 0 || mouseY <= 0 || mouseX > width || mouseY > height) {
83 // Release outside the button:
84 cam.autoFocus.stopAutoFocus();
90 running: capture.pressed
93 if (cam.autoFocus.cafStatus != AutoFocus.Success) {
94 cam.autoFocus.startAutoFocus();
103 onPreviewAvailable: {
104 if (!standbyWidget.visible) {
105 page.setPreview(preview);
108 cam.autoFocus.stopAutoFocus();
111 onSaved: mountProtector.unlock();
116 visible: controlsVisible
117 anchors.top: parent.top
118 anchors.left: parent.left
119 anchors.topMargin: 20
120 anchors.leftMargin: 20
125 visible: controlsVisible
126 anchors.top: flash.bottom
127 anchors.left: parent.left
128 anchors.topMargin: 10
129 anchors.leftMargin: 20
134 visible: controlsVisible
135 anchors.top: scene.bottom
136 anchors.left: parent.left
137 anchors.topMargin: 10
138 anchors.leftMargin: 20
143 anchors.bottom: parent.bottom
144 anchors.bottomMargin: 20
145 anchors.left: parent.left
146 anchors.leftMargin: 20
149 onClicked: openFile("ImageSettingsPage.qml");
150 visible: controlsVisible
156 source: indicators.pressed ? "image://theme/meegotouch-camera-settings-indicators-background-pressed" : "image://theme/meegotouch-camera-settings-indicators-background"
165 id: resolutionIndicator
166 source: "image://theme/" + Data.imageIcon(settings.imageAspectRatio, settings.imageResolution);
171 source: "image://theme/" + Data.wbIcon(settings.imageWhiteBalance) + "-screen"
172 visible: settings.imageWhiteBalance != WhiteBalance.Auto
177 source: "image://theme/" + Data.cfIcon(settings.imageColorFilter) + "-screen"
178 visible: settings.imageColorFilter != ColorTone.Normal
183 visible: settings.imageIso != 0
184 source: "image://theme/" + Data.isoIcon(settings.imageIso);
189 visible: settings.useGps
190 source: "image://theme/icon-m-camera-location"
192 PropertyAnimation on opacity {
193 easing.type: Easing.OutSine
194 loops: Animation.Infinite
198 running: settings.useGps && !positionSource.position.longitudeValid
207 anchors.top: parent.top
208 anchors.right: parent.right
209 anchors.topMargin: 20
210 anchors.rightMargin: 20
215 iconSource: "image://theme/icon-m-camera-roll"
216 onClicked: openFile("PostCapturePage.qml");
217 visible: controlsVisible