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 (!fileSystem.available) {
48 showError(qsTr("Camera cannot capture images in mass storage mode."));
52 if (!checkDiskSpace()) {
53 showError(qsTr("Not enough space to capture images."));
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.busy && dimmer.opacity == 0.0 && !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 anchors.top: parent.top
118 anchors.topMargin: 20
119 anchors.left: parent.left
120 anchors.leftMargin: 20
127 visible: controlsVisible
135 id: resolutionIndicator
136 source: "image://theme/" + Data.imageIcon(settings.imageAspectRatio, settings.imageResolution);
141 source: visible ? "image://theme/" + Data.wbIcon(settings.imageWhiteBalance) + "-screen" : ""
142 visible: settings.imageWhiteBalance != WhiteBalance.Auto
147 source: "image://theme/" + Data.cfIcon(settings.imageColorFilter) + "-screen"
148 visible: settings.imageColorFilter != ColorTone.Normal
153 visible: settings.imageIso != 0
154 source: "image://theme/" + Data.isoIcon(settings.imageIso);
159 visible: settings.useGps
160 source: "image://theme/icon-m-camera-location"
162 PropertyAnimation on opacity {
163 easing.type: Easing.OutSine
164 loops: Animation.Infinite
168 running: settings.useGps && !positionSource.position.longitudeValid
177 anchors.top: parent.top
178 anchors.right: parent.right
179 anchors.topMargin: 20
180 anchors.rightMargin: 20
185 iconSource: "image://theme/icon-m-camera-roll"
186 onClicked: openFile("PostCapturePage.qml");
187 visible: controlsVisible
192 anchors.bottom: parent.bottom
193 anchors.bottomMargin: 20
194 anchors.left: parent.left
195 anchors.leftMargin: 20
197 targetWidth: parent.width - (anchors.leftMargin * 2) - (66 * 1.5)
198 visible: controlsVisible
199 expanded: settings.showToolBar
200 onExpandedChanged: settings.showToolBar = expanded;
204 onClicked: toolBar.push(items);
207 onClicked: toolBar.push(items);
210 onClicked: toolBar.push(items);
212 ImageWhiteBalanceButton {
213 onClicked: toolBar.push(items);
215 ImageColorFilterButton {
216 onClicked: toolBar.push(items);
219 onClicked: toolBar.push(items);
222 iconSource: "image://theme/icon-m-toolbar-view-menu-white"
223 onClicked: openFile("ImageSettingsPage.qml");