summaryrefslogtreecommitdiff
path: root/daemon/manager.cpp
diff options
context:
space:
mode:
authorPhilipp Andreas <github@smurfy.de>2014-07-20 22:25:45 +0200
committerPhilipp Andreas <github@smurfy.de>2014-07-20 23:21:05 +0200
commitc9c1ed9faee07c0067827872ffe465d465c81470 (patch)
tree91b87b5ad63956bda1254cb4b083f3fc8d6551e4 /daemon/manager.cpp
parent9bbba72939248388dfc832a5bf20cb9539ab0675 (diff)
parentc47315faa12bbb36772c3f5897751bf74fa122f4 (diff)
Merge branch 'master' into notifications
Conflicts: daemon/daemon.cpp daemon/manager.cpp daemon/manager.h ext/Log4Qt
Diffstat (limited to 'daemon/manager.cpp')
-rw-r--r--daemon/manager.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/daemon/manager.cpp b/daemon/manager.cpp
index ec0d21b..efa5a28 100644
--- a/daemon/manager.cpp
+++ b/daemon/manager.cpp
@@ -5,10 +5,14 @@
#include <QtContacts/QContact>
#include <QtContacts/QContactPhoneNumber>
-Manager::Manager(watch::WatchConnector *watch, DBusConnector *dbus, VoiceCallManager *voice, NotificationManager *notifications) :
+Manager::Manager(watch::WatchConnector *watch, DBusConnector *dbus, VoiceCallManager *voice, NotificationManager *notifications, Settings *settings) :
QObject(0), watch(watch), dbus(dbus), voice(voice), notifications(notifications), commands(new WatchCommands(watch, this)),
- notification(MNotification::DeviceEvent)
+ settings(settings), notification(MNotification::DeviceEvent)
{
+ connect(settings, SIGNAL(valueChanged(QString)), SLOT(onSettingChanged(const QString&)));
+ connect(settings, SIGNAL(valuesChanged()), SLOT(onSettingsChanged()));
+ connect(settings, SIGNAL(silentWhenConnectedChanged()), SLOT(onSettingsChanged()));
+
// We don't need to handle presence changes, so report them separately and ignore them
QMap<QString, QString> parameters;
parameters.insert(QString::fromLatin1("mergePresenceChanges"), QString::fromLatin1("false"));
@@ -26,7 +30,7 @@ Manager::Manager(watch::WatchConnector *watch, DBusConnector *dbus, VoiceCallMan
connect(notifications, SIGNAL(emailNotify(const QString &,const QString &,const QString &)), SLOT(onEmailNotify(const QString &,const QString &,const QString &)));
connect(notifications, SIGNAL(smsNotify(const QString &,const QString &)), SLOT(onSmsNotify(const QString &,const QString &)));
- connect(watch, SIGNAL(messageDecoded(uint,uint,QByteArray)), commands, SLOT(processMessage(uint,uint,QByteArray)));
+ connect(watch, SIGNAL(messageDecoded(uint,QByteArray)), commands, SLOT(processMessage(uint,QByteArray)));
connect(commands, SIGNAL(hangup()), SLOT(hangupAll()));
// Set BT icon for notification
@@ -54,6 +58,16 @@ Manager::Manager(watch::WatchConnector *watch, DBusConnector *dbus, VoiceCallMan
connect(this, SIGNAL(mprisMetadataChanged(QVariantMap)), commands, SLOT(onMprisMetadataChanged(QVariantMap)));
}
+void Manager::onSettingChanged(const QString &key)
+{
+ logger()->debug() << __FUNCTION__ << key << ":" << settings->property(qPrintable(key));
+}
+
+void Manager::onSettingsChanged()
+{
+ logger()->warn() << __FUNCTION__ << "Not implemented!";
+}
+
void Manager::onPebbleChanged()
{
const QVariantMap & pebble = dbus->pebble();