diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2013-03-28 18:07:34 +0100 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2013-03-28 18:07:34 +0100 |
commit | 94d434ca1c60d4ff9e518fdcdcfd867abf03c4ac (patch) | |
tree | 40f85ce5978af4f6f1f0db1ce914d19f1f6a44b5 /metawatch/metawatch.cpp | |
parent | ff3e0c160733707ce0bb835362d2730b407b0126 (diff) | |
download | sowatch-94d434ca1c60d4ff9e518fdcdcfd867abf03c4ac.tar.gz sowatch-94d434ca1c60d4ff9e518fdcdcfd867abf03c4ac.zip |
add change mode command to workaround mode priorities
Diffstat (limited to 'metawatch/metawatch.cpp')
-rw-r--r-- | metawatch/metawatch.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/metawatch/metawatch.cpp b/metawatch/metawatch.cpp index f9979ed..bd7d852 100644 --- a/metawatch/metawatch.cpp +++ b/metawatch/metawatch.cpp @@ -245,6 +245,8 @@ void MetaWatch::displayIdleScreen() { _currentMode = IdleMode; _paintMode = IdleMode; + changeMode(_currentMode); + _ringTimer->stop(); _idleTimer->stop(); setVibrateMode(false, 0, 0, 0); @@ -254,6 +256,8 @@ void MetaWatch::displayNotification(Notification *notification) { _currentMode = NotificationMode; _paintMode = NotificationMode; + changeMode(_currentMode); + if (notification->type() == Notification::CallNotification) { timedRing(); _ringTimer->start(); @@ -269,6 +273,8 @@ void MetaWatch::displayApplication() { _currentMode = ApplicationMode; _paintMode = ApplicationMode; + changeMode(_currentMode); + _ringTimer->stop(); _idleTimer->stop(); } @@ -526,10 +532,15 @@ void MetaWatch::updateLcdDisplay(Mode mode, int startRow, int numRows) void MetaWatch::loadLcdTemplate(Mode mode, int templ) { - Message msg(LoadLcdTemplate, QByteArray(1, templ), mode & 0xF); + Message msg(LoadLcdTemplate, QByteArray(1, templ), mode & 0x3); send(msg); } +void MetaWatch::changeMode(Mode mode) +{ + send(Message(ChangeMode, QByteArray(), mode & 0x3)); +} + void MetaWatch::enableButton(Mode mode, Button button, ButtonPress press) { Message msg(EnableButton, QByteArray(5, 0)); @@ -692,14 +703,10 @@ void MetaWatch::settingChanged(const QString &key) _notificationTimeout = _settings->value(key, 15).toInt(); } else if (key == "day-month-order") { _dayMonthOrder = _settings->value(key, false).toBool(); - if (isConnected()) { - updateWatchProperties(); - } + if (isConnected()) updateWatchProperties(); } else if (key == "24h-mode") { _24hMode = _settings->value(key, false).toBool(); - if (isConnected()) { - updateWatchProperties(); - } + if (isConnected()) updateWatchProperties(); } } |