forked from Ryuzaki-MrL/savemii
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enh - batch restore - mocked version
- Loading branch information
Showing
15 changed files
with
944 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,5 @@ class ApplicationState { | |
|
||
virtual void render() = 0; | ||
virtual eSubState update(Input *input) = 0; | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#pragma once | ||
|
||
#include <ApplicationState.h> | ||
#include <memory> | ||
#include <savemng.h> | ||
#include <utils/InputUtils.h> | ||
#include <utils/LanguageUtils.h> | ||
#include <vector> | ||
|
||
class BRTitleSelectState : public ApplicationState { | ||
public: | ||
BRTitleSelectState(int sduser, int wiiuuser, bool common, bool wipeBeforeRestore, bool fullBackup,Title *titles, int titlesCount); | ||
|
||
enum eState { | ||
STATE_BATCH_RESTORE_TITLE_SELECT, | ||
STATE_DO_SUBSTATE, | ||
}; | ||
|
||
void render() override; | ||
ApplicationState::eSubState update(Input *input) override; | ||
|
||
private: | ||
std::unique_ptr<ApplicationState> subState{}; | ||
eState state = STATE_BATCH_RESTORE_TITLE_SELECT; | ||
|
||
|
||
int sduser; | ||
int wiiuuser; | ||
bool common; | ||
bool wipeBeforeRestore; | ||
bool fullBackup; | ||
Title *titles; | ||
int titlesCount; | ||
|
||
|
||
std::vector<const char *> sortNames = {LanguageUtils::gettext("None"), | ||
LanguageUtils::gettext("Name"), | ||
LanguageUtils::gettext("Storage"), | ||
LanguageUtils::gettext("Storage+Name")}; | ||
|
||
int titleSort = 1; | ||
int scroll = 0; | ||
int cursorPos = 0; | ||
bool sortAscending = true; | ||
int targ = 0; | ||
|
||
bool noTitles = false; | ||
|
||
std::vector<int> c2t; | ||
int candidatesCount; | ||
|
||
void updateC2t(); | ||
|
||
std::vector<const char*> titleStateAfterBR = { | ||
" ", | ||
" > Aborted", | ||
" > OK", | ||
" > WR", | ||
" > KO" | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#pragma once | ||
|
||
#include <ApplicationState.h> | ||
#include <memory> | ||
#include <set> | ||
#include <algorithm> | ||
#include <utils/InputUtils.h> | ||
#include <savemng.h> | ||
|
||
class BatchRestoreOptions : public ApplicationState { | ||
public: | ||
BatchRestoreOptions(Title *titles, int titlesCount); | ||
|
||
enum eState { | ||
STATE_BATCH_RESTORE_OPTIONS_MENU, | ||
STATE_DO_SUBSTATE, | ||
}; | ||
|
||
void render() override; | ||
ApplicationState::eSubState update(Input *input) override; | ||
std::string tag; | ||
|
||
private: | ||
std::unique_ptr<ApplicationState> subState{}; | ||
eState state = STATE_BATCH_RESTORE_OPTIONS_MENU; | ||
|
||
int8_t wiiuuser = -1; | ||
int8_t sduser = -1; | ||
bool common = false; | ||
|
||
bool wipeBeforeRestore = true; | ||
bool fullBackup = true; | ||
std::set<std::string,std::less<std::string>> batchSDUsers; | ||
|
||
Title *titles; | ||
int titlesCount = 0; | ||
|
||
int cursorPos = 0; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#pragma once | ||
|
||
#include <ApplicationState.h> | ||
#include <memory> | ||
#include <savemng.h> | ||
#include <utils/InputUtils.h> | ||
|
||
class BatchRestoreState : public ApplicationState { | ||
public: | ||
BatchRestoreState(Title *wiiutitles, Title *wiititles, int wiiuTitlesCount, int vWiiTitlesCount) : wiiutitles(wiiutitles), | ||
wiititles(wiititles), | ||
wiiuTitlesCount(wiiuTitlesCount), | ||
vWiiTitlesCount(vWiiTitlesCount) {} | ||
enum eState { | ||
STATE_BATCH_RESTORE_MENU, | ||
STATE_DO_SUBSTATE, | ||
}; | ||
|
||
void render() override; | ||
ApplicationState::eSubState update(Input *input) override; | ||
std::string tag; | ||
|
||
private: | ||
std::unique_ptr<ApplicationState> subState{}; | ||
eState state = STATE_BATCH_RESTORE_MENU; | ||
|
||
Title *wiiutitles; | ||
Title *wiititles; | ||
|
||
int wiiuTitlesCount; | ||
int vWiiTitlesCount; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.