Skip to content

Commit

Permalink
Merge pull request #65 from w3irDv/enh/mngslot
Browse files Browse the repository at this point in the history
force manual backup always to root backupset
  • Loading branch information
w3irDv authored Jan 6, 2025
2 parents d6a5424 + a491957 commit 7f723ec
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 0 additions & 4 deletions src/menu/MainMenuState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,10 @@ ApplicationState::eSubState MainMenuState::update(Input *input) {
if (input->get(TRIGGER, PAD_BUTTON_A)) {
switch (cursorPos) {
case 0:
//BackupSetList::setBackupSetToRoot();
this->state = STATE_DO_SUBSTATE;
this->subState = std::make_unique<WiiUTitleListState>(this->wiiutitles, this->wiiuTitlesCount);
break;
case 1:
//BackupSetList::setBackupSetToRoot();
this->state = STATE_DO_SUBSTATE;
this->subState = std::make_unique<vWiiTitleListState>(this->wiititles, this->vWiiTitlesCount);
break;
Expand All @@ -65,12 +63,10 @@ ApplicationState::eSubState MainMenuState::update(Input *input) {
this->subState = std::make_unique<BatchBackupState>(this->wiiutitles, this->wiititles, this->wiiuTitlesCount, this->vWiiTitlesCount);
break;
case 3:
//BackupSetList::setBackupSetToRoot();
this->state = STATE_DO_SUBSTATE;
this->subState = std::make_unique<BatchRestoreState>(this->wiiutitles, this->wiititles, this->wiiuTitlesCount, this->vWiiTitlesCount);
break;
case 4:
//BackupSetList::setBackupSetToRoot();
this->state = STATE_DO_SUBSTATE;
this->substateCalled = STATE_BACKUPSET_MENU;
this->subState = std::make_unique<BackupSetListState>();
Expand Down
1 change: 0 additions & 1 deletion src/menu/TitleOptionsState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ void TitleOptionsState::render() {
ApplicationState::eSubState TitleOptionsState::update(Input *input) {
if (this->state == STATE_TITLE_OPTIONS) {
if (input->get(TRIGGER, PAD_BUTTON_B)) {
BackupSetList::setBackupSetSubPathToRoot(); // reset nxt operations to current backupSet
return SUBSTATE_RETURN;
}
if (input->get(TRIGGER, PAD_BUTTON_X))
Expand Down
10 changes: 7 additions & 3 deletions src/menu/TitleTaskState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ ApplicationState::eSubState TitleTaskState::update(Input *input) {
if (!this->title.saveInit) {
promptError(LanguageUtils::gettext("No save to Backup."));
noError = false;
}
} else
BackupSetList::setBackupSetSubPathToRoot(); // from backup menu, always backup to root
}

if (this->task == restore) {
Expand All @@ -89,10 +90,12 @@ ApplicationState::eSubState TitleTaskState::update(Input *input) {
if (!this->title.saveInit) {
promptError(LanguageUtils::gettext("No save to Wipe."));
noError = false;
}
} else
BackupSetList::setBackupSetSubPathToRoot(); // default behaviour: unaware of backupsets
}

if ((this->task == importLoadiine) || (this->task == exportLoadiine)) {
BackupSetList::setBackupSetSubPathToRoot(); // default behaviour: unaware of backupsets
char gamePath[PATH_SIZE];
memset(versionList, 0, 0x100 * sizeof(int));
if (!getLoadiineGameSaveDir(gamePath, this->title.productCode, this->title.longName, this->title.highID, this->title.lowID)) {
Expand All @@ -115,7 +118,8 @@ ApplicationState::eSubState TitleTaskState::update(Input *input) {
if (!this->title.saveInit) {
promptError(LanguageUtils::gettext("No save to Copy."));
noError = false;
}
} else
BackupSetList::setBackupSetSubPathToRoot(); // default behaviour: unaware of backupsets
}
if (noError) {
DrawUtils::setRedraw(true);
Expand Down
2 changes: 1 addition & 1 deletion src/savemng.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ void copySavedata(Title *title, Title *titleb, int8_t wiiuuser, int8_t wiiuuser_
int slotb = getEmptySlot(titleb->highID, titleb->lowID);
if ((slotb >= 0) && promptConfirm(ST_YES_NO, LanguageUtils::gettext("Backup current savedata first to next empty slot?"))) {
backupSavedata(titleb, slotb, wiiuuser, common, LanguageUtils::gettext("pre-copyToOtherDev backup"));
promptError(LanguageUtils::gettext("Backup done. Now copying Savedata."));
promptError(LanguageUtils::gettext("Backup done. Now copying Savedata."));
}

std::string path = (isUSB ? (getUSB() + "/usr/save").c_str() : "storage_mlc01:/usr/save");
Expand Down

0 comments on commit 7f723ec

Please sign in to comment.