summaryrefslogtreecommitdiffstats
path: root/app/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'app/main.cpp')
-rw-r--r--app/main.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/app/main.cpp b/app/main.cpp
index 1be4efa..827a561 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -8,6 +8,7 @@
#include <QtQml/QQmlContext>
#include <QtQuick/QQuickWindow>
#include <navigation.h>
+#include <vehiclesignals.h>
#include <QScreen>
#include "navigation_client.h"
@@ -91,6 +92,8 @@ int main(int argc, char *argv[])
QString graphic_role = QString("tbtnavi");
struct agl_shell_desktop *agl_shell_desktop = nullptr;
+ setenv("QT_QUICK_CONTROLS_STYLE", "AGL", 1);
+
QGuiApplication app(argc, argv);
QCoreApplication::setOrganizationDomain("automotivelinux.org");
QCoreApplication::setOrganizationName("AutomotiveGradeLinux");
@@ -132,7 +135,17 @@ int main(int argc, char *argv[])
File_Operation file;
context->setContextProperty("fileOperation", &file);
- Navigation *navigation = new Navigation(context);
+ VehicleSignalsConfig vsConfig("tbtnavi");
+ VehicleSignals *vs = new VehicleSignals(vsConfig);
+ if (!vs) {
+ qFatal("Could not create VehicleSignals!");
+ }
+ context->setContextProperty("VehicleSignals", vs);
+
+ // Give the navigation client it's own vehicle signals connection
+ // to simplify state management wrt QML initialization, and keep the
+ // notification streams separate.
+ Navigation *navigation = new Navigation(new VehicleSignals(vsConfig), context);
engine.load(QUrl(QStringLiteral("qrc:qml/Main.qml")));