summaryrefslogtreecommitdiff
path: root/daemon/manager.cpp
diff options
context:
space:
mode:
authorTomasz Sterna <tomek@xiaoka.com>2014-06-30 02:14:58 +0200
committerTomasz Sterna <tomek@xiaoka.com>2014-06-30 02:14:58 +0200
commitf86af8e40591693f733c539a476c53ccf41c97a1 (patch)
tree4b853f79d9a6d0d78e874cfc8b07b56b494669ac /daemon/manager.cpp
parent3c52767b24f27ac166f9c68e2fc73811527bafe1 (diff)
Implemented notification on Pebble connect/disconnect
Diffstat (limited to 'daemon/manager.cpp')
-rw-r--r--daemon/manager.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/daemon/manager.cpp b/daemon/manager.cpp
index 691d7a5..cfa955b 100644
--- a/daemon/manager.cpp
+++ b/daemon/manager.cpp
@@ -47,6 +47,21 @@ void Manager::onPebbleChanged()
}
}
+void Manager::onConnectedChanged()
+{
+ QString message = QString("%1 %2")
+ .arg(watch->name().isEmpty() ? "Pebble" : watch->name())
+ .arg(watch->isConnected() ? "connected" : "disconnected");
+ qDebug() << message;
+
+ if (notification.isPublished()) notification.remove();
+
+ notification.setBody(message);
+ if (!notification.publish()) {
+ qDebug() << "Failed publishing notification";
+ }
+}
+
void Manager::onActiveVoiceCallChanged()
{
qDebug() << "Manager::onActiveVoiceCallChanged()";