mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-18 08:55:45 -04:00
HostInterface: Add a ConfirmMessage() method
This commit is contained in:
@ -35,7 +35,7 @@ MainWindow::~MainWindow()
|
||||
|
||||
void MainWindow::reportError(const QString& message)
|
||||
{
|
||||
QMessageBox::critical(nullptr, tr("DuckStation Error"), message, QMessageBox::Ok);
|
||||
QMessageBox::critical(this, tr("DuckStation"), message, QMessageBox::Ok);
|
||||
}
|
||||
|
||||
void MainWindow::reportMessage(const QString& message)
|
||||
@ -43,6 +43,11 @@ void MainWindow::reportMessage(const QString& message)
|
||||
m_ui.statusBar->showMessage(message, 2000);
|
||||
}
|
||||
|
||||
bool MainWindow::confirmMessage(const QString& message)
|
||||
{
|
||||
return (QMessageBox::question(this, tr("DuckStation"), message) == QMessageBox::Yes);
|
||||
}
|
||||
|
||||
void MainWindow::createDisplayWindow(QThread* worker_thread, bool use_debug_device)
|
||||
{
|
||||
DebugAssert(!m_display_widget);
|
||||
@ -336,12 +341,14 @@ void MainWindow::connectSignals()
|
||||
|
||||
connect(m_host_interface, &QtHostInterface::errorReported, this, &MainWindow::reportError,
|
||||
Qt::BlockingQueuedConnection);
|
||||
connect(m_host_interface, &QtHostInterface::messageReported, this, &MainWindow::reportMessage);
|
||||
connect(m_host_interface, &QtHostInterface::messageConfirmed, this, &MainWindow::confirmMessage,
|
||||
Qt::BlockingQueuedConnection);
|
||||
connect(m_host_interface, &QtHostInterface::createDisplayWindowRequested, this, &MainWindow::createDisplayWindow,
|
||||
Qt::BlockingQueuedConnection);
|
||||
connect(m_host_interface, &QtHostInterface::destroyDisplayWindowRequested, this, &MainWindow::destroyDisplayWindow);
|
||||
connect(m_host_interface, &QtHostInterface::setFullscreenRequested, this, &MainWindow::setFullscreen);
|
||||
connect(m_host_interface, &QtHostInterface::toggleFullscreenRequested, this, &MainWindow::toggleFullscreen);
|
||||
connect(m_host_interface, &QtHostInterface::messageReported, this, &MainWindow::reportMessage);
|
||||
connect(m_host_interface, &QtHostInterface::emulationStarted, this, &MainWindow::onEmulationStarted);
|
||||
connect(m_host_interface, &QtHostInterface::emulationStopped, this, &MainWindow::onEmulationStopped);
|
||||
connect(m_host_interface, &QtHostInterface::emulationPaused, this, &MainWindow::onEmulationPaused);
|
||||
|
@ -24,6 +24,7 @@ public:
|
||||
private Q_SLOTS:
|
||||
void reportError(const QString& message);
|
||||
void reportMessage(const QString& message);
|
||||
bool confirmMessage(const QString& message);
|
||||
void createDisplayWindow(QThread* worker_thread, bool use_debug_device);
|
||||
void destroyDisplayWindow();
|
||||
void setFullscreen(bool fullscreen);
|
||||
|
@ -54,6 +54,11 @@ void QtHostInterface::ReportMessage(const char* message)
|
||||
emit messageReported(QString::fromLocal8Bit(message));
|
||||
}
|
||||
|
||||
bool QtHostInterface::ConfirmMessage(const char* message)
|
||||
{
|
||||
return messageConfirmed(QString::fromLocal8Bit(message));
|
||||
}
|
||||
|
||||
void QtHostInterface::setDefaultSettings()
|
||||
{
|
||||
HostInterface::UpdateSettings([this]() { HostInterface::SetDefaultSettings(); });
|
||||
|
@ -32,6 +32,7 @@ public:
|
||||
|
||||
void ReportError(const char* message) override;
|
||||
void ReportMessage(const char* message) override;
|
||||
bool ConfirmMessage(const char* message) override;
|
||||
|
||||
void setDefaultSettings();
|
||||
|
||||
@ -64,6 +65,7 @@ public:
|
||||
Q_SIGNALS:
|
||||
void errorReported(const QString& message);
|
||||
void messageReported(const QString& message);
|
||||
bool messageConfirmed(const QString& message);
|
||||
void emulationStarted();
|
||||
void emulationStopped();
|
||||
void emulationPaused(bool paused);
|
||||
|
Reference in New Issue
Block a user