summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2011-12-02 20:31:12 +0100
committerJavier S. Pedro <maemo@javispedro.com>2011-12-02 20:31:12 +0100
commitcd220a213060b6211330699ec6a3830593945a24 (patch)
treeffc66db575419828da9262c9ba07e1204075767f
parent88d6c8d388bd73e1f2ee1c23df221f8d3c6208d9 (diff)
downloadsowatch-cd220a213060b6211330699ec6a3830593945a24.tar.gz
sowatch-cd220a213060b6211330699ec6a3830593945a24.zip
moving some resources to the filesystem
-rw-r--r--libsowatch/sowatch_global.h10
-rw-r--r--metawatch/metawatch.pro29
-rw-r--r--metawatch/metawatch.qrc23
-rw-r--r--metawatch/metawatchdigital.cpp24
-rw-r--r--metawatch/metawatchplugin.cpp6
-rw-r--r--metawatch/qml/MWListView.qml59
-rw-r--r--metawatch/qml/MWTitle.qml6
-rw-r--r--metawatch/res/fonts/metawatch_16pt_11pxl.ttf (renamed from metawatch/metawatch_16pt_11pxl.ttf)bin14576 -> 14576 bytes
-rw-r--r--metawatch/res/fonts/metawatch_8pt_5pxl_CAPS.ttf (renamed from metawatch/metawatch_8pt_5pxl_CAPS.ttf)bin12408 -> 12408 bytes
-rw-r--r--metawatch/res/fonts/metawatch_8pt_7pxl_CAPS.ttf (renamed from metawatch/metawatch_8pt_7pxl_CAPS.ttf)bin15212 -> 15212 bytes
-rw-r--r--metawatch/res/graphics/email.bmp (renamed from metawatch/email.bmp)bin126 -> 126 bytes
-rw-r--r--metawatch/res/graphics/idle_call.bmp (renamed from metawatch/idle_call.bmp)bin134 -> 134 bytes
-rw-r--r--metawatch/res/graphics/idle_gmail.bmp (renamed from metawatch/idle_gmail.bmp)bin134 -> 134 bytes
-rw-r--r--metawatch/res/graphics/idle_sms.bmp (renamed from metawatch/idle_sms.bmp)bin134 -> 134 bytes
-rw-r--r--metawatch/res/graphics/message.bmp (renamed from metawatch/message.bmp)bin126 -> 126 bytes
-rw-r--r--metawatch/res/graphics/phone.bmp (renamed from metawatch/phone.bmp)bin126 -> 126 bytes
-rw-r--r--metawatch/res/graphics/play.bmp (renamed from metawatch/play.bmp)bin126 -> 126 bytes
-rw-r--r--metawatch/res/graphics/timer.bmp (renamed from metawatch/timer.bmp)bin126 -> 126 bytes
-rw-r--r--metawatch/res/graphics/weather_cloudy.bmp (renamed from metawatch/weather_cloudy.bmp)bin158 -> 158 bytes
-rw-r--r--metawatch/res/graphics/weather_rain.bmp (renamed from metawatch/weather_rain.bmp)bin158 -> 158 bytes
-rw-r--r--metawatch/res/graphics/weather_snow.bmp (renamed from metawatch/weather_snow.bmp)bin158 -> 158 bytes
-rw-r--r--metawatch/res/graphics/weather_sunny.bmp (renamed from metawatch/weather_sunny.bmp)bin158 -> 158 bytes
-rw-r--r--metawatch/res/graphics/weather_thunderstorm.bmp (renamed from metawatch/weather_thunderstorm.bmp)bin158 -> 158 bytes
-rw-r--r--metawatch/res/graphics/weather_wind.bmp (renamed from metawatch/weather_wind.bmp)bin158 -> 158 bytes
-rw-r--r--qtc_packaging/debian_fremantle/changelog6
-rw-r--r--qtc_packaging/debian_harmattan/changelog6
26 files changed, 111 insertions, 58 deletions
diff --git a/libsowatch/sowatch_global.h b/libsowatch/sowatch_global.h
index c317ba4..510a38a 100644
--- a/libsowatch/sowatch_global.h
+++ b/libsowatch/sowatch_global.h
@@ -11,11 +11,15 @@
#endif
#if defined(MEEGO_VERSION_MAJOR) || defined(Q_WS_MAEMO_5)
-# define SOWATCH_PLUGINS_DIR "/opt/sowatch/lib"
+# define SOWATCH_PLUGINS_DIR "/opt/sowatch/lib"
+# define SOWATCH_RESOURCES_DIR "/opt/sowatch/share"
+# define SOWATCH_QML_DIR "/opt/sowatch/qml"
#elif defined(Q_OS_LINUX)
-# define SOWATCH_PLUGINS_DIR "/usr/lib/sowatch"
+# define SOWATCH_PLUGINS_DIR "/usr/lib/sowatch"
+# define SOWATCH_RESOURCES_DIR "/usr/share/sowatch"
+# define SOWATCH_QML_DIR SOWATCH_RESOURCES_DIR "/qml"
#else
-# error Please define a path for your platform
+# error Please define the paths for your platform
#endif
#define SOWATCH_DRIVERS_DIR SOWATCH_PLUGINS_DIR "/drivers"
diff --git a/metawatch/metawatch.pro b/metawatch/metawatch.pro
index f48cfe0..d0ffddf 100644
--- a/metawatch/metawatch.pro
+++ b/metawatch/metawatch.pro
@@ -30,22 +30,8 @@ HEADERS += metawatchplugin.h \
FORMS += \
metawatchsimulatorform.ui
-RESOURCES += \
- metawatch.qrc
-
-OTHER_FILES += \
- idle_sms.bmp \
- idle_gmail.bmp \
- idle_call.bmp \
- weather_wind.bmp \
- weather_thunderstorm.bmp \
- weather_sunny.bmp \
- weather_snow.bmp \
- weather_rain.bmp \
- weather_cloudy.bmp \
- metawatch_16pt_11pxl.ttf \
- metawatch_8pt_7pxl_CAPS.ttf \
- metawatch_8pt_5pxl_CAPS.ttf
+res_files.files += res/graphics res/fonts
+qml_files.files += qml/MWListView.qml
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../libsowatch/release/ -lsowatch
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../libsowatch/debug/ -lsowatch
@@ -69,8 +55,17 @@ unix:!symbian {
!isEmpty(MEEGO_VERSION_MAJOR)|maemo5 {
QMAKE_RPATHDIR += /opt/sowatch/lib
target.path = /opt/sowatch/lib/drivers
+ res_files.path = /opt/sowatch/share/metawatch
+ qml_files.path = /opt/sowatch/qml/metawatch
} else {
target.path = /usr/lib/sowatch/drivers
+ res_files.path = /usr/share/sowatch/metawatch
+ qml_files.path = /usr/share/sowatch/qml/metawatch
}
- INSTALLS += target
+ INSTALLS += target res_files qml_files
}
+
+OTHER_FILES += \
+ qml/MWTitle.qml
+
+
diff --git a/metawatch/metawatch.qrc b/metawatch/metawatch.qrc
deleted file mode 100644
index 821a3dc..0000000
--- a/metawatch/metawatch.qrc
+++ /dev/null
@@ -1,23 +0,0 @@
-<RCC>
- <qresource prefix="/metawatch/graphics">
- <file>idle_call.bmp</file>
- <file>idle_gmail.bmp</file>
- <file>idle_sms.bmp</file>
- <file>weather_cloudy.bmp</file>
- <file>weather_rain.bmp</file>
- <file>weather_snow.bmp</file>
- <file>weather_sunny.bmp</file>
- <file>weather_thunderstorm.bmp</file>
- <file>weather_wind.bmp</file>
- <file>email.bmp</file>
- <file>message.bmp</file>
- <file>phone.bmp</file>
- <file>play.bmp</file>
- <file>timer.bmp</file>
- </qresource>
- <qresource prefix="/metawatch/fonts">
- <file>metawatch_8pt_5pxl_CAPS.ttf</file>
- <file>metawatch_8pt_7pxl_CAPS.ttf</file>
- <file>metawatch_16pt_11pxl.ttf</file>
- </qresource>
-</RCC>
diff --git a/metawatch/metawatchdigital.cpp b/metawatch/metawatchdigital.cpp
index f35eab0..b91b370 100644
--- a/metawatch/metawatchdigital.cpp
+++ b/metawatch/metawatchdigital.cpp
@@ -143,9 +143,9 @@ void MetaWatchDigital::clear(Mode mode, bool black)
void MetaWatchDigital::renderIdleScreen()
{
- QImage idle_call(QString(":/metawatch/graphics/idle_call.bmp"));
- QImage idle_sms(QString(":/metawatch/graphics/idle_sms.bmp"));
- QImage idle_mail(QString(":/metawatch/graphics/idle_gmail.bmp"));
+ QImage idle_call(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/idle_call.bmp"));
+ QImage idle_sms(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/idle_sms.bmp"));
+ QImage idle_mail(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/idle_gmail.bmp"));
QPainter p;
_paintMode = IdleMode;
@@ -204,17 +204,17 @@ QImage MetaWatchDigital::iconForWeather(WeatherNotification::WeatherType w)
{
switch (w) {
case WeatherNotification::Sunny:
- return QImage(QString(":/metawatch/graphics/weather_sunny.bmp"));
+ return QImage(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/weather_sunny.bmp"));
case WeatherNotification::PartlyCloudy:
case WeatherNotification::Cloudy:
case WeatherNotification::Fog:
- return QImage(QString(":/metawatch/graphics/weather_cloudy.bmp"));
+ return QImage(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/weather_cloudy.bmp"));
case WeatherNotification::Rain:
- return QImage(QString(":/metawatch/graphics/weather_rain.bmp"));
+ return QImage(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/weather_rain.bmp"));
case WeatherNotification::Thunderstorm:
- return QImage(QString(":/metawatch/graphics/weather_thunderstorm.bmp"));
+ return QImage(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/weather_thunderstorm.bmp"));
case WeatherNotification::Snow:
- return QImage(QString(":/metawatch/graphics/weather_snow.bmp"));
+ return QImage(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/weather_snow.bmp"));
default:
return QImage();
}
@@ -313,18 +313,18 @@ QImage MetaWatchDigital::iconForNotification(const Notification *n)
switch (n->type()) {
case Notification::CallNotification:
case Notification::MissedCallNotification:
- return QImage(QString(":/metawatch/graphics/phone.bmp"));
+ return QImage(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/phone.bmp"));
break;
case Notification::SmsNotification:
case Notification::MmsNotification:
case Notification::ImNotification:
- return QImage(QString(":/metawatch/graphics/message.bmp"));
+ return QImage(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/message.bmp"));
break;
case Notification::EmailNotification:
- return QImage(QString(":/metawatch/graphics/email.bmp"));
+ return QImage(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/email.bmp"));
break;
case Notification::CalendarNotification:
- return QImage(QString(":/metawatch/graphics/timer.bmp"));
+ return QImage(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/timer.bmp"));
break;
default:
return QImage();
diff --git a/metawatch/metawatchplugin.cpp b/metawatch/metawatchplugin.cpp
index 5e649a9..523230b 100644
--- a/metawatch/metawatchplugin.cpp
+++ b/metawatch/metawatchplugin.cpp
@@ -13,9 +13,9 @@ bool MetaWatchPlugin::fontsLoaded = false;
MetaWatchPlugin::MetaWatchPlugin()
{
if (!fontsLoaded) {
- QFontDatabase::addApplicationFont(":/metawatch/fonts/metawatch_16pt_11pxl.ttf");
- QFontDatabase::addApplicationFont(":/metawatch/fonts/metawatch_8pt_7pxl_CAPS.ttf");
- QFontDatabase::addApplicationFont(":/metawatch/fonts/metawatch_8pt_5pxl_CAPS.ttf");
+ QFontDatabase::addApplicationFont(SOWATCH_RESOURCES_DIR "/metawatch/fonts/metawatch_16pt_11pxl.ttf");
+ QFontDatabase::addApplicationFont(SOWATCH_RESOURCES_DIR "/metawatch/fonts/metawatch_8pt_7pxl_CAPS.ttf");
+ QFontDatabase::addApplicationFont(SOWATCH_RESOURCES_DIR "/metawatch/fonts/metawatch_8pt_5pxl_CAPS.ttf");
// "MetaWatch Large 16pt", "MetaWatch Large caps 8pt", "MetaWatch Small caps 8pt"
fontsLoaded = true;
}
diff --git a/metawatch/qml/MWListView.qml b/metawatch/qml/MWListView.qml
new file mode 100644
index 0000000..e49905b
--- /dev/null
+++ b/metawatch/qml/MWListView.qml
@@ -0,0 +1,59 @@
+import QtQuick 1.0
+
+ListView {
+ id: list
+
+ property bool selectable: true
+
+ //interactive: false
+ highlightFollowsCurrentItem: false
+ boundsBehavior: Flickable.StopAtBounds
+
+ property real currentItemTop: currentItem.y - contentY
+ property real currentItemBottom: currentItemTop + currentItem.height
+
+ function _scrollSelectable(dir) {
+ var maxy = contentHeight - height;
+ if (maxy < 0) maxy = 0;
+
+ console.log(contentHeight);
+
+ var newy = contentY;
+
+ if (dir > 0) {
+ if (currentIndex < count && currentItemBottom < height) {
+ // If the next item is visible, highlight it
+ list.incrementCurrentIndex();
+ }
+ if (currentItemBottom >= height) {
+ // If the next item now is still not visible, scroll
+ newy += 96/3;
+ }
+ } else {
+ if (currentIndex >= 0 && currentItemTop > 0) {
+ // If the previous item is visible, highlight it
+ list.decrementCurrentIndex();
+ }
+ if (currentItemTop <= 0) {
+ // If the previous item now is still not visible, scroll
+ newy -= 96/3;
+ }
+ }
+
+ //if (newy < 0) newy = 0;
+ //if (newy > maxy) newy = maxy;
+ list.contentY = newy;
+ }
+
+ function scrollDown() {
+ if (selectable) {
+ _scrollSelectable(+1);
+ }
+ }
+
+ function scrollUp() {
+ if (selectable) {
+ _scrollSelectable(-1);
+ }
+ }
+}
diff --git a/metawatch/qml/MWTitle.qml b/metawatch/qml/MWTitle.qml
new file mode 100644
index 0000000..44f4f70
--- /dev/null
+++ b/metawatch/qml/MWTitle.qml
@@ -0,0 +1,6 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 100
+ height: 62
+}
diff --git a/metawatch/metawatch_16pt_11pxl.ttf b/metawatch/res/fonts/metawatch_16pt_11pxl.ttf
index 9aeb8b3..9aeb8b3 100644
--- a/metawatch/metawatch_16pt_11pxl.ttf
+++ b/metawatch/res/fonts/metawatch_16pt_11pxl.ttf
Binary files differ
diff --git a/metawatch/metawatch_8pt_5pxl_CAPS.ttf b/metawatch/res/fonts/metawatch_8pt_5pxl_CAPS.ttf
index a6b8f30..a6b8f30 100644
--- a/metawatch/metawatch_8pt_5pxl_CAPS.ttf
+++ b/metawatch/res/fonts/metawatch_8pt_5pxl_CAPS.ttf
Binary files differ
diff --git a/metawatch/metawatch_8pt_7pxl_CAPS.ttf b/metawatch/res/fonts/metawatch_8pt_7pxl_CAPS.ttf
index 72eda9e..72eda9e 100644
--- a/metawatch/metawatch_8pt_7pxl_CAPS.ttf
+++ b/metawatch/res/fonts/metawatch_8pt_7pxl_CAPS.ttf
Binary files differ
diff --git a/metawatch/email.bmp b/metawatch/res/graphics/email.bmp
index 7c895af..7c895af 100644
--- a/metawatch/email.bmp
+++ b/metawatch/res/graphics/email.bmp
Binary files differ
diff --git a/metawatch/idle_call.bmp b/metawatch/res/graphics/idle_call.bmp
index 2b69eea..2b69eea 100644
--- a/metawatch/idle_call.bmp
+++ b/metawatch/res/graphics/idle_call.bmp
Binary files differ
diff --git a/metawatch/idle_gmail.bmp b/metawatch/res/graphics/idle_gmail.bmp
index fd129b0..fd129b0 100644
--- a/metawatch/idle_gmail.bmp
+++ b/metawatch/res/graphics/idle_gmail.bmp
Binary files differ
diff --git a/metawatch/idle_sms.bmp b/metawatch/res/graphics/idle_sms.bmp
index 095ca62..095ca62 100644
--- a/metawatch/idle_sms.bmp
+++ b/metawatch/res/graphics/idle_sms.bmp
Binary files differ
diff --git a/metawatch/message.bmp b/metawatch/res/graphics/message.bmp
index 53605b8..53605b8 100644
--- a/metawatch/message.bmp
+++ b/metawatch/res/graphics/message.bmp
Binary files differ
diff --git a/metawatch/phone.bmp b/metawatch/res/graphics/phone.bmp
index a9da9d8..a9da9d8 100644
--- a/metawatch/phone.bmp
+++ b/metawatch/res/graphics/phone.bmp
Binary files differ
diff --git a/metawatch/play.bmp b/metawatch/res/graphics/play.bmp
index f6f507c..f6f507c 100644
--- a/metawatch/play.bmp
+++ b/metawatch/res/graphics/play.bmp
Binary files differ
diff --git a/metawatch/timer.bmp b/metawatch/res/graphics/timer.bmp
index 20ae04d..20ae04d 100644
--- a/metawatch/timer.bmp
+++ b/metawatch/res/graphics/timer.bmp
Binary files differ
diff --git a/metawatch/weather_cloudy.bmp b/metawatch/res/graphics/weather_cloudy.bmp
index 506c24a..506c24a 100644
--- a/metawatch/weather_cloudy.bmp
+++ b/metawatch/res/graphics/weather_cloudy.bmp
Binary files differ
diff --git a/metawatch/weather_rain.bmp b/metawatch/res/graphics/weather_rain.bmp
index fc12c6e..fc12c6e 100644
--- a/metawatch/weather_rain.bmp
+++ b/metawatch/res/graphics/weather_rain.bmp
Binary files differ
diff --git a/metawatch/weather_snow.bmp b/metawatch/res/graphics/weather_snow.bmp
index d328105..d328105 100644
--- a/metawatch/weather_snow.bmp
+++ b/metawatch/res/graphics/weather_snow.bmp
Binary files differ
diff --git a/metawatch/weather_sunny.bmp b/metawatch/res/graphics/weather_sunny.bmp
index df9f774..df9f774 100644
--- a/metawatch/weather_sunny.bmp
+++ b/metawatch/res/graphics/weather_sunny.bmp
Binary files differ
diff --git a/metawatch/weather_thunderstorm.bmp b/metawatch/res/graphics/weather_thunderstorm.bmp
index f101610..f101610 100644
--- a/metawatch/weather_thunderstorm.bmp
+++ b/metawatch/res/graphics/weather_thunderstorm.bmp
Binary files differ
diff --git a/metawatch/weather_wind.bmp b/metawatch/res/graphics/weather_wind.bmp
index 59bd81b..59bd81b 100644
--- a/metawatch/weather_wind.bmp
+++ b/metawatch/res/graphics/weather_wind.bmp
Binary files differ
diff --git a/qtc_packaging/debian_fremantle/changelog b/qtc_packaging/debian_fremantle/changelog
index 4f197dc..4a51983 100644
--- a/qtc_packaging/debian_fremantle/changelog
+++ b/qtc_packaging/debian_fremantle/changelog
@@ -1,3 +1,9 @@
+sowatch (0.3.0) unstable; urgency=low
+
+ * Using actual files instead of Qt Resources for MetaWatch resources.
+
+ -- Javier S. Pedro <maemo@javispedro.com> Fri, 02 Dec 2011 20:15:34 +0100
+
sowatch (0.2.2) unstable; urgency=low
* Support for MetaWatch 24 mode setting using the 0.8 firmware
diff --git a/qtc_packaging/debian_harmattan/changelog b/qtc_packaging/debian_harmattan/changelog
index 4f197dc..4a51983 100644
--- a/qtc_packaging/debian_harmattan/changelog
+++ b/qtc_packaging/debian_harmattan/changelog
@@ -1,3 +1,9 @@
+sowatch (0.3.0) unstable; urgency=low
+
+ * Using actual files instead of Qt Resources for MetaWatch resources.
+
+ -- Javier S. Pedro <maemo@javispedro.com> Fri, 02 Dec 2011 20:15:34 +0100
+
sowatch (0.2.2) unstable; urgency=low
* Support for MetaWatch 24 mode setting using the 0.8 firmware