diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main_qmladaptor.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main_qmladaptor.cpp b/src/main_qmladaptor.cpp index 845da0a..419f794 100644 --- a/src/main_qmladaptor.cpp +++ b/src/main_qmladaptor.cpp @@ -151,7 +151,20 @@ void MainQMLAdaptor::get_web_app_hosts_response(QJsonDocument *doc) { if (!atLeastOneHostAvailable) { main_content_replace("scenes/Scene_no_server_available.qml"); - //addRWAHost(new RWAHost("-","Kein Server verfügbar!","-")); + // Find item via 'objectName' + QObject *sidebar_drawer = _engine->rootObjects().takeFirst()->findChild<QObject*>("sidebar_drawer"); + if (sidebar_drawer) { + sidebar_drawer->setProperty("rwaHostIsSelected", false); + } else { + qWarning() << "Unable to find 'sidebar_drawer' Item!"; + } + } + QObject *server_chooser = _engine->rootObjects().takeFirst()->findChild<QObject*>("server_chooser"); + if (server_chooser) { + server_chooser->setProperty("displayText", atLeastOneHostAvailable ? server_chooser->property("currentText") : tr("No RWA host available!")); + server_chooser->setProperty("enabled", atLeastOneHostAvailable); + } else { + qWarning() << "Unable to find 'server_chooser' Item!"; } } |