mirror of
https://gitlab.com/Theopse/fbi-i18n-zh.git
synced 2025-05-11 10:38:58 +08:00
Add NAND delete warning, return to network install screen after a successful network install.
This commit is contained in:
parent
073262f4ba
commit
d36899d35b
@ -108,6 +108,36 @@ int main(int argc, char **argv) {
|
|||||||
std::string fileTarget;
|
std::string fileTarget;
|
||||||
App appTarget;
|
App appTarget;
|
||||||
if(mode == INSTALL_CIA || mode == DELETE_CIA) {
|
if(mode == INSTALL_CIA || mode == DELETE_CIA) {
|
||||||
|
if(netInstall && !exit) {
|
||||||
|
screenClearBuffers(BOTTOM_SCREEN, 0, 0, 0);
|
||||||
|
|
||||||
|
RemoteFile file = uiAcceptRemoteFile(TOP_SCREEN);
|
||||||
|
if(file.fd == NULL) {
|
||||||
|
netInstall = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::stringstream confirmStream;
|
||||||
|
confirmStream << "Install the received application?" << "\n";
|
||||||
|
confirmStream << "Size: " << file.fileSize << " bytes (" << std::fixed << std::setprecision(2) << file.fileSize / 1024.0f / 1024.0f << "MB)" << "\n";
|
||||||
|
if(uiPrompt(TOP_SCREEN, confirmStream.str(), true)) {
|
||||||
|
AppResult ret = appInstall(destination, file.fd, file.fileSize, onProgress);
|
||||||
|
std::stringstream resultMsg;
|
||||||
|
resultMsg << "Install ";
|
||||||
|
if(ret == APP_SUCCESS) {
|
||||||
|
resultMsg << "succeeded!";
|
||||||
|
} else {
|
||||||
|
resultMsg << "failed!" << "\n";
|
||||||
|
resultMsg << appGetResultString(ret) << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
uiPrompt(TOP_SCREEN, resultMsg.str(), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose(file.fd);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
uiSelectFile(&fileTarget, "/", extensions, [&](const std::string currDirectory, bool inRoot, bool &updateList) {
|
uiSelectFile(&fileTarget, "/", extensions, [&](const std::string currDirectory, bool inRoot, bool &updateList) {
|
||||||
if(inputIsPressed(BUTTON_X)) {
|
if(inputIsPressed(BUTTON_X)) {
|
||||||
std::stringstream confirmMsg;
|
std::stringstream confirmMsg;
|
||||||
@ -209,7 +239,7 @@ int main(int argc, char **argv) {
|
|||||||
return onLoop();
|
return onLoop();
|
||||||
}, [&](App app, bool &updateList) {
|
}, [&](App app, bool &updateList) {
|
||||||
if(mode == DELETE_TITLE) {
|
if(mode == DELETE_TITLE) {
|
||||||
if(uiPrompt(TOP_SCREEN, "Delete the selected title?", true)) {
|
if(uiPrompt(TOP_SCREEN, "Delete the selected title?", true) && (destination != NAND || uiPrompt(TOP_SCREEN, "You are about to delete a title from the NAND.\nTHIS HAS THE POTENTIAL TO BRICK YOUR 3DS!\nAre you sure you wish to continue?", true))) {
|
||||||
updateList = true;
|
updateList = true;
|
||||||
uiDisplayMessage(TOP_SCREEN, "Deleting title...");
|
uiDisplayMessage(TOP_SCREEN, "Deleting title...");
|
||||||
AppResult ret = appDelete(app);
|
AppResult ret = appDelete(app);
|
||||||
@ -249,37 +279,6 @@ int main(int argc, char **argv) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if(netInstall && !exit) {
|
|
||||||
netInstall = false;
|
|
||||||
|
|
||||||
screenClearBuffers(BOTTOM_SCREEN, 0, 0, 0);
|
|
||||||
|
|
||||||
RemoteFile file = uiAcceptRemoteFile(TOP_SCREEN);
|
|
||||||
if(file.fd == NULL) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::stringstream confirmStream;
|
|
||||||
confirmStream << "Install the received application?" << "\n";
|
|
||||||
confirmStream << "Size: " << file.fileSize << " bytes (" << std::fixed << std::setprecision(2) << file.fileSize / 1024.0f / 1024.0f << "MB)" << "\n";
|
|
||||||
if(uiPrompt(TOP_SCREEN, confirmStream.str(), true)) {
|
|
||||||
AppResult ret = appInstall(destination, file.fd, file.fileSize, onProgress);
|
|
||||||
std::stringstream resultMsg;
|
|
||||||
resultMsg << "Install ";
|
|
||||||
if(ret == APP_SUCCESS) {
|
|
||||||
resultMsg << "succeeded!";
|
|
||||||
} else {
|
|
||||||
resultMsg << "failed!" << "\n";
|
|
||||||
resultMsg << appGetResultString(ret) << "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
uiPrompt(TOP_SCREEN, resultMsg.str(), false);
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose(file.fd);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(exit) {
|
if(exit) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user