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
92 onTriggered: cam.autoFocus.startAutoFocus();
99 onPreviewAvailable: { page.setPreview(preview); cam.autoFocus.stopAutoFocus(); }
100 onSaved: mountProtector.unlock();
105 visible: controlsVisible
106 anchors.top: parent.top
107 anchors.left: parent.left
108 anchors.topMargin: 20
109 anchors.leftMargin: 20
114 visible: controlsVisible
115 anchors.top: flash.bottom
116 anchors.left: parent.left
117 anchors.topMargin: 10
118 anchors.leftMargin: 20
123 visible: controlsVisible
124 anchors.top: scene.bottom
125 anchors.left: parent.left
126 anchors.topMargin: 10
127 anchors.leftMargin: 20
132 anchors.bottom: parent.bottom
133 anchors.bottomMargin: 20
134 anchors.left: parent.left
135 anchors.leftMargin: 20
138 onClicked: openFile("ImageSettingsPage.qml");
139 visible: controlsVisible
145 source: indicators.pressed ? "image://theme/meegotouch-camera-settings-indicators-background-pressed" : "image://theme/meegotouch-camera-settings-indicators-background"
154 id: resolutionIndicator
155 source: "image://theme/" + Data.imageIcon(settings.imageAspectRatio, settings.imageResolution);
160 source: "image://theme/" + Data.wbIcon(settings.imageWhiteBalance) + "-screen"
161 visible: settings.imageWhiteBalance != WhiteBalance.Auto
166 source: "image://theme/" + Data.cfIcon(settings.imageColorFilter) + "-screen"
167 visible: settings.imageColorFilter != ColorTone.Normal
172 visible: settings.imageIso != 0
173 source: "image://theme/" + Data.isoIcon(settings.imageIso);
178 visible: settings.useGps
179 source: "image://theme/icon-m-camera-location"
181 PropertyAnimation on opacity {
182 easing.type: Easing.OutSine
183 loops: Animation.Infinite
187 running: settings.useGps && !positionSource.position.longitudeValid
196 anchors.top: parent.top
197 anchors.right: parent.right
198 anchors.topMargin: 20
199 anchors.rightMargin: 20
204 iconSource: "image://theme/icon-m-camera-roll"
205 onClicked: openFile("PostCapturePage.qml");
206 visible: controlsVisible