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.
Merge pull request #61 from w3irDv/enh/backupset
enhancement: restore from batch backup | fixes: savedata timestamp not shown, several bugs in from/to users operations
- Loading branch information
Showing
35 changed files
with
1,059 additions
and
608 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
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
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 <string> | ||
#include <vector> | ||
#include <memory> | ||
|
||
class BackupSetList { | ||
public: | ||
friend class BackupSetListState; | ||
|
||
BackupSetList() {}; | ||
BackupSetList(const char *backupSetListRoot); | ||
static std::unique_ptr<BackupSetList> currentBackupSetList; | ||
|
||
void sort(bool sortAscending = false); | ||
std::string at(int i); | ||
void add(std::string backupSet); | ||
|
||
static const std::string ROOT_BS; | ||
static std::string getBackupSetSubPath() { return backupSetSubPath; } | ||
static std::string getBackupSetEntry() { return backupSetEntry; } | ||
static void setBackupSetEntry(int i); | ||
static void setBackupSetSubPath(); | ||
static void initBackupSetList(); | ||
static void setBackupSetSubPathToRoot() { backupSetSubPath = "/"; } | ||
static void saveBackupSetSubPath() { savedBackupSetSubPath = backupSetSubPath; } | ||
static void restoreBackupSetSubPath() { backupSetSubPath = savedBackupSetSubPath; } | ||
|
||
private: | ||
static bool sortAscending; | ||
std::vector<std::string> backupSets; | ||
int entries; | ||
std::string backupSetListRoot; | ||
static std::string backupSetSubPath; | ||
static std::string backupSetEntry; | ||
static std::string savedBackupSetSubPath; | ||
|
||
}; | ||
|
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,30 @@ | ||
#pragma once | ||
|
||
#include <jansson.h> | ||
#include <utils/StringUtils.h> | ||
#include <savemng.h> | ||
|
||
class Metadata { | ||
public: | ||
Metadata(uint32_t high, uint32_t low, uint8_t s) : highID(high), | ||
lowID(low), | ||
slot(s), | ||
path (getDynamicBackupPath(highID, lowID, slot).append("/savemiiMeta.json")) { | ||
} | ||
|
||
Metadata(uint32_t high, uint32_t low, uint8_t s, std::string datetime) : highID(high), | ||
lowID(low), | ||
slot(s), | ||
path (getBatchBackupPath(highID, lowID, slot, datetime).append("/savemiiMeta.json")) { | ||
} | ||
|
||
std::string get(); | ||
bool set(const std::string &date,bool isUSB); | ||
static std::string serialId; | ||
|
||
private: | ||
uint32_t highID; | ||
uint32_t lowID; | ||
uint8_t slot; | ||
std::string path; | ||
}; |
This file was deleted.
Oops, something went wrong.
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,29 @@ | ||
#pragma once | ||
|
||
#include <ApplicationState.h> | ||
#include <memory> | ||
#include <utils/InputUtils.h> | ||
|
||
|
||
|
||
|
||
class BackupSetListState : public ApplicationState { | ||
public: | ||
BackupSetListState(); | ||
static void resetCursorPosition(); | ||
enum eState { | ||
STATE_BACKUPSET_MENU, | ||
STATE_DO_SUBSTATE, | ||
}; | ||
|
||
void render() override; | ||
ApplicationState::eSubState update(Input *input) override; | ||
|
||
private: | ||
std::unique_ptr<ApplicationState> subState{}; | ||
eState state = STATE_BACKUPSET_MENU; | ||
|
||
bool sortAscending; | ||
|
||
std::string backupSetListRoot; | ||
}; |
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
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
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
#define VERSION_MAJOR 1 | ||
#define VERSION_MINOR 6 | ||
#define VERSION_MICRO 2 | ||
#define VERSION_MICRO 3 |
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
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.