From c47315faa12bbb36772c3f5897751bf74fa122f4 Mon Sep 17 00:00:00 2001 From: Tomasz Sterna Date: Fri, 18 Jul 2014 23:36:05 +0200 Subject: Implemented settings skeleton and notifications --- daemon/manager.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'daemon/manager.cpp') diff --git a/daemon/manager.cpp b/daemon/manager.cpp index a2365b4..8e07d52 100644 --- a/daemon/manager.cpp +++ b/daemon/manager.cpp @@ -5,10 +5,14 @@ #include #include -Manager::Manager(watch::WatchConnector *watch, DBusConnector *dbus, VoiceCallManager *voice) : +Manager::Manager(watch::WatchConnector *watch, DBusConnector *dbus, VoiceCallManager *voice, Settings *settings) : QObject(0), watch(watch), dbus(dbus), voice(voice), 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 parameters; parameters.insert(QString::fromLatin1("mergePresenceChanges"), QString::fromLatin1("false")); @@ -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(); -- cgit v1.2.3