Kill post capture menu
authorMohammed Sameer <msameer@foolab.org>
Wed, 7 Aug 2013 20:29:09 +0000 (23:29 +0300)
committerMohammed Sameer <msameer@foolab.org>
Wed, 7 Aug 2013 20:29:09 +0000 (23:29 +0300)
- show current image in gallery was not working so removed.
- move launch gallery from menu to the toolbar.

Also cleaned up the C++ code.

data/n9/cameraplus.ini
qml/PostCaptureView.qml
qml/harmattan/CameraMenu.qml [deleted file]
qml/harmattan/CameraMenuAction.qml [deleted file]
qml/harmattan/CameraTheme.qml
qml/harmattan/harmattan.qrc
src/galleryhelper.cpp
src/galleryhelper.h

index 9c801a3..1fb3253 100644 (file)
@@ -17,7 +17,7 @@ type = dbus
 path = /
 interface = com.nokia.maemo.meegotouch.GalleryInterface
 dest = com.nokia.Gallery
-method = camera-roll:showCameraRoll|show-media:showMediaInFullScreen
+method = camera-roll:showCameraRoll
 
 [share]
 enabled = true
index 8bbd1d4..a34e431 100644 (file)
@@ -26,6 +26,7 @@ import QtCamera 1.0
 
 // TODO: qrc:/qml/PostCaptureView.qml:104:5: QML CameraToolBar: Binding loop detected for property "height"
 // TODO: try to reload the preview thumbnail when the picture becomes available
+// TODO: prevent flicking to this view while preview animation is running
 Item {
     id: postCaptureView
 
@@ -125,7 +126,7 @@ Item {
         opacity: 0.8
 
         property bool show: deleteDialog.isOpen || deleteDialog.isOpening ||
-            hideTimer.running || menu.isOpen || menu.isOpening ||
+            hideTimer.running ||
             (view.currentItem && view.currentItem.error) && !view.currentItem.playing
 
         Behavior on anchors.bottomMargin {
@@ -161,9 +162,9 @@ Item {
             }
 
             CameraToolIcon {
-                iconId: cameraTheme.menuIconId
+                iconId: cameraTheme.galleryIconId
                 onClicked: {
-                    menu.open()
+                    launchGallery()
                     restartTimer()
                 }
             }
@@ -191,24 +192,6 @@ Item {
         }
     }
 
-    CameraMenu {
-        id: menu
-        onStatusChanged: restartTimer()
-
-        actions: [
-            CameraMenuAction {
-                text: qsTr("Captures in gallery")
-                onClicked: launchGallery()
-            },
-            CameraMenuAction {
-                // TODO: this is not working...
-                text: qsTr("View in gallery")
-                enabled: available
-                onClicked: showInGallery()
-            }
-        ]
-    }
-
     Rectangle {
         opacity: toolBar.opacity
         anchors.top: parent.top
@@ -258,16 +241,6 @@ Item {
         }
     }
 
-    function showInGallery() {
-        if (!available) {
-            return
-        }
-
-        if (!gallery.show(view.currentItem.itemUrl)) {
-            showError(qsTr("Failed to launch gallery"))
-        }
-    }
-
     function deleteCurrentItem() {
         if (!available) {
             return
diff --git a/qml/harmattan/CameraMenu.qml b/qml/harmattan/CameraMenu.qml
deleted file mode 100644 (file)
index ec8afd0..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-// -*- qml -*-
-
-/*!
- * This file is part of CameraPlus.
- *
- * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-import QtQuick 1.1
-import com.nokia.meego 1.1
-
-Menu {
-    id: menu
-
-    property bool isOpen: status == DialogStatus.Open
-    property bool isOpening: status == DialogStatus.Opening
-
-    property list<CameraMenuAction> actions
-
-    MenuLayout {
-        Repeater {
-            model: menu.actions
-            delegate: MenuItem {
-                text: modelData.text
-                enabled: modelData.enabled
-                onClicked: modelData.clicked()
-            }
-        }
-    }
-}
diff --git a/qml/harmattan/CameraMenuAction.qml b/qml/harmattan/CameraMenuAction.qml
deleted file mode 100644 (file)
index a7d32ad..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// -*- qml -*-
-
-/*!
- * This file is part of CameraPlus.
- *
- * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-import QtQuick 1.1
-import com.nokia.meego 1.1
-
-QtObject {
-    property string text
-    property bool enabled: true
-    signal clicked
-}
index fe2904b..c17fcad 100644 (file)
@@ -48,7 +48,7 @@ QtObject {
     property string shareIconId: "icon-m-toolbar-share-white"
     property string favoriteMarkIconId: "icon-m-toolbar-favorite-mark-white"
     property string favoriteUnmarkIconId: "icon-m-toolbar-favorite-unmark-white"
-    property string menuIconId: "icon-m-toolbar-view-menu-white"
+    property string galleryIconId: "icon-m-camera-roll"
 
     property string flashAutoIconId: "icon-m-camera-flash-auto"
     property string flashOnIconId: "icon-m-camera-flash-always"
index c5c2b34..7b4af28 100644 (file)
@@ -12,8 +12,6 @@
        <file>CameraWindow.qml</file>
        <file>CameraInfoBanner.qml</file>
        <file>CameraButtonStyle.qml</file>
-       <file>CameraMenu.qml</file>
-       <file>CameraMenuAction.qml</file>
        <file>FullScreenThumbnail.qml</file>
        <file>CameraPositionSource.qml</file>
        <file>CameraPage.qml</file>
index fc886f4..16d777e 100644 (file)
@@ -31,16 +31,6 @@ GalleryHelper::~GalleryHelper() {
 
 }
 
-bool GalleryHelper::show(const QUrl& path) {
-  // TODO: this is not working and I don't know why.
-  QStringList args;
-  args << path.toLocalFile();
-
-  QVariant var(args);
-
-  return asyncCall("show-media", var);
-}
-
 bool GalleryHelper::launch() {
   return asyncCall("camera-roll");
 }
index 80e7c77..6ee67fb 100644 (file)
@@ -34,7 +34,6 @@ public:
   GalleryHelper(QObject *parent = 0);
   ~GalleryHelper();
 
-  Q_INVOKABLE bool show(const QUrl& path);
   Q_INVOKABLE bool launch();
 };