summaryrefslogtreecommitdiff
path: root/metawatch
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2013-05-05 03:18:46 +0200
committerJavier S. Pedro <maemo@javispedro.com>2013-05-05 03:18:46 +0200
commit12cf6df3f1c90c6ccbab398f0ae03c946e4af638 (patch)
treea205f1240a421a1a6ac4d97e592730e5be00533b /metawatch
parent12d61ddf50f5f34cafd25d7cbdc827156cfb184c (diff)
downloadsowatch-12cf6df3f1c90c6ccbab398f0ae03c946e4af638.tar.gz
sowatch-12cf6df3f1c90c6ccbab398f0ae03c946e4af638.zip
continue working on qml watchface support
Diffstat (limited to 'metawatch')
-rw-r--r--metawatch/metawatch.pro12
-rw-r--r--metawatch/metawatchdigital.cpp6
-rw-r--r--metawatch/metawatchdigitalsimulator.cpp13
-rw-r--r--metawatch/metawatchfacewatchlet.cpp9
-rw-r--r--metawatch/metawatchfacewatchlet.h18
-rw-r--r--metawatch/metawatchscanner.cpp2
-rw-r--r--metawatch/qml/metawatch-digital-watchface.qml7
7 files changed, 23 insertions, 44 deletions
diff --git a/metawatch/metawatch.pro b/metawatch/metawatch.pro
index bd6d9bc..536ccee 100644
--- a/metawatch/metawatch.pro
+++ b/metawatch/metawatch.pro
@@ -18,8 +18,7 @@ SOURCES += metawatchplugin.cpp \
metawatchanalog.cpp \
metawatchscanner.cpp \
metawatchdigitalsimulator.cpp \
- metawatchdigitalsimulatorform.cpp \
- metawatchfacewatchlet.cpp
+ metawatchdigitalsimulatorform.cpp
HEADERS += metawatchplugin.h \
metawatchpaintengine.h \
@@ -28,15 +27,13 @@ HEADERS += metawatchplugin.h \
metawatchanalog.h \
metawatchscanner.h \
metawatchdigitalsimulator.h \
- metawatchdigitalsimulatorform.h \
- metawatchfacewatchlet.h
+ metawatchdigitalsimulatorform.h
FORMS += \
metawatchdigitalsimulatorform.ui
res_files.files += res/graphics res/fonts
-qml_files.files += qml/com qml/metawatch-digital-config.qml \
- qml/metawatch-digital-watchface.qml
+qml_files.files += qml/com qml/metawatch-digital-config.qml
LIBS += -L$$OUT_PWD/../libsowatch/ -lsowatch
@@ -54,6 +51,3 @@ DEPENDPATH += $$PWD/../libsowatch
qml_files.path = /usr/share/sowatch/qml
}
INSTALLS += target res_files qml_files
-
-OTHER_FILES += \
- qml/metawatch-digital-watchface.qml
diff --git a/metawatch/metawatchdigital.cpp b/metawatch/metawatchdigital.cpp
index 9145336..d2de326 100644
--- a/metawatch/metawatchdigital.cpp
+++ b/metawatch/metawatchdigital.cpp
@@ -146,6 +146,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"));
@@ -169,10 +170,12 @@ void MetaWatchDigital::renderIdleScreen()
renderIdleWeather();
renderIdleCounts();
+#endif
}
void MetaWatchDigital::renderIdleWeather()
{
+#if 0
_paintMode = IdleMode;
QFont sf("MetaWatch Small caps 8pt");
QFont lf("MetaWatch Large 16pt");
@@ -201,6 +204,7 @@ void MetaWatchDigital::renderIdleWeather()
}
_paintMode = _currentMode;
+#endif
}
QImage MetaWatchDigital::iconForWeather(WeatherNotification::WeatherType w)
@@ -225,6 +229,7 @@ QImage MetaWatchDigital::iconForWeather(WeatherNotification::WeatherType w)
void MetaWatchDigital::renderIdleCounts()
{
+#if 0
_paintMode = IdleMode;
QFont f("MetaWatch Large caps 8pt");
QString s;
@@ -248,6 +253,7 @@ void MetaWatchDigital::renderIdleCounts()
p.drawText(QRect((32 * 2) + 4, y, w, h), s.sprintf("%d", mails), opt);
_paintMode = _currentMode;
+#endif
}
void MetaWatchDigital::renderNotification(Notification *n)
diff --git a/metawatch/metawatchdigitalsimulator.cpp b/metawatch/metawatchdigitalsimulator.cpp
index dabc0f3..dcd0f6f 100644
--- a/metawatch/metawatchdigitalsimulator.cpp
+++ b/metawatch/metawatchdigitalsimulator.cpp
@@ -16,10 +16,14 @@ MetaWatchDigitalSimulator::MetaWatchDigitalSimulator(ConfigKey *config, QObject
_pixmap[IdleMode] = QPixmap(screenWidth, screenHeight);
_pixmap[ApplicationMode] = QPixmap(screenWidth, screenHeight);
_pixmap[NotificationMode] = QPixmap(screenWidth, screenHeight);
- _form->showNormal();
+
+ // Connect form signals
connect(_form, SIGNAL(buttonPressed(int)), SIGNAL(buttonPressed(int)));
connect(_form, SIGNAL(buttonReleased(int)), SIGNAL(buttonReleased(int)));
connect(_form, SIGNAL(destroyed()), SLOT(handleFormDestroyed()));
+
+ // Show the form
+ _form->showNormal();
}
MetaWatchDigitalSimulator::~MetaWatchDigitalSimulator()
@@ -79,6 +83,13 @@ void MetaWatchDigitalSimulator::update(Mode mode, const QList<QRect> &rects)
p.drawImage(r, _image[mode], r);
}
+
+ if (mode == IdleMode) {
+ QRect systemArea(0, 0, screenWidth, systemAreaHeight);
+ p.fillRect(systemArea, Qt::BDiagPattern);
+ p.drawText(systemArea, Qt::AlignCenter, "System area");
+ }
+
p.end();
int totalRows = rows.count(true);
diff --git a/metawatch/metawatchfacewatchlet.cpp b/metawatch/metawatchfacewatchlet.cpp
deleted file mode 100644
index 7e18988..0000000
--- a/metawatch/metawatchfacewatchlet.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-#include "metawatchfacewatchlet.h"
-
-using namespace sowatch;
-
-MetaWatchFaceWatchlet::MetaWatchFaceWatchlet(Watch *watch) :
- DeclarativeWatchlet(watch, "com.javispedro.sowatch.metawatch.watchface")
-{
- setSource(QUrl(SOWATCH_QML_DIR "/metawatch/" + watch->model() + "-watchface.qml"));
-}
diff --git a/metawatch/metawatchfacewatchlet.h b/metawatch/metawatchfacewatchlet.h
deleted file mode 100644
index 2895589..0000000
--- a/metawatch/metawatchfacewatchlet.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef METAWATCHFACEWATCHLET_H
-#define METAWATCHFACEWATCHLET_H
-
-#include <sowatch.h>
-
-namespace sowatch
-{
-
-class MetaWatchFaceWatchlet : public DeclarativeWatchlet
-{
- Q_OBJECT
-public:
- explicit MetaWatchFaceWatchlet(Watch* watch);
-};
-
-}
-
-#endif // METAWATCHFACEWATCHLET_H
diff --git a/metawatch/metawatchscanner.cpp b/metawatch/metawatchscanner.cpp
index 6abe4a6..0c1d88e 100644
--- a/metawatch/metawatchscanner.cpp
+++ b/metawatch/metawatchscanner.cpp
@@ -44,6 +44,8 @@ void MetaWatchScanner::handleDiscoveredService(const QBluetoothServiceInfo &info
// For now, assume Digital metawatch.
foundInfo["driver"] = QString("metawatch-digital");
foundInfo["next-watchlet-button"] = QString("A");
+ foundInfo["idle-watchlet"] = QString("com.javispedro.sowatch.metawatch.watchface");
+ foundInfo["notification-watchlet"] = QString("com.javispedro.sowatch.metawatch.notificationwatchlet");
emit watchFound(foundInfo);
}
}
diff --git a/metawatch/qml/metawatch-digital-watchface.qml b/metawatch/qml/metawatch-digital-watchface.qml
deleted file mode 100644
index d2abbf0..0000000
--- a/metawatch/qml/metawatch-digital-watchface.qml
+++ /dev/null
@@ -1,7 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 1.1
-
-Rectangle {
- width: 100
- height: 62
-}