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
28 // TODO: losing resources while playback won't show an error
30 // TODO: mass storage mode interaction
35 controlsVisible: false
36 policyMode: CameraResources.PostCapture
38 standbyVisible: !Qt.application.active
40 property Item currentItem: null
41 property bool available: currentItem ? currentItem.itemData.available : false
43 Component.onCompleted: postCaptureModel.reload();
45 function launchGallery() {
46 if (!gallery.launch()) {
47 showError(qsTr("Failed to launch gallery"));
51 function showInGallery() {
56 if (!gallery.show(currentItem.itemUrl)) {
57 showError(qsTr("Failed to launch gallery"));
64 MenuItem {text: qsTr("Captures in gallery"); onClicked: launchGallery(); }
65 MenuItem {text: qsTr("View in gallery"); enabled: available; onClicked: showInGallery(); }
69 function deleteCurrentItem() {
74 deleteDialog.message = currentItem.itemData.fileName;
80 titleText: qsTr("Delete item?");
81 acceptButtonText: qsTr("Yes");
82 rejectButtonText: qsTr("No");
84 if (!remove.remove(currentItem.itemData.url)) {
85 showError(qsTr("Failed to delete item"));
88 postCaptureModel.remove(currentItem.itemData);
97 function shareCurrentItem() {
102 if (!share.share(currentItem.itemData.url)) {
103 showError(qsTr("Failed to launch share service"));
126 startY: view.height / 2
127 PathLine { x: view.width * 2; y: view.height / 2 }
130 flickDeceleration: 999999 // Insanely high value to prevent panning multiple images
131 preferredHighlightBegin: 0.5
132 preferredHighlightEnd: 0.5
133 highlightRangeMode: PathView.StrictlyEnforceRange
136 model: PostCaptureModel {
138 manufacturer: deviceInfo.manufacturer
139 model: deviceInfo.model
141 console.log("Error populating model " + msg);
142 showError(qsTr("Failed to load captures"));
147 // TODO: Hide this when we have no items
148 text: qsTr("No captures available");
149 anchors.centerIn: parent
151 visible: currentItem == null
154 delegate: PostCaptureItem {
155 width: view.width - 10
163 anchors.bottom: parent.bottom
164 tools: ToolBarLayout {
166 ToolIcon { iconId: "icon-m-toolbar-back-white"; onClicked: { pageStack.pop(); } }
167 ToolIcon { iconId: available ? "icon-m-toolbar-favorite-mark-white" : "icon-m-toolbar-favorite-mark-dimmed-white"}
168 ToolIcon { iconId: available ? "icon-m-toolbar-share-white" : "icon-m-toolbar-share-dimmed-white"; onClicked: shareCurrentItem(); }
169 ToolIcon { iconId: available ? "icon-m-toolbar-delete-white" : "icon-m-toolbar-delete-dimmed-white"; onClicked: deleteCurrentItem(); }
170 ToolIcon { iconId: "icon-m-toolbar-view-menu-white"; onClicked: menu.open(); }
175 opacity: toolBar.opacity
176 anchors.top: parent.top
177 visible: toolBar.visible
179 tools: ToolBarLayout {
181 text: currentItem ? currentItem.itemData.title : ""
182 anchors.top: parent.top
183 anchors.bottom: parent.bottom
184 anchors.left: parent.left
186 verticalAlignment: Text.AlignVCenter
190 text: currentItem ? currentItem.itemData.created : ""
192 anchors.top: parent.top
193 anchors.bottom: parent.bottom
194 anchors.right: parent.right
195 verticalAlignment: Text.AlignVCenter