Removed special case handling for system archives & safe mode firm

This commit is contained in:
Pengfei
2021-08-25 21:51:27 +08:00
parent e095abd3cc
commit 6cadb86071
4 changed files with 35 additions and 150 deletions
+4 -8
View File
@@ -36,7 +36,6 @@ static constexpr std::array<std::tuple<Core::ContentType, const char*, const cha
{Core::ContentType::DLC, QT_TR_NOOP("DLC"), QT_TR_NOOP("DLCs"), "dlc"},
{Core::ContentType::Savegame, QT_TR_NOOP("Save Data"), QT_TR_NOOP("Save Data"), "save_data"},
{Core::ContentType::Extdata, QT_TR_NOOP("Extra Data"), QT_TR_NOOP("Extra Data"), "save_data"},
{Core::ContentType::SystemArchive, QT_TR_NOOP("System Archive"), QT_TR_NOOP("System Archives"), "system_archive"},
{Core::ContentType::Sysdata, QT_TR_NOOP("System Data"), QT_TR_NOOP("System Data"), "system_data"},
{Core::ContentType::SystemTitle, QT_TR_NOOP("System Title"), QT_TR_NOOP("System Titles"), "hos"},
{Core::ContentType::SystemApplet, QT_TR_NOOP("System Applet"), QT_TR_NOOP("System Applets"), "hos"},
@@ -213,8 +212,7 @@ void ImportDialog::InsertTopLevelItem(QString text, QPixmap icon, u64 total_size
}
// Content types that themselves form a 'Title' like entity.
constexpr std::array<Core::ContentType, 4> SpecialContentTypeList{{
Core::ContentType::SystemArchive,
constexpr std::array<Core::ContentType, 3> SpecialContentTypeList{{
Core::ContentType::Sysdata,
Core::ContentType::SystemTitle,
Core::ContentType::SystemApplet,
@@ -255,9 +253,8 @@ void ImportDialog::InsertSecondLevelItem(std::size_t row, const Core::ContentSpe
content.type != Core::ContentType::SystemApplet) {
icon = GetContentTypeIcon(content.type);
} else {
// When not in title view, System Data and System Archive groups use category icons.
const bool use_category_icon = content.type == Core::ContentType::Sysdata ||
content.type == Core::ContentType::SystemArchive;
// When not in title view, System Data groups use category icons.
const bool use_category_icon = content.type == Core::ContentType::Sysdata;
icon = GetContentIcon(content, use_category_icon);
}
} else {
@@ -296,8 +293,7 @@ void ImportDialog::OnItemChanged(QTreeWidgetItem* item, int column) {
total_selected_size += specifier.maximum_size;
} else {
if (!system_warning_shown && !specifier.already_exists &&
(specifier.type == Core::ContentType::SystemArchive ||
specifier.type == Core::ContentType::Sysdata ||
(specifier.type == Core::ContentType::Sysdata ||
specifier.type == Core::ContentType::SystemTitle)) {
QMessageBox::warning(this, tr("Warning"),
+9 -6
View File
@@ -36,6 +36,13 @@ bool IsConfigGood(const Core::Config& config) {
!config.movable_sed_path.empty() && !config.bootrom_path.empty();
}
bool IsConfigComplete(const Core::Config& config) {
return IsConfigGood(config) && !config.certs_db_path.empty() &&
!config.nand_title_db_path.empty() && !config.ticket_db_path.empty() &&
!config.config_savegame_path.empty() && !config.system_titles_path.empty() &&
!config.nand_data_path.empty();
}
MainDialog::MainDialog(QWidget* parent)
: DPIAwareDialog(parent, 640, 256), ui(std::make_unique<Ui::MainDialog>()) {
@@ -145,10 +152,7 @@ void MainDialog::LoadPresetConfig() {
status = tr("No Configuration Found");
} else if (list[i].version != Core::CurrentDumperVersion) {
status = tr("Version Dismatch");
} else if (list[i].safe_mode_firm_path.empty() ||
list[i].config_savegame_path.empty() ||
list[i].system_archives_path.empty()) {
} else if (!IsConfigComplete(list[i])) {
status = tr("Missing System Files");
} else if (list[i].seed_db_path.empty()) {
status = tr("Good, Missing Seeds");
@@ -217,8 +221,7 @@ void MainDialog::LaunchImportDialog() {
return;
}
if (config.safe_mode_firm_path.empty() || config.config_savegame_path.empty() ||
config.system_archives_path.empty()) {
if (!IsConfigComplete(config)) {
QMessageBox::warning(
this, tr("Warning"),
tr("Certain system files are missing from your configuration.<br>Some contents "