summaryrefslogtreecommitdiff
path: root/metawatch/metawatchdigital.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2013-05-06 23:13:37 +0200
committerJavier S. Pedro <maemo@javispedro.com>2013-05-06 23:13:37 +0200
commitae37832316d905889c82706b351b3c037c9e1ab6 (patch)
treed90c4a18729937b782f557e170cf95d4ef38f031 /metawatch/metawatchdigital.cpp
parentd83093df7602aa2896de71292b47948540c22a44 (diff)
downloadsowatch-ae37832316d905889c82706b351b3c037c9e1ab6.tar.gz
sowatch-ae37832316d905889c82706b351b3c037c9e1ab6.zip
prepare for weather qml notifications
Diffstat (limited to 'metawatch/metawatchdigital.cpp')
-rw-r--r--metawatch/metawatchdigital.cpp96
1 files changed, 0 insertions, 96 deletions
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;