Qt: Hook up HostInterface::Report{Error,Message}
This commit is contained in:
parent
19cd91a684
commit
2694181811
|
@ -30,6 +30,16 @@ MainWindow::~MainWindow()
|
||||||
m_host_interface->displayWidgetDestroyed();
|
m_host_interface->displayWidgetDestroyed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::reportError(QString message)
|
||||||
|
{
|
||||||
|
QMessageBox::critical(nullptr, tr("DuckStation Error"), message, QMessageBox::Ok);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::reportMessage(QString message)
|
||||||
|
{
|
||||||
|
m_ui.statusBar->showMessage(message, 2000);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::onEmulationStarting()
|
void MainWindow::onEmulationStarting()
|
||||||
{
|
{
|
||||||
switchToEmulationView();
|
switchToEmulationView();
|
||||||
|
@ -292,6 +302,9 @@ void MainWindow::connectSignals()
|
||||||
connect(m_ui.actionIssueTracker, &QAction::triggered, this, &MainWindow::onIssueTrackerActionTriggered);
|
connect(m_ui.actionIssueTracker, &QAction::triggered, this, &MainWindow::onIssueTrackerActionTriggered);
|
||||||
connect(m_ui.actionAbout, &QAction::triggered, this, &MainWindow::onAboutActionTriggered);
|
connect(m_ui.actionAbout, &QAction::triggered, this, &MainWindow::onAboutActionTriggered);
|
||||||
|
|
||||||
|
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::emulationStarting, this, &MainWindow::onEmulationStarting);
|
connect(m_host_interface, &QtHostInterface::emulationStarting, this, &MainWindow::onEmulationStarting);
|
||||||
connect(m_host_interface, &QtHostInterface::emulationStarted, this, &MainWindow::onEmulationStarted);
|
connect(m_host_interface, &QtHostInterface::emulationStarted, this, &MainWindow::onEmulationStarted);
|
||||||
connect(m_host_interface, &QtHostInterface::emulationStopped, this, &MainWindow::onEmulationStopped);
|
connect(m_host_interface, &QtHostInterface::emulationStopped, this, &MainWindow::onEmulationStopped);
|
||||||
|
|
|
@ -21,6 +21,8 @@ public:
|
||||||
~MainWindow();
|
~MainWindow();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
void reportError(QString message);
|
||||||
|
void reportMessage(QString message);
|
||||||
void onEmulationStarting();
|
void onEmulationStarting();
|
||||||
void onEmulationStarted();
|
void onEmulationStarted();
|
||||||
void onEmulationStopped();
|
void onEmulationStopped();
|
||||||
|
|
|
@ -38,12 +38,16 @@ QtHostInterface::~QtHostInterface()
|
||||||
|
|
||||||
void QtHostInterface::ReportError(const char* message)
|
void QtHostInterface::ReportError(const char* message)
|
||||||
{
|
{
|
||||||
// QMessageBox::critical(nullptr, tr("DuckStation Error"), message, QMessageBox::Ok);
|
HostInterface::ReportError(message);
|
||||||
|
|
||||||
|
emit errorReported(QString::fromLocal8Bit(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtHostInterface::ReportMessage(const char* message)
|
void QtHostInterface::ReportMessage(const char* message)
|
||||||
{
|
{
|
||||||
// QMessageBox::information(nullptr, tr("DuckStation Information"), message, QMessageBox::Ok);
|
HostInterface::ReportMessage(message);
|
||||||
|
|
||||||
|
emit messageReported(QString::fromLocal8Bit(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtHostInterface::setDefaultSettings()
|
void QtHostInterface::setDefaultSettings()
|
||||||
|
|
|
@ -62,6 +62,8 @@ public:
|
||||||
std::vector<HotkeyInfo> getHotkeyList() const;
|
std::vector<HotkeyInfo> getHotkeyList() const;
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
|
void errorReported(QString message);
|
||||||
|
void messageReported(QString message);
|
||||||
void emulationStarting();
|
void emulationStarting();
|
||||||
void emulationStarted();
|
void emulationStarted();
|
||||||
void emulationStopped();
|
void emulationStopped();
|
||||||
|
|
Loading…
Reference in New Issue