diff options
Diffstat (limited to 'daemon')
| -rw-r--r-- | daemon/manager.cpp | 30 | ||||
| -rw-r--r-- | daemon/manager.h | 3 |
2 files changed, 32 insertions, 1 deletions
diff --git a/daemon/manager.cpp b/daemon/manager.cpp index f9bd7be..b02264e 100644 --- a/daemon/manager.cpp +++ b/daemon/manager.cpp @@ -259,6 +259,36 @@ void Manager::applyProfile() } } +void Manager::ping(uint val) +{ + qCDebug(l) << "ping" << val; + + if (settings->property("debug").toBool()) { + // magic here! + // I do not want to add specific debugging methods to pebbled + // so just provide some magic Ping() method handling here :-) + switch (val) { + case 128: + watch->sendSMSNotification("SMS", "lorem ipsum"); + return; + case 129: + watch->sendEmailNotification("e-mail", "lorem ipsum", "subject"); + return; + case 130: + watch->sendFacebookNotification("Facebook", "lorem ipsum"); + return; + case 131: + watch->sendTwitterNotification("Twitter", "lorem ipsum"); + return; + case 132: + watch->sendMusicNowPlaying("artist", "album", "track name"); + return; + } + } + + watch->ping(val); +} + void Manager::transliterateMessage(const QString &text) { if (transliterator.isNull()) { diff --git a/daemon/manager.h b/daemon/manager.h index a605ed1..e3143b1 100644 --- a/daemon/manager.h +++ b/daemon/manager.h @@ -70,6 +70,7 @@ protected: public slots: void applyProfile(); + void ping(uint val); private slots: void onSettingChanged(const QString &key); @@ -125,7 +126,7 @@ public: public slots: inline void Disconnect() { manager()->watch->disconnect(); } inline void Reconnect() { manager()->watch->connect(); } - inline void Ping(uint val) { manager()->watch->ping(val); } + inline void Ping(uint val) { manager()->ping(val); } inline void SyncTime() { manager()->watch->time(); } inline void LaunchApp(const QString &uuid) { manager()->appmsg->launchApp(uuid); } |
