summaryrefslogtreecommitdiff
path: root/app/pebble.cpp
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2014-12-14 03:26:46 +0100
committerJavier <dev.git@javispedro.com>2014-12-14 03:26:46 +0100
commitf40514fe681f5163deb5f579140ef4f7ac77f5a8 (patch)
treec3edddde3cbc98a797d5a1a7b745c2c5d3b99eba /app/pebble.cpp
parentdf30ca18eebd2dfec03c589b607d45a5891cf2b2 (diff)
add icons to the slots managament UI
Diffstat (limited to 'app/pebble.cpp')
-rw-r--r--app/pebble.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/app/pebble.cpp b/app/pebble.cpp
index 44f1aeb..41da080 100644
--- a/app/pebble.cpp
+++ b/app/pebble.cpp
@@ -33,16 +33,22 @@
#include <sailfishapp.h>
#include "pebbledinterface.h"
+#include "pebbleappiconprovider.h"
int main(int argc, char *argv[])
{
- // Register Pebble daemon interface object on QML side
- qmlRegisterType<PebbledInterface>("org.pebbled", 0, 1, "PebbledInterface");
-
QScopedPointer<QGuiApplication> app(SailfishApp::application(argc, argv));
+ qmlRegisterUncreatableType<PebbledInterface>("org.pebbled", 0, 1, "PebbledInterface",
+ "Please use pebbled context property");
+
QScopedPointer<QQuickView> view(SailfishApp::createView());
+ QScopedPointer<PebbledInterface> pebbled(new PebbledInterface);
+ QScopedPointer<PebbleAppIconProvider> appicons(new PebbleAppIconProvider(pebbled.data()));
+
view->rootContext()->setContextProperty("APP_VERSION", APP_VERSION);
+ view->rootContext()->setContextProperty("pebbled", pebbled.data());
+ view->engine()->addImageProvider("pebble-app-icon", appicons.data());
view->setSource(SailfishApp::pathTo("qml/pebble.qml"));
view->show();