2025-07-23 21:12:22 -04:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2025-07-23 21:10:17 -04:00
|
|
|
#ifndef QT_FRONTEND_UTIL_H
|
|
|
|
#define QT_FRONTEND_UTIL_H
|
|
|
|
|
|
|
|
#include <QGuiApplication>
|
|
|
|
#include <QMessageBox>
|
|
|
|
|
|
|
|
#ifdef YUZU_QT_WIDGETS
|
|
|
|
#include <QWidget>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* manages common functionality e.g. message boxes and such for Qt/QML
|
|
|
|
*/
|
|
|
|
namespace QtCommon::Frontend {
|
|
|
|
Q_NAMESPACE
|
|
|
|
|
2025-08-30 19:48:13 -04:00
|
|
|
// TODO(crueter) widgets-less impl, choices et al.
|
2025-07-23 21:10:17 -04:00
|
|
|
QMessageBox::StandardButton ShowMessage(QMessageBox::Icon icon,
|
|
|
|
const QString &title,
|
|
|
|
const QString &text,
|
|
|
|
QMessageBox::StandardButtons buttons = QMessageBox::NoButton,
|
2025-08-30 19:48:13 -04:00
|
|
|
QObject *parent = nullptr);
|
2025-07-23 21:10:17 -04:00
|
|
|
|
2025-08-30 19:48:13 -04:00
|
|
|
QMessageBox::StandardButton Information(QObject *parent,
|
|
|
|
const QString &title,
|
|
|
|
const QString &text,
|
|
|
|
QMessageBox::StandardButtons buttons = QMessageBox::Ok);
|
|
|
|
|
|
|
|
QMessageBox::StandardButton Warning(QObject *parent,
|
|
|
|
const QString &title,
|
|
|
|
const QString &text,
|
|
|
|
QMessageBox::StandardButtons buttons = QMessageBox::Ok);
|
|
|
|
|
|
|
|
QMessageBox::StandardButton Critical(QObject *parent,
|
|
|
|
const QString &title,
|
|
|
|
const QString &text,
|
|
|
|
QMessageBox::StandardButtons buttons = QMessageBox::Ok);
|
|
|
|
|
|
|
|
QMessageBox::StandardButton Question(QObject *parent,
|
|
|
|
const QString &title,
|
|
|
|
const QString &text,
|
|
|
|
QMessageBox::StandardButtons buttons = QMessageBox::Ok);
|
|
|
|
|
|
|
|
QMessageBox::StandardButton Information(QObject *parent,
|
2025-07-23 21:10:17 -04:00
|
|
|
const char *title,
|
|
|
|
const char *text,
|
2025-08-30 19:48:13 -04:00
|
|
|
QMessageBox::StandardButtons buttons = QMessageBox::Ok);
|
|
|
|
|
|
|
|
QMessageBox::StandardButton Warning(QObject *parent,
|
|
|
|
const char *title,
|
|
|
|
const char *text,
|
|
|
|
QMessageBox::StandardButtons buttons = QMessageBox::Ok);
|
|
|
|
|
|
|
|
QMessageBox::StandardButton Critical(QObject *parent,
|
|
|
|
const char *title,
|
|
|
|
const char *text,
|
|
|
|
QMessageBox::StandardButtons buttons = QMessageBox::Ok);
|
|
|
|
|
|
|
|
QMessageBox::StandardButton Question(QObject *parent,
|
|
|
|
const char *title,
|
|
|
|
const char *text,
|
|
|
|
QMessageBox::StandardButtons buttons = QMessageBox::Ok);
|
|
|
|
|
2025-07-23 21:10:17 -04:00
|
|
|
} // namespace QtCommon::Frontend
|
|
|
|
#endif // QT_FRONTEND_UTIL_H
|