From 12d61ddf50f5f34cafd25d7cbdc827156cfb184c Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Sun, 5 May 2013 02:21:29 +0200 Subject: preparing face watchlet support --- metawatch/metawatch.pro | 7 ++++--- metawatch/metawatchdigital.h | 5 +++-- metawatch/metawatchdigitalfacewatchlet.cpp | 8 -------- metawatch/metawatchdigitalfacewatchlet.h | 18 ------------------ metawatch/metawatchfacewatchlet.cpp | 9 +++++++++ metawatch/metawatchfacewatchlet.h | 18 ++++++++++++++++++ 6 files changed, 34 insertions(+), 31 deletions(-) delete mode 100644 metawatch/metawatchdigitalfacewatchlet.cpp delete mode 100644 metawatch/metawatchdigitalfacewatchlet.h create mode 100644 metawatch/metawatchfacewatchlet.cpp create mode 100644 metawatch/metawatchfacewatchlet.h (limited to 'metawatch') diff --git a/metawatch/metawatch.pro b/metawatch/metawatch.pro index 1437b71..bd6d9bc 100644 --- a/metawatch/metawatch.pro +++ b/metawatch/metawatch.pro @@ -19,7 +19,7 @@ SOURCES += metawatchplugin.cpp \ metawatchscanner.cpp \ metawatchdigitalsimulator.cpp \ metawatchdigitalsimulatorform.cpp \ - metawatchdigitalfacewatchlet.cpp + metawatchfacewatchlet.cpp HEADERS += metawatchplugin.h \ metawatchpaintengine.h \ @@ -29,13 +29,14 @@ HEADERS += metawatchplugin.h \ metawatchscanner.h \ metawatchdigitalsimulator.h \ metawatchdigitalsimulatorform.h \ - metawatchdigitalfacewatchlet.h + metawatchfacewatchlet.h FORMS += \ metawatchdigitalsimulatorform.ui res_files.files += res/graphics res/fonts -qml_files.files += qml/com qml/metawatch-digital-config.qml +qml_files.files += qml/com qml/metawatch-digital-config.qml \ + qml/metawatch-digital-watchface.qml LIBS += -L$$OUT_PWD/../libsowatch/ -lsowatch diff --git a/metawatch/metawatchdigital.h b/metawatch/metawatchdigital.h index 4fd6ae6..3648160 100644 --- a/metawatch/metawatchdigital.h +++ b/metawatch/metawatchdigital.h @@ -31,6 +31,9 @@ public: void update(Mode mode, const QList& rects = QList()); protected: + void handleWatchConnected(); + +private: // Idle screen: notifications unread count ushort _nMails, _nCalls, _nIms, _nSms, _nMms; // Idle screen: weather information @@ -39,8 +42,6 @@ protected: short _wTemperature; bool _wMetric; - void handleWatchConnected(); - void renderIdleScreen(); void renderIdleWeather(); QImage iconForWeather(WeatherNotification::WeatherType w); diff --git a/metawatch/metawatchdigitalfacewatchlet.cpp b/metawatch/metawatchdigitalfacewatchlet.cpp deleted file mode 100644 index 08d8ac4..0000000 --- a/metawatch/metawatchdigitalfacewatchlet.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "metawatchdigitalfacewatchlet.h" - -using namespace sowatch; - -MetaWatchDigitalFaceWatchlet::MetaWatchDigitalFaceWatchlet(Watch *watch) : - DeclarativeWatchlet(watch, "crap") -{ -} diff --git a/metawatch/metawatchdigitalfacewatchlet.h b/metawatch/metawatchdigitalfacewatchlet.h deleted file mode 100644 index b4b92ca..0000000 --- a/metawatch/metawatchdigitalfacewatchlet.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef METAWATCHDIGITALFACEWATCHLET_H -#define METAWATCHDIGITALFACEWATCHLET_H - -#include - -namespace sowatch -{ - -class MetaWatchDigitalFaceWatchlet : public DeclarativeWatchlet -{ - Q_OBJECT -public: - explicit MetaWatchDigitalFaceWatchlet(Watch* watch); -}; - -} - -#endif // METAWATCHDIGITALFACEWATCHLET_H diff --git a/metawatch/metawatchfacewatchlet.cpp b/metawatch/metawatchfacewatchlet.cpp new file mode 100644 index 0000000..7e18988 --- /dev/null +++ b/metawatch/metawatchfacewatchlet.cpp @@ -0,0 +1,9 @@ +#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 new file mode 100644 index 0000000..2895589 --- /dev/null +++ b/metawatch/metawatchfacewatchlet.h @@ -0,0 +1,18 @@ +#ifndef METAWATCHFACEWATCHLET_H +#define METAWATCHFACEWATCHLET_H + +#include + +namespace sowatch +{ + +class MetaWatchFaceWatchlet : public DeclarativeWatchlet +{ + Q_OBJECT +public: + explicit MetaWatchFaceWatchlet(Watch* watch); +}; + +} + +#endif // METAWATCHFACEWATCHLET_H -- cgit v1.2.3