03f46a02958b4b0e31fe42cabb9621022c3bfe10
[harmattan/cameraplus] / qml / ImagePage.qml
1 // -*- qml -*-
2 import QtQuick 1.1
3 import com.nokia.meego 1.1
4 import QtCamera 1.0
5 import CameraPlus 1.0
6
7 CameraPage {
8         id: page
9
10         policyMode: CameraResources.Image
11         controlsVisible: capture.visible && cam.running && !standbyWidget.visible
12
13         Button {
14                 id: capture
15                 anchors.right: parent.right
16                 anchors.rightMargin: 20
17                 anchors.verticalCenter: parent.verticalCenter
18                 iconSource: "image://theme/icon-m-camera-shutter"
19                 width: 75
20                 height: 75
21                 opacity: 0.5
22                 onClicked: {
23                         if (!fileSystem.available) {
24                                 showError(qsTr("Camera cannot capture images in mass storage mode."));
25                         }
26                         else if (!imageMode.capture(fileNaming.imageFileName())) {
27                                 showError(qsTr("Failed to capture image. Please restart the camera."));
28                         }
29                 }
30
31                 visible: imageMode.canCapture && !cameraMode.animationRunning && !previewAnimationRunning && cam.running
32         }
33
34         ImageMode {
35                 id: imageMode
36                 camera: cam
37                 onPreviewAvailable: page.setPreview(preview);
38         }
39
40         FlashButton {
41                 id: flash
42                 visible: controlsVisible
43                 anchors.top: parent.top
44                 anchors.left: parent.left
45                 anchors.topMargin: 20
46                 anchors.leftMargin: 20
47         }
48
49         ImageSceneButton {
50                 id: scene
51                 visible: controlsVisible
52                 anchors.top: flash.bottom
53                 anchors.left: parent.left
54                 anchors.topMargin: 10
55                 anchors.leftMargin: 20
56         }
57
58         EvCompButton {
59                 id: evComp
60                 visible: controlsVisible
61                 anchors.top: scene.bottom
62                 anchors.left: parent.left
63                 anchors.topMargin: 10
64                 anchors.leftMargin: 20
65         }
66
67         Indicators {
68                 visible: controlsVisible
69                 anchors.bottom: parent.bottom
70                 anchors.bottomMargin: 20
71                 anchors.left: parent.left
72                 anchors.leftMargin: 20
73
74                 onClicked: openFile("ImageSettingsPage.qml");
75 //                Image {
76 ///                        
77 //                }
78         }
79
80         Button {
81                 id: cameraRoll
82                 anchors.top: parent.top
83                 anchors.right: parent.right
84                 anchors.topMargin: 20
85                 anchors.rightMargin: 20
86                 width: 56
87                 height: 56
88
89                 opacity: 0.5
90                 iconSource: "image://theme/icon-m-camera-roll"
91                 onClicked: openFile("PostCapturePage.qml");
92                 visible: controlsVisible
93         }
94
95         // TODO: metadata
96 }