Qt: Use window modality for message boxes
Stops them opening in the middle of the screen on MacOS.
This commit is contained in:
parent
f0f1473b6e
commit
86927ea3eb
|
@ -141,6 +141,7 @@ void ConsoleSettingsWidget::onEnableCPUClockSpeedControlChecked(int state)
|
||||||
"have confirmed the bug also occurs with overclocking disabled.\n\nThis warning will only be shown once.");
|
"have confirmed the bug also occurs with overclocking disabled.\n\nThis warning will only be shown once.");
|
||||||
|
|
||||||
QMessageBox mb(QMessageBox::Warning, tr("CPU Overclocking Warning"), message, QMessageBox::NoButton, this);
|
QMessageBox mb(QMessageBox::Warning, tr("CPU Overclocking Warning"), message, QMessageBox::NoButton, this);
|
||||||
|
mb.setWindowModality(Qt::WindowModal);
|
||||||
const QAbstractButton* const yes_button =
|
const QAbstractButton* const yes_button =
|
||||||
mb.addButton(tr("Yes, I will confirm bugs without overclocking before reporting."), QMessageBox::YesRole);
|
mb.addButton(tr("Yes, I will confirm bugs without overclocking before reporting."), QMessageBox::YesRole);
|
||||||
mb.addButton(tr("No, take me back to safety."), QMessageBox::NoRole);
|
mb.addButton(tr("No, take me back to safety."), QMessageBox::NoRole);
|
||||||
|
|
|
@ -1154,6 +1154,7 @@ std::optional<bool> MainWindow::promptForResumeState(const std::string& save_sta
|
||||||
QMessageBox msgbox(this);
|
QMessageBox msgbox(this);
|
||||||
msgbox.setIcon(QMessageBox::Question);
|
msgbox.setIcon(QMessageBox::Question);
|
||||||
msgbox.setWindowTitle(tr("Load Resume State"));
|
msgbox.setWindowTitle(tr("Load Resume State"));
|
||||||
|
msgbox.setWindowModality(Qt::WindowModal);
|
||||||
msgbox.setText(tr("A resume save state was found for this game, saved at:\n\n%1.\n\nDo you want to load this state, "
|
msgbox.setText(tr("A resume save state was found for this game, saved at:\n\n%1.\n\nDo you want to load this state, "
|
||||||
"or start from a fresh boot?")
|
"or start from a fresh boot?")
|
||||||
.arg(QDateTime::fromSecsSinceEpoch(sd.ModificationTime, Qt::UTC).toLocalTime().toString()));
|
.arg(QDateTime::fromSecsSinceEpoch(sd.ModificationTime, Qt::UTC).toLocalTime().toString()));
|
||||||
|
@ -2749,6 +2750,7 @@ bool MainWindow::requestShutdown(bool allow_confirm /* = true */, bool allow_sav
|
||||||
QMessageBox msgbox(lock.getDialogParent());
|
QMessageBox msgbox(lock.getDialogParent());
|
||||||
msgbox.setIcon(QMessageBox::Question);
|
msgbox.setIcon(QMessageBox::Question);
|
||||||
msgbox.setWindowTitle(tr("Confirm Shutdown"));
|
msgbox.setWindowTitle(tr("Confirm Shutdown"));
|
||||||
|
msgbox.setWindowModality(Qt::WindowModal);
|
||||||
msgbox.setText(tr("Are you sure you want to shut down the virtual machine?"));
|
msgbox.setText(tr("Are you sure you want to shut down the virtual machine?"));
|
||||||
|
|
||||||
QCheckBox* save_cb = new QCheckBox(tr("Save State For Resume"), &msgbox);
|
QCheckBox* save_cb = new QCheckBox(tr("Save State For Resume"), &msgbox);
|
||||||
|
@ -2992,6 +2994,7 @@ void MainWindow::checkForUpdates(bool display_message)
|
||||||
{
|
{
|
||||||
QMessageBox mbox(this);
|
QMessageBox mbox(this);
|
||||||
mbox.setWindowTitle(tr("Updater Error"));
|
mbox.setWindowTitle(tr("Updater Error"));
|
||||||
|
mbox.setWindowModality(Qt::WindowModal);
|
||||||
mbox.setTextFormat(Qt::RichText);
|
mbox.setTextFormat(Qt::RichText);
|
||||||
|
|
||||||
QString message;
|
QString message;
|
||||||
|
|
|
@ -304,6 +304,7 @@ bool QtHost::DownloadMissingFont(QWidget* dialog_parent, const char* font_name,
|
||||||
{
|
{
|
||||||
QMessageBox msgbox(dialog_parent);
|
QMessageBox msgbox(dialog_parent);
|
||||||
msgbox.setWindowTitle(qApp->translate("QtHost", "Missing Font File"));
|
msgbox.setWindowTitle(qApp->translate("QtHost", "Missing Font File"));
|
||||||
|
msgbox.setWindowModality(Qt::WindowModal);
|
||||||
msgbox.setWindowIcon(QtHost::GetAppIcon());
|
msgbox.setWindowIcon(QtHost::GetAppIcon());
|
||||||
msgbox.setIcon(QMessageBox::Critical);
|
msgbox.setIcon(QMessageBox::Critical);
|
||||||
msgbox.setTextFormat(Qt::RichText);
|
msgbox.setTextFormat(Qt::RichText);
|
||||||
|
|
Loading…
Reference in New Issue