From 64662ecc6ea6b5296ea77d83eac6eb1372afac01 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Tue, 27 Sep 2011 20:22:49 +0200 Subject: new crappy map watchlet --- libsowatch/watch.cpp | 1 + qmafwwatchlet/qmafwwatchlet.cpp | 6 ---- qmapwatchlet/metawatch-digital.qml | 36 ++++++++++++++++++++ qmapwatchlet/qmapwatchlet.cpp | 11 ++++++ qmapwatchlet/qmapwatchlet.h | 18 ++++++++++ qmapwatchlet/qmapwatchlet.pro | 48 +++++++++++++++++++++++++++ qmapwatchlet/qmapwatchlet.qrc | 5 +++ qmapwatchlet/qmapwatchletplugin.cpp | 29 ++++++++++++++++ qmapwatchlet/qmapwatchletplugin.h | 24 ++++++++++++++ qtc_packaging/debian_harmattan/changelog | 2 +- qtc_packaging/debian_harmattan/control | 13 ++++++-- qtc_packaging/debian_harmattan/manifest.aegis | 9 +++++ sowatch.pro | 3 +- 13 files changed, 194 insertions(+), 11 deletions(-) create mode 100644 qmapwatchlet/metawatch-digital.qml create mode 100644 qmapwatchlet/qmapwatchlet.cpp create mode 100644 qmapwatchlet/qmapwatchlet.h create mode 100644 qmapwatchlet/qmapwatchlet.pro create mode 100644 qmapwatchlet/qmapwatchlet.qrc create mode 100644 qmapwatchlet/qmapwatchletplugin.cpp create mode 100644 qmapwatchlet/qmapwatchletplugin.h diff --git a/libsowatch/watch.cpp b/libsowatch/watch.cpp index e62c6c4..e37cdf8 100644 --- a/libsowatch/watch.cpp +++ b/libsowatch/watch.cpp @@ -17,4 +17,5 @@ Watch::~Watch() void Watch::vibrate(int msecs) { /* The default implementation does nothing. */ + Q_UNUSED(msecs); } diff --git a/qmafwwatchlet/qmafwwatchlet.cpp b/qmafwwatchlet/qmafwwatchlet.cpp index e2f41a2..d53d136 100644 --- a/qmafwwatchlet/qmafwwatchlet.cpp +++ b/qmafwwatchlet/qmafwwatchlet.cpp @@ -5,12 +5,6 @@ using namespace sowatch; -class WatchletPlayer : public QObject -{ - Q_OBJECT -}; - - QMafwWatchlet::QMafwWatchlet(WatchServer* server) : DeclarativeWatchlet(server, "com.javispedro.sowatch.qmafw"), _registry(MafwRegistry::instance()), diff --git a/qmapwatchlet/metawatch-digital.qml b/qmapwatchlet/metawatch-digital.qml new file mode 100644 index 0000000..16206db --- /dev/null +++ b/qmapwatchlet/metawatch-digital.qml @@ -0,0 +1,36 @@ +import QtQuick 1.0 +import QtMobility.location 1.2 + +Rectangle { + width: 96 + height: 96 + + color: "white" + + PositionSource { + id: pos + updateInterval: 5000 + active: watch.active + } + + Map { + id: map + anchors.fill: parent; + plugin : Plugin { name : "nokia" } + center: pos.position.coordinate + } + + Connections { + target: watch + onButtonPressed : { + switch(button) { + case 1: + map.zoomLevel -= 1; + break; + case 2: + map.zoomLevel += 1; + break; + } + } + } +} diff --git a/qmapwatchlet/qmapwatchlet.cpp b/qmapwatchlet/qmapwatchlet.cpp new file mode 100644 index 0000000..c77ede4 --- /dev/null +++ b/qmapwatchlet/qmapwatchlet.cpp @@ -0,0 +1,11 @@ +#include "qmapwatchlet.h" + +using namespace sowatch; + +QMapWatchlet::QMapWatchlet(WatchServer* server) : + DeclarativeWatchlet(server, "com.javispedro.sowatch.map") +{ + + setSource(QUrl("qrc:/qmapwatchlet/" + server->watch()->model() + ".qml")); +} + diff --git a/qmapwatchlet/qmapwatchlet.h b/qmapwatchlet/qmapwatchlet.h new file mode 100644 index 0000000..ae8e7ea --- /dev/null +++ b/qmapwatchlet/qmapwatchlet.h @@ -0,0 +1,18 @@ +#ifndef QMAPWATCHLET_H +#define QMAPWATCHLET_H + +#include + +namespace sowatch +{ + +class QMapWatchlet : public DeclarativeWatchlet +{ + Q_OBJECT +public: + explicit QMapWatchlet(WatchServer* server); +}; + +} + +#endif // QMAPWATCHLET_H diff --git a/qmapwatchlet/qmapwatchlet.pro b/qmapwatchlet/qmapwatchlet.pro new file mode 100644 index 0000000..da5cf6f --- /dev/null +++ b/qmapwatchlet/qmapwatchlet.pro @@ -0,0 +1,48 @@ + +TARGET = qmapwatchlet +TEMPLATE = lib +# CONFIG += plugin +CONFIG += mobility + +SOURCES += qmapwatchletplugin.cpp qmapwatchlet.cpp + +HEADERS += qmapwatchletplugin.h qmapwatchlet.h + +win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../libsowatch/release/ -lsowatch +else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../libsowatch/debug/ -lsowatch +else:symbian: LIBS += -lsowatch +else:unix: LIBS += -L$$OUT_PWD/../libsowatch/ -lsowatch + +INCLUDEPATH += $$PWD/../libsowatch +DEPENDPATH += $$PWD/../libsowatch + +unix:!symbian { + maemo5 { + target.path = /opt/sowatch/watchlets + } else { + target.path = /usr/lib/sowatch/watchlets + } + INSTALLS += target +} + +OTHER_FILES += \ + metawatch-digital.qml + +RESOURCES += \ + qmapwatchlet.qrc + + + + + + + + + + + + + + + + diff --git a/qmapwatchlet/qmapwatchlet.qrc b/qmapwatchlet/qmapwatchlet.qrc new file mode 100644 index 0000000..96c215e --- /dev/null +++ b/qmapwatchlet/qmapwatchlet.qrc @@ -0,0 +1,5 @@ + + + metawatch-digital.qml + + diff --git a/qmapwatchlet/qmapwatchletplugin.cpp b/qmapwatchlet/qmapwatchletplugin.cpp new file mode 100644 index 0000000..5b72482 --- /dev/null +++ b/qmapwatchlet/qmapwatchletplugin.cpp @@ -0,0 +1,29 @@ +#include "qmapwatchlet.h" +#include "qmapwatchletplugin.h" + +using namespace sowatch; + +QMapWatchletPlugin::QMapWatchletPlugin(QObject *parent) : + QObject(parent) +{ +} + +QMapWatchletPlugin::~QMapWatchletPlugin() +{ +} + +QStringList QMapWatchletPlugin::watchlets() +{ + QStringList l; + l << "com.javispedro.sowatch.qmap"; + return l; +} + +Watchlet* QMapWatchletPlugin::getWatchlet(const QString& driver, QSettings& settings, WatchServer *server) +{ + Q_UNUSED(driver); + Q_UNUSED(settings); + return new QMapWatchlet(server); +} + +Q_EXPORT_PLUGIN2(qmapwatchlet, QMapWatchletPlugin) diff --git a/qmapwatchlet/qmapwatchletplugin.h b/qmapwatchlet/qmapwatchletplugin.h new file mode 100644 index 0000000..e594209 --- /dev/null +++ b/qmapwatchlet/qmapwatchletplugin.h @@ -0,0 +1,24 @@ +#ifndef QMAPWATCHLETPLUGIN_H +#define QMAPWATCHLETPLUGIN_H + +#include + +namespace sowatch +{ + +class QMapWatchletPlugin : public QObject, public WatchletPluginInterface +{ + Q_OBJECT + Q_INTERFACES(sowatch::WatchletPluginInterface) + +public: + explicit QMapWatchletPlugin(QObject *parent = 0); + ~QMapWatchletPlugin(); + + QStringList watchlets(); + Watchlet* getWatchlet(const QString& driver, QSettings& settings, WatchServer* server); +}; + +} + +#endif // QMAPWATCHLETPLUGIN_H diff --git a/qtc_packaging/debian_harmattan/changelog b/qtc_packaging/debian_harmattan/changelog index 0128649..5a9190c 100644 --- a/qtc_packaging/debian_harmattan/changelog +++ b/qtc_packaging/debian_harmattan/changelog @@ -1,4 +1,4 @@ -sowatch (0.1.1) unstable; urgency=low +sowatch (0.2.0) unstable; urgency=low * Initial Release. diff --git a/qtc_packaging/debian_harmattan/control b/qtc_packaging/debian_harmattan/control index 0253449..c5850ec 100644 --- a/qtc_packaging/debian_harmattan/control +++ b/qtc_packaging/debian_harmattan/control @@ -2,13 +2,20 @@ Source: sowatch Section: user/other Priority: optional Maintainer: Javier -Build-Depends: debhelper (>= 5), libqt4-dev, libqtm-dev +Build-Depends: debhelper (>= 5), libqt4-dev, libqtm-dev, libqmafw0-dev, + libnotificationsystem-dev Standards-Version: 3.7.3 -Homepage: +Homepage: http://gitorious.org/sowatch Package: sowatch Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Bluetooth smartwatch manager - + sowatch is a manager for bluetooth-enabled smartwatches, whose display + can be controlled by a device via a bluetooth based protocol. + This framework provides several features for such smartwatches: + - Notifications support: incoming calls, messages, etc. + - Watchlets: control the media player or view a map. + . + Currently, only the MetaWatch is supported. XSBC-Maemo-Display-Name: Smart Open Watch diff --git a/qtc_packaging/debian_harmattan/manifest.aegis b/qtc_packaging/debian_harmattan/manifest.aegis index e69de29..480b230 100644 --- a/qtc_packaging/debian_harmattan/manifest.aegis +++ b/qtc_packaging/debian_harmattan/manifest.aegis @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/sowatch.pro b/sowatch.pro index 90e1eb1..afd8b49 100644 --- a/sowatch.pro +++ b/sowatch.pro @@ -5,7 +5,8 @@ SUBDIRS = libsowatch \ sysinfowatchlet !isEmpty(MEEGO_VERSION_MAJOR) { - SUBDIRS += meegohandsetnotification ckitcallnotification qmafwwatchlet + SUBDIRS += meegohandsetnotification ckitcallnotification \ + qmafwwatchlet qmapwatchlet } unix:!symbian { -- cgit v1.2.3