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
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: { page.setPreview(preview); cam.autoFocus.stopAutoFocus(); }
104 onSaved: mountProtector.unlock();
109 visible: controlsVisible
110 anchors.top: parent.top
111 anchors.left: parent.left
112 anchors.topMargin: 20
113 anchors.leftMargin: 20
118 visible: controlsVisible
119 anchors.top: flash.bottom
120 anchors.left: parent.left
121 anchors.topMargin: 10
122 anchors.leftMargin: 20
127 visible: controlsVisible
128 anchors.top: scene.bottom
129 anchors.left: parent.left
130 anchors.topMargin: 10
131 anchors.leftMargin: 20
136 anchors.bottom: parent.bottom
137 anchors.bottomMargin: 20
138 anchors.left: parent.left
139 anchors.leftMargin: 20
142 onClicked: openFile("ImageSettingsPage.qml");
143 visible: controlsVisible
149 source: indicators.pressed ? "image://theme/meegotouch-camera-settings-indicators-background-pressed" : "image://theme/meegotouch-camera-settings-indicators-background"
158 id: resolutionIndicator
159 source: "image://theme/" + Data.imageIcon(settings.imageAspectRatio, settings.imageResolution);
164 source: "image://theme/" + Data.wbIcon(settings.imageWhiteBalance) + "-screen"
165 visible: settings.imageWhiteBalance != WhiteBalance.Auto
170 source: "image://theme/" + Data.cfIcon(settings.imageColorFilter) + "-screen"
171 visible: settings.imageColorFilter != ColorTone.Normal
176 visible: settings.imageIso != 0
177 source: "image://theme/" + Data.isoIcon(settings.imageIso);
182 visible: settings.useGps
183 source: "image://theme/icon-m-camera-location"
185 PropertyAnimation on opacity {
186 easing.type: Easing.OutSine
187 loops: Animation.Infinite
191 running: settings.useGps && !positionSource.position.longitudeValid
200 anchors.top: parent.top
201 anchors.right: parent.right
202 anchors.topMargin: 20
203 anchors.rightMargin: 20
208 iconSource: "image://theme/icon-m-camera-roll"
209 onClicked: openFile("PostCapturePage.qml");
210 visible: controlsVisible