summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sysinfowatchlet/metawatch-digital.qml55
-rw-r--r--sysinfowatchlet/sysinfowatchlet.cpp2
-rw-r--r--sysinfowatchlet/sysinfowatchlet.pro13
-rw-r--r--sysinfowatchlet/sysinfowatchlet.qrc5
4 files changed, 39 insertions, 36 deletions
diff --git a/sysinfowatchlet/metawatch-digital.qml b/sysinfowatchlet/metawatch-digital.qml
index 0d840d6..67486ba 100644
--- a/sysinfowatchlet/metawatch-digital.qml
+++ b/sysinfowatchlet/metawatch-digital.qml
@@ -1,4 +1,5 @@
import Qt 4.7
+import com.javispedro.sowatch.metawatch 1.0
Rectangle {
width: 96
@@ -8,39 +9,47 @@ Rectangle {
Column {
anchors.fill: parent
- spacing: 4
- Text {
- text: "Battery: " + batteryLevel + "%"
+ MWTitle {
+ id: title
+ text: qsTr("Phone Info")
}
- Rectangle {
- id: battery
- x: 12
- width: 72
- height: 16
+ Column {
+ spacing: 4
- border.color: "black"
- border.width: 1
+ Text {
+ text: "Battery: " + batteryLevel + "%"
+ }
Rectangle {
- width: (batteryLevel / 100) * parent.width
- height: parent.height
+ id: battery
+ x: 12
+ width: 72
+ height: 16
+
+ border.color: "black"
+ border.width: 1
- color: "black"
+ Rectangle {
+ width: (batteryLevel / 100) * parent.width
+ height: parent.height
+
+ color: "black"
+ }
}
- }
- Text {
- width: parent.width
- text: "Connected to:"
- }
+ Text {
+ width: parent.width
+ text: "Connected to:"
+ }
- Text {
- width: parent.width
- text: networkName
- horizontalAlignment: Text.AlignHCenter
- wrapMode: Text.Wrap
+ Text {
+ width: parent.width
+ text: networkName
+ horizontalAlignment: Text.AlignHCenter
+ wrapMode: Text.Wrap
+ }
}
}
}
diff --git a/sysinfowatchlet/sysinfowatchlet.cpp b/sysinfowatchlet/sysinfowatchlet.cpp
index 9e4bbf2..46d45e7 100644
--- a/sysinfowatchlet/sysinfowatchlet.cpp
+++ b/sysinfowatchlet/sysinfowatchlet.cpp
@@ -10,7 +10,7 @@ SysInfoWatchlet::SysInfoWatchlet(WatchServer* server) :
{
rootContext()->setContextProperty("batteryLevel", 0);
rootContext()->setContextProperty("networkName", "");
- setSource(QUrl("qrc:/sysinfowatchlet/" + server->watch()->model() + ".qml"));
+ setSource(QUrl(SOWATCH_QML_DIR "/sysinfowatchlet/" + server->watch()->model() + ".qml"));
connect(this, SIGNAL(activated()), SLOT(handleActivated()));
}
diff --git a/sysinfowatchlet/sysinfowatchlet.pro b/sysinfowatchlet/sysinfowatchlet.pro
index 329b74b..96af06a 100644
--- a/sysinfowatchlet/sysinfowatchlet.pro
+++ b/sysinfowatchlet/sysinfowatchlet.pro
@@ -15,6 +15,8 @@ SOURCES += sysinfoplugin.cpp sysinfowatchlet.cpp
HEADERS += sysinfoplugin.h sysinfowatchlet.h
+qml_files.files = metawatch-digital.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
else:symbian: LIBS += -lsowatch
@@ -22,19 +24,16 @@ else:unix: LIBS += -L$$OUT_PWD/../libsowatch/ -lsowatch
INCLUDEPATH += $$PWD/../libsowatch
DEPENDPATH += $$PWD/../libsowatch
+QML_IMPORT_PATH += $$PWD/../metawatch/qml
unix:!symbian {
!isEmpty(MEEGO_VERSION_MAJOR)|maemo5 {
QMAKE_RPATHDIR += /opt/sowatch/lib
target.path = /opt/sowatch/lib/watchlets
+ qml_files.path = /opt/sowatch/qml/$$TARGET
} else {
target.path = /usr/lib/sowatch/watchlets
+ qml_files.path = /usr/share/sowatch/qml/$$TARGET
}
- INSTALLS += target
+ INSTALLS += target qml_files
}
-
-OTHER_FILES += \
- metawatch-digital.qml
-
-RESOURCES += \
- sysinfowatchlet.qrc
diff --git a/sysinfowatchlet/sysinfowatchlet.qrc b/sysinfowatchlet/sysinfowatchlet.qrc
deleted file mode 100644
index 62142b0..0000000
--- a/sysinfowatchlet/sysinfowatchlet.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/sysinfowatchlet">
- <file>metawatch-digital.qml</file>
- </qresource>
-</RCC>