summaryrefslogtreecommitdiff
path: root/libsowatch/watchserver.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2013-05-06 01:11:40 +0200
committerJavier S. Pedro <maemo@javispedro.com>2013-05-06 01:11:40 +0200
commitd83093df7602aa2896de71292b47948540c22a44 (patch)
tree5f0b2c86f8a75124aaa4ae03547ec8b9f4bc4376 /libsowatch/watchserver.cpp
parent12cf6df3f1c90c6ccbab398f0ae03c946e4af638 (diff)
downloadsowatch-d83093df7602aa2896de71292b47948540c22a44.tar.gz
sowatch-d83093df7602aa2896de71292b47948540c22a44.zip
metawatch watchface in QML still a work in progress
Diffstat (limited to 'libsowatch/watchserver.cpp')
-rw-r--r--libsowatch/watchserver.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/libsowatch/watchserver.cpp b/libsowatch/watchserver.cpp
index 6448508..41dc78e 100644
--- a/libsowatch/watchserver.cpp
+++ b/libsowatch/watchserver.cpp
@@ -65,10 +65,13 @@ void WatchServer::setIdleWatchlet(Watchlet *watchlet)
{
if (_idleWatchlet) {
removeWatchlet(_idleWatchlet);
+ unsetWatchletProperties(_idleWatchlet);
}
_idleWatchlet = watchlet;
if (watchlet) {
_watchletIds[watchlet->id()] = watchlet;
+ setWatchletProperties(_idleWatchlet);
+ // TODO Possibly activate this watchlet now if we are on the idle screen.
}
}
@@ -81,11 +84,12 @@ void WatchServer::setNotificationWatchlet(Watchlet *watchlet)
{
if (_notificationWatchlet) {
removeWatchlet(_notificationWatchlet);
+ unsetWatchletProperties(_notificationWatchlet);
}
_notificationWatchlet = watchlet;
if (watchlet) {
_watchletIds[watchlet->id()] = watchlet;
- // TODO Possibly activate this watchlet now if we are on the idle screen.
+ setWatchletProperties(_notificationWatchlet);
}
}
@@ -218,16 +222,27 @@ void WatchServer::runWatchlet(Watchlet *watchlet)
if (_activeWatchlet) {
deactivateActiveWatchlet();
}
+ if (_watch->isConnected()) {
+ activateWatchlet(watchlet);
+ }
+}
+
+void WatchServer::openWatchlet(Watchlet *watchlet)
+{
+ Q_ASSERT(watchlet->watch() == _watch);
+ if (_activeWatchlet) {
+ deactivateActiveWatchlet();
+ }
_currentWatchlet = watchlet;
if (_watch->isConnected()) {
activateCurrentWatchlet();
}
}
-void WatchServer::runWatchlet(const QString& id)
+void WatchServer::openWatchlet(const QString& id)
{
Q_ASSERT(_watchletIds.contains(id));
- runWatchlet(_watchletIds[id]);
+ openWatchlet(_watchletIds[id]);
}
void WatchServer::closeWatchlet()
@@ -291,7 +306,7 @@ void WatchServer::nextWatchlet()
closeWatchlet();
} else {
Watchlet* watchlet = _watchlets.at(_currentWatchletIndex);
- runWatchlet(watchlet);
+ openWatchlet(watchlet);
}
}
@@ -306,7 +321,9 @@ void WatchServer::syncTime()
uint WatchServer::getNotificationCount(Notification::Type type)
{
- return _notifications->fullCountByType(type);
+ // TODO: deprecate
+ return 0;
+ //return _notifications->fullCountByType(type);
}
void WatchServer::removeNotification(Notification::Type type, Notification *n)