lots of important fixes

- DPFS container is fixed
- SD Savegame is fixed
- added slot0x25KeyX load
- added regex for titile ID
- added aes_keys.txt import
- sd savegame listing is fixed (uninitialized won't be listed any more)
- error handling is improved (removed asserts and replaced with return values)
- UI is now functional
- config is now checked in main
This commit is contained in:
zhupengfei
2019-08-30 15:33:47 +08:00
parent 8acfe9f304
commit 67e6b05e87
22 changed files with 490 additions and 78 deletions
+19 -2
View File
@@ -4,6 +4,7 @@
#include <string>
#include <QApplication>
#include <QMessageBox>
#include <QStorageInfo>
#include <qdevicewatcher.h>
#include "common/file_util.h"
@@ -16,6 +17,11 @@
#include "common/common_paths.h"
#endif
bool IsConfigGood(const Core::Config& config) {
return !config.sdmc_path.empty() && !config.user_path.empty() &&
!config.movable_sed_path.empty() && !config.bootrom_path.empty();
}
MainDialog::MainDialog(QWidget* parent) : QDialog(parent), ui(std::make_unique<Ui::MainDialog>()) {
ui->setupUi(this);
@@ -36,8 +42,7 @@ MainDialog::MainDialog(QWidget* parent) : QDialog(parent), ui(std::make_unique<U
if (button == ui->buttonBox->button(QDialogButtonBox::StandardButton::Reset)) {
LoadPresetConfig();
} else if (button == ui->buttonBox->button(QDialogButtonBox::StandardButton::Ok)) {
ImportDialog dialog(this, GetCurrentConfig());
dialog.exec();
LaunchImportDialog();
}
});
@@ -145,6 +150,18 @@ Core::Config MainDialog::GetCurrentConfig() {
}
}
void MainDialog::LaunchImportDialog() {
const auto& config = GetCurrentConfig();
if (!IsConfigGood(config)) {
QMessageBox::critical(this, tr("Incomplete Config"),
tr("Your config is missing some of the required fields."));
return;
}
ImportDialog dialog(this, config);
dialog.exec();
}
int main(int argc, char* argv[]) {
// Init settings params
QCoreApplication::setOrganizationName(QStringLiteral("zhaowenlan1779"));