aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/BrowserApp.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/widgets/BrowserApp.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/widgets/BrowserApp.cpp b/src/widgets/BrowserApp.cpp
index 0a82de0..3cd06b4 100644
--- a/src/widgets/BrowserApp.cpp
+++ b/src/widgets/BrowserApp.cpp
@@ -2,8 +2,9 @@
#include <QtCore>
#include "LuaRuntime.hpp"
+#include "WindowActionRouter.hpp"
#include "widgets/BrowserApp.hpp"
-#include "widgets/MainWindow.hpp"
+#include "widgets/BrowserWindow.hpp"
BrowserApp::BrowserApp() {
auto *lua = LuaRuntime::instance();
@@ -11,16 +12,13 @@ BrowserApp::BrowserApp() {
// Global event filter
qApp->installEventFilter(this);
-
- // NOTE: TMP
- lua->load_file("./config.lua");
};
-MainWindow *BrowserApp::create_window() {
- auto *win = new MainWindow((const Configuration &)configuration);
+BrowserWindow *BrowserApp::create_window() {
+ auto *win = new BrowserWindow((const Configuration &)configuration);
win->setWindowTitle("null-browser");
- windows.insert({last_id, win});
- last_id++;
+ auto *router = WindowActionRouter::instance();
+ router->add_window(win);
win->show();
return win;
}
@@ -29,7 +27,7 @@ bool BrowserApp::eventFilter(QObject *target, QEvent *event) {
if (event->type() != QEvent::KeyPress)
return false;
- for (auto &match : windows) {
+ for (const auto &match : WindowActionRouter::instance()->windows()) {
auto *win = match.second;
if (auto *target_widget = dynamic_cast<QWidget *>(target);