add url max file limit option

This commit is contained in:
mrdude2478 2023-09-08 03:11:50 +01:00
parent aa7d7bed4c
commit 777c39d84d
13 changed files with 101 additions and 34 deletions

View File

@ -22,6 +22,7 @@ namespace inst::config {
extern bool gayMode; extern bool gayMode;
extern bool useSound; extern bool useSound;
extern bool fixticket; extern bool fixticket;
extern bool listoveride;
extern bool httpkeyboard; extern bool httpkeyboard;
void setConfig(); void setConfig();

View File

@ -54,7 +54,9 @@
"hint": "Gebe eine URL zu einer Datei ein", "hint": "Gebe eine URL zu einer Datei ein",
"invalid": "Die eingegebene URL ist ungültig", "invalid": "Die eingegebene URL ist ungültig",
"nolinks": "No XCI, XCZ, NSP, NSZ links found!\nDid you use the correct URL?", "nolinks": "No XCI, XCZ, NSP, NSZ links found!\nDid you use the correct URL?",
"source_string": " per URL" "source_string": " per URL",
"listwait": "Populating the list from a url can take some time.\nThe list default limit is purposely set to ",
"listwait2": " items.\nPress OK to load the list."
}, },
"gdrive": { "gdrive": {
"hint": "Gebe die ID einer öffentlichen Google Drive Datei ein", "hint": "Gebe die ID einer öffentlichen Google Drive Datei ein",
@ -178,6 +180,7 @@
"gay_option": "Design verwenden", "gay_option": "Design verwenden",
"useSound": "Nutzen von Benachrichtungstönen während Installation", "useSound": "Nutzen von Benachrichtungstönen während Installation",
"fixticket": "Convert temporary tickets to permanent", "fixticket": "Convert temporary tickets to permanent",
"listoveride": "Disable URL list warning and file limit",
"usehttpkeyboard": "Use keyboard during http server installs", "usehttpkeyboard": "Use keyboard during http server installs",
"sig_url": "Signatur Patches URL: ", "sig_url": "Signatur Patches URL: ",
"http_url": "Http server source URL: ", "http_url": "Http server source URL: ",

View File

@ -54,7 +54,9 @@
"hint": "Enter the Internet address of a file", "hint": "Enter the Internet address of a file",
"invalid": "The URL specified is invalid!", "invalid": "The URL specified is invalid!",
"nolinks": "No XCI, XCZ, NSP, NSZ links found!\nDid you use the correct URL?", "nolinks": "No XCI, XCZ, NSP, NSZ links found!\nDid you use the correct URL?",
"source_string": " from URL" "source_string": " from URL",
"listwait": "Populating the list from a url can take some time.\nThe list default limit is purposely set to ",
"listwait2": " items.\nPress OK to load the list."
}, },
"gdrive": { "gdrive": {
"hint": "Enter the file ID of a public Google Drive file", "hint": "Enter the file ID of a public Google Drive file",
@ -178,6 +180,7 @@
"gay_option": "Use Theme", "gay_option": "Use Theme",
"useSound": "Use sound notifications during installs", "useSound": "Use sound notifications during installs",
"fixticket": "Convert temporary tickets to permanent", "fixticket": "Convert temporary tickets to permanent",
"listoveride": "Disable URL list warning and file limit",
"usehttpkeyboard": "Use keyboard during http server installs", "usehttpkeyboard": "Use keyboard during http server installs",
"sig_url": "Signature patches source URL: ", "sig_url": "Signature patches source URL: ",
"http_url": "Http server source URL: ", "http_url": "Http server source URL: ",

View File

@ -54,7 +54,9 @@
"hint": "Ingrese la dirección de Internet de un archivo", "hint": "Ingrese la dirección de Internet de un archivo",
"invalid": "¡La URL especificada no es válida!", "invalid": "¡La URL especificada no es válida!",
"nolinks": "No XCI, XCZ, NSP, NSZ links found!\nDid you use the correct URL?", "nolinks": "No XCI, XCZ, NSP, NSZ links found!\nDid you use the correct URL?",
"source_string": "desde la URL" "source_string": "desde la URL",
"listwait": "Populating the list from a url can take some time.\nThe list default limit is purposely set to ",
"listwait2": " items.\nPress OK to load the list."
}, },
"gdrive": { "gdrive": {
"hint": "Introduce el ID de un archivo público de Google Drive", "hint": "Introduce el ID de un archivo público de Google Drive",
@ -178,6 +180,7 @@
"gay_option": "Usar tema", "gay_option": "Usar tema",
"useSound": "Usar notificaciones de sonido durante las instalaciones", "useSound": "Usar notificaciones de sonido durante las instalaciones",
"fixticket": "Convert temporary tickets to permanent", "fixticket": "Convert temporary tickets to permanent",
"listoveride": "Disable URL list warning and file limit",
"usehttpkeyboard": "Use keyboard during http server installs", "usehttpkeyboard": "Use keyboard during http server installs",
"sig_url": "URL de origen de parches de firma: ", "sig_url": "URL de origen de parches de firma: ",
"http_url": "Http server source URL: ", "http_url": "Http server source URL: ",

View File

@ -54,7 +54,9 @@
"hint": "Entrez l'URL d'un fichier", "hint": "Entrez l'URL d'un fichier",
"invalid": "L'URL spécifiée n'est pas valide !", "invalid": "L'URL spécifiée n'est pas valide !",
"nolinks": "No XCI, XCZ, NSP, NSZ links found!\nDid you use the correct URL?", "nolinks": "No XCI, XCZ, NSP, NSZ links found!\nDid you use the correct URL?",
"source_string": " à partir d'un URL" "source_string": " à partir d'un URL",
"listwait": "Populating the list from a url can take some time.\nThe list default limit is purposely set to ",
"listwait2": " items.\nPress OK to load the list."
}, },
"gdrive": { "gdrive": {
"hint": "Saisissez l'ID d'un fichier Google Drive public", "hint": "Saisissez l'ID d'un fichier Google Drive public",
@ -178,6 +180,7 @@
"gay_option": "Utiliser le thème", "gay_option": "Utiliser le thème",
"useSound": "Utiliser les notifications sonores lors des installations", "useSound": "Utiliser les notifications sonores lors des installations",
"fixticket": "Convertir des billets temporaires en billets permanents", "fixticket": "Convertir des billets temporaires en billets permanents",
"listoveride": "Disable URL list warning and file limit",
"usehttpkeyboard": "Utiliser le clavier lors des installations du serveur http", "usehttpkeyboard": "Utiliser le clavier lors des installations du serveur http",
"sig_url": "Patchs de signatures URL: ", "sig_url": "Patchs de signatures URL: ",
"http_url": "URL source du serveur HTTP: ", "http_url": "URL source du serveur HTTP: ",

View File

@ -54,7 +54,9 @@
"hint": "Inserisci l'URL del file", "hint": "Inserisci l'URL del file",
"invalid": "L'URL specificato non è valido!", "invalid": "L'URL specificato non è valido!",
"nolinks": "No XCI, XCZ, NSP, NSZ links found!\nDid you use the correct URL?", "nolinks": "No XCI, XCZ, NSP, NSZ links found!\nDid you use the correct URL?",
"source_string": " da URL" "source_string": " da URL",
"listwait": "Populating the list from a url can take some time.\nThe list default limit is purposely set to ",
"listwait2": " items.\nPress OK to load the list."
}, },
"gdrive": { "gdrive": {
"hint": "Inserisci l'ID di un file pubblico di Google Drive", "hint": "Inserisci l'ID di un file pubblico di Google Drive",
@ -178,6 +180,7 @@
"gay_option": "Usa tema", "gay_option": "Usa tema",
"useSound": "Use sound notifications during installs", "useSound": "Use sound notifications during installs",
"fixticket": "Convert temporary tickets to permanent", "fixticket": "Convert temporary tickets to permanent",
"listoveride": "Disable URL list warning and file limit",
"usehttpkeyboard": "Use keyboard during http server installs", "usehttpkeyboard": "Use keyboard during http server installs",
"sig_url": "Fonte URL SigPatches: ", "sig_url": "Fonte URL SigPatches: ",
"http_url": "Http server source URL: ", "http_url": "Http server source URL: ",

View File

@ -54,7 +54,9 @@
"hint": "ファイルのインターネットアドレスを入力してください", "hint": "ファイルのインターネットアドレスを入力してください",
"invalid": "指定されたURLは無効です", "invalid": "指定されたURLは無効です",
"nolinks": "No XCI, XCZ, NSP, NSZ links found!\nDid you use the correct URL?", "nolinks": "No XCI, XCZ, NSP, NSZ links found!\nDid you use the correct URL?",
"source_string": " URLから" "source_string": " URLから",
"listwait": "Populating the list from a url can take some time.\nThe list default limit is purposely set to ",
"listwait2": " items.\nPress OK to load the list."
}, },
"gdrive": { "gdrive": {
"hint": "Googleドライブの公開ファイルのファイルIDを入力してください", "hint": "Googleドライブの公開ファイルのファイルIDを入力してください",
@ -178,6 +180,7 @@
"gay_option": "テーマを使用する", "gay_option": "テーマを使用する",
"useSound": "インストール時にサウンドで通知する", "useSound": "インストール時にサウンドで通知する",
"fixticket": "Convert temporary tickets to permanent", "fixticket": "Convert temporary tickets to permanent",
"listoveride": "Disable URL list warning and file limit",
"usehttpkeyboard": "Use keyboard during http server installs", "usehttpkeyboard": "Use keyboard during http server installs",
"sig_url": "署名パッチのソースURL: ", "sig_url": "署名パッチのソースURL: ",
"http_url": "Http server source URL: ", "http_url": "Http server source URL: ",

View File

@ -54,7 +54,9 @@
"hint": "Укажите ссылку на файл", "hint": "Укажите ссылку на файл",
"invalid": "Указан неверный URL!", "invalid": "Указан неверный URL!",
"nolinks": "No XCI, XCZ, NSP, NSZ links found!\nDid you use the correct URL?", "nolinks": "No XCI, XCZ, NSP, NSZ links found!\nDid you use the correct URL?",
"source_string": " из URL" "source_string": " из URL",
"listwait": "Populating the list from a url can take some time.\nThe list default limit is purposely set to ",
"listwait2": " items.\nPress OK to load the list."
}, },
"gdrive": { "gdrive": {
"hint": "Введите ID файла из общедоступного Google Drive", "hint": "Введите ID файла из общедоступного Google Drive",
@ -178,6 +180,7 @@
"gay_option": "Использовать тему", "gay_option": "Использовать тему",
"useSound": "Use sound notifications during installs", "useSound": "Use sound notifications during installs",
"fixticket": "Convert temporary tickets to permanent", "fixticket": "Convert temporary tickets to permanent",
"listoveride": "Disable URL list warning and file limit",
"usehttpkeyboard": "Use keyboard during http server installs", "usehttpkeyboard": "Use keyboard during http server installs",
"sig_url": "URL для скачивания Signature patches: ", "sig_url": "URL для скачивания Signature patches: ",
"http_url": "Http server source URL: ", "http_url": "Http server source URL: ",

View File

@ -54,7 +54,9 @@
"hint": "請輸入檔案的URL網路位址", "hint": "請輸入檔案的URL網路位址",
"invalid": "URL網路位址無效", "invalid": "URL網路位址無效",
"nolinks": "No XCI, XCZ, NSP, NSZ links found!\nDid you use the correct URL?", "nolinks": "No XCI, XCZ, NSP, NSZ links found!\nDid you use the correct URL?",
"source_string": "來源為URL" "source_string": "來源為URL",
"listwait": "Populating the list from a url can take some time.\nThe list default limit is purposely set to ",
"listwait2": " items.\nPress OK to load the list."
}, },
"gdrive": { "gdrive": {
"hint": "請輸入Google網路硬碟的共享檔案ID", "hint": "請輸入Google網路硬碟的共享檔案ID",
@ -178,6 +180,7 @@
"gay_option": "套用主題", "gay_option": "套用主題",
"useSound": "在安裝過程中使用音效提醒進度", "useSound": "在安裝過程中使用音效提醒進度",
"fixticket": "Convert temporary tickets to permanent", "fixticket": "Convert temporary tickets to permanent",
"listoveride": "Disable URL list warning and file limit",
"usehttpkeyboard": "Use keyboard during http server installs", "usehttpkeyboard": "Use keyboard during http server installs",
"sig_url": "簽名修補程式來源URL: ", "sig_url": "簽名修補程式來源URL: ",
"http_url": "Http server source URL: ", "http_url": "Http server source URL: ",

View File

@ -101,6 +101,7 @@ namespace netInstStuff {
if (c == '/') new_str += '/'; if (c == '/') new_str += '/';
else if (c == '.') new_str += '.'; else if (c == '.') new_str += '.';
else if (c == ':') new_str += ':'; else if (c == ':') new_str += ':';
else if (c == '\\') new_str += '/'; //windows paths break urls - change the path mod..
else if (isalnum(c) || c == '-' || c == '_' || c == '.' || c == '~') new_str += c; else if (isalnum(c) || c == '-' || c == '_' || c == '.' || c == '~') new_str += c;
else { else {
sprintf(bufHex, "%X", c); sprintf(bufHex, "%X", c);
@ -356,7 +357,10 @@ namespace netInstStuff {
} }
if (kDown & HidNpadButton_Minus) { if (kDown & HidNpadButton_Minus) {
if (std::filesystem::remove("temp.html"));
std::string url; std::string url;
unsigned short maxlist = 50;
unsigned short nowlist = 0;
if (inst::config::httpkeyboard) { if (inst::config::httpkeyboard) {
url = inst::util::softwareKeyboard("inst.net.url.hint"_lang, inst::config::httpIndexUrl, 500); url = inst::util::softwareKeyboard("inst.net.url.hint"_lang, inst::config::httpIndexUrl, 500);
@ -398,7 +402,7 @@ namespace netInstStuff {
} }
if (!response.empty()) { if (!response.empty()) {
if (response[0] == '{') { if (response[0] == '*') {
try { try {
nlohmann::json j = nlohmann::json::parse(response); nlohmann::json j = nlohmann::json::parse(response);
for (const auto& file : j["files"]) { for (const auto& file : j["files"]) {
@ -414,6 +418,9 @@ namespace netInstStuff {
} }
else if (!response.empty()) { else if (!response.empty()) {
std::size_t index = 0; std::size_t index = 0;
if (!inst::config::listoveride) {
inst::ui::mainApp->CreateShowDialog("inst.net.url.listwait"_lang + std::to_string(maxlist) + "inst.net.url.listwait2"_lang, "", { "common.ok"_lang }, false, "romfs:/images/icons/wait.png");
}
while (index < response.size()) { while (index < response.size()) {
std::string link; std::string link;
auto found = findCaseInsensitive(response, "href=\"", index); auto found = findCaseInsensitive(response, "href=\"", index);
@ -429,17 +436,26 @@ namespace netInstStuff {
Try to see if the href links contain http - if not add the own url Try to see if the href links contain http - if not add the own url
defined in the settings page defined in the settings page
*/ */
if (link.find("http") == std::string::npos) { if (!inst::config::listoveride && nowlist >= maxlist) {
std::string before_strip = stripfilename(url); break;
if (link[0] == '/'){
tmp_array.push_back(before_strip + link);
}
else{
tmp_array.push_back(before_strip + "/" + link);
}
} }
else { else {
tmp_array.push_back(link); if (link.find("http") == std::string::npos) {
std::string before_strip = stripfilename(url);
if (link[0] == '/') {
tmp_array.push_back(before_strip + link);
nowlist++;
}
else {
tmp_array.push_back(before_strip + "/" + link);
nowlist++;
}
}
else {
tmp_array.push_back(link);
nowlist++;
}
} }
} }
break; //don't remove this or the net install screen will crash break; //don't remove this or the net install screen will crash

View File

@ -124,57 +124,77 @@ namespace inst::ui {
void optionsPage::setMenuText() { void optionsPage::setMenuText() {
this->menu->ClearItems(); this->menu->ClearItems();
auto ignoreFirmOption = pu::ui::elm::MenuItem::New("options.menu_items.ignore_firm"_lang); auto ignoreFirmOption = pu::ui::elm::MenuItem::New("options.menu_items.ignore_firm"_lang);
ignoreFirmOption->SetColor(COLOR("#FFFFFFFF")); ignoreFirmOption->SetColor(COLOR("#FFFFFFFF"));
ignoreFirmOption->SetIcon(this->getMenuOptionIcon(inst::config::ignoreReqVers)); ignoreFirmOption->SetIcon(this->getMenuOptionIcon(inst::config::ignoreReqVers));
this->menu->AddItem(ignoreFirmOption); this->menu->AddItem(ignoreFirmOption);
auto validateOption = pu::ui::elm::MenuItem::New("options.menu_items.nca_verify"_lang); auto validateOption = pu::ui::elm::MenuItem::New("options.menu_items.nca_verify"_lang);
validateOption->SetColor(COLOR("#FFFFFFFF")); validateOption->SetColor(COLOR("#FFFFFFFF"));
validateOption->SetIcon(this->getMenuOptionIcon(inst::config::validateNCAs)); validateOption->SetIcon(this->getMenuOptionIcon(inst::config::validateNCAs));
this->menu->AddItem(validateOption); this->menu->AddItem(validateOption);
auto overclockOption = pu::ui::elm::MenuItem::New("options.menu_items.boost_mode"_lang); auto overclockOption = pu::ui::elm::MenuItem::New("options.menu_items.boost_mode"_lang);
overclockOption->SetColor(COLOR("#FFFFFFFF")); overclockOption->SetColor(COLOR("#FFFFFFFF"));
overclockOption->SetIcon(this->getMenuOptionIcon(inst::config::overClock)); overclockOption->SetIcon(this->getMenuOptionIcon(inst::config::overClock));
this->menu->AddItem(overclockOption); this->menu->AddItem(overclockOption);
auto deletePromptOption = pu::ui::elm::MenuItem::New("options.menu_items.ask_delete"_lang); auto deletePromptOption = pu::ui::elm::MenuItem::New("options.menu_items.ask_delete"_lang);
deletePromptOption->SetColor(COLOR("#FFFFFFFF")); deletePromptOption->SetColor(COLOR("#FFFFFFFF"));
deletePromptOption->SetIcon(this->getMenuOptionIcon(inst::config::deletePrompt)); deletePromptOption->SetIcon(this->getMenuOptionIcon(inst::config::deletePrompt));
this->menu->AddItem(deletePromptOption); this->menu->AddItem(deletePromptOption);
auto autoUpdateOption = pu::ui::elm::MenuItem::New("options.menu_items.auto_update"_lang); auto autoUpdateOption = pu::ui::elm::MenuItem::New("options.menu_items.auto_update"_lang);
autoUpdateOption->SetColor(COLOR("#FFFFFFFF")); autoUpdateOption->SetColor(COLOR("#FFFFFFFF"));
autoUpdateOption->SetIcon(this->getMenuOptionIcon(inst::config::autoUpdate)); autoUpdateOption->SetIcon(this->getMenuOptionIcon(inst::config::autoUpdate));
this->menu->AddItem(autoUpdateOption); this->menu->AddItem(autoUpdateOption);
auto gayModeOption = pu::ui::elm::MenuItem::New("options.menu_items.gay_option"_lang); auto gayModeOption = pu::ui::elm::MenuItem::New("options.menu_items.gay_option"_lang);
gayModeOption->SetColor(COLOR("#FFFFFFFF")); gayModeOption->SetColor(COLOR("#FFFFFFFF"));
gayModeOption->SetIcon(this->getMenuOptionIcon(inst::config::gayMode)); gayModeOption->SetIcon(this->getMenuOptionIcon(inst::config::gayMode));
this->menu->AddItem(gayModeOption); this->menu->AddItem(gayModeOption);
auto useSoundOption = pu::ui::elm::MenuItem::New("options.menu_items.useSound"_lang); auto useSoundOption = pu::ui::elm::MenuItem::New("options.menu_items.useSound"_lang);
useSoundOption->SetColor(COLOR("#FFFFFFFF")); useSoundOption->SetColor(COLOR("#FFFFFFFF"));
useSoundOption->SetIcon(this->getMenuOptionIcon(inst::config::useSound)); useSoundOption->SetIcon(this->getMenuOptionIcon(inst::config::useSound));
this->menu->AddItem(useSoundOption); this->menu->AddItem(useSoundOption);
auto fixticket = pu::ui::elm::MenuItem::New("options.menu_items.fixticket"_lang); auto fixticket = pu::ui::elm::MenuItem::New("options.menu_items.fixticket"_lang);
fixticket->SetColor(COLOR("#FFFFFFFF")); fixticket->SetColor(COLOR("#FFFFFFFF"));
fixticket->SetIcon(this->getMenuOptionIcon(inst::config::fixticket)); fixticket->SetIcon(this->getMenuOptionIcon(inst::config::fixticket));
this->menu->AddItem(fixticket); this->menu->AddItem(fixticket);
auto listoveride = pu::ui::elm::MenuItem::New("options.menu_items.listoveride"_lang);
listoveride->SetColor(COLOR("#FFFFFFFF"));
listoveride->SetIcon(this->getMenuOptionIcon(inst::config::listoveride));
this->menu->AddItem(listoveride);
auto httpkeyboard = pu::ui::elm::MenuItem::New("options.menu_items.usehttpkeyboard"_lang); auto httpkeyboard = pu::ui::elm::MenuItem::New("options.menu_items.usehttpkeyboard"_lang);
httpkeyboard->SetColor(COLOR("#FFFFFFFF")); httpkeyboard->SetColor(COLOR("#FFFFFFFF"));
httpkeyboard->SetIcon(this->getMenuOptionIcon(inst::config::httpkeyboard)); httpkeyboard->SetIcon(this->getMenuOptionIcon(inst::config::httpkeyboard));
this->menu->AddItem(httpkeyboard); this->menu->AddItem(httpkeyboard);
auto SigPatch = pu::ui::elm::MenuItem::New("main.menu.sig"_lang); auto SigPatch = pu::ui::elm::MenuItem::New("main.menu.sig"_lang);
SigPatch->SetColor(COLOR("#FFFFFFFF")); SigPatch->SetColor(COLOR("#FFFFFFFF"));
this->menu->AddItem(SigPatch); this->menu->AddItem(SigPatch);
auto sigPatchesUrlOption = pu::ui::elm::MenuItem::New("options.menu_items.sig_url"_lang + inst::util::shortenString(inst::config::sigPatchesUrl, 42, false)); auto sigPatchesUrlOption = pu::ui::elm::MenuItem::New("options.menu_items.sig_url"_lang + inst::util::shortenString(inst::config::sigPatchesUrl, 42, false));
sigPatchesUrlOption->SetColor(COLOR("#FFFFFFFF")); sigPatchesUrlOption->SetColor(COLOR("#FFFFFFFF"));
this->menu->AddItem(sigPatchesUrlOption); this->menu->AddItem(sigPatchesUrlOption);
auto httpServerUrlOption = pu::ui::elm::MenuItem::New("options.menu_items.http_url"_lang + inst::util::shortenString(inst::config::httpIndexUrl, 42, false)); auto httpServerUrlOption = pu::ui::elm::MenuItem::New("options.menu_items.http_url"_lang + inst::util::shortenString(inst::config::httpIndexUrl, 42, false));
httpServerUrlOption->SetColor(COLOR("#FFFFFFFF")); httpServerUrlOption->SetColor(COLOR("#FFFFFFFF"));
this->menu->AddItem(httpServerUrlOption); this->menu->AddItem(httpServerUrlOption);
auto languageOption = pu::ui::elm::MenuItem::New("options.menu_items.language"_lang + this->getMenuLanguage(inst::config::languageSetting)); auto languageOption = pu::ui::elm::MenuItem::New("options.menu_items.language"_lang + this->getMenuLanguage(inst::config::languageSetting));
languageOption->SetColor(COLOR("#FFFFFFFF")); languageOption->SetColor(COLOR("#FFFFFFFF"));
this->menu->AddItem(languageOption); this->menu->AddItem(languageOption);
auto updateOption = pu::ui::elm::MenuItem::New("options.menu_items.check_update"_lang); auto updateOption = pu::ui::elm::MenuItem::New("options.menu_items.check_update"_lang);
updateOption->SetColor(COLOR("#FFFFFFFF")); updateOption->SetColor(COLOR("#FFFFFFFF"));
this->menu->AddItem(updateOption); this->menu->AddItem(updateOption);
auto creditsOption = pu::ui::elm::MenuItem::New("options.menu_items.credits"_lang); auto creditsOption = pu::ui::elm::MenuItem::New("options.menu_items.credits"_lang);
creditsOption->SetColor(COLOR("#FFFFFFFF")); creditsOption->SetColor(COLOR("#FFFFFFFF"));
this->menu->AddItem(creditsOption); this->menu->AddItem(creditsOption);
@ -269,7 +289,6 @@ namespace inst::ui {
thememessage(); thememessage();
inst::config::setConfig(); inst::config::setConfig();
break; break;
case 6: case 6:
if (inst::config::useSound) { if (inst::config::useSound) {
inst::config::useSound = false; inst::config::useSound = false;
@ -281,7 +300,6 @@ namespace inst::ui {
this->menu->SetSelectedIndex(index); this->menu->SetSelectedIndex(index);
inst::config::setConfig(); inst::config::setConfig();
break; break;
case 7: case 7:
if (inst::config::fixticket) { if (inst::config::fixticket) {
inst::config::fixticket = false; inst::config::fixticket = false;
@ -293,8 +311,18 @@ namespace inst::ui {
this->menu->SetSelectedIndex(index); this->menu->SetSelectedIndex(index);
inst::config::setConfig(); inst::config::setConfig();
break; break;
case 8: case 8:
if (inst::config::listoveride) {
inst::config::listoveride = false;
}
else {
inst::config::listoveride = true;
}
this->setMenuText();
this->menu->SetSelectedIndex(index);
inst::config::setConfig();
break;
case 9:
if (inst::config::httpkeyboard) { if (inst::config::httpkeyboard) {
inst::config::httpkeyboard = false; inst::config::httpkeyboard = false;
} }
@ -305,12 +333,10 @@ namespace inst::ui {
this->menu->SetSelectedIndex(index); this->menu->SetSelectedIndex(index);
inst::config::setConfig(); inst::config::setConfig();
break; break;
case 10:
case 9:
sigPatchesMenuItem_Click(); sigPatchesMenuItem_Click();
break; break;
case 11:
case 10:
keyboardResult = inst::util::softwareKeyboard("options.sig_hint"_lang, inst::config::sigPatchesUrl.c_str(), 500); keyboardResult = inst::util::softwareKeyboard("options.sig_hint"_lang, inst::config::sigPatchesUrl.c_str(), 500);
if (keyboardResult.size() > 0) { if (keyboardResult.size() > 0) {
inst::config::sigPatchesUrl = keyboardResult; inst::config::sigPatchesUrl = keyboardResult;
@ -319,8 +345,7 @@ namespace inst::ui {
this->menu->SetSelectedIndex(index); this->menu->SetSelectedIndex(index);
} }
break; break;
case 12:
case 11:
keyboardResult = inst::util::softwareKeyboard("inst.net.url.hint"_lang, inst::config::httpIndexUrl.c_str(), 500); keyboardResult = inst::util::softwareKeyboard("inst.net.url.hint"_lang, inst::config::httpIndexUrl.c_str(), 500);
if (keyboardResult.size() > 0) { if (keyboardResult.size() > 0) {
inst::config::httpIndexUrl = keyboardResult; inst::config::httpIndexUrl = keyboardResult;
@ -329,8 +354,7 @@ namespace inst::ui {
this->menu->SetSelectedIndex(index); this->menu->SetSelectedIndex(index);
} }
break; break;
case 13:
case 12:
languageList = languageStrings; languageList = languageStrings;
languageList.push_back("options.language.system_language"_lang); languageList.push_back("options.language.system_language"_lang);
rc = inst::ui::mainApp->CreateShowDialog("options.language.title"_lang, "options.language.desc"_lang, languageList, false, flag ); rc = inst::ui::mainApp->CreateShowDialog("options.language.title"_lang, "options.language.desc"_lang, languageList, false, flag );
@ -367,7 +391,7 @@ namespace inst::ui {
mainApp->FadeOut(); mainApp->FadeOut();
mainApp->Close(); mainApp->Close();
break; break;
case 13: case 14:
if (inst::util::getIPAddress() == "1.0.0.127") { if (inst::util::getIPAddress() == "1.0.0.127") {
inst::ui::mainApp->CreateShowDialog("main.net.title"_lang, "main.net.desc"_lang, { "common.ok"_lang }, true, "romfs:/images/icons/update.png"); inst::ui::mainApp->CreateShowDialog("main.net.title"_lang, "main.net.desc"_lang, { "common.ok"_lang }, true, "romfs:/images/icons/update.png");
break; break;
@ -379,7 +403,7 @@ namespace inst::ui {
} }
this->askToUpdate(downloadUrl); this->askToUpdate(downloadUrl);
break; break;
case 14: case 15:
inst::ui::mainApp->CreateShowDialog("options.credits.title"_lang, "options.credits.desc"_lang, { "common.close"_lang }, true, "romfs:/images/icons/credits.png"); inst::ui::mainApp->CreateShowDialog("options.credits.title"_lang, "options.credits.desc"_lang, { "common.close"_lang }, true, "romfs:/images/icons/credits.png");
break; break;
default: default:

View File

@ -19,6 +19,7 @@ namespace inst::config {
bool usbAck; bool usbAck;
bool validateNCAs; bool validateNCAs;
bool fixticket; bool fixticket;
bool listoveride;
bool httpkeyboard; bool httpkeyboard;
void setConfig() { void setConfig() {
@ -37,6 +38,7 @@ namespace inst::config {
{"httpIndexUrl", httpIndexUrl}, {"httpIndexUrl", httpIndexUrl},
{"httplastUrl", httplastUrl}, {"httplastUrl", httplastUrl},
{"fixticket", fixticket}, {"fixticket", fixticket},
{"listoveride", listoveride},
{"httpkeyboard", httpkeyboard} {"httpkeyboard", httpkeyboard}
}; };
std::ofstream file(inst::config::configPath); std::ofstream file(inst::config::configPath);
@ -50,6 +52,7 @@ namespace inst::config {
file >> j; file >> j;
autoUpdate = j["autoUpdate"].get<bool>(); autoUpdate = j["autoUpdate"].get<bool>();
fixticket = j["fixticket"].get<bool>(); fixticket = j["fixticket"].get<bool>();
listoveride = j["listoveride"].get<bool>();
httpkeyboard = j["httpkeyboard"].get<bool>(); httpkeyboard = j["httpkeyboard"].get<bool>();
deletePrompt = j["deletePrompt"].get<bool>(); deletePrompt = j["deletePrompt"].get<bool>();
gAuthKey = j["gAuthKey"].get<std::string>(); gAuthKey = j["gAuthKey"].get<std::string>();
@ -76,6 +79,7 @@ namespace inst::config {
gayMode = false; gayMode = false;
useSound = true; useSound = true;
fixticket = true; fixticket = true;
listoveride = false;
httpkeyboard = false; httpkeyboard = false;
ignoreReqVers = true; ignoreReqVers = true;
overClock = true; overClock = true;

View File

@ -126,8 +126,6 @@ namespace inst::curl {
} }
std::string html_to_buffer(const std::string ourUrl) { std::string html_to_buffer(const std::string ourUrl) {
//best to remove "temp.html if it already exists!"
if (std::filesystem::remove("temp.html"));
CURL* curl; CURL* curl;
FILE* fp; FILE* fp;
CURLcode res{}; CURLcode res{};