mirror of
https://github.com/PCSX2/pcsx2.git
synced 2025-12-16 04:08:48 +00:00
Host: Remove ConfirmMessage and ConfirmFormattedMessage functions
This commit is contained in:
parent
8cc28c25d8
commit
eaa834d238
@ -175,16 +175,6 @@ void Host::ReportErrorAsync(const std::string_view title, const std::string_view
|
|||||||
ERROR_LOG("ReportErrorAsync: {}", message);
|
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)
|
void Host::OpenURL(const std::string_view url)
|
||||||
{
|
{
|
||||||
// noop
|
// noop
|
||||||
|
|||||||
@ -427,7 +427,6 @@ void MainWindow::connectSignals()
|
|||||||
|
|
||||||
void MainWindow::connectVMThreadSignals(EmuThread* thread)
|
void MainWindow::connectVMThreadSignals(EmuThread* thread)
|
||||||
{
|
{
|
||||||
connect(thread, &EmuThread::messageConfirmed, this, &MainWindow::confirmMessage, Qt::BlockingQueuedConnection);
|
|
||||||
connect(thread, &EmuThread::statusMessage, this, &MainWindow::onStatusMessage);
|
connect(thread, &EmuThread::statusMessage, this, &MainWindow::onStatusMessage);
|
||||||
connect(thread, &EmuThread::onAcquireRenderWindowRequested, this, &MainWindow::acquireRenderWindow, Qt::BlockingQueuedConnection);
|
connect(thread, &EmuThread::onAcquireRenderWindowRequested, this, &MainWindow::acquireRenderWindow, Qt::BlockingQueuedConnection);
|
||||||
connect(thread, &EmuThread::onReleaseRenderWindowRequested, this, &MainWindow::releaseRenderWindow, Qt::BlockingQueuedConnection);
|
connect(thread, &EmuThread::onReleaseRenderWindowRequested, this, &MainWindow::releaseRenderWindow, Qt::BlockingQueuedConnection);
|
||||||
|
|||||||
@ -141,41 +141,6 @@ void EmuThread::stopInThread()
|
|||||||
m_shutdown_flag.store(true);
|
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)
|
void EmuThread::startFullscreenUI(bool fullscreen)
|
||||||
{
|
{
|
||||||
if (!isOnEmuThread())
|
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())));
|
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)
|
void Host::OpenURL(const std::string_view url)
|
||||||
{
|
{
|
||||||
QtHost::RunOnUIThread([url = QtUtils::StringViewToQString(url)]() { QtUtils::OpenURL(g_main_window, QUrl(url)); });
|
QtHost::RunOnUIThread([url = QtUtils::StringViewToQString(url)]() { QtUtils::OpenURL(g_main_window, QUrl(url)); });
|
||||||
|
|||||||
@ -77,7 +77,6 @@ public:
|
|||||||
void updatePerformanceMetrics(bool force);
|
void updatePerformanceMetrics(bool force);
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
bool confirmMessage(const QString& title, const QString& message);
|
|
||||||
void loadSettings(SettingsInterface& si, std::unique_lock<std::mutex>& lock);
|
void loadSettings(SettingsInterface& si, std::unique_lock<std::mutex>& lock);
|
||||||
void checkForSettingChanges(const Pcsx2Config& old_config);
|
void checkForSettingChanges(const Pcsx2Config& old_config);
|
||||||
void startFullscreenUI(bool fullscreen);
|
void startFullscreenUI(bool fullscreen);
|
||||||
@ -114,7 +113,6 @@ public Q_SLOTS:
|
|||||||
void endCapture();
|
void endCapture();
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
bool messageConfirmed(const QString& title, const QString& message);
|
|
||||||
void statusMessage(const QString& message);
|
void statusMessage(const QString& message);
|
||||||
|
|
||||||
std::optional<WindowInfo> onAcquireRenderWindowRequested(bool recreate_window, bool fullscreen, bool render_to_main, bool surfaceless);
|
std::optional<WindowInfo> onAcquireRenderWindowRequested(bool recreate_window, bool fullscreen, bool render_to_main, bool surfaceless);
|
||||||
|
|||||||
@ -154,16 +154,6 @@ void Host::ReportFormattedErrorAsync(const std::string_view title, const char* f
|
|||||||
ReportErrorAsync(title, message);
|
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()
|
std::string Host::GetHTTPUserAgent()
|
||||||
{
|
{
|
||||||
return fmt::format("PCSX2 {} ({})", BuildVersion::GitRev, GetOSVersionString());
|
return fmt::format("PCSX2 {} ({})", BuildVersion::GitRev, GetOSVersionString());
|
||||||
|
|||||||
@ -63,10 +63,6 @@ namespace Host
|
|||||||
void ReportErrorAsync(const std::string_view title, const std::string_view message);
|
void ReportErrorAsync(const std::string_view title, const std::string_view message);
|
||||||
void ReportFormattedErrorAsync(const std::string_view title, const char* format, ...);
|
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).
|
/// Sets batch mode (exit after game shutdown).
|
||||||
bool InBatchMode();
|
bool InBatchMode();
|
||||||
|
|
||||||
|
|||||||
@ -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)
|
void Host::OpenURL(const std::string_view url)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user