mirror of
https://github.com/Dark98/threeSD.git
synced 2026-07-03 00:38:58 +00:00
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:
+19
-2
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user