mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-24 05:37:54 -05:00
qt: implement RequestExit for applets
This commit is contained in:
@ -393,6 +393,8 @@ void QtNXWebEngineView::FocusFirstLinkElement() {
|
||||
QtWebBrowser::QtWebBrowser(GMainWindow& main_window) {
|
||||
connect(this, &QtWebBrowser::MainWindowOpenWebPage, &main_window,
|
||||
&GMainWindow::WebBrowserOpenWebPage, Qt::QueuedConnection);
|
||||
connect(this, &QtWebBrowser::MainWindowRequestExit, &main_window,
|
||||
&GMainWindow::WebBrowserRequestExit, Qt::QueuedConnection);
|
||||
connect(&main_window, &GMainWindow::WebBrowserExtractOfflineRomFS, this,
|
||||
&QtWebBrowser::MainWindowExtractOfflineRomFS, Qt::QueuedConnection);
|
||||
connect(&main_window, &GMainWindow::WebBrowserClosed, this,
|
||||
@ -401,6 +403,11 @@ QtWebBrowser::QtWebBrowser(GMainWindow& main_window) {
|
||||
|
||||
QtWebBrowser::~QtWebBrowser() = default;
|
||||
|
||||
void QtWebBrowser::Close() const {
|
||||
callback = {};
|
||||
emit MainWindowRequestExit();
|
||||
}
|
||||
|
||||
void QtWebBrowser::OpenLocalWebPage(const std::string& local_url,
|
||||
ExtractROMFSCallback extract_romfs_callback_,
|
||||
OpenWebPageCallback callback_) const {
|
||||
@ -436,5 +443,7 @@ void QtWebBrowser::MainWindowExtractOfflineRomFS() {
|
||||
|
||||
void QtWebBrowser::MainWindowWebBrowserClosed(Service::AM::Applets::WebExitReason exit_reason,
|
||||
std::string last_url) {
|
||||
callback(exit_reason, last_url);
|
||||
if (callback) {
|
||||
callback(exit_reason, last_url);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user