diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2020-12-08 06:20:45 -0500 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2020-12-18 10:33:28 -0500 |
commit | 82fa9f8d56bc285e7bb58fc81b495a55be9ea82c (patch) | |
tree | 19ca59277d5730dc76d632ab1f0a135f25f19415 /src/yuzu/main.cpp | |
parent | 51cddcb8b8d4d12715ba0517638b394244b500bb (diff) |
applets/web: Implement the online web browser applet
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r-- | src/yuzu/main.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index f835ee9cb7..620e80cdcf 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -366,13 +366,13 @@ void GMainWindow::SoftwareKeyboardInvokeCheckDialog(std::u16string error_message emit SoftwareKeyboardFinishedCheckDialog(); } -void GMainWindow::WebBrowserOpenLocalWebPage(std::string_view main_url, - std::string_view additional_args) { +void GMainWindow::WebBrowserOpenWebPage(std::string_view main_url, std::string_view additional_args, + bool is_local) { #ifdef YUZU_USE_QT_WEB_ENGINE if (disable_web_applet) { emit WebBrowserClosed(Service::AM::Applets::WebExitReason::WindowClosed, - "http://localhost"); + "http://localhost/"); return; } @@ -388,7 +388,7 @@ void GMainWindow::WebBrowserOpenLocalWebPage(std::string_view main_url, loading_progress.setRange(0, 3); loading_progress.setValue(0); - if (!Common::FS::Exists(std::string(main_url))) { + if (is_local && !Common::FS::Exists(std::string(main_url))) { loading_progress.show(); auto future = QtConcurrent::run([this] { emit WebBrowserExtractOfflineRomFS(); }); @@ -400,7 +400,11 @@ void GMainWindow::WebBrowserOpenLocalWebPage(std::string_view main_url, loading_progress.setValue(1); - web_browser_view.LoadLocalWebPage(main_url, additional_args); + if (is_local) { + web_browser_view.LoadLocalWebPage(main_url, additional_args); + } else { + web_browser_view.LoadExternalWebPage(main_url, additional_args); + } if (render_window->IsLoadingComplete()) { render_window->hide(); @@ -493,7 +497,7 @@ void GMainWindow::WebBrowserOpenLocalWebPage(std::string_view main_url, #else // Utilize the same fallback as the default web browser applet. - emit WebBrowserClosed(Service::AM::Applets::WebExitReason::WindowClosed, "http://localhost"); + emit WebBrowserClosed(Service::AM::Applets::WebExitReason::WindowClosed, "http://localhost/"); #endif } |