From 326dc2449a69c9ea97cb5c2936807e9045dc1aa7 Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" <kali@leap.se> Date: Tue, 22 Jun 2021 13:05:44 +0200 Subject: [PATCH] [feat] show controls window if no available systray --- gui/main.cpp | 5 ++++- gui/qml/main.qml | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gui/main.cpp b/gui/main.cpp index 76368106..1efa332d 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -117,6 +117,7 @@ int main(int argc, char **argv) { parser.process(app); bool hideSystray = parser.isSet("no-systray"); + bool availableSystray = true; bool installHelpers = parser.isSet("install-helpers"); bool webAPI = parser.isSet("web-api"); QString webPort = parser.value("web-port"); @@ -146,7 +147,8 @@ int main(int argc, char **argv) { } if (!QSystemTrayIcon::isSystemTrayAvailable()) { - qDebug() << "No systray icon available. Things might not work for now, sorry..."; + qDebug() << "No systray icon available."; + availableSystray = false; } QTranslator translator; @@ -174,6 +176,7 @@ int main(int argc, char **argv) { /* set some useful flags */ ctx->setContextProperty("systrayVisible", !hideSystray); + ctx->setContextProperty("systrayAvailable", availableSystray); engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml"))); diff --git a/gui/qml/main.qml b/gui/qml/main.qml index 91e3b4ea..e0a9a817 100644 --- a/gui/qml/main.qml +++ b/gui/qml/main.qml @@ -276,9 +276,10 @@ ApplicationWindow { loginDone = false allowEmptyPass = Logic.shouldAllowEmptyPass(providers) needsRestart = false; - /* TODO get appVisible flag from backend */ - //app.visible = true - //app.raise() + if (!systrayAvailable) { + app.visible = true + app.raise() + } } -- GitLab