aboutsummaryrefslogtreecommitdiff
path: root/src/scenes
diff options
context:
space:
mode:
Diffstat (limited to 'src/scenes')
-rw-r--r--src/scenes/add_server_wizard/add_server_wizard.cpp10
-rw-r--r--src/scenes/add_server_wizard/add_server_wizard.h5
2 files changed, 9 insertions, 6 deletions
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 <https://www.gnu.org/licenses/>.
*/
-#include <QDebug>
-#include <QtDBus>
-#include <QDBusPendingCallWatcher>
-
#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<RWAHost> 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();