mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Qt: Use ModalMessageBox everywhere
This commit is contained in:
@ -9,7 +9,6 @@
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QMessageBox>
|
||||
#include <QStringList>
|
||||
#include <QTextEdit>
|
||||
|
||||
@ -17,6 +16,8 @@
|
||||
#include "Core/ActionReplay.h"
|
||||
#include "Core/GeckoCodeConfig.h"
|
||||
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
|
||||
CheatCodeEditor::CheatCodeEditor(QWidget* parent) : QDialog(parent)
|
||||
{
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
@ -167,7 +168,7 @@ bool CheatCodeEditor::AcceptAR()
|
||||
|
||||
if (!good)
|
||||
{
|
||||
auto result = QMessageBox::warning(
|
||||
auto result = ModalMessageBox::warning(
|
||||
this, tr("Parsing Error"),
|
||||
tr("Unable to parse line %1 of the entered AR code as a valid "
|
||||
"encrypted or decrypted code. Make sure you typed it correctly.\n\n"
|
||||
@ -184,7 +185,7 @@ bool CheatCodeEditor::AcceptAR()
|
||||
{
|
||||
if (!entries.empty())
|
||||
{
|
||||
auto result = QMessageBox::warning(
|
||||
auto result = ModalMessageBox::warning(
|
||||
this, tr("Invalid Mixed Code"),
|
||||
tr("This Action Replay code contains both encrypted and unencrypted lines; "
|
||||
"you should check that you have entered it correctly.\n\n"
|
||||
@ -213,8 +214,8 @@ bool CheatCodeEditor::AcceptAR()
|
||||
|
||||
if (entries.empty())
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"),
|
||||
tr("The resulting decrypted AR code doesn't contain any lines."));
|
||||
ModalMessageBox::critical(this, tr("Error"),
|
||||
tr("The resulting decrypted AR code doesn't contain any lines."));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -253,13 +254,13 @@ bool CheatCodeEditor::AcceptGecko()
|
||||
|
||||
if (!good)
|
||||
{
|
||||
auto result =
|
||||
QMessageBox::warning(this, tr("Parsing Error"),
|
||||
tr("Unable to parse line %1 of the entered Gecko code as a valid "
|
||||
"code. Make sure you typed it correctly.\n\n"
|
||||
"Would you like to ignore this line and continue parsing?")
|
||||
.arg(i + 1),
|
||||
QMessageBox::Ok | QMessageBox::Abort);
|
||||
auto result = ModalMessageBox::warning(
|
||||
this, tr("Parsing Error"),
|
||||
tr("Unable to parse line %1 of the entered Gecko code as a valid "
|
||||
"code. Make sure you typed it correctly.\n\n"
|
||||
"Would you like to ignore this line and continue parsing?")
|
||||
.arg(i + 1),
|
||||
QMessageBox::Ok | QMessageBox::Abort);
|
||||
|
||||
if (result == QMessageBox::Abort)
|
||||
return false;
|
||||
@ -277,8 +278,8 @@ bool CheatCodeEditor::AcceptGecko()
|
||||
|
||||
if (entries.empty())
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"),
|
||||
tr("The resulting decrypted AR code doesn't contain any lines."));
|
||||
ModalMessageBox::critical(this, tr("Error"),
|
||||
tr("The resulting decrypted AR code doesn't contain any lines."));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include <QGroupBox>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QRadioButton>
|
||||
#include <QScreen>
|
||||
@ -34,6 +33,7 @@
|
||||
|
||||
#include "DolphinQt/Config/Mapping/GCPadWiiUConfigDialog.h"
|
||||
#include "DolphinQt/Config/Mapping/MappingWindow.h"
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
#include "DolphinQt/QtUtils/WrapInScrollArea.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
@ -328,12 +328,9 @@ void ControllersWindow::OnBluetoothPassthroughResetPressed()
|
||||
|
||||
if (!ios)
|
||||
{
|
||||
QMessageBox error(this);
|
||||
error.setIcon(QMessageBox::Warning);
|
||||
error.setWindowModality(Qt::WindowModal);
|
||||
error.setWindowTitle(tr("Warning"));
|
||||
error.setText(tr("Saved Wii Remote pairings can only be reset when a Wii game is running."));
|
||||
error.exec();
|
||||
ModalMessageBox::warning(
|
||||
this, tr("Warning"),
|
||||
tr("Saved Wii Remote pairings can only be reset when a Wii game is running."));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -350,12 +347,8 @@ void ControllersWindow::OnBluetoothPassthroughSyncPressed()
|
||||
|
||||
if (!ios)
|
||||
{
|
||||
QMessageBox error(this);
|
||||
error.setIcon(QMessageBox::Warning);
|
||||
error.setWindowModality(Qt::WindowModal);
|
||||
error.setWindowTitle(tr("Warning"));
|
||||
error.setText(tr("A sync can only be triggered when a Wii game is running."));
|
||||
error.exec();
|
||||
ModalMessageBox::warning(this, tr("Warning"),
|
||||
tr("A sync can only be triggered when a Wii game is running."));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include <QFileInfo>
|
||||
#include <QHeaderView>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QProgressDialog>
|
||||
#include <QStandardItemModel>
|
||||
#include <QStyleFactory>
|
||||
@ -23,6 +22,7 @@
|
||||
#include "DiscIO/Filesystem.h"
|
||||
#include "DiscIO/Volume.h"
|
||||
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
#include "DolphinQt/Resources.h"
|
||||
|
||||
#include "UICommon/UICommon.h"
|
||||
@ -199,9 +199,10 @@ void FilesystemWidget::ShowContextMenu(const QPoint&)
|
||||
return;
|
||||
|
||||
if (ExtractSystemData(partition, folder))
|
||||
QMessageBox::information(this, tr("Success"), tr("Successfully extracted system data."));
|
||||
ModalMessageBox::information(this, tr("Success"),
|
||||
tr("Successfully extracted system data."));
|
||||
else
|
||||
QMessageBox::critical(this, tr("Error"), tr("Failed to extract system data."));
|
||||
ModalMessageBox::critical(this, tr("Error"), tr("Failed to extract system data."));
|
||||
});
|
||||
}
|
||||
|
||||
@ -323,9 +324,9 @@ void FilesystemWidget::ExtractFile(const DiscIO::Partition& partition, const QSt
|
||||
*m_volume, partition, filesystem->FindFileInfo(path.toStdString()).get(), out.toStdString());
|
||||
|
||||
if (success)
|
||||
QMessageBox::information(this, tr("Success"), tr("Successfully extracted file."));
|
||||
ModalMessageBox::information(this, tr("Success"), tr("Successfully extracted file."));
|
||||
else
|
||||
QMessageBox::critical(this, tr("Error"), tr("Failed to extract file."));
|
||||
ModalMessageBox::critical(this, tr("Error"), tr("Failed to extract file."));
|
||||
}
|
||||
|
||||
void FilesystemWidget::CheckIntegrity(const DiscIO::Partition& partition)
|
||||
@ -348,10 +349,14 @@ void FilesystemWidget::CheckIntegrity(const DiscIO::Partition& partition)
|
||||
dialog->close();
|
||||
|
||||
if (is_valid.get())
|
||||
QMessageBox::information(this, tr("Success"),
|
||||
tr("Integrity check completed. No errors have been found."));
|
||||
{
|
||||
ModalMessageBox::information(this, tr("Success"),
|
||||
tr("Integrity check completed. No errors have been found."));
|
||||
}
|
||||
else
|
||||
QMessageBox::critical(this, tr("Error"),
|
||||
tr("Integrity check for partition failed. The disc image is most "
|
||||
"likely corrupted or has been patched incorrectly."));
|
||||
{
|
||||
ModalMessageBox::critical(this, tr("Error"),
|
||||
tr("Integrity check for partition failed. The disc image is most "
|
||||
"likely corrupted or has been patched incorrectly."));
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include <QFile>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#include <QMessageBox>
|
||||
#include <QScrollBar>
|
||||
#include <QStringListModel>
|
||||
#include <QTextCursor>
|
||||
@ -20,6 +19,7 @@
|
||||
#include <QWhatsThis>
|
||||
|
||||
#include "DolphinQt/Config/GameConfigHighlighter.h"
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
|
||||
GameConfigEdit::GameConfigEdit(QWidget* parent, const QString& path, bool read_only)
|
||||
: m_path(path), m_read_only(read_only)
|
||||
@ -122,14 +122,14 @@ void GameConfigEdit::SaveFile()
|
||||
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text))
|
||||
{
|
||||
QMessageBox::warning(this, tr("Warning"), tr("Failed to open config file!"));
|
||||
ModalMessageBox::warning(this, tr("Warning"), tr("Failed to open config file!"));
|
||||
return;
|
||||
}
|
||||
|
||||
const QByteArray contents = m_edit->toPlainText().toUtf8();
|
||||
|
||||
if (file.write(contents) == -1)
|
||||
QMessageBox::warning(this, tr("Warning"), tr("Failed to write config file!"));
|
||||
ModalMessageBox::warning(this, tr("Warning"), tr("Failed to write config file!"));
|
||||
}
|
||||
|
||||
void GameConfigEdit::ConnectWidgets()
|
||||
|
13
Source/Core/DolphinQt/Config/GeckoCodeWidget.cpp
Executable file → Normal file
13
Source/Core/DolphinQt/Config/GeckoCodeWidget.cpp
Executable file → Normal file
@ -9,7 +9,6 @@
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QListWidget>
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QTextEdit>
|
||||
#include <QVBoxLayout>
|
||||
@ -22,6 +21,7 @@
|
||||
|
||||
#include "DolphinQt/Config/CheatCodeEditor.h"
|
||||
#include "DolphinQt/Config/CheatWarningWidget.h"
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
|
||||
#include "UICommon/GameFile.h"
|
||||
|
||||
@ -255,13 +255,13 @@ void GeckoCodeWidget::DownloadCodes()
|
||||
|
||||
if (!success)
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("Failed to download codes."));
|
||||
ModalMessageBox::critical(this, tr("Error"), tr("Failed to download codes."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (codes.empty())
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("File contained no codes."));
|
||||
ModalMessageBox::critical(this, tr("Error"), tr("File contained no codes."));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -281,7 +281,8 @@ void GeckoCodeWidget::DownloadCodes()
|
||||
UpdateList();
|
||||
SaveCodes();
|
||||
|
||||
QMessageBox::information(this, tr("Download complete"),
|
||||
tr("Downloaded %1 codes. (added %2)")
|
||||
.arg(QString::number(codes.size()), QString::number(added_count)));
|
||||
ModalMessageBox::information(
|
||||
this, tr("Download complete"),
|
||||
tr("Downloaded %1 codes. (added %2)")
|
||||
.arg(QString::number(codes.size()), QString::number(added_count)));
|
||||
}
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include <QGroupBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QMessageBox>
|
||||
#include <QRadioButton>
|
||||
#include <QSignalBlocker>
|
||||
#include <QVBoxLayout>
|
||||
@ -23,6 +22,7 @@
|
||||
#include "DolphinQt/Config/Graphics/GraphicsChoice.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsRadio.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
#include "UICommon/VideoUtils.h"
|
||||
@ -172,10 +172,9 @@ void GeneralWidget::SaveSettings()
|
||||
{
|
||||
if (current_backend == "Software Renderer")
|
||||
{
|
||||
QMessageBox confirm_sw(this);
|
||||
ModalMessageBox confirm_sw(this);
|
||||
|
||||
confirm_sw.setIcon(QMessageBox::Warning);
|
||||
confirm_sw.setWindowModality(Qt::WindowModal);
|
||||
confirm_sw.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||
confirm_sw.setWindowTitle(tr("Confirm backend change"));
|
||||
confirm_sw.setText(tr("The software renderer is significantly slower than other "
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
#include <QAction>
|
||||
#include <QDateTime>
|
||||
#include <QMessageBox>
|
||||
#include <QPainter>
|
||||
#include <QTimer>
|
||||
|
||||
@ -23,6 +22,7 @@
|
||||
#include "InputCommon/ControllerEmu/Setting/NumericSetting.h"
|
||||
#include "InputCommon/ControllerInterface/Device.h"
|
||||
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
// Color constants to keep things looking consistent:
|
||||
@ -480,11 +480,9 @@ CalibrationWidget::CalibrationWidget(ControllerEmu::ReshapableInput& input,
|
||||
if (*std::max_element(m_calibration_data.begin(), m_calibration_data.end()) > 0.5)
|
||||
return;
|
||||
|
||||
QMessageBox msg(QMessageBox::Information, tr("Calibration"),
|
||||
tr("For best results please slowly move your input to all possible regions."),
|
||||
QMessageBox::Ok, this);
|
||||
msg.setWindowModality(Qt::WindowModal);
|
||||
msg.exec();
|
||||
ModalMessageBox::information(
|
||||
this, tr("Calibration"),
|
||||
tr("For best results please slowly move your input to all possible regions."));
|
||||
});
|
||||
m_informative_timer->setSingleShot(true);
|
||||
}
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include <QDialogButtonBox>
|
||||
#include <QGroupBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QTabWidget>
|
||||
#include <QVBoxLayout>
|
||||
@ -36,6 +35,7 @@
|
||||
#include "DolphinQt/Config/Mapping/WiimoteEmuExtension.h"
|
||||
#include "DolphinQt/Config/Mapping/WiimoteEmuGeneral.h"
|
||||
#include "DolphinQt/Config/Mapping/WiimoteEmuMotionControl.h"
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
#include "DolphinQt/QtUtils/WrapInScrollArea.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
@ -161,19 +161,17 @@ void MappingWindow::OnDeleteProfilePressed()
|
||||
|
||||
if (!File::Exists(profile_path.toStdString()))
|
||||
{
|
||||
QMessageBox error(this);
|
||||
ModalMessageBox error(this);
|
||||
error.setIcon(QMessageBox::Critical);
|
||||
error.setWindowModality(Qt::WindowModal);
|
||||
error.setWindowTitle(tr("Error"));
|
||||
error.setText(tr("The profile '%1' does not exist").arg(profile_name));
|
||||
error.exec();
|
||||
return;
|
||||
}
|
||||
|
||||
QMessageBox confirm(this);
|
||||
ModalMessageBox confirm(this);
|
||||
|
||||
confirm.setIcon(QMessageBox::Warning);
|
||||
confirm.setWindowModality(Qt::WindowModal);
|
||||
confirm.setWindowTitle(tr("Confirm"));
|
||||
confirm.setText(tr("Are you sure that you want to delete '%1'?").arg(profile_name));
|
||||
confirm.setInformativeText(tr("This cannot be undone!"));
|
||||
@ -188,7 +186,7 @@ void MappingWindow::OnDeleteProfilePressed()
|
||||
|
||||
File::Delete(profile_path.toStdString());
|
||||
|
||||
QMessageBox result(this);
|
||||
ModalMessageBox result(this);
|
||||
result.setIcon(QMessageBox::Information);
|
||||
result.setWindowModality(Qt::WindowModal);
|
||||
result.setWindowTitle(tr("Success"));
|
||||
|
@ -9,13 +9,13 @@
|
||||
#include <QGroupBox>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QRadioButton>
|
||||
#include <QScrollArea>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "Core/PatchEngine.h"
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
|
||||
NewPatchDialog::NewPatchDialog(QWidget* parent, PatchEngine::Patch& patch)
|
||||
: QDialog(parent), m_patch(patch)
|
||||
@ -191,7 +191,7 @@ void NewPatchDialog::accept()
|
||||
{
|
||||
if (m_name_edit->text().isEmpty())
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("You have to enter a name."));
|
||||
ModalMessageBox::critical(this, tr("Error"), tr("You have to enter a name."));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -206,7 +206,7 @@ void NewPatchDialog::accept()
|
||||
|
||||
if (!valid)
|
||||
{
|
||||
QMessageBox::critical(
|
||||
ModalMessageBox::critical(
|
||||
this, tr("Error"),
|
||||
tr("Some values you provided are invalid.\nPlease check the highlighted values."));
|
||||
return;
|
||||
|
Reference in New Issue
Block a user