summaryrefslogtreecommitdiffstats
path: root/app/main.cpp
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2022-06-07 15:39:51 -0400
committerScott Murray <scott.murray@konsulko.com>2022-06-07 15:50:29 -0400
commitb53c55799ff50fb51bec1bf75bac477fa4165336 (patch)
tree4200790f43db597c73de3acda9c71b76938a67e2 /app/main.cpp
parent70dfe121582cda2c82c794e5af6550b5c1a237c4 (diff)
Updates to restore to a functional state
Changes: - Add setenv of QT_QUICK_CONTROLS_STYLE and setting of the frameless window hint to match the previous behavior before the removal of the previous application framework. - Use the new VehicleSignals API from libqtappfw to replace the previous signal-composer usage. - Update the use of the Navigation API from libqtappfw for its rework to use VIS signals instead of the previous signal-composer usage. - The default unit for the vehicle speed has been switched to kilometers with switching driven by the appropriate VSS schema value. Bug-AGL: SPEC-4409, SPEC-4426 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I69b60a1e3207a54c34aaf114a1e89fce2cf0059f
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")));