Press Y on net install page to supply your own URL

This commit is contained in:
Huntereb 2019-10-26 17:00:55 -04:00
parent 515cca1270
commit f91a0104ff
2 changed files with 24 additions and 0 deletions

View file

@ -175,6 +175,10 @@ namespace netInstStuff{
{ {
break; break;
} }
if (kDown & KEY_Y)
{
return {"supplyUrl"};
}
struct sockaddr_in client; struct sockaddr_in client;
socklen_t clientLen = sizeof(client); socklen_t clientLen = sizeof(client);

View file

@ -34,6 +34,26 @@ namespace inst::ui {
if (!ourUrls.size()) { if (!ourUrls.size()) {
mainApp->LoadLayout(mainApp->mainPage); mainApp->LoadLayout(mainApp->mainPage);
return; return;
} else if (ourUrls[0] == "supplyUrl") {
Result rc=0;
SwkbdConfig kbd;
char tmpoutstr[128] = {0};
rc = swkbdCreate(&kbd, 0);
if (R_SUCCEEDED(rc)) {
swkbdConfigMakePresetDefault(&kbd);
swkbdConfigSetInitialText(&kbd, "http://");
rc = swkbdShow(&kbd, tmpoutstr, sizeof(tmpoutstr));
swkbdClose(&kbd);
if (R_SUCCEEDED(rc) && (tmpoutstr[0] != 0 || tmpoutstr != "http://")) {
ourUrls[0] = tmpoutstr;
this->pageInfoText->SetText(ourUrls[0]);
netInstPage::startInstall();
return;
} else {
mainApp->LoadLayout(mainApp->mainPage);
return;
}
}
} else { } else {
this->pageInfoText->SetText("Select a NSP to install! Press B to cancel!"); this->pageInfoText->SetText("Select a NSP to install! Press B to cancel!");
for (auto& url: ourUrls) { for (auto& url: ourUrls) {