aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
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();
});
}