aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-11-25 13:01:17 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2018-11-25 15:05:18 +0100
commit09c4508aee96ca20d084b8a60b4c6603de8bff8b (patch)
treefa17b39bb6018b96b8045b3af6bdfbd8e1ca5af5 /src/mainwindow/mainwindow.cpp
parentAdd QT_NO_DEBUG to non-debug builds (diff)
downloadsmolbote-09c4508aee96ca20d084b8a60b4c6603de8bff8b.tar.xz
Add Session Dialog
Diffstat (limited to 'src/mainwindow/mainwindow.cpp')
-rw-r--r--src/mainwindow/mainwindow.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp
index 8f635c9..80e4faa 100644
--- a/src/mainwindow/mainwindow.cpp
+++ b/src/mainwindow/mainwindow.cpp
@@ -13,6 +13,7 @@
#include "configuration.h"
#include "profilemanager.h"
#include "session.h"
+#include "session/sessiondialog.h"
#include "subwindow/subwindow.h"
#include "ui_mainwindow.h"
#include "webengine/webview.h"
@@ -126,14 +127,8 @@ MainWindow::MainWindow(const std::unique_ptr<Configuration> &config, QWidget *pa
}
});
connect(ui->actionLoadSession, &QAction::triggered, this, [this]() {
- const QString filename = QFileDialog::getOpenFileName(this, tr("Load Session"), QDir::homePath(), tr("JSON (*.json)"));
- QFile json(filename);
- if(json.open(QIODevice::ReadOnly | QIODevice::Text)) {
- auto *browser = qobject_cast<Browser *>(qApp);
- auto doc = QJsonDocument::fromJson(json.readAll());
- browser->createSession(doc.object());
- json.close();
- }
+ auto *sessionDialog = new SessionDialog(this);
+ sessionDialog->exec();
});
}