better handling for sys/vfs/rootobject

Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
crueter 2025-08-31 14:56:25 -04:00
parent 4356e80e50
commit c65f075638
Signed by: crueter
GPG key ID: 425ACD2D4830EBC6
15 changed files with 286 additions and 291 deletions

View file

@ -2,6 +2,11 @@
// SPDX-License-Identifier: GPL-3.0-or-later
#include "qt_frontend_util.h"
#include "qt_common/qt_common.h"
#ifdef YUZU_QT_WIDGETS
#include <QFileDialog>
#endif
namespace QtCommon::Frontend {
@ -19,69 +24,15 @@ QMessageBox::StandardButton ShowMessage(QMessageBox::Icon icon,
// need a way to reference icon/buttons too
}
QMessageBox::StandardButton Information(QObject *parent,
const QString &title,
const QString &text,
QMessageBox::StandardButtons buttons)
const QString GetOpenFileName(const QString &title,
const QString &dir,
const QString &filter,
QString *selectedFilter,
Options options)
{
return ShowMessage(QMessageBox::Information, title, text, buttons, parent);
#ifdef YUZU_QT_WIDGETS
return QFileDialog::getOpenFileName((QWidget *) rootObject, title, dir, filter, selectedFilter, options);
#endif
}
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