From 54249d9c37ce3994b03123ee6367c7f5519d3b40 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Wed, 7 Jul 2021 15:03:13 +0200 Subject: Introduce RWAHostModel. RWAHost's are now loaded on start. Scene_remote_{view, control} are no longer available if no host is selected. --- src/scenes/add_server_wizard/add_server_wizard.cpp | 10 +++++----- src/scenes/add_server_wizard/add_server_wizard.h | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src/scenes') diff --git a/src/scenes/add_server_wizard/add_server_wizard.cpp b/src/scenes/add_server_wizard/add_server_wizard.cpp index bd1dd3c..d06108c 100644 --- a/src/scenes/add_server_wizard/add_server_wizard.cpp +++ b/src/scenes/add_server_wizard/add_server_wizard.cpp @@ -23,16 +23,15 @@ * along with this program. If not, see . */ -#include -#include -#include - #include "add_server_wizard.h" #include "../../RWADBusAdaptor.h" #include "../../RWAHost.h" -Add_Server_wizard::Add_Server_wizard(QObject *parent) : QObject(parent) { +Add_Server_wizard::Add_Server_wizard(QObject *parent, MainQMLAdaptor *main_gui) : QObject(parent) { + Q_ASSERT(main_gui != nullptr); + _dbus_api = new DBusAPI(); + _main_gui = main_gui; // _dbus_api --serviceAddWebAppHostResponse-> this.add_web_app_host_response() QObject::connect(_dbus_api, @@ -96,6 +95,7 @@ void Add_Server_wizard::add_web_app_host_response(QJsonDocument *doc) { // Now built RWAHost object. QScopedPointer rwa_host (new RWAHost(host_uuid, host_alias, host_url)); + _main_gui->addRWAHost(rwa_host.data()); qInfo() << "Successfully added a new RWAHost."; emit step1Success(); diff --git a/src/scenes/add_server_wizard/add_server_wizard.h b/src/scenes/add_server_wizard/add_server_wizard.h index 554f6af..e4d62df 100644 --- a/src/scenes/add_server_wizard/add_server_wizard.h +++ b/src/scenes/add_server_wizard/add_server_wizard.h @@ -30,16 +30,19 @@ #include "../../RWADBusAdaptor.h" #include "../../DBusAPI.h" +#include "../../main_qmladaptor.h" class Add_Server_wizard : public QObject { Q_OBJECT public: - explicit Add_Server_wizard(QObject *parent = nullptr); + explicit Add_Server_wizard(QObject *parent = nullptr, + MainQMLAdaptor *main_gui = nullptr); void add_server(QString host_url); private: DBusAPI *_dbus_api; + MainQMLAdaptor *_main_gui; signals: void step1Success(); -- cgit v1.2.3