diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-03-29 11:45:18 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-03-29 11:45:18 +0530 |
| commit | bcecbced7e1af9d99443a7e823f18328c7943f09 (patch) | |
| tree | 612fac477acfa38358e15916bd4a44f386dc9206 /src/WindowMediator.cpp | |
| parent | f7392096d2d84be7143947d386528bf4f487ee83 (diff) | |
| download | null-browser-bcecbced7e1af9d99443a7e823f18328c7943f09.tar.gz null-browser-bcecbced7e1af9d99443a7e823f18328c7943f09.zip | |
Add window action router for multi-window
Diffstat (limited to '')
| -rw-r--r-- | src/WindowMediator.cpp (renamed from src/InputMediator.cpp) | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/InputMediator.cpp b/src/WindowMediator.cpp index 175a1b4..8c49e94 100644 --- a/src/InputMediator.cpp +++ b/src/WindowMediator.cpp @@ -2,30 +2,30 @@ #include <QWidget> #include <QtCore> -#include "InputMediator.hpp" #include "LuaRuntime.hpp" +#include "WindowMediator.hpp" #include "keymap/KeymapEvaluator.hpp" #include "widgets/WebViewStack.hpp" -// TODO: Rename this -InputMediator::InputMediator(WebViewStack *webview_stack, - LuaRuntime *lua_runtime, - KeymapEvaluator *keymap_evaluator) +WindowMediator::WindowMediator(WebViewStack *webview_stack, + LuaRuntime *lua_runtime, + KeymapEvaluator *keymap_evaluator) : webview_stack(webview_stack), lua_runtime(lua_runtime), keymap_evaluator(keymap_evaluator) { - connect(lua_runtime, &LuaRuntime::keymap_added, this, - &InputMediator::add_keymap); - connect(lua_runtime, &LuaRuntime::history_back_requested, webview_stack, + connect(this, &WindowMediator::keymap_added, this, + &WindowMediator::add_keymap); + + connect(this, &WindowMediator::history_back_requested, webview_stack, &WebViewStack::webview_history_back); - connect(lua_runtime, &LuaRuntime::history_forward_requested, webview_stack, + connect(this, &WindowMediator::history_forward_requested, webview_stack, &WebViewStack::webview_history_forward); - connect(lua_runtime, &LuaRuntime::url_opened, webview_stack, + connect(this, &WindowMediator::url_opened, webview_stack, &WebViewStack::open_url); - connect(lua_runtime, &LuaRuntime::webview_closed, webview_stack, + connect(this, &WindowMediator::webview_closed, webview_stack, &WebViewStack::close); - connect(lua_runtime, &LuaRuntime::webview_selected, webview_stack, + connect(this, &WindowMediator::webview_selected, webview_stack, &WebViewStack::focus_webview); // TODO: Think of how to handle this for multi-window @@ -35,11 +35,11 @@ InputMediator::InputMediator(WebViewStack *webview_stack, [this]() { return this->webview_stack->get_webview_list(); }); } -void InputMediator::add_keymap(const QString &mode_string, - const QString &keyseq, - std::function<void()> action) { +void WindowMediator::add_keymap(const QString &mode_string, + const QString &keyseq, + std::function<void()> action) { const KeyMode mode = keymap_evaluator->mode_from_string(mode_string); keymap_evaluator->add_keymap(mode, keyseq, std::move(action)); } -InputMediator::~InputMediator() { delete webview_stack; } +WindowMediator::~WindowMediator() { delete webview_stack; } |
