mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-01 16:02:39 +00:00
Qt: Use ModalMessageBox everywhere
This commit is contained in:
parent
d1cb79f644
commit
70da86f1c3
31 changed files with 244 additions and 298 deletions
|
@ -12,7 +12,6 @@
|
|||
#include <QFontDialog>
|
||||
#include <QInputDialog>
|
||||
#include <QMap>
|
||||
#include <QMessageBox>
|
||||
#include <QUrl>
|
||||
|
||||
#include "Common/CommonPaths.h"
|
||||
|
@ -49,6 +48,7 @@
|
|||
|
||||
#include "DolphinQt/AboutDialog.h"
|
||||
#include "DolphinQt/Host.h"
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
#include "DolphinQt/Updater.h"
|
||||
|
||||
|
@ -519,7 +519,7 @@ void MenuBar::InstallUpdateManually()
|
|||
|
||||
if (!updater->CheckForUpdate())
|
||||
{
|
||||
QMessageBox::information(
|
||||
ModalMessageBox::information(
|
||||
this, tr("Update"),
|
||||
tr("You are running the latest version available on this update track."));
|
||||
}
|
||||
|
@ -969,23 +969,18 @@ void MenuBar::InstallWAD()
|
|||
if (wad_file.isEmpty())
|
||||
return;
|
||||
|
||||
QMessageBox result_dialog(this);
|
||||
ModalMessageBox result_dialog(this);
|
||||
|
||||
if (WiiUtils::InstallWAD(wad_file.toStdString()))
|
||||
{
|
||||
Settings::Instance().NANDRefresh();
|
||||
result_dialog.setIcon(QMessageBox::Information);
|
||||
result_dialog.setWindowTitle(tr("Success"));
|
||||
result_dialog.setText(tr("Successfully installed this title to the NAND."));
|
||||
ModalMessageBox::information(this, tr("Success"),
|
||||
tr("Successfully installed this title to the NAND."));
|
||||
}
|
||||
else
|
||||
{
|
||||
result_dialog.setIcon(QMessageBox::Critical);
|
||||
result_dialog.setWindowTitle(tr("Failure"));
|
||||
result_dialog.setText(tr("Failed to install this title to the NAND."));
|
||||
ModalMessageBox::critical(this, tr("Failure"), tr("Failed to install this title to the NAND."));
|
||||
}
|
||||
|
||||
result_dialog.exec();
|
||||
}
|
||||
|
||||
void MenuBar::ImportWiiSave()
|
||||
|
@ -999,7 +994,7 @@ void MenuBar::ImportWiiSave()
|
|||
|
||||
bool cancelled = false;
|
||||
auto can_overwrite = [&] {
|
||||
bool yes = QMessageBox::question(
|
||||
bool yes = ModalMessageBox::question(
|
||||
this, tr("Save Import"),
|
||||
tr("Save data for this title already exists in the NAND. Consider backing up "
|
||||
"the current data before overwriting.\nOverwrite now?")) == QMessageBox::Yes;
|
||||
|
@ -1007,9 +1002,9 @@ void MenuBar::ImportWiiSave()
|
|||
return yes;
|
||||
};
|
||||
if (WiiSave::Import(file.toStdString(), can_overwrite))
|
||||
QMessageBox::information(this, tr("Save Import"), tr("Successfully imported save files."));
|
||||
ModalMessageBox::information(this, tr("Save Import"), tr("Successfully imported save files."));
|
||||
else if (!cancelled)
|
||||
QMessageBox::critical(this, tr("Save Import"), tr("Failed to import save files."));
|
||||
ModalMessageBox::critical(this, tr("Save Import"), tr("Failed to import save files."));
|
||||
}
|
||||
|
||||
void MenuBar::ExportWiiSaves()
|
||||
|
@ -1021,8 +1016,8 @@ void MenuBar::ExportWiiSaves()
|
|||
return;
|
||||
|
||||
const size_t count = WiiSave::ExportAll(export_dir.toStdString());
|
||||
QMessageBox::information(this, tr("Save Export"),
|
||||
tr("Exported %n save(s)", "", static_cast<int>(count)));
|
||||
ModalMessageBox::information(this, tr("Save Export"),
|
||||
tr("Exported %n save(s)", "", static_cast<int>(count)));
|
||||
}
|
||||
|
||||
void MenuBar::CheckNAND()
|
||||
|
@ -1031,7 +1026,7 @@ void MenuBar::CheckNAND()
|
|||
WiiUtils::NANDCheckResult result = WiiUtils::CheckNAND(ios);
|
||||
if (!result.bad)
|
||||
{
|
||||
QMessageBox::information(this, tr("NAND Check"), tr("No issues have been detected."));
|
||||
ModalMessageBox::information(this, tr("NAND Check"), tr("No issues have been detected."));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1075,30 +1070,30 @@ void MenuBar::CheckNAND()
|
|||
.arg(QString::fromStdString(title_listings));
|
||||
}
|
||||
|
||||
if (QMessageBox::question(this, tr("NAND Check"), message) != QMessageBox::Yes)
|
||||
if (ModalMessageBox::question(this, tr("NAND Check"), message) != QMessageBox::Yes)
|
||||
return;
|
||||
|
||||
if (WiiUtils::RepairNAND(ios))
|
||||
{
|
||||
QMessageBox::information(this, tr("NAND Check"), tr("The NAND has been repaired."));
|
||||
ModalMessageBox::information(this, tr("NAND Check"), tr("The NAND has been repaired."));
|
||||
return;
|
||||
}
|
||||
|
||||
QMessageBox::critical(this, tr("NAND Check"),
|
||||
tr("The NAND could not be repaired. It is recommended to back up "
|
||||
"your current data and start over with a fresh NAND."));
|
||||
ModalMessageBox::critical(this, tr("NAND Check"),
|
||||
tr("The NAND could not be repaired. It is recommended to back up "
|
||||
"your current data and start over with a fresh NAND."));
|
||||
}
|
||||
|
||||
void MenuBar::NANDExtractCertificates()
|
||||
{
|
||||
if (DiscIO::NANDImporter().ExtractCertificates(File::GetUserPath(D_WIIROOT_IDX)))
|
||||
{
|
||||
QMessageBox::information(this, tr("Success"),
|
||||
tr("Successfully extracted certificates from NAND"));
|
||||
ModalMessageBox::information(this, tr("Success"),
|
||||
tr("Successfully extracted certificates from NAND"));
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("Failed to extract certificates from NAND"));
|
||||
ModalMessageBox::critical(this, tr("Error"), tr("Failed to extract certificates from NAND"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1133,9 +1128,9 @@ void MenuBar::ChangeDebugFont()
|
|||
|
||||
void MenuBar::ClearSymbols()
|
||||
{
|
||||
auto result = QMessageBox::warning(this, tr("Confirmation"),
|
||||
tr("Do you want to clear the list of symbol names?"),
|
||||
QMessageBox::Yes | QMessageBox::Cancel);
|
||||
auto result = ModalMessageBox::warning(this, tr("Confirmation"),
|
||||
tr("Do you want to clear the list of symbol names?"),
|
||||
QMessageBox::Yes | QMessageBox::Cancel);
|
||||
|
||||
if (result == QMessageBox::Cancel)
|
||||
return;
|
||||
|
@ -1157,14 +1152,14 @@ void MenuBar::GenerateSymbolsFromSignatureDB()
|
|||
if (db.Load(File::GetSysDirectory() + TOTALDB))
|
||||
{
|
||||
db.Apply(&g_symbolDB);
|
||||
QMessageBox::information(
|
||||
ModalMessageBox::information(
|
||||
this, tr("Information"),
|
||||
tr("Generated symbol names from '%1'").arg(QString::fromStdString(TOTALDB)));
|
||||
db.List();
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::critical(
|
||||
ModalMessageBox::critical(
|
||||
this, tr("Error"),
|
||||
tr("'%1' not found, no symbol names generated").arg(QString::fromStdString(TOTALDB)));
|
||||
}
|
||||
|
@ -1180,7 +1175,7 @@ void MenuBar::GenerateSymbolsFromRSO()
|
|||
|
||||
if (!good)
|
||||
{
|
||||
QMessageBox::warning(this, tr("Error"), tr("Invalid RSO module address: %1").arg(text));
|
||||
ModalMessageBox::warning(this, tr("Error"), tr("Invalid RSO module address: %1").arg(text));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1192,7 +1187,7 @@ void MenuBar::GenerateSymbolsFromRSO()
|
|||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::warning(this, tr("Error"), tr("Failed to load RSO module at %1").arg(text));
|
||||
ModalMessageBox::warning(this, tr("Error"), tr("Failed to load RSO module at %1").arg(text));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1209,9 +1204,9 @@ void MenuBar::LoadSymbolMap()
|
|||
if (db.Load(File::GetSysDirectory() + TOTALDB))
|
||||
db.Apply(&g_symbolDB);
|
||||
|
||||
QMessageBox::warning(this, tr("Warning"),
|
||||
tr("'%1' not found, scanning for common functions instead")
|
||||
.arg(QString::fromStdString(writable_map_file)));
|
||||
ModalMessageBox::warning(this, tr("Warning"),
|
||||
tr("'%1' not found, scanning for common functions instead")
|
||||
.arg(QString::fromStdString(writable_map_file)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1220,8 +1215,8 @@ void MenuBar::LoadSymbolMap()
|
|||
if (!TryLoadMapFile(existing_map_file_path))
|
||||
return;
|
||||
|
||||
QMessageBox::information(this, tr("Information"),
|
||||
tr("Loaded symbols from '%1'").arg(existing_map_file_path));
|
||||
ModalMessageBox::information(this, tr("Information"),
|
||||
tr("Loaded symbols from '%1'").arg(existing_map_file_path));
|
||||
}
|
||||
|
||||
HLE::PatchFunctions();
|
||||
|
@ -1292,7 +1287,7 @@ void MenuBar::SaveCode()
|
|||
|
||||
if (!g_symbolDB.SaveCodeMap(path))
|
||||
{
|
||||
QMessageBox::warning(
|
||||
ModalMessageBox::warning(
|
||||
this, tr("Error"),
|
||||
tr("Failed to save code map to path '%1'").arg(QString::fromStdString(path)));
|
||||
}
|
||||
|
@ -1302,7 +1297,7 @@ bool MenuBar::TryLoadMapFile(const QString& path, const bool bad)
|
|||
{
|
||||
if (!g_symbolDB.LoadMap(path.toStdString(), bad))
|
||||
{
|
||||
QMessageBox::warning(this, tr("Error"), tr("Failed to load map file '%1'").arg(path));
|
||||
ModalMessageBox::warning(this, tr("Error"), tr("Failed to load map file '%1'").arg(path));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1314,7 +1309,8 @@ void MenuBar::TrySaveSymbolMap(const QString& path)
|
|||
if (g_symbolDB.SaveSymbolMap(path.toStdString()))
|
||||
return;
|
||||
|
||||
QMessageBox::warning(this, tr("Error"), tr("Failed to save symbol map to path '%1'").arg(path));
|
||||
ModalMessageBox::warning(this, tr("Error"),
|
||||
tr("Failed to save symbol map to path '%1'").arg(path));
|
||||
}
|
||||
|
||||
void MenuBar::CreateSignatureFile()
|
||||
|
@ -1334,7 +1330,7 @@ void MenuBar::CreateSignatureFile()
|
|||
|
||||
if (!db.Save(save_path))
|
||||
{
|
||||
QMessageBox::warning(this, tr("Error"), tr("Failed to save signature file '%1'").arg(file));
|
||||
ModalMessageBox::warning(this, tr("Error"), tr("Failed to save signature file '%1'").arg(file));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1359,8 +1355,8 @@ void MenuBar::AppendSignatureFile()
|
|||
db.Load(signature_path);
|
||||
if (!db.Save(signature_path))
|
||||
{
|
||||
QMessageBox::warning(this, tr("Error"),
|
||||
tr("Failed to append to signature file '%1'").arg(file));
|
||||
ModalMessageBox::warning(this, tr("Error"),
|
||||
tr("Failed to append to signature file '%1'").arg(file));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1412,8 +1408,8 @@ void MenuBar::CombineSignatureFiles()
|
|||
db.Load(load_pathSecondaryFile);
|
||||
if (!db.Save(save_path))
|
||||
{
|
||||
QMessageBox::warning(this, tr("Error"),
|
||||
tr("Failed to save to signature file '%1'").arg(saveFile));
|
||||
ModalMessageBox::warning(this, tr("Error"),
|
||||
tr("Failed to save to signature file '%1'").arg(saveFile));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue