summaryrefslogtreecommitdiffstats
path: root/app/main.cpp
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2022-03-07 15:33:50 -0500
committerScott Murray <scott.murray@konsulko.com>2022-03-07 15:45:58 -0500
commit00fa784cdb2570f742511820b885b1c3e18b6d01 (patch)
treeb8ab83fdbc77fa411f3ddcf9d169b6772663ebe6 /app/main.cpp
parent4b7c213e30871d1e6afcbed8a2863d7459065572 (diff)
Update for app framework removalmarlin_12.93.0marlin/12.93.012.93.0
Changes: - Remove the autobuild scripts and config.xml used by the app framework widget build. - Update the CMake files to just build a "cluster-dashboard" binary and install it into /usr/bin by default. - Remove the code in main.cpp that handled reading the WebSocket command-line arguments and passing them to binding related code. - Removed signal-composer wrapper instantiation in main.cpp, but the related QML has been left alone now, this will need to be revisited once something else is in place for vehicle signals (e.g. perhaps a simple VISS API wrapper in libqtappfw that leverages kuksa.val). Bug-AGL: SPEC-4283 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: Ibf36aebb74d584f93b2e5fe9d068b18b7f2a7ce5
Diffstat (limited to 'app/main.cpp')
-rw-r--r--app/main.cpp64
1 files changed, 14 insertions, 50 deletions
diff --git a/app/main.cpp b/app/main.cpp
index 3c460d5..14c2ead 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -32,7 +32,6 @@
#include <QDebug>
#include <QScreen>
-#include <signalcomposer.h>
#include <wayland-client.h>
#include "agl-shell-client-protocol.h"
@@ -144,7 +143,7 @@ create_component(QPlatformNativeInterface *native, QQmlComponent *comp,
int main(int argc, char *argv[])
{
- QString myname = QString("cluster-gauges");
+ QString myname = QString("cluster-dashboard");
struct agl_shell *agl_shell;
struct wl_output *output;
@@ -165,60 +164,25 @@ int main(int argc, char *argv[])
screen = qApp->primaryScreen();
output = getWlOutput(native, screen);
- QCommandLineParser parser;
- parser.addPositionalArgument("port", app.translate("main", "port for binding"));
- parser.addPositionalArgument("secret", app.translate("main", "secret for binding"));
- parser.addHelpOption();
- parser.addVersionOption();
- parser.process(app);
-
- QStringList positionalArguments = parser.positionalArguments();
+ read_config();
QQmlApplicationEngine engine;
QQmlContext *context = engine.rootContext();
+ context->setContextProperty("runAnimation", runAnimation);
- if (positionalArguments.length() == 2) {
- int port = positionalArguments.takeFirst().toInt();
- QString secret = positionalArguments.takeFirst();
-
- QUrl bindingAddress;
- QUrlQuery query;
-
- struct wl_surface *bg;
-
- bindingAddress.setScheme(QStringLiteral("ws"));
- bindingAddress.setHost(QStringLiteral("localhost"));
- bindingAddress.setPort(port);
- bindingAddress.setPath(QStringLiteral("/api"));
-
- query.addQueryItem(QStringLiteral("token"), secret);
- bindingAddress.setQuery(query);
-
- read_config();
+ QQmlComponent bg_comp(&engine, QUrl("qrc:/cluster-gauges.qml"));
+ qDebug() << bg_comp.errors();
+ struct wl_surface *bg = create_component(native, &bg_comp, screen, &qobj_bg);
- context->setContextProperty(QStringLiteral("bindingAddress"),
- bindingAddress);
+ // set the surface as the background
+ agl_shell_set_background(agl_shell, bg, output);
- context->setContextProperty("SignalComposer",
- new SignalComposer(bindingAddress,
- context));
- context->setContextProperty("runAnimation", runAnimation);
-
- QQmlComponent bg_comp(&engine, QUrl("qrc:/cluster-gauges.qml"));
- qDebug() << bg_comp.errors();
-
- bg = create_component(native, &bg_comp, screen, &qobj_bg);
-
- // set the surface as the background
- agl_shell_set_background(agl_shell, bg, output);
-
- // instruct the compositor it can display after Qt has a chance
- // to load everything
- QTimer::singleShot(500, [agl_shell](){
- qDebug() << "agl_shell ready!";
- agl_shell_ready(agl_shell);
- });
- }
+ // instruct the compositor it can display after Qt has a chance
+ // to load everything
+ QTimer::singleShot(500, [agl_shell](){
+ qDebug() << "agl_shell ready!";
+ agl_shell_ready(agl_shell);
+ });
return app.exec();
}