property string creationDate: created
property string itemTitle: title
property bool itemAvailable: available
+ property url itemUrl: url
function startPlayback() {
openFileNow("VideoPlayerPage.qml");
// TODO: losing resources while playback won't show an error
// TODO: show something if we have no files.
// TODO: favorites
-// TODO: share
// TODO: menu
CameraPage {
id: page
}
}
+ function shareCurrentItem() {
+ if (!available) {
+ return;
+ }
+
+ share.share(currentItem.itemUrl);
+ }
+
+ ShareHelper {
+ id: share
+ }
+
Rectangle {
color: "black"
anchors.fill: parent
id: layout
ToolIcon { iconId: "icon-m-toolbar-back-white"; onClicked: { pageStack.pop(); } }
ToolIcon { iconId: available ? "icon-m-toolbar-favorite-mark-white" : "icon-m-toolbar-favorite-mark-dimmed-white"}
- ToolIcon { iconId: available ? "icon-m-toolbar-share-white" : "icon-m-toolbar-share-dimmed-white" }
+ ToolIcon { iconId: available ? "icon-m-toolbar-share-white" : "icon-m-toolbar-share-dimmed-white"; onClicked: shareCurrentItem(); }
ToolIcon { iconId: available ? "icon-m-toolbar-delete-white" : "icon-m-toolbar-delete-dimmed-white"; onClicked: deleteCurrentItem(); }
ToolIcon { iconId: "icon-m-toolbar-view-menu-white" }
}
#include "mountprotector.h"
#include "trackerstore.h"
#include "focusrectangle.h"
+#include "sharehelper.h"
static void initQuill() {
// TODO: All these are hardcoded.
qmlRegisterType<MountProtector>("CameraPlus", 1, 0, "MountProtector");
qmlRegisterType<TrackerStore>("CameraPlus", 1, 0, "TrackerStore");
qmlRegisterType<FocusRectangle>("CameraPlus", 1, 0, "FocusRectangle");
+ qmlRegisterType<ShareHelper>("CameraPlus", 1, 0, "ShareHelper");
QUrl sourceUrl = QUrl::fromLocalFile(QDir::currentPath() + "/main.qml");
view.setSource(sourceUrl);
--- /dev/null
+/*!
+ * This file is part of CameraPlus.
+ *
+ * Copyright (C) 2012 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
+ */
+
+#include "sharehelper.h"
+#include <QDBusInterface>
+#include <QStringList>
+#include <QUrl>
+#include <QDeclarativeInfo>
+
+ShareHelper::ShareHelper(QObject *parent) :
+ QObject(parent) {
+
+}
+
+ShareHelper::~ShareHelper() {
+
+}
+
+void ShareHelper::share(const QUrl& path) {
+ QDBusInterface iface("com.nokia.ShareUi", "/", "com.nokia.maemo.meegotouch.ShareUiInterface",
+ QDBusConnection::sessionBus());
+
+ iface.call("share", QStringList() << path.toLocalFile());
+}
--- /dev/null
+// -*- c++ -*-
+
+/*!
+ * This file is part of CameraPlus.
+ *
+ * Copyright (C) 2012 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
+ */
+
+#ifndef SHARE_HELPER_H
+#define SHARE_HELPER_H
+
+#include <QObject>
+
+class QUrl;
+
+class ShareHelper : public QObject {
+ Q_OBJECT
+
+public:
+ ShareHelper(QObject *parent = 0);
+ ~ShareHelper();
+
+public slots:
+ void share(const QUrl& path);
+};
+
+#endif /* SHARE_HELPER_H */
DEPENDPATH += . ../
INCLUDEPATH += . ../
-QT += declarative opengl
+QT += declarative opengl dbus
CONFIG += link_pkgconfig debug static mobility qtsparql
SOURCES += main.cpp settings.cpp filenaming.cpp quillitem.cpp displaystate.cpp fsmonitor.cpp \
cameraresources.cpp compass.cpp orientation.cpp geocode.cpp mountprotector.cpp \
- trackerstore.cpp focusrectangle.cpp
+ trackerstore.cpp focusrectangle.cpp sharehelper.cpp
HEADERS += settings.h filenaming.h quillitem.h displaystate.h fsmonitor.h \
cameraresources.h compass.h orientation.h geocode.h mountprotector.h \
- trackerstore.h focusrectangle.h
+ trackerstore.h focusrectangle.h sharehelper.h