[qt] frontend abstraction and message box early handling

Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
crueter 2025-07-23 21:10:17 -04:00
parent 115d0484a6
commit 49670ebb0f
Signed by: crueter
GPG key ID: 425ACD2D4830EBC6
8 changed files with 136 additions and 47 deletions

View file

@ -0,0 +1,25 @@
#include "qt_frontend_util.h"
namespace QtCommon::Frontend {
QMessageBox::StandardButton ShowMessage(QMessageBox::Icon icon,
const QString &title,
const QString &text,
QMessageBox::StandardButtons buttons,
QWidget *parent)
{
#ifdef YUZU_QT_WIDGETS
QMessageBox *box = new QMessageBox(icon, title, text, buttons, parent);
return static_cast<QMessageBox::StandardButton>(box->exec());
#endif
}
QMessageBox::StandardButton ShowMessage(QMessageBox::Icon icon,
const char *title,
const char *text,
QMessageBox::StandardButtons buttons,
QWidget *parent)
{
return ShowMessage(icon, qApp->tr(title), qApp->tr(text), buttons, parent);
}
} // namespace QtCommon::Frontend