diff --git a/pcsx2-gsrunner/Main.cpp b/pcsx2-gsrunner/Main.cpp index 4a1fd2669b..b991537f60 100644 --- a/pcsx2-gsrunner/Main.cpp +++ b/pcsx2-gsrunner/Main.cpp @@ -175,16 +175,6 @@ void Host::ReportErrorAsync(const std::string_view title, const std::string_view ERROR_LOG("ReportErrorAsync: {}", message); } -bool Host::ConfirmMessage(const std::string_view title, const std::string_view message) -{ - if (!title.empty() && !message.empty()) - ERROR_LOG("ConfirmMessage: {}: {}", title, message); - else if (!message.empty()) - ERROR_LOG("ConfirmMessage: {}", message); - - return true; -} - void Host::OpenURL(const std::string_view url) { // noop diff --git a/pcsx2-qt/MainWindow.cpp b/pcsx2-qt/MainWindow.cpp index 43eec1fbbe..1e6aaa188f 100644 --- a/pcsx2-qt/MainWindow.cpp +++ b/pcsx2-qt/MainWindow.cpp @@ -427,7 +427,6 @@ void MainWindow::connectSignals() void MainWindow::connectVMThreadSignals(EmuThread* thread) { - connect(thread, &EmuThread::messageConfirmed, this, &MainWindow::confirmMessage, Qt::BlockingQueuedConnection); connect(thread, &EmuThread::statusMessage, this, &MainWindow::onStatusMessage); connect(thread, &EmuThread::onAcquireRenderWindowRequested, this, &MainWindow::acquireRenderWindow, Qt::BlockingQueuedConnection); connect(thread, &EmuThread::onReleaseRenderWindowRequested, this, &MainWindow::releaseRenderWindow, Qt::BlockingQueuedConnection); diff --git a/pcsx2-qt/QtHost.cpp b/pcsx2-qt/QtHost.cpp index 8a712d594a..770296497c 100644 --- a/pcsx2-qt/QtHost.cpp +++ b/pcsx2-qt/QtHost.cpp @@ -141,41 +141,6 @@ void EmuThread::stopInThread() m_shutdown_flag.store(true); } -bool EmuThread::confirmMessage(const QString& title, const QString& message) -{ - if (!isOnEmuThread()) - { - // This is definitely deadlock risky, but unlikely to happen (why would GS be confirming?). - bool result = false; - QMetaObject::invokeMethod(g_emu_thread, "confirmMessage", Qt::BlockingQueuedConnection, Q_RETURN_ARG(bool, result), - Q_ARG(const QString&, title), Q_ARG(const QString&, message)); - return result; - } - - // Easy if there's no VM. - if (!VMManager::HasValidVM()) - return emit messageConfirmed(title, message); - - // Preemptively pause/set surfaceless on the emu thread, because it can't run while the popup is open. - const bool was_paused = (VMManager::GetState() == VMState::Paused); - const bool was_fullscreen = isFullscreen(); - if (!was_paused) - VMManager::SetPaused(true); - if (was_fullscreen) - setSurfaceless(true); - - // This won't return until the user confirms one way or another. - const bool result = emit messageConfirmed(title, message); - - // Resume VM after confirming. - if (was_fullscreen) - setSurfaceless(false); - if (!was_paused) - VMManager::SetPaused(false); - - return result; -} - void EmuThread::startFullscreenUI(bool fullscreen) { if (!isOnEmuThread()) @@ -1649,13 +1614,6 @@ void Host::ReportErrorAsync(const std::string_view title, const std::string_view Q_ARG(const QString&, message.empty() ? QString() : QString::fromUtf8(message.data(), message.size()))); } -bool Host::ConfirmMessage(const std::string_view title, const std::string_view message) -{ - const QString qtitle(QString::fromUtf8(title.data(), title.size())); - const QString qmessage(QString::fromUtf8(message.data(), message.size())); - return g_emu_thread->confirmMessage(qtitle, qmessage); -} - void Host::OpenURL(const std::string_view url) { QtHost::RunOnUIThread([url = QtUtils::StringViewToQString(url)]() { QtUtils::OpenURL(g_main_window, QUrl(url)); }); diff --git a/pcsx2-qt/QtHost.h b/pcsx2-qt/QtHost.h index e732b6d074..0785f4d811 100644 --- a/pcsx2-qt/QtHost.h +++ b/pcsx2-qt/QtHost.h @@ -77,7 +77,6 @@ public: void updatePerformanceMetrics(bool force); public Q_SLOTS: - bool confirmMessage(const QString& title, const QString& message); void loadSettings(SettingsInterface& si, std::unique_lock& lock); void checkForSettingChanges(const Pcsx2Config& old_config); void startFullscreenUI(bool fullscreen); @@ -114,7 +113,6 @@ public Q_SLOTS: void endCapture(); Q_SIGNALS: - bool messageConfirmed(const QString& title, const QString& message); void statusMessage(const QString& message); std::optional onAcquireRenderWindowRequested(bool recreate_window, bool fullscreen, bool render_to_main, bool surfaceless); diff --git a/pcsx2/Host.cpp b/pcsx2/Host.cpp index 15a287bbe4..a089b3f120 100644 --- a/pcsx2/Host.cpp +++ b/pcsx2/Host.cpp @@ -154,16 +154,6 @@ void Host::ReportFormattedErrorAsync(const std::string_view title, const char* f ReportErrorAsync(title, message); } -bool Host::ConfirmFormattedMessage(const std::string_view title, const char* format, ...) -{ - std::va_list ap; - va_start(ap, format); - std::string message = StringUtil::StdStringFromFormatV(format, ap); - va_end(ap); - - return ConfirmMessage(title, message); -} - std::string Host::GetHTTPUserAgent() { return fmt::format("PCSX2 {} ({})", BuildVersion::GitRev, GetOSVersionString()); diff --git a/pcsx2/Host.h b/pcsx2/Host.h index 0f9d17391b..50023cc9d4 100644 --- a/pcsx2/Host.h +++ b/pcsx2/Host.h @@ -63,10 +63,6 @@ namespace Host void ReportErrorAsync(const std::string_view title, const std::string_view message); void ReportFormattedErrorAsync(const std::string_view title, const char* format, ...); - /// Displays a synchronous confirmation on the UI thread, i.e. blocks the caller. - bool ConfirmMessage(const std::string_view title, const std::string_view message); - bool ConfirmFormattedMessage(const std::string_view title, const char* format, ...); - /// Sets batch mode (exit after game shutdown). bool InBatchMode(); diff --git a/tests/ctest/core/StubHost.cpp b/tests/ctest/core/StubHost.cpp index 9d30641bbd..bcf741a90f 100644 --- a/tests/ctest/core/StubHost.cpp +++ b/tests/ctest/core/StubHost.cpp @@ -46,11 +46,6 @@ void Host::ReportErrorAsync(const std::string_view title, const std::string_view { } -bool Host::ConfirmMessage(const std::string_view title, const std::string_view message) -{ - return true; -} - void Host::OpenURL(const std::string_view url) { }