diff options
Diffstat (limited to '')
| -rw-r--r-- | src/widgets/BrowserWindow.cpp | 5 | ||||
| -rw-r--r-- | src/widgets/BrowserWindow.hpp | 1 | ||||
| -rw-r--r-- | src/widgets/Decorations.cpp | 2 | ||||
| -rw-r--r-- | src/widgets/Decorations.hpp | 1 | ||||
| -rw-r--r-- | src/widgets/IWebViewMediator.hpp | 1 | ||||
| -rw-r--r-- | src/widgets/WebViewStack.cpp | 10 | ||||
| -rw-r--r-- | src/widgets/WebViewStack.hpp | 1 |
7 files changed, 20 insertions, 1 deletions
diff --git a/src/widgets/BrowserWindow.cpp b/src/widgets/BrowserWindow.cpp index 7852a66..87e315c 100644 --- a/src/widgets/BrowserWindow.cpp +++ b/src/widgets/BrowserWindow.cpp @@ -10,7 +10,6 @@ #include "WindowActionRouter.hpp" #include "events/KeyPressedEvent.hpp" #include "keymap/KeymapEvaluator.hpp" -#include "widgets/BrowserApp.hpp" #include "widgets/Decorations.hpp" #include "widgets/WebViewStack.hpp" @@ -111,3 +110,7 @@ void BrowserWindow::expose_rpc_function(const QString &name, const RpcFunc &acti WebViewId webview_id) { get_webview_mediator(webview_id)->expose_rpc_function(name, action, webview_id); } + +void BrowserWindow::reload(WebViewId webview_id) { + get_webview_mediator(webview_id)->reload(webview_id); +} diff --git a/src/widgets/BrowserWindow.hpp b/src/widgets/BrowserWindow.hpp index bc6cea1..de48c6e 100644 --- a/src/widgets/BrowserWindow.hpp +++ b/src/widgets/BrowserWindow.hpp @@ -40,6 +40,7 @@ public: void set_html(const QString &html, WebViewId webview_id); void run_javascript(const QString &js_code, WebViewId webview_id); void expose_rpc_function(const QString &name, const RpcFunc &action, WebViewId webview_id); + void reload(WebViewId webview_id); bool on_window_key_event(QObject *target, QKeyEvent *event); diff --git a/src/widgets/Decorations.cpp b/src/widgets/Decorations.cpp index dc644d5..1cff3d4 100644 --- a/src/widgets/Decorations.cpp +++ b/src/widgets/Decorations.cpp @@ -101,3 +101,5 @@ void Decorations::expose_rpc_function(const QString &name, const RpcFunc &action if (decoration.has_value()) decoration.value()->expose_rpc_function(name, action); } + +void Decorations::reload(WebViewId /* unused */) { qDebug() << "TODO: Impl"; } diff --git a/src/widgets/Decorations.hpp b/src/widgets/Decorations.hpp index 97e0415..108b13e 100644 --- a/src/widgets/Decorations.hpp +++ b/src/widgets/Decorations.hpp @@ -32,6 +32,7 @@ public: void run_javascript(const QString &js_code, WebViewId webview_id) override; void expose_rpc_function(const QString &name, const RpcFunc &action, WebViewId webview_id) override; + void reload(WebViewId webview_id) override; private: EdgeDecoration *decoration_top; diff --git a/src/widgets/IWebViewMediator.hpp b/src/widgets/IWebViewMediator.hpp index 9c64e53..a7007f2 100644 --- a/src/widgets/IWebViewMediator.hpp +++ b/src/widgets/IWebViewMediator.hpp @@ -13,4 +13,5 @@ public: virtual void expose_rpc_function(const QString &name, const RpcFunc &action, WebViewId webview_id) = 0; virtual void run_javascript(const QString &js_code, WebViewId webview_id) = 0; + virtual void reload(WebViewId webview_id) = 0; }; diff --git a/src/widgets/WebViewStack.cpp b/src/widgets/WebViewStack.cpp index 37532ff..ab5808f 100644 --- a/src/widgets/WebViewStack.cpp +++ b/src/widgets/WebViewStack.cpp @@ -356,3 +356,13 @@ void WebViewStack::expose_rpc_function(const QString &name, const RpcFunc & /* u WebViewId /* unused */) { qDebug() << "expose_rpc_function: NOT IMPLEMENTED" << name; } + +void WebViewStack::reload(WebViewId webview_id) { + auto *webview = get_webview(webview_id); + if (webview == nullptr) { + qDebug() << "Webview does not exist"; + return; + } + + webview->reload(); +} diff --git a/src/widgets/WebViewStack.hpp b/src/widgets/WebViewStack.hpp index 5a88266..bbee44c 100644 --- a/src/widgets/WebViewStack.hpp +++ b/src/widgets/WebViewStack.hpp @@ -65,6 +65,7 @@ public slots: void run_javascript(const QString &js_code, WebViewId webview_id) override; void expose_rpc_function(const QString &name, const RpcFunc &action, WebViewId webview_id) override; + void reload(WebViewId webview_id) override; protected slots: void on_new_webview_request(QWebEngineNewWindowRequest &request); |
