Merge pull request #3655 from FearlessTobi/ui-retext-yuzu

yuzu/main: Add better popup texts and remove duplicated actions
This commit is contained in:
bunnei 2020-04-19 02:16:50 -04:00 committed by GitHub
commit 779a3b222a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 64 deletions

View file

@ -802,10 +802,6 @@ void GMainWindow::ConnectMenuEvents() {
connect(ui.action_Load_Folder, &QAction::triggered, this, &GMainWindow::OnMenuLoadFolder); connect(ui.action_Load_Folder, &QAction::triggered, this, &GMainWindow::OnMenuLoadFolder);
connect(ui.action_Install_File_NAND, &QAction::triggered, this, connect(ui.action_Install_File_NAND, &QAction::triggered, this,
&GMainWindow::OnMenuInstallToNAND); &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_Exit, &QAction::triggered, this, &QMainWindow::close);
connect(ui.action_Load_Amiibo, &QAction::triggered, this, &GMainWindow::OnLoadAmiibo); connect(ui.action_Load_Amiibo, &QAction::triggered, this, &GMainWindow::OnLoadAmiibo);
@ -940,16 +936,18 @@ bool GMainWindow::LoadROM(const QString& filename) {
default: default:
if (static_cast<u32>(result) > if (static_cast<u32>(result) >
static_cast<u32>(Core::System::ResultStatus::ErrorLoader)) { static_cast<u32>(Core::System::ResultStatus::ErrorLoader)) {
LOG_CRITICAL(Frontend, "Failed to load ROM!");
const u16 loader_id = static_cast<u16>(Core::System::ResultStatus::ErrorLoader); const u16 loader_id = static_cast<u16>(Core::System::ResultStatus::ErrorLoader);
const u16 error_id = static_cast<u16>(result) - loader_id; const u16 error_id = static_cast<u16>(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( QMessageBox::critical(
this, tr("Error while loading ROM!"), this,
tr("Error while loading ROM! ").append(QString::fromStdString(error_code)),
QString::fromStdString(fmt::format( QString::fromStdString(fmt::format(
"While attempting to load the ROM requested, an error occured. Please " "{}<br>Please follow <a href='https://yuzu-emu.org/help/quickstart/'>the "
"refer to the yuzu wiki for more information or the yuzu discord for " "yuzu quickstart guide</a> to redump your files.<br>You can refer "
"additional help.\n\nError Code: {:04X}-{:04X}\nError Description: {}", "to the yuzu wiki</a> or the yuzu Discord</a> for help.",
loader_id, error_id, static_cast<Loader::ResultStatus>(error_id)))); static_cast<Loader::ResultStatus>(error_id))));
} else { } else {
QMessageBox::critical( QMessageBox::critical(
this, tr("Error while loading ROM!"), 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() { void GMainWindow::OnMenuRecentFile() {
QAction* action = qobject_cast<QAction*>(sender()); QAction* action = qobject_cast<QAction*>(sender());
assert(action); assert(action);
@ -2095,27 +2071,25 @@ void GMainWindow::OnReinitializeKeys(ReinitializeKeyBehavior behavior) {
QString errors; QString errors;
if (!pdm.HasFuses()) { if (!pdm.HasFuses()) {
errors += tr("- Missing fuses - Cannot derive SBK\n"); errors += tr("Missing fuses");
} }
if (!pdm.HasBoot0()) { if (!pdm.HasBoot0()) {
errors += tr("- Missing BOOT0 - Cannot derive master keys\n"); errors += tr(" - Missing BOOT0");
} }
if (!pdm.HasPackage2()) { 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()) { if (!pdm.HasProdInfo()) {
errors += tr("- Missing PRODINFO - Cannot derive title keys\n"); errors += tr(" - Missing PRODINFO");
} }
if (!errors.isEmpty()) { if (!errors.isEmpty()) {
QMessageBox::warning( QMessageBox::warning(
this, tr("Warning Missing Derivation Components"), this, tr("Derivation Components Missing"),
tr("The following are missing from your configuration that may hinder key " tr("Components are missing that may hinder key derivation from completing. "
"derivation. It will be attempted but may not complete.<br><br>") + "<br>Please follow <a href='https://yuzu-emu.org/help/quickstart/'>the yuzu "
errors + "quickstart guide</a> to get all your keys and "
tr("<br><br>You can get all of these and dump all of your games easily by " "games.<br><br><small>(%1)</small>")
"following <a href='https://yuzu-emu.org/help/quickstart/'>the " .arg(errors));
"quickstart guide</a>. Alternatively, you can use another method of dumping "
"to obtain all of your keys."));
} }
QProgressDialog prog; QProgressDialog prog;

View file

@ -196,8 +196,6 @@ private slots:
void OnMenuLoadFile(); void OnMenuLoadFile();
void OnMenuLoadFolder(); void OnMenuLoadFolder();
void OnMenuInstallToNAND(); void OnMenuInstallToNAND();
/// Called whenever a user select the "File->Select -- Directory" where -- is NAND or SD Card
void OnMenuSelectEmulatedDirectory(EmulatedDirectoryTarget target);
void OnMenuRecentFile(); void OnMenuRecentFile();
void OnConfigure(); void OnConfigure();
void OnLoadAmiibo(); void OnLoadAmiibo();

View file

@ -64,8 +64,6 @@
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="menu_recent_files"/> <addaction name="menu_recent_files"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="action_Select_NAND_Directory"/>
<addaction name="action_Select_SDMC_Directory"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="action_Load_Amiibo"/> <addaction name="action_Load_Amiibo"/>
<addaction name="separator"/> <addaction name="separator"/>
@ -217,22 +215,6 @@
<string>Show Status Bar</string> <string>Show Status Bar</string>
</property> </property>
</action> </action>
<action name="action_Select_NAND_Directory">
<property name="text">
<string>Select NAND Directory...</string>
</property>
<property name="toolTip">
<string>Selects a folder to use as the root of the emulated NAND</string>
</property>
</action>
<action name="action_Select_SDMC_Directory">
<property name="text">
<string>Select SD Card Directory...</string>
</property>
<property name="toolTip">
<string>Selects a folder to use as the root of the emulated SD card</string>
</property>
</action>
<action name="action_Fullscreen"> <action name="action_Fullscreen">
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>