summaryrefslogtreecommitdiff
path: root/libsowatch/watchserver.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2012-08-09 04:03:20 +0200
committerJavier S. Pedro <maemo@javispedro.com>2012-08-09 04:03:20 +0200
commit406332eb6b3199d19388f359d04c9f184e6082b5 (patch)
tree0560e8dabcd715cdf1932b7ac6105df5d20025e5 /libsowatch/watchserver.cpp
parent3aa62b0543d978c1a01c5cf05a898fd8d805c44b (diff)
downloadsowatch-406332eb6b3199d19388f359d04c9f184e6082b5.tar.gz
sowatch-406332eb6b3199d19388f359d04c9f184e6082b5.zip
watch status UI
Diffstat (limited to 'libsowatch/watchserver.cpp')
-rw-r--r--libsowatch/watchserver.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/libsowatch/watchserver.cpp b/libsowatch/watchserver.cpp
index 540eeea..d5db9da 100644
--- a/libsowatch/watchserver.cpp
+++ b/libsowatch/watchserver.cpp
@@ -14,10 +14,10 @@ WatchServer::WatchServer(Watch* watch, QObject* parent) :
_currentWatchlet(0), _currentWatchletActive(false), _currentWatchletIndex(-1),
_syncTimeTimer(new QTimer(this))
{
- connect(_watch, SIGNAL(connected()), SLOT(watchConnected()));
- connect(_watch, SIGNAL(disconnected()), SLOT(watchDisconnected()));
- connect(_watch, SIGNAL(idling()), SLOT(watchIdling()));
- connect(_watch, SIGNAL(buttonPressed(int)), SLOT(watchButtonPress(int)));
+ connect(_watch, SIGNAL(connected()), SLOT(handleWatchConnected()));
+ connect(_watch, SIGNAL(disconnected()), SLOT(handleWatchDisconnected()));
+ connect(_watch, SIGNAL(idling()), SLOT(handleWatchIdling()));
+ connect(_watch, SIGNAL(buttonPressed(int)), SLOT(handleWatchButtonPress(int)));
connect(_syncTimeTimer, SIGNAL(timeout()), SLOT(syncTime()));
_syncTimeTimer->setSingleShot(true);
@@ -165,7 +165,7 @@ void WatchServer::goToIdle()
_watch->displayIdleScreen();
}
-void WatchServer::watchConnected()
+void WatchServer::handleWatchConnected()
{
syncTime();
if (!_pendingNotifications.isEmpty()) {
@@ -175,18 +175,20 @@ void WatchServer::watchConnected()
} else {
goToIdle();
}
+ emit watchConnected();
}
-void WatchServer::watchDisconnected()
+void WatchServer::handleWatchDisconnected()
{
_syncTimeTimer->stop();
if (_currentWatchlet && _currentWatchletActive) {
deactivateCurrentWatchlet();
}
_pendingNotifications.clear();
+ emit watchDisconnected();
}
-void WatchServer::watchIdling()
+void WatchServer::handleWatchIdling()
{
qDebug() << "watch idling";
if (!_pendingNotifications.empty()) {
@@ -195,7 +197,7 @@ void WatchServer::watchIdling()
}
}
-void WatchServer::watchButtonPress(int button)
+void WatchServer::handleWatchButtonPress(int button)
{
if (button == _nextWatchletButton) {
qDebug() << "next watchlet button pressed";
@@ -216,8 +218,8 @@ void WatchServer::postNotification(Notification *notification)
_notifications[type].append(notification);
_notificationCounts[notification] = notification->count();
- connect(notification, SIGNAL(changed()), SLOT(notificationChanged()));
- connect(notification, SIGNAL(dismissed()), SLOT(notificationDismissed()));
+ connect(notification, SIGNAL(changed()), SLOT(handleNotificationChanged()));
+ connect(notification, SIGNAL(dismissed()), SLOT(handleNotificationDismissed()));
qDebug() << "notification received" << notification->title() << "(" << notification->count() << ")";
@@ -264,7 +266,7 @@ void WatchServer::nextNotification()
}
}
-void WatchServer::notificationChanged()
+void WatchServer::handleNotificationChanged()
{
QObject *obj = sender();
if (obj) {
@@ -307,7 +309,7 @@ void WatchServer::notificationChanged()
}
}
-void WatchServer::notificationDismissed()
+void WatchServer::handleNotificationDismissed()
{
QObject *obj = sender();
if (obj) {