summaryrefslogtreecommitdiff
path: root/rockwork/main.cpp
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2016-02-11 23:55:16 +0100
committerAndrew Branson <andrew.branson@cern.ch>2016-02-11 23:55:16 +0100
commit29aaea2d80a9eb1715b6cddfac2d2aacf76358bd (patch)
tree012795b6bec16c72f38d33cff46324c9a0225868 /rockwork/main.cpp
launchpad ~mzanetti/rockwork/trunk r87
Diffstat (limited to 'rockwork/main.cpp')
-rw-r--r--rockwork/main.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/rockwork/main.cpp b/rockwork/main.cpp
new file mode 100644
index 0000000..70fd0d7
--- /dev/null
+++ b/rockwork/main.cpp
@@ -0,0 +1,37 @@
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+#include <QQuickView>
+#include <QtQml>
+#include <QFile>
+
+#include "notificationsourcemodel.h"
+#include "servicecontrol.h"
+#include "pebbles.h"
+#include "pebble.h"
+#include "applicationsmodel.h"
+#include "applicationsfiltermodel.h"
+#include "appstoreclient.h"
+#include "screenshotmodel.h"
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+
+ qmlRegisterUncreatableType<Pebble>("RockWork", 1, 0, "Pebble", "Get them from the model");
+ qmlRegisterUncreatableType<ApplicationsModel>("RockWork", 1, 0, "ApplicationsModel", "Get them from a Pebble object");
+ qmlRegisterUncreatableType<AppItem>("RockWork", 1, 0, "AppItem", "Get them from an ApplicationsModel");
+ qmlRegisterType<ApplicationsFilterModel>("RockWork", 1, 0, "ApplicationsFilterModel");
+ qmlRegisterType<Pebbles>("RockWork", 1, 0, "Pebbles");
+ qmlRegisterUncreatableType<NotificationSourceModel>("RockWork", 1, 0, "NotificationSourceModel", "Get it from a Pebble object");
+ qmlRegisterType<ServiceControl>("RockWork", 1, 0, "ServiceController");
+ qmlRegisterType<AppStoreClient>("RockWork", 1, 0, "AppStoreClient");
+ qmlRegisterType<ScreenshotModel>("RockWork", 1, 0, "ScreenshotModel");
+
+ QQuickView view;
+ view.engine()->rootContext()->setContextProperty("version", QStringLiteral(VERSION));
+ view.engine()->rootContext()->setContextProperty("homePath", QStandardPaths::standardLocations(QStandardPaths::HomeLocation).first());
+ view.setSource(QUrl(QStringLiteral("qrc:///Main.qml")));
+ view.setResizeMode(QQuickView::SizeRootObjectToView);
+ view.show();
+ return app.exec();
+}