diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2013-05-06 23:13:37 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2013-05-06 23:13:37 +0200 |
commit | ae37832316d905889c82706b351b3c037c9e1ab6 (patch) | |
tree | d90c4a18729937b782f557e170cf95d4ef38f031 /metawatch | |
parent | d83093df7602aa2896de71292b47948540c22a44 (diff) | |
download | sowatch-ae37832316d905889c82706b351b3c037c9e1ab6.tar.gz sowatch-ae37832316d905889c82706b351b3c037c9e1ab6.zip |
prepare for weather qml notifications
Diffstat (limited to 'metawatch')
-rw-r--r-- | metawatch/metawatch.cpp | 13 | ||||
-rw-r--r-- | metawatch/metawatch.h | 3 | ||||
-rw-r--r-- | metawatch/metawatchdigital.cpp | 96 | ||||
-rw-r--r-- | metawatch/metawatchdigital.h | 4 |
4 files changed, 0 insertions, 116 deletions
diff --git a/metawatch/metawatch.cpp b/metawatch/metawatch.cpp index a8eab4d..01dec25 100644 --- a/metawatch/metawatch.cpp +++ b/metawatch/metawatch.cpp @@ -228,19 +228,6 @@ bool MetaWatch::charging() const return _watchCharging; } -void MetaWatch::updateNotificationCount(Notification::Type type, int count) -{ - Q_UNUSED(type); - Q_UNUSED(count); - // Default implementation does nothing -} - -void MetaWatch::updateWeather(WeatherNotification *weather) -{ - Q_UNUSED(weather); - // Default implementation does nothing -} - void MetaWatch::displayIdleScreen() { _currentMode = IdleMode; diff --git a/metawatch/metawatch.h b/metawatch/metawatch.h index 2a86f5c..a9cf58b 100644 --- a/metawatch/metawatch.h +++ b/metawatch/metawatch.h @@ -112,9 +112,6 @@ public: void queryCharging(); bool charging() const; - void updateNotificationCount(Notification::Type type, int count); - void updateWeather(WeatherNotification *weather); - void displayIdleScreen(); void displayNotification(Notification *notification); void displayApplication(); diff --git a/metawatch/metawatchdigital.cpp b/metawatch/metawatchdigital.cpp index d2de326..de55db6 100644 --- a/metawatch/metawatchdigital.cpp +++ b/metawatch/metawatchdigital.cpp @@ -46,49 +46,6 @@ QString MetaWatchDigital::model() const return "metawatch-digital"; } -void MetaWatchDigital::updateNotificationCount(Notification::Type type, int count) -{ - switch (type) { - case Notification::MissedCallNotification: - _nCalls = count; - break; - case Notification::EmailNotification: - _nMails = count; - break; - case Notification::ImNotification: - _nIms = count; - break; - case Notification::SmsNotification: - _nSms = count; - break; - case Notification::MmsNotification: - _nMms = count; - break; - default: - return; // Since this notification won't show up in idle screen, we do not redraw. - break; - } - - if (isConnected()) { - renderIdleCounts(); - } -} - -void MetaWatchDigital::updateWeather(WeatherNotification *weather) -{ - if (weather) { - _wForecast = weather->forecast(); - _wBody = weather->body(); - _wTemperature = weather->temperature(); - _wMetric = weather->temperatureUnits() == WeatherNotification::Celsius; - } else { - _wForecast = WeatherNotification::UnknownWeather; - } - if (isConnected()) { - renderIdleWeather(); - } -} - void MetaWatchDigital::displayIdleScreen() { qDebug() << "displaying idle screen"; @@ -146,31 +103,7 @@ void MetaWatchDigital::clear(Mode mode, bool black) void MetaWatchDigital::renderIdleScreen() { -#if 0 - QImage idle_call(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/idle_call.bmp")); - QImage idle_msg(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/idle_msg.bmp")); - QImage idle_mail(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/idle_mail.bmp")); - QPainter p; - - _paintMode = IdleMode; - p.begin(this); - - p.fillRect(0, 0, screenWidth, screenHeight, Qt::white); - p.setPen(QPen(Qt::black, 1.0, Qt::DashLine)); - p.drawLine(1, systemAreaHeight + 2, screenWidth - 2, systemAreaHeight + 2); - p.drawLine(1, systemAreaHeight * 2 + 4, screenWidth - 2, systemAreaHeight * 2 + 4); - - p.drawImage((32 * 0) + 4, systemAreaHeight * 2 + 7, idle_call); - p.drawImage((32 * 1) + 4, systemAreaHeight * 2 + 7, idle_msg); - p.drawImage((32 * 2) + 4, systemAreaHeight * 2 + 7, idle_mail); - - p.end(); - _paintMode = _currentMode; - - renderIdleWeather(); - renderIdleCounts(); -#endif } void MetaWatchDigital::renderIdleWeather() @@ -227,35 +160,6 @@ QImage MetaWatchDigital::iconForWeather(WeatherNotification::WeatherType w) } } -void MetaWatchDigital::renderIdleCounts() -{ -#if 0 - _paintMode = IdleMode; - QFont f("MetaWatch Large caps 8pt"); - QString s; - QPainter p(this); - QTextOption opt(Qt::AlignCenter); - const int y = systemAreaHeight * 2 + 26; - const int w = 24; - const int h = screenHeight - (y + 1); - const int mails = _nMails; - const int calls = _nCalls; - const int sms = _nSms + _nIms; - - qDebug() << "unread counts" << calls << sms << mails; - - f.setPixelSize(8); // Seems to be the only way to get the desired size. - - p.setFont(f); - p.fillRect(QRect(0, y, screenWidth, h), Qt::white); - p.drawText(QRect((32 * 0) + 4, y, w, h), s.sprintf("%d", calls), opt); - p.drawText(QRect((32 * 1) + 4, y, w, h), s.sprintf("%d", sms), opt); - p.drawText(QRect((32 * 2) + 4, y, w, h), s.sprintf("%d", mails), opt); - - _paintMode = _currentMode; -#endif -} - void MetaWatchDigital::renderNotification(Notification *n) { _paintMode = NotificationMode; diff --git a/metawatch/metawatchdigital.h b/metawatch/metawatchdigital.h index 3648160..dde017a 100644 --- a/metawatch/metawatchdigital.h +++ b/metawatch/metawatchdigital.h @@ -20,9 +20,6 @@ public: QString model() const; - void updateNotificationCount(Notification::Type type, int count); - void updateWeather(WeatherNotification *weather); - void displayIdleScreen(); void displayNotification(Notification *notification); void displayApplication(); @@ -45,7 +42,6 @@ private: void renderIdleScreen(); void renderIdleWeather(); QImage iconForWeather(WeatherNotification::WeatherType w); - void renderIdleCounts(); void renderNotification(Notification *n); QImage iconForNotification(const Notification *n); |