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
35 orientationLock: PageOrientation.LockLandscape
37 function cameraError() {
38 mountProtector.unlock();
41 function captureImage() {
42 if (!checkBattery()) {
43 showError(qsTr("Not enough battery to capture images."));
47 if (!checkDiskSpace()) {
48 showError(qsTr("Not enough space to capture images."));
52 if (!fileSystem.available) {
53 showError(qsTr("Camera cannot capture images in mass storage mode."));
57 if (!mountProtector.lock()) {
58 showError(qsTr("Failed to lock images directory."));
62 metaData.setMetaData();
64 var fileName = fileNaming.imageFileName();
65 if (!imageMode.capture(fileName)) {
66 showError(qsTr("Failed to capture image. Please restart the camera."));
70 trackerStore.storeImage(fileName);
75 anchors.right: parent.right
76 anchors.rightMargin: 20
77 anchors.verticalCenter: parent.verticalCenter
78 iconSource: "image://theme/icon-m-camera-shutter"
82 onClicked: captureImage();
83 visible: imageMode.canCapture && !cameraMode.animationRunning && !previewAnimationRunning && cam.running
86 if (mouseX <= 0 || mouseY <= 0 || mouseX > width || mouseY > height) {
87 // Release outside the button:
88 cam.autoFocus.stopAutoFocus();
94 running: capture.pressed
97 if (cam.autoFocus.cafStatus != AutoFocus.Success) {
98 cam.autoFocus.startAutoFocus();
107 onPreviewAvailable: {
108 page.setPreview(preview);
109 cam.autoFocus.stopAutoFocus();
112 onSaved: mountProtector.unlock();
117 visible: controlsVisible
118 anchors.top: parent.top
119 anchors.left: parent.left
120 anchors.topMargin: 20
121 anchors.leftMargin: 20
126 visible: controlsVisible
127 anchors.top: flash.bottom
128 anchors.left: parent.left
129 anchors.topMargin: 10
130 anchors.leftMargin: 20
135 visible: controlsVisible
136 anchors.top: scene.bottom
137 anchors.left: parent.left
138 anchors.topMargin: 10
139 anchors.leftMargin: 20
144 anchors.bottom: parent.bottom
145 anchors.bottomMargin: 20
146 anchors.left: parent.left
147 anchors.leftMargin: 20
150 onClicked: openFile("ImageSettingsPage.qml");
151 visible: controlsVisible
157 source: indicators.pressed ? "image://theme/meegotouch-camera-settings-indicators-background-pressed" : "image://theme/meegotouch-camera-settings-indicators-background"
166 id: resolutionIndicator
167 source: "image://theme/" + Data.imageIcon(settings.imageAspectRatio, settings.imageResolution);
172 source: visible ? "image://theme/" + Data.wbIcon(settings.imageWhiteBalance) + "-screen" : ""
173 visible: settings.imageWhiteBalance != WhiteBalance.Auto
178 source: "image://theme/" + Data.cfIcon(settings.imageColorFilter) + "-screen"
179 visible: settings.imageColorFilter != ColorTone.Normal
184 visible: settings.imageIso != 0
185 source: "image://theme/" + Data.isoIcon(settings.imageIso);
190 visible: settings.useGps
191 source: "image://theme/icon-m-camera-location"
193 PropertyAnimation on opacity {
194 easing.type: Easing.OutSine
195 loops: Animation.Infinite
199 running: settings.useGps && !positionSource.position.longitudeValid
208 anchors.top: parent.top
209 anchors.right: parent.right
210 anchors.topMargin: 20
211 anchors.rightMargin: 20
216 iconSource: "image://theme/icon-m-camera-roll"
217 onClicked: openFile("PostCapturePage.qml");
218 visible: controlsVisible