From c2bf91156a30d12cee6d36bedf1b1c9241a2a927 Mon Sep 17 00:00:00 2001 From: FearlessTobi Date: Tue, 14 Apr 2020 02:56:22 +0200 Subject: [PATCH] yuzu/main: Add better popup texts and remove duplicated actions Makes popup texts more compact and clear and also links our quickstart guide now. Also removes OnMenuSelectEmulatedDirectory from the File dropdown, as the action already exists in the Filesystem tab and provides better visual feedback there. --- src/yuzu/main.cpp | 62 ++++++++++++++--------------------------------- src/yuzu/main.h | 2 -- src/yuzu/main.ui | 18 -------------- 3 files changed, 18 insertions(+), 64 deletions(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 1717e06f97..a2702ac3c9 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -802,10 +802,6 @@ void GMainWindow::ConnectMenuEvents() { connect(ui.action_Load_Folder, &QAction::triggered, this, &GMainWindow::OnMenuLoadFolder); connect(ui.action_Install_File_NAND, &QAction::triggered, this, &GMainWindow::OnMenuInstallToNAND); - connect(ui.action_Select_NAND_Directory, &QAction::triggered, this, - [this] { OnMenuSelectEmulatedDirectory(EmulatedDirectoryTarget::NAND); }); - connect(ui.action_Select_SDMC_Directory, &QAction::triggered, this, - [this] { OnMenuSelectEmulatedDirectory(EmulatedDirectoryTarget::SDMC); }); connect(ui.action_Exit, &QAction::triggered, this, &QMainWindow::close); connect(ui.action_Load_Amiibo, &QAction::triggered, this, &GMainWindow::OnLoadAmiibo); @@ -940,16 +936,18 @@ bool GMainWindow::LoadROM(const QString& filename) { default: if (static_cast(result) > static_cast(Core::System::ResultStatus::ErrorLoader)) { - LOG_CRITICAL(Frontend, "Failed to load ROM!"); const u16 loader_id = static_cast(Core::System::ResultStatus::ErrorLoader); const u16 error_id = static_cast(result) - loader_id; + const std::string error_code = fmt::format("({:04X}-{:04X})", loader_id, error_id); + LOG_CRITICAL(Frontend, "Failed to load ROM! {}", error_code); QMessageBox::critical( - this, tr("Error while loading ROM!"), + this, + tr("Error while loading ROM! ").append(QString::fromStdString(error_code)), QString::fromStdString(fmt::format( - "While attempting to load the ROM requested, an error occured. Please " - "refer to the yuzu wiki for more information or the yuzu discord for " - "additional help.\n\nError Code: {:04X}-{:04X}\nError Description: {}", - loader_id, error_id, static_cast(error_id)))); + "{}
Please follow the " + "yuzu quickstart guide to redump your files.
You can refer " + "to the yuzu wiki or the yuzu Discord for help.", + static_cast(error_id)))); } else { QMessageBox::critical( this, tr("Error while loading ROM!"), @@ -1663,28 +1661,6 @@ void GMainWindow::OnMenuInstallToNAND() { } } -void GMainWindow::OnMenuSelectEmulatedDirectory(EmulatedDirectoryTarget target) { - const auto res = QMessageBox::information( - this, tr("Changing Emulated Directory"), - tr("You are about to change the emulated %1 directory of the system. Please note " - "that this does not also move the contents of the previous directory to the " - "new one and you will have to do that yourself.") - .arg(target == EmulatedDirectoryTarget::SDMC ? tr("SD card") : tr("NAND")), - QMessageBox::StandardButtons{QMessageBox::Ok, QMessageBox::Cancel}); - - if (res == QMessageBox::Cancel) - return; - - QString dir_path = QFileDialog::getExistingDirectory(this, tr("Select Directory")); - if (!dir_path.isEmpty()) { - FileUtil::GetUserPath(target == EmulatedDirectoryTarget::SDMC ? FileUtil::UserPath::SDMCDir - : FileUtil::UserPath::NANDDir, - dir_path.toStdString()); - Core::System::GetInstance().GetFileSystemController().CreateFactories(*vfs); - game_list->PopulateAsync(UISettings::values.game_dirs); - } -} - void GMainWindow::OnMenuRecentFile() { QAction* action = qobject_cast(sender()); assert(action); @@ -2095,27 +2071,25 @@ void GMainWindow::OnReinitializeKeys(ReinitializeKeyBehavior behavior) { QString errors; if (!pdm.HasFuses()) { - errors += tr("- Missing fuses - Cannot derive SBK\n"); + errors += tr("Missing fuses"); } if (!pdm.HasBoot0()) { - errors += tr("- Missing BOOT0 - Cannot derive master keys\n"); + errors += tr(" - Missing BOOT0"); } if (!pdm.HasPackage2()) { - errors += tr("- Missing BCPKG2-1-Normal-Main - Cannot derive general keys\n"); + errors += tr(" - Missing BCPKG2-1-Normal-Main"); } if (!pdm.HasProdInfo()) { - errors += tr("- Missing PRODINFO - Cannot derive title keys\n"); + errors += tr(" - Missing PRODINFO"); } if (!errors.isEmpty()) { QMessageBox::warning( - this, tr("Warning Missing Derivation Components"), - tr("The following are missing from your configuration that may hinder key " - "derivation. It will be attempted but may not complete.

") + - errors + - tr("

You can get all of these and dump all of your games easily by " - "following the " - "quickstart guide. Alternatively, you can use another method of dumping " - "to obtain all of your keys.")); + this, tr("Derivation Components Missing"), + tr("Components are missing that may hinder key derivation from completing. " + "
Please follow the yuzu " + "quickstart guide to get all your keys and " + "games.

(%1)") + .arg(errors)); } QProgressDialog prog; diff --git a/src/yuzu/main.h b/src/yuzu/main.h index a67125567f..0b750689de 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -196,8 +196,6 @@ private slots: void OnMenuLoadFile(); void OnMenuLoadFolder(); void OnMenuInstallToNAND(); - /// Called whenever a user select the "File->Select -- Directory" where -- is NAND or SD Card - void OnMenuSelectEmulatedDirectory(EmulatedDirectoryTarget target); void OnMenuRecentFile(); void OnConfigure(); void OnLoadAmiibo(); diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui index a2c9e45472..ae414241ea 100644 --- a/src/yuzu/main.ui +++ b/src/yuzu/main.ui @@ -64,8 +64,6 @@ - - @@ -217,22 +215,6 @@ Show Status Bar - - - Select NAND Directory... - - - Selects a folder to use as the root of the emulated NAND - - - - - Select SD Card Directory... - - - Selects a folder to use as the root of the emulated SD card - - true