mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-02 16:49:05 +00:00
Delete Stores with <SELECT>.
This commit is contained in:
@@ -57,6 +57,7 @@ private:
|
||||
void execute();
|
||||
void descript();
|
||||
void updateStore(int selectedStore);
|
||||
void deleteStore(int selectedStore);
|
||||
bool handleIfDisplayText();
|
||||
int mode = 0;
|
||||
int selectedOptionAppStore = 0;
|
||||
|
||||
@@ -110,5 +110,6 @@
|
||||
|
||||
"OWNER_AND_REPO": "Owner & Repo",
|
||||
"FILENAME": "Filename",
|
||||
"OK": "OK"
|
||||
"OK": "OK",
|
||||
"DELETE_STORE": "Would you like to delete this store?"
|
||||
}
|
||||
|
||||
@@ -476,6 +476,28 @@ void UniStore::SubMenuLogic(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
}
|
||||
}
|
||||
|
||||
void UniStore::deleteStore(int selectedStore) {
|
||||
std::string path = Config::StorePath;
|
||||
path += dirContents[selectedStore].name;
|
||||
deleteFile(path.c_str());
|
||||
// Refresh the list.
|
||||
dirContents.clear();
|
||||
storeInfo.clear();
|
||||
chdir(Config::StorePath.c_str());
|
||||
getDirectoryContents(dirContents, {"unistore"});
|
||||
for(uint i=0;i<dirContents.size();i++) {
|
||||
storeInfo.push_back(parseStoreInfo(dirContents[i].name));
|
||||
descript();
|
||||
loadStoreDesc();
|
||||
}
|
||||
if (dirContents.size() == 0) {
|
||||
dirContents.clear();
|
||||
storeInfo.clear();
|
||||
mode = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool UniStore::handleIfDisplayText() {
|
||||
if (appStoreJson.at("storeInfo").contains("displayInformation")) {
|
||||
if (appStoreJson["storeInfo"]["displayInformation"] != true) {
|
||||
@@ -579,6 +601,12 @@ void UniStore::StoreSelectionLogic(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
}
|
||||
}
|
||||
|
||||
if (hDown & KEY_SELECT) {
|
||||
if (Gui::promptMsg(Lang::get("DELETE_STORE"))) {
|
||||
deleteStore(selection);
|
||||
}
|
||||
}
|
||||
|
||||
if (hDown & KEY_TOUCH) {
|
||||
if (Config::viewMode == 0) {
|
||||
for(int i=0;i<ENTRIES_PER_SCREEN && i<(int)storeInfo.size();i++) {
|
||||
|
||||
Reference in New Issue
Block a user