diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2011-10-02 16:39:40 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2011-10-02 16:39:40 +0200 |
commit | 0a656b75f3fc80f13424db0e7ec403dff28a366e (patch) | |
tree | 23f72a2fde3f718048b49d9806ded3d315d50a80 | |
parent | d9f132f3d5bf41ee4f30e7ea2bd1b61120fa29b7 (diff) | |
download | sowatch-0a656b75f3fc80f13424db0e7ec403dff28a366e.tar.gz sowatch-0a656b75f3fc80f13424db0e7ec403dff28a366e.zip |
new notifications list, time syncing
29 files changed, 349 insertions, 87 deletions
diff --git a/ckitcallnotification/ckitcallnotification.cpp b/ckitcallnotification/ckitcallnotification.cpp index 72a768e..7362e2d 100644 --- a/ckitcallnotification/ckitcallnotification.cpp +++ b/ckitcallnotification/ckitcallnotification.cpp @@ -39,14 +39,19 @@ void CKitCallNotification::activate() // TODO Actually do something } -void CKitCallNotification::clear() +void CKitCallNotification::dismiss() { // TODO Actually reject the call - emit cleared(); } void CKitCallNotification::changeDisplayName(const QString &displayName) { _displayName = displayName; + emit titleChanged(); emit changed(); } + +void CKitCallNotification::remove() +{ + emit dismissed(); +} diff --git a/ckitcallnotification/ckitcallnotification.h b/ckitcallnotification/ckitcallnotification.h index 10453be..bd65e63 100644 --- a/ckitcallnotification/ckitcallnotification.h +++ b/ckitcallnotification/ckitcallnotification.h @@ -21,16 +21,13 @@ public: QString body() const; void activate(); - void clear(); - -signals: - void changed(); - void cleared(); + void dismiss(); protected: QDateTime _dateTime; QString _displayName; void changeDisplayName(const QString& displayName); + void remove(); friend class CKitCallProvider; }; diff --git a/ckitcallnotification/ckitcallprovider.cpp b/ckitcallnotification/ckitcallprovider.cpp index acfcca3..5e00977 100644 --- a/ckitcallnotification/ckitcallprovider.cpp +++ b/ckitcallnotification/ckitcallprovider.cpp @@ -44,7 +44,7 @@ void CKitCallProvider::activeCallChanged() } else { // Call has either been answered, rejected, missed, .. if (_notification) { - _notification->clear(); + _notification->remove(); _notification->deleteLater(); _notification = 0; } diff --git a/libsowatch/declarativewatchlet.cpp b/libsowatch/declarativewatchlet.cpp index dbd4759..34a1d2a 100644 --- a/libsowatch/declarativewatchlet.cpp +++ b/libsowatch/declarativewatchlet.cpp @@ -24,7 +24,7 @@ DeclarativeWatchlet::DeclarativeWatchlet(WatchServer* server, const QString& id) } _engine = new QDeclarativeEngine(this); - _wrapper = new DeclarativeWatchWrapper(server->watch(), this); + _wrapper = new DeclarativeWatchWrapper(server, server->watch(), this); _engine->rootContext()->setContextProperty("watch", _wrapper); } diff --git a/libsowatch/declarativewatchwrapper.cpp b/libsowatch/declarativewatchwrapper.cpp index f7914f8..d972d86 100644 --- a/libsowatch/declarativewatchwrapper.cpp +++ b/libsowatch/declarativewatchwrapper.cpp @@ -1,11 +1,14 @@ #include <QtCore/QDebug> +#include "watchserver.h" #include "watch.h" +#include "notification.h" #include "declarativewatchwrapper.h" using namespace sowatch; -DeclarativeWatchWrapper::DeclarativeWatchWrapper(Watch* watch, QObject *parent) : - QObject(parent), _watch(watch), _active(false) +DeclarativeWatchWrapper::DeclarativeWatchWrapper(WatchServer* server, Watch* watch, QObject* parent) : + QObject(parent), _server(server), _watch(watch), + _active(false) { } @@ -20,6 +23,19 @@ bool DeclarativeWatchWrapper::active() const return _active; } +QList<QObject*> DeclarativeWatchWrapper::notifications() const +{ + // TODO: Figure a better way for this; QAbstractListModel, etc. + QList<Notification*> nl = _server->liveNotifications(); + QList<QObject*> ol; + foreach (Notification* n, nl) { + QObject * o = n; + ol.append(o); + } + qDebug() << "notifications declarative: " << ol; + return ol; +} + void DeclarativeWatchWrapper::vibrate(int msecs) { if (_active) { @@ -34,6 +50,9 @@ void DeclarativeWatchWrapper::activate() connect(_watch, SIGNAL(buttonReleased(int)), this, SIGNAL(buttonReleased(int))); _active = true; emit activeChanged(); + // Since a notification currently causes the active watchlet to be deactivated, + // we can assume notifications only change when we are deactivated. + emit notificationsChanged(); } } diff --git a/libsowatch/declarativewatchwrapper.h b/libsowatch/declarativewatchwrapper.h index 583b2d2..8d4fd7d 100644 --- a/libsowatch/declarativewatchwrapper.h +++ b/libsowatch/declarativewatchwrapper.h @@ -2,24 +2,30 @@ #define SOWATCH_DECLARATIVEWATCHWRAPPER_H #include <QtDeclarative/QtDeclarative> +#include "sowatch_global.h" namespace sowatch { +class WatchServer; class Watch; class DeclarativeWatchlet; +class Notification; -class DeclarativeWatchWrapper : public QObject +class SOWATCH_EXPORT DeclarativeWatchWrapper : public QObject { Q_OBJECT Q_PROPERTY(QString model READ model CONSTANT) Q_PROPERTY(bool active READ active NOTIFY activeChanged) + Q_PROPERTY(QList<QObject*> notifications READ notifications NOTIFY notificationsChanged) public: - explicit DeclarativeWatchWrapper(Watch *watch, QObject *parent = 0); + explicit DeclarativeWatchWrapper(WatchServer *server, Watch *watch, QObject *parent = 0); - Q_INVOKABLE QString model() const; - Q_INVOKABLE bool active() const; + QString model() const; + bool active() const; + + QList<QObject*> notifications() const; public slots: void vibrate(int msecs); @@ -29,8 +35,10 @@ signals: void buttonReleased(int button); void activeChanged(); + void notificationsChanged(); -protected: +private: + WatchServer *_server; Watch* _watch; bool _active; diff --git a/libsowatch/libsowatch.pro b/libsowatch/libsowatch.pro index 4c0d7dc..574e1a4 100644 --- a/libsowatch/libsowatch.pro +++ b/libsowatch/libsowatch.pro @@ -5,7 +5,6 @@ #------------------------------------------------- QT += gui declarative -CONFIG += mobility TARGET = sowatch TEMPLATE = lib @@ -66,30 +65,3 @@ unix:!symbian { } INSTALLS += install_headers target } - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libsowatch/notification.cpp b/libsowatch/notification.cpp index e321b58..62a9b7d 100644 --- a/libsowatch/notification.cpp +++ b/libsowatch/notification.cpp @@ -15,7 +15,7 @@ QString Notification::displayTime() const { QDateTime dt = dateTime(); int secsDiff = dt.secsTo(QDateTime::currentDateTime()); - if (secsDiff < 1) { + if (secsDiff < 20) { return ""; } else if (secsDiff < 60) { return tr("%n second(s) ago", "", secsDiff); diff --git a/libsowatch/notification.h b/libsowatch/notification.h index 1af0264..758a8b7 100644 --- a/libsowatch/notification.h +++ b/libsowatch/notification.h @@ -4,6 +4,7 @@ #include <QtCore/QString> #include <QtCore/QDateTime> #include <QtGui/QImage> +#include <QtDeclarative/QtDeclarative> #include "sowatch_global.h" namespace sowatch @@ -13,12 +14,13 @@ class SOWATCH_EXPORT Notification : public QObject { Q_OBJECT Q_ENUMS(Type) - Q_PROPERTY(Type type READ type) - Q_PROPERTY(uint count READ count) - Q_PROPERTY(QDateTime dateTime READ dateTime) - Q_PROPERTY(QString title READ title) - Q_PROPERTY(QString body READ body) - Q_PROPERTY(QImage image READ image) + Q_PROPERTY(Type type READ type CONSTANT) + Q_PROPERTY(uint count READ count NOTIFY countChanged) + Q_PROPERTY(QDateTime dateTime READ dateTime NOTIFY dateTimeChanged) + Q_PROPERTY(QString displayTime READ displayTime NOTIFY displayTimeChanged STORED false) + Q_PROPERTY(QString title READ title NOTIFY titleChanged) + Q_PROPERTY(QString body READ body NOTIFY bodyChanged) + Q_PROPERTY(QImage image READ image NOTIFY imageChanged) public: enum Type { @@ -45,14 +47,30 @@ public: virtual QImage image() const; public slots: + /** Do something on this notification; open the application that caused it, answer, etc. */ virtual void activate() = 0; - virtual void clear() = 0; + /** Dismiss this notification. */ + virtual void dismiss() = 0; signals: + /* For the convenience of QML users */ + void countChanged(); + void dateTimeChanged(); + void displayTimeChanged(); + void titleChanged(); + void bodyChanged(); + void imageChanged(); + + /** Generic "changed" signal if any of the properties changes; can be batched. */ void changed(); - void cleared(); + + /** The notification has been dismissed by the user or via dismiss(). */ + void dismissed(); + /* Provider of this notification object should delete it after dismissal. */ }; } +QML_DECLARE_TYPE(sowatch::Notification) + #endif // SOWATCH_NOTIFICATION_H diff --git a/libsowatch/notificationprovider.h b/libsowatch/notificationprovider.h index 31182f1..d5449f8 100644 --- a/libsowatch/notificationprovider.h +++ b/libsowatch/notificationprovider.h @@ -3,11 +3,12 @@ #include <QtCore/QObject> #include "notification.h" +#include "sowatch_global.h" namespace sowatch { -class NotificationProvider : public QObject +class SOWATCH_EXPORT NotificationProvider : public QObject { Q_OBJECT diff --git a/libsowatch/watch.h b/libsowatch/watch.h index bb4376c..f18ed9a 100644 --- a/libsowatch/watch.h +++ b/libsowatch/watch.h @@ -7,11 +7,12 @@ #include <QtGui/QPaintDevice> #include <QtGui/QImage> #include "notification.h" +#include "sowatch_global.h" namespace sowatch { -class Watch : public QObject, public QPaintDevice +class SOWATCH_EXPORT Watch : public QObject, public QPaintDevice { Q_OBJECT Q_PROPERTY(QString model READ model CONSTANT) diff --git a/libsowatch/watchpaintengine.h b/libsowatch/watchpaintengine.h index 7a97ad7..07e3868 100644 --- a/libsowatch/watchpaintengine.h +++ b/libsowatch/watchpaintengine.h @@ -2,11 +2,12 @@ #define SOWATCH_WATCHPAINTENGINE_H #include <QtGui/QPaintEngine> +#include "sowatch_global.h" namespace sowatch { -class WatchPaintEngine : public QPaintEngine +class SOWATCH_EXPORT WatchPaintEngine : public QPaintEngine { public: ~WatchPaintEngine(); diff --git a/libsowatch/watchserver.cpp b/libsowatch/watchserver.cpp index 9f11795..60c410d 100644 --- a/libsowatch/watchserver.cpp +++ b/libsowatch/watchserver.cpp @@ -12,12 +12,17 @@ WatchServer::WatchServer(Watch* watch, QObject* parent) : QObject(parent), _watch(watch), _nextWatchletButton(-1), _oldNotificationThreshold(300), - _currentWatchlet(0), _currentWatchletIndex(-1) + _currentWatchlet(0), _currentWatchletIndex(-1), + _syncTimeTimer(new QTimer(this)) { connect(_watch, SIGNAL(connected()), SLOT(watchConnected())); connect(_watch, SIGNAL(disconnected()), SLOT(watchDisconnected())); connect(_watch, SIGNAL(idling()), SLOT(watchIdling())); connect(_watch, SIGNAL(buttonPressed(int)), SLOT(watchButtonPress(int))); + connect(_syncTimeTimer, SIGNAL(timeout()), SLOT(syncTime())); + + _syncTimeTimer->setSingleShot(true); + _syncTimeTimer->setInterval(24 * 3600 * 1000); // Once a day } Watch* WatchServer::watch() @@ -53,6 +58,17 @@ void WatchServer::addProvider(NotificationProvider *provider) // And that's it, really. } +QList<Notification*> WatchServer::liveNotifications() +{ + QList<Notification*> notifications; + + for (int i = 0; i < Notification::TypeCount; i++) { + notifications.append(_notifications[i]); + } + + return notifications; +} + void WatchServer::runWatchlet(const QString& id) { if (_currentWatchlet) { @@ -105,16 +121,12 @@ void WatchServer::nextWatchlet() } } -void WatchServer::nextNotification() +void WatchServer::syncTime() { - if (!_watch->isConnected()) return; - if (!_pendingNotifications.empty()) { - Notification *n = _pendingNotifications.head(); - _watch->displayNotification(n); - } else if (_currentWatchlet) { - reactivateCurrentWatchlet(); - } else { - goToIdle(); + if (_watch->isConnected()) { + qDebug() << "syncing watch time"; + _watch->setDateTime(QDateTime::currentDateTime()); + _syncTimeTimer->start(); } } @@ -137,6 +149,7 @@ void WatchServer::goToIdle() void WatchServer::watchConnected() { + syncTime(); if (!_pendingNotifications.isEmpty()) { nextNotification(); } else if (_currentWatchlet) { @@ -148,6 +161,7 @@ void WatchServer::watchConnected() void WatchServer::watchDisconnected() { + _syncTimeTimer->stop(); if (_currentWatchlet) { _currentWatchlet->deactivate(); } @@ -184,7 +198,7 @@ void WatchServer::postNotification(Notification *notification) _notifications[type].append(notification); connect(notification, SIGNAL(changed()), SLOT(notificationChanged())); - connect(notification, SIGNAL(cleared()), SLOT(notificationCleared())); + connect(notification, SIGNAL(dismissed()), SLOT(notificationDismissed())); qDebug() << "notification received" << notification->title() << "(" << notification->count() << ")"; @@ -207,6 +221,19 @@ void WatchServer::postNotification(Notification *notification) } } +void WatchServer::nextNotification() +{ + if (!_watch->isConnected()) return; + if (!_pendingNotifications.empty()) { + Notification *n = _pendingNotifications.head(); + _watch->displayNotification(n); + } else if (_currentWatchlet) { + reactivateCurrentWatchlet(); + } else { + goToIdle(); + } +} + void WatchServer::notificationChanged() { QObject *obj = sender(); @@ -223,7 +250,7 @@ void WatchServer::notificationChanged() } } -void WatchServer::notificationCleared() +void WatchServer::notificationDismissed() { QObject *obj = sender(); if (obj) { @@ -231,7 +258,7 @@ void WatchServer::notificationCleared() const Notification::Type type = n->type(); _notifications[type].removeOne(n); - qDebug() << "notification deleted" << n->title() << "(" << n->count() << ")"; + qDebug() << "notification dismissed" << n->title() << "(" << n->count() << ")"; _watch->updateNotificationCount(type, getNotificationCount(type)); diff --git a/libsowatch/watchserver.h b/libsowatch/watchserver.h index 66c941a..a773749 100644 --- a/libsowatch/watchserver.h +++ b/libsowatch/watchserver.h @@ -5,6 +5,7 @@ #include <QtCore/QStringList> #include <QtCore/QMap> #include <QtCore/QQueue> +#include <QtCore/QTimer> #include "sowatch_global.h" #include "notification.h" @@ -32,12 +33,19 @@ public: void addProvider(NotificationProvider* provider); + /** Get a list of all current live notifications. */ + QList<Notification*> liveNotifications(); + public slots: void postNotification(Notification *notification); + void nextNotification(); + void runWatchlet(const QString& id); void closeWatchlet(); void nextWatchlet(); + void syncTime(); + private: Watch* _watch; @@ -61,10 +69,12 @@ private: /** The current watchlet index if any, for use by nextWatchlet() */ int _currentWatchletIndex; + /** Used for periodic time syncing. */ + QTimer* _syncTimeTimer; + void registerWatchlet(Watchlet *watchlet); void reactivateCurrentWatchlet(); - void nextNotification(); uint getNotificationCount(Notification::Type type); void goToIdle(); @@ -76,7 +86,7 @@ private slots: void watchButtonPress(int button); void notificationChanged(); - void notificationCleared(); + void notificationDismissed(); friend class Watchlet; }; diff --git a/libsowatch/watchsimulator.h b/libsowatch/watchsimulator.h index c9d69ba..8189dfe 100644 --- a/libsowatch/watchsimulator.h +++ b/libsowatch/watchsimulator.h @@ -1,14 +1,13 @@ #ifndef SOWATCH_WATCHSIMULATOR_H #define SOWATCH_WATCHSIMULATOR_H -#include <QtGui/QImage> - #include "watch.h" +#include "sowatch_global.h" namespace sowatch { -class WatchSimulator : public Watch +class SOWATCH_EXPORT WatchSimulator : public Watch { Q_OBJECT public: diff --git a/meegohandsetnotification/meegohandsetnotification.cpp b/meegohandsetnotification/meegohandsetnotification.cpp index 69e2bd5..41264b6 100644 --- a/meegohandsetnotification/meegohandsetnotification.cpp +++ b/meegohandsetnotification/meegohandsetnotification.cpp @@ -48,14 +48,35 @@ void MeegoHandsetNotification::activate() // TODO Actually do something } -void MeegoHandsetNotification::clear() +void MeegoHandsetNotification::dismiss() { - // TODO Actually clear... - emit cleared(); + // TODO Actually dismiss } void MeegoHandsetNotification::changeTo(const ::Notification ¬ification) { + uint oldCount = count(); + QDateTime oldDateTime = dateTime(); + QString oldTitle = title(); + QString oldBody = body(); _n = notification; + if (oldCount != count()) { + emit countChanged(); + } + if (oldDateTime != dateTime()) { + emit dateTimeChanged(); + emit displayTimeChanged(); + } + if (oldTitle != title()) { + emit titleChanged(); + } + if (oldBody != body()) { + emit bodyChanged(); + } emit changed(); } + +void MeegoHandsetNotification::remove() +{ + emit dismissed(); +} diff --git a/meegohandsetnotification/meegohandsetnotification.h b/meegohandsetnotification/meegohandsetnotification.h index fc9d50f..06cacf9 100644 --- a/meegohandsetnotification/meegohandsetnotification.h +++ b/meegohandsetnotification/meegohandsetnotification.h @@ -19,14 +19,11 @@ public: QString title() const; QString body() const; void activate(); - void clear(); - -signals: - void changed(); - void cleared(); + void dismiss(); protected: void changeTo(const ::Notification& notification); + void remove(); protected: ::Notification _n; diff --git a/meegohandsetnotification/watchnotificationsink.cpp b/meegohandsetnotification/watchnotificationsink.cpp index cf03c30..860c4b6 100644 --- a/meegohandsetnotification/watchnotificationsink.cpp +++ b/meegohandsetnotification/watchnotificationsink.cpp @@ -26,7 +26,7 @@ void WatchNotificationSink::removeNotification(uint notificationId) if (_trackedNotifications.contains(notificationId)) { MeegoHandsetNotification* n = _trackedNotifications[notificationId]; _trackedNotifications.remove(notificationId); - n->clear(); + n->remove(); n->deleteLater(); } } diff --git a/metawatch/metawatch.cpp b/metawatch/metawatch.cpp index 714ec30..0ffa5b4 100644 --- a/metawatch/metawatch.cpp +++ b/metawatch/metawatch.cpp @@ -102,7 +102,7 @@ MetaWatch::MetaWatch(const QBluetoothAddress& address, QSettings* settings, QObj if (settings) { _24hMode = settings->value("24hMode", false).toBool(); _dayMonthOrder = settings->value("DayMonthOrder", false).toBool(); - _notificationTimeout = settings->value("NotificationTimeout", 10).toInt(); + _notificationTimeout = settings->value("NotificationTimeout", 15).toInt(); _invertedIdle = settings->value("InvertedIdleScreen", false).toBool(); _invertedNotifications = settings->value("InvertedNotifications", false).toBool(); _invertedApplications = settings->value("InvertedApplications", false).toBool(); diff --git a/metawatch/metawatch.pro b/metawatch/metawatch.pro index 9a661ba..6819c67 100644 --- a/metawatch/metawatch.pro +++ b/metawatch/metawatch.pro @@ -69,4 +69,3 @@ unix:!symbian { } INSTALLS += target } - diff --git a/notificationswatchlet/metawatch-digital.qml b/notificationswatchlet/metawatch-digital.qml new file mode 100644 index 0000000..4a69a0d --- /dev/null +++ b/notificationswatchlet/metawatch-digital.qml @@ -0,0 +1,39 @@ +import QtQuick 1.0 +import QtMobility.location 1.2 + +Rectangle { + width: 96 + height: 96 + + color: "white" + + ListView { + id: notifs + anchors.fill: parent + model: watch.notifications + delegate: Column { + Text { text: model.modelData.title } + Text { text: model.modelData.body } + } + visible: count > 0; + } + Text { + anchors.fill: parent + text: "No notifications" + visible: notifs.count == 0; + } + + Connections { + target: watch + onButtonPressed : { + switch(button) { + case 1: + notifs.decrementCurrentIndex(); + break; + case 2: + notifs.incrementCurrentIndex(); + break; + } + } + } +} diff --git a/notificationswatchlet/notificationswatchlet.cpp b/notificationswatchlet/notificationswatchlet.cpp new file mode 100644 index 0000000..01110e9 --- /dev/null +++ b/notificationswatchlet/notificationswatchlet.cpp @@ -0,0 +1,10 @@ +#include "notificationswatchlet.h" + +using namespace sowatch; + +NotificationsWatchlet::NotificationsWatchlet(WatchServer* server) : + DeclarativeWatchlet(server, "com.javispedro.sowatch.notifications") +{ + setSource(QUrl("qrc:/notificationswatchlet/" + server->watch()->model() + ".qml")); +} + diff --git a/notificationswatchlet/notificationswatchlet.h b/notificationswatchlet/notificationswatchlet.h new file mode 100644 index 0000000..fe49f97 --- /dev/null +++ b/notificationswatchlet/notificationswatchlet.h @@ -0,0 +1,18 @@ +#ifndef NOTIFICATIONSWATCHLET_H +#define NOTIFICATIONSWATCHLET_H + +#include <sowatch.h> + +namespace sowatch +{ + +class NotificationsWatchlet : public DeclarativeWatchlet +{ + Q_OBJECT +public: + explicit NotificationsWatchlet(WatchServer* server); +}; + +} + +#endif // NOTIFICATIONSWATCHLET_H diff --git a/notificationswatchlet/notificationswatchlet.pro b/notificationswatchlet/notificationswatchlet.pro new file mode 100644 index 0000000..f5e4ce8 --- /dev/null +++ b/notificationswatchlet/notificationswatchlet.pro @@ -0,0 +1,60 @@ + +TARGET = notificationswatchlet +TEMPLATE = lib +# CONFIG += plugin +CONFIG += mobility + +SOURCES += notificationswatchletplugin.cpp notificationswatchlet.cpp + +HEADERS += notificationswatchletplugin.h notificationswatchlet.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 += \ + notificationswatchlet.qrc + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/notificationswatchlet/notificationswatchlet.qrc b/notificationswatchlet/notificationswatchlet.qrc new file mode 100644 index 0000000..a1f217d --- /dev/null +++ b/notificationswatchlet/notificationswatchlet.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/notificationswatchlet"> + <file>metawatch-digital.qml</file> + </qresource> +</RCC> diff --git a/notificationswatchlet/notificationswatchletplugin.cpp b/notificationswatchlet/notificationswatchletplugin.cpp new file mode 100644 index 0000000..a3ebbd7 --- /dev/null +++ b/notificationswatchlet/notificationswatchletplugin.cpp @@ -0,0 +1,29 @@ +#include "notificationswatchlet.h" +#include "notificationswatchletplugin.h" + +using namespace sowatch; + +NotificationsWatchletPlugin::NotificationsWatchletPlugin(QObject *parent) : + QObject(parent) +{ +} + +NotificationsWatchletPlugin::~NotificationsWatchletPlugin() +{ +} + +QStringList NotificationsWatchletPlugin::watchlets() +{ + QStringList l; + l << "com.javispedro.sowatch.notifications"; + return l; +} + +Watchlet* NotificationsWatchletPlugin::getWatchlet(const QString& driver, QSettings& settings, WatchServer *server) +{ + Q_UNUSED(driver); + Q_UNUSED(settings); + return new NotificationsWatchlet(server); +} + +Q_EXPORT_PLUGIN2(notificationswatchlet, NotificationsWatchletPlugin) diff --git a/notificationswatchlet/notificationswatchletplugin.h b/notificationswatchlet/notificationswatchletplugin.h new file mode 100644 index 0000000..e417aea --- /dev/null +++ b/notificationswatchlet/notificationswatchletplugin.h @@ -0,0 +1,24 @@ +#ifndef NOTIFICATIONSWATCHLETPLUGIN_H +#define NOTIFICATIONSWATCHLETPLUGIN_H + +#include <sowatch.h> + +namespace sowatch +{ + +class NotificationsWatchletPlugin : public QObject, public WatchletPluginInterface +{ + Q_OBJECT + Q_INTERFACES(sowatch::WatchletPluginInterface) + +public: + explicit NotificationsWatchletPlugin(QObject *parent = 0); + ~NotificationsWatchletPlugin(); + + QStringList watchlets(); + Watchlet* getWatchlet(const QString& driver, QSettings& settings, WatchServer* server); +}; + +} + +#endif // NOTIFICATIONSWATCHLETPLUGIN_H diff --git a/qtc_packaging/debian_harmattan/changelog b/qtc_packaging/debian_harmattan/changelog index 493b3de..8c270d7 100644 --- a/qtc_packaging/debian_harmattan/changelog +++ b/qtc_packaging/debian_harmattan/changelog @@ -1,6 +1,8 @@ sowatch (0.2.1) unstable; urgency=low * Fixing build dependencies. + * Adding autosyncing of time every 24 hours. + * Adding a new active notifications list watchlet. -- Javier S. Pedro <maemo@javispedro.com> Fri, 30 Sep 2011 01:06:09 +0200 diff --git a/sowatch.pro b/sowatch.pro index 1663794..e4c3107 100644 --- a/sowatch.pro +++ b/sowatch.pro @@ -2,11 +2,11 @@ TEMPLATE = subdirs SUBDIRS = libsowatch \ metawatch \ sowatchd \ + notificationswatchlet \ sysinfowatchlet !isEmpty(MEEGO_VERSION_MAJOR) { - SUBDIRS += meegohandsetnotification ckitcallnotification \ - qmafwwatchlet qmapwatchlet + SUBDIRS += meegohandsetnotification ckitcallnotification qmafwwatchlet qmapwatchlet } unix:!symbian { |