diff options
| author | 2020-04-14 02:56:22 +0200 | |
|---|---|---|
| committer | 2020-04-14 02:56:22 +0200 | |
| commit | c2bf91156a30d12cee6d36bedf1b1c9241a2a927 (patch) | |
| tree | deee8a55e2db3715326193a90176d51af8b5d2cb /src | |
| parent | Merge pull request #3636 from ReinUsesLisp/drop-vk-hpp (diff) | |
| download | yuzu-c2bf91156a30d12cee6d36bedf1b1c9241a2a927.tar.gz yuzu-c2bf91156a30d12cee6d36bedf1b1c9241a2a927.tar.xz yuzu-c2bf91156a30d12cee6d36bedf1b1c9241a2a927.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/main.cpp | 62 | ||||
| -rw-r--r-- | src/yuzu/main.h | 2 | ||||
| -rw-r--r-- | 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 1717e06f9..a2702ac3c 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -802,10 +802,6 @@ void GMainWindow::ConnectMenuEvents() { | |||
| 802 | connect(ui.action_Load_Folder, &QAction::triggered, this, &GMainWindow::OnMenuLoadFolder); | 802 | connect(ui.action_Load_Folder, &QAction::triggered, this, &GMainWindow::OnMenuLoadFolder); |
| 803 | connect(ui.action_Install_File_NAND, &QAction::triggered, this, | 803 | connect(ui.action_Install_File_NAND, &QAction::triggered, this, |
| 804 | &GMainWindow::OnMenuInstallToNAND); | 804 | &GMainWindow::OnMenuInstallToNAND); |
| 805 | connect(ui.action_Select_NAND_Directory, &QAction::triggered, this, | ||
| 806 | [this] { OnMenuSelectEmulatedDirectory(EmulatedDirectoryTarget::NAND); }); | ||
| 807 | connect(ui.action_Select_SDMC_Directory, &QAction::triggered, this, | ||
| 808 | [this] { OnMenuSelectEmulatedDirectory(EmulatedDirectoryTarget::SDMC); }); | ||
| 809 | connect(ui.action_Exit, &QAction::triggered, this, &QMainWindow::close); | 805 | connect(ui.action_Exit, &QAction::triggered, this, &QMainWindow::close); |
| 810 | connect(ui.action_Load_Amiibo, &QAction::triggered, this, &GMainWindow::OnLoadAmiibo); | 806 | connect(ui.action_Load_Amiibo, &QAction::triggered, this, &GMainWindow::OnLoadAmiibo); |
| 811 | 807 | ||
| @@ -940,16 +936,18 @@ bool GMainWindow::LoadROM(const QString& filename) { | |||
| 940 | default: | 936 | default: |
| 941 | if (static_cast<u32>(result) > | 937 | if (static_cast<u32>(result) > |
| 942 | static_cast<u32>(Core::System::ResultStatus::ErrorLoader)) { | 938 | static_cast<u32>(Core::System::ResultStatus::ErrorLoader)) { |
| 943 | LOG_CRITICAL(Frontend, "Failed to load ROM!"); | ||
| 944 | const u16 loader_id = static_cast<u16>(Core::System::ResultStatus::ErrorLoader); | 939 | const u16 loader_id = static_cast<u16>(Core::System::ResultStatus::ErrorLoader); |
| 945 | const u16 error_id = static_cast<u16>(result) - loader_id; | 940 | const u16 error_id = static_cast<u16>(result) - loader_id; |
| 941 | const std::string error_code = fmt::format("({:04X}-{:04X})", loader_id, error_id); | ||
| 942 | LOG_CRITICAL(Frontend, "Failed to load ROM! {}", error_code); | ||
| 946 | QMessageBox::critical( | 943 | QMessageBox::critical( |
| 947 | this, tr("Error while loading ROM!"), | 944 | this, |
| 945 | tr("Error while loading ROM! ").append(QString::fromStdString(error_code)), | ||
| 948 | QString::fromStdString(fmt::format( | 946 | QString::fromStdString(fmt::format( |
| 949 | "While attempting to load the ROM requested, an error occured. Please " | 947 | "{}<br>Please follow <a href='https://yuzu-emu.org/help/quickstart/'>the " |
| 950 | "refer to the yuzu wiki for more information or the yuzu discord for " | 948 | "yuzu quickstart guide</a> to redump your files.<br>You can refer " |
| 951 | "additional help.\n\nError Code: {:04X}-{:04X}\nError Description: {}", | 949 | "to the yuzu wiki</a> or the yuzu Discord</a> for help.", |
| 952 | loader_id, error_id, static_cast<Loader::ResultStatus>(error_id)))); | 950 | static_cast<Loader::ResultStatus>(error_id)))); |
| 953 | } else { | 951 | } else { |
| 954 | QMessageBox::critical( | 952 | QMessageBox::critical( |
| 955 | this, tr("Error while loading ROM!"), | 953 | this, tr("Error while loading ROM!"), |
| @@ -1663,28 +1661,6 @@ void GMainWindow::OnMenuInstallToNAND() { | |||
| 1663 | } | 1661 | } |
| 1664 | } | 1662 | } |
| 1665 | 1663 | ||
| 1666 | void GMainWindow::OnMenuSelectEmulatedDirectory(EmulatedDirectoryTarget target) { | ||
| 1667 | const auto res = QMessageBox::information( | ||
| 1668 | this, tr("Changing Emulated Directory"), | ||
| 1669 | tr("You are about to change the emulated %1 directory of the system. Please note " | ||
| 1670 | "that this does not also move the contents of the previous directory to the " | ||
| 1671 | "new one and you will have to do that yourself.") | ||
| 1672 | .arg(target == EmulatedDirectoryTarget::SDMC ? tr("SD card") : tr("NAND")), | ||
| 1673 | QMessageBox::StandardButtons{QMessageBox::Ok, QMessageBox::Cancel}); | ||
| 1674 | |||
| 1675 | if (res == QMessageBox::Cancel) | ||
| 1676 | return; | ||
| 1677 | |||
| 1678 | QString dir_path = QFileDialog::getExistingDirectory(this, tr("Select Directory")); | ||
| 1679 | if (!dir_path.isEmpty()) { | ||
| 1680 | FileUtil::GetUserPath(target == EmulatedDirectoryTarget::SDMC ? FileUtil::UserPath::SDMCDir | ||
| 1681 | : FileUtil::UserPath::NANDDir, | ||
| 1682 | dir_path.toStdString()); | ||
| 1683 | Core::System::GetInstance().GetFileSystemController().CreateFactories(*vfs); | ||
| 1684 | game_list->PopulateAsync(UISettings::values.game_dirs); | ||
| 1685 | } | ||
| 1686 | } | ||
| 1687 | |||
| 1688 | void GMainWindow::OnMenuRecentFile() { | 1664 | void GMainWindow::OnMenuRecentFile() { |
| 1689 | QAction* action = qobject_cast<QAction*>(sender()); | 1665 | QAction* action = qobject_cast<QAction*>(sender()); |
| 1690 | assert(action); | 1666 | assert(action); |
| @@ -2095,27 +2071,25 @@ void GMainWindow::OnReinitializeKeys(ReinitializeKeyBehavior behavior) { | |||
| 2095 | 2071 | ||
| 2096 | QString errors; | 2072 | QString errors; |
| 2097 | if (!pdm.HasFuses()) { | 2073 | if (!pdm.HasFuses()) { |
| 2098 | errors += tr("- Missing fuses - Cannot derive SBK\n"); | 2074 | errors += tr("Missing fuses"); |
| 2099 | } | 2075 | } |
| 2100 | if (!pdm.HasBoot0()) { | 2076 | if (!pdm.HasBoot0()) { |
| 2101 | errors += tr("- Missing BOOT0 - Cannot derive master keys\n"); | 2077 | errors += tr(" - Missing BOOT0"); |
| 2102 | } | 2078 | } |
| 2103 | if (!pdm.HasPackage2()) { | 2079 | if (!pdm.HasPackage2()) { |
| 2104 | errors += tr("- Missing BCPKG2-1-Normal-Main - Cannot derive general keys\n"); | 2080 | errors += tr(" - Missing BCPKG2-1-Normal-Main"); |
| 2105 | } | 2081 | } |
| 2106 | if (!pdm.HasProdInfo()) { | 2082 | if (!pdm.HasProdInfo()) { |
| 2107 | errors += tr("- Missing PRODINFO - Cannot derive title keys\n"); | 2083 | errors += tr(" - Missing PRODINFO"); |
| 2108 | } | 2084 | } |
| 2109 | if (!errors.isEmpty()) { | 2085 | if (!errors.isEmpty()) { |
| 2110 | QMessageBox::warning( | 2086 | QMessageBox::warning( |
| 2111 | this, tr("Warning Missing Derivation Components"), | 2087 | this, tr("Derivation Components Missing"), |
| 2112 | tr("The following are missing from your configuration that may hinder key " | 2088 | tr("Components are missing that may hinder key derivation from completing. " |
| 2113 | "derivation. It will be attempted but may not complete.<br><br>") + | 2089 | "<br>Please follow <a href='https://yuzu-emu.org/help/quickstart/'>the yuzu " |
| 2114 | errors + | 2090 | "quickstart guide</a> to get all your keys and " |
| 2115 | tr("<br><br>You can get all of these and dump all of your games easily by " | 2091 | "games.<br><br><small>(%1)</small>") |
| 2116 | "following <a href='https://yuzu-emu.org/help/quickstart/'>the " | 2092 | .arg(errors)); |
| 2117 | "quickstart guide</a>. Alternatively, you can use another method of dumping " | ||
| 2118 | "to obtain all of your keys.")); | ||
| 2119 | } | 2093 | } |
| 2120 | 2094 | ||
| 2121 | QProgressDialog prog; | 2095 | QProgressDialog prog; |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index a67125567..0b750689d 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -196,8 +196,6 @@ private slots: | |||
| 196 | void OnMenuLoadFile(); | 196 | void OnMenuLoadFile(); |
| 197 | void OnMenuLoadFolder(); | 197 | void OnMenuLoadFolder(); |
| 198 | void OnMenuInstallToNAND(); | 198 | void OnMenuInstallToNAND(); |
| 199 | /// Called whenever a user select the "File->Select -- Directory" where -- is NAND or SD Card | ||
| 200 | void OnMenuSelectEmulatedDirectory(EmulatedDirectoryTarget target); | ||
| 201 | void OnMenuRecentFile(); | 199 | void OnMenuRecentFile(); |
| 202 | void OnConfigure(); | 200 | void OnConfigure(); |
| 203 | void OnLoadAmiibo(); | 201 | void OnLoadAmiibo(); |
diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui index a2c9e4547..ae414241e 100644 --- a/src/yuzu/main.ui +++ b/src/yuzu/main.ui | |||
| @@ -64,8 +64,6 @@ | |||
| 64 | <addaction name="separator"/> | 64 | <addaction name="separator"/> |
| 65 | <addaction name="menu_recent_files"/> | 65 | <addaction name="menu_recent_files"/> |
| 66 | <addaction name="separator"/> | 66 | <addaction name="separator"/> |
| 67 | <addaction name="action_Select_NAND_Directory"/> | ||
| 68 | <addaction name="action_Select_SDMC_Directory"/> | ||
| 69 | <addaction name="separator"/> | 67 | <addaction name="separator"/> |
| 70 | <addaction name="action_Load_Amiibo"/> | 68 | <addaction name="action_Load_Amiibo"/> |
| 71 | <addaction name="separator"/> | 69 | <addaction name="separator"/> |
| @@ -217,22 +215,6 @@ | |||
| 217 | <string>Show Status Bar</string> | 215 | <string>Show Status Bar</string> |
| 218 | </property> | 216 | </property> |
| 219 | </action> | 217 | </action> |
| 220 | <action name="action_Select_NAND_Directory"> | ||
| 221 | <property name="text"> | ||
| 222 | <string>Select NAND Directory...</string> | ||
| 223 | </property> | ||
| 224 | <property name="toolTip"> | ||
| 225 | <string>Selects a folder to use as the root of the emulated NAND</string> | ||
| 226 | </property> | ||
| 227 | </action> | ||
| 228 | <action name="action_Select_SDMC_Directory"> | ||
| 229 | <property name="text"> | ||
| 230 | <string>Select SD Card Directory...</string> | ||
| 231 | </property> | ||
| 232 | <property name="toolTip"> | ||
| 233 | <string>Selects a folder to use as the root of the emulated SD card</string> | ||
| 234 | </property> | ||
| 235 | </action> | ||
| 236 | <action name="action_Fullscreen"> | 218 | <action name="action_Fullscreen"> |
| 237 | <property name="checkable"> | 219 | <property name="checkable"> |
| 238 | <bool>true</bool> | 220 | <bool>true</bool> |