forked from eden-emu/eden
[qt_common] reorg, move more stuff out of main
Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
parent
75f18095e0
commit
ca349ad7b0
20 changed files with 923 additions and 680 deletions
|
@ -4,27 +4,84 @@
|
|||
#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)
|
||||
QObject *parent)
|
||||
{
|
||||
#ifdef YUZU_QT_WIDGETS
|
||||
QMessageBox *box = new QMessageBox(icon, title, text, buttons, parent);
|
||||
QMessageBox *box = new QMessageBox(icon, title, text, buttons, (QWidget *) parent);
|
||||
return static_cast<QMessageBox::StandardButton>(box->exec());
|
||||
#endif
|
||||
// TODO(crueter): If Qt Widgets is disabled...
|
||||
// need a way to reference icon/buttons too
|
||||
}
|
||||
|
||||
QMessageBox::StandardButton ShowMessage(QMessageBox::Icon icon,
|
||||
const char *title,
|
||||
const char *text,
|
||||
QMessageBox::StandardButtons buttons,
|
||||
QWidget *parent)
|
||||
QMessageBox::StandardButton Information(QObject *parent,
|
||||
const QString &title,
|
||||
const QString &text,
|
||||
QMessageBox::StandardButtons buttons)
|
||||
{
|
||||
return ShowMessage(icon, qApp->tr(title), qApp->tr(text), buttons, parent);
|
||||
return ShowMessage(QMessageBox::Information, title, text, buttons, parent);
|
||||
}
|
||||
|
||||
QMessageBox::StandardButton Warning(QObject *parent,
|
||||
const QString &title,
|
||||
const QString &text,
|
||||
QMessageBox::StandardButtons buttons)
|
||||
{
|
||||
return ShowMessage(QMessageBox::Warning, title, text, buttons, parent);
|
||||
}
|
||||
|
||||
QMessageBox::StandardButton Critical(QObject *parent,
|
||||
const QString &title,
|
||||
const QString &text,
|
||||
QMessageBox::StandardButtons buttons)
|
||||
{
|
||||
return ShowMessage(QMessageBox::Critical, title, text, buttons, parent);
|
||||
}
|
||||
|
||||
QMessageBox::StandardButton Question(QObject *parent,
|
||||
const QString &title,
|
||||
const QString &text,
|
||||
QMessageBox::StandardButtons buttons)
|
||||
{
|
||||
return ShowMessage(QMessageBox::Question, title, text, buttons, parent);
|
||||
}
|
||||
|
||||
QMessageBox::StandardButton Information(QObject *parent,
|
||||
const char *title,
|
||||
const char *text,
|
||||
QMessageBox::StandardButtons buttons)
|
||||
{
|
||||
return ShowMessage(QMessageBox::Information, parent->tr(title), parent->tr(text), buttons, parent);
|
||||
}
|
||||
|
||||
QMessageBox::StandardButton Warning(QObject *parent,
|
||||
const char *title,
|
||||
const char *text,
|
||||
QMessageBox::StandardButtons buttons)
|
||||
{
|
||||
return ShowMessage(QMessageBox::Warning, parent->tr(title), parent->tr(text), buttons, parent);
|
||||
}
|
||||
|
||||
QMessageBox::StandardButton Critical(QObject *parent,
|
||||
const char *title,
|
||||
const char *text,
|
||||
QMessageBox::StandardButtons buttons)
|
||||
{
|
||||
return ShowMessage(QMessageBox::Critical, parent->tr(title), parent->tr(text), buttons, parent);
|
||||
}
|
||||
|
||||
QMessageBox::StandardButton Question(QObject *parent,
|
||||
const char *title,
|
||||
const char *text,
|
||||
QMessageBox::StandardButtons buttons)
|
||||
{
|
||||
return ShowMessage(QMessageBox::Question, parent->tr(title), parent->tr(text), buttons, parent);
|
||||
}
|
||||
|
||||
|
||||
} // namespace QtCommon::Frontend
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue