mirror of
https://github.com/Huntereb/Awoo-Installer
synced 2024-11-22 03:33:05 +00:00
Save URLs from previous net installations
This commit is contained in:
parent
447226e955
commit
b181a9183c
3 changed files with 9 additions and 4 deletions
|
@ -9,6 +9,7 @@ namespace inst::config {
|
|||
|
||||
extern std::string gAuthKey;
|
||||
extern std::string sigPatchesUrl;
|
||||
extern std::string lastNetUrl;
|
||||
extern std::vector<std::string> updateInfo;
|
||||
extern int languageSetting;
|
||||
extern bool ignoreReqVers;
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
namespace inst::ui {
|
||||
extern MainApplication *mainApp;
|
||||
|
||||
std::string lastUrl = "https://";
|
||||
std::string lastFileID = "";
|
||||
std::string sourceString = "";
|
||||
|
||||
|
@ -88,13 +87,14 @@ namespace inst::ui {
|
|||
std::string keyboardResult;
|
||||
switch (mainApp->CreateShowDialog("inst.net.src.title"_lang, "common.cancel_desc"_lang, {"inst.net.src.opt0"_lang, "inst.net.src.opt1"_lang}, false)) {
|
||||
case 0:
|
||||
keyboardResult = inst::util::softwareKeyboard("inst.net.url.hint"_lang, lastUrl, 500);
|
||||
keyboardResult = inst::util::softwareKeyboard("inst.net.url.hint"_lang, inst::config::lastNetUrl, 500);
|
||||
if (keyboardResult.size() > 0) {
|
||||
lastUrl = keyboardResult;
|
||||
if (inst::util::formatUrlString(keyboardResult) == "" || keyboardResult == "https://" || keyboardResult == "http://") {
|
||||
mainApp->CreateShowDialog("inst.net.url.invalid"_lang, "", {"common.ok"_lang}, false);
|
||||
break;
|
||||
}
|
||||
inst::config::lastNetUrl = keyboardResult;
|
||||
inst::config::setConfig();
|
||||
sourceString = "inst.net.url.source_string"_lang;
|
||||
this->selectedUrls = {keyboardResult};
|
||||
this->startInstall(true);
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
namespace inst::config {
|
||||
std::string gAuthKey;
|
||||
std::string sigPatchesUrl;
|
||||
std::string lastNetUrl;
|
||||
std::vector<std::string> updateInfo;
|
||||
int languageSetting;
|
||||
bool autoUpdate;
|
||||
|
@ -27,7 +28,8 @@ namespace inst::config {
|
|||
{"overClock", overClock},
|
||||
{"sigPatchesUrl", sigPatchesUrl},
|
||||
{"usbAck", usbAck},
|
||||
{"validateNCAs", validateNCAs}
|
||||
{"validateNCAs", validateNCAs},
|
||||
{"lastNetUrl", lastNetUrl}
|
||||
};
|
||||
std::ofstream file(inst::config::configPath);
|
||||
file << std::setw(4) << j << std::endl;
|
||||
|
@ -48,6 +50,7 @@ namespace inst::config {
|
|||
sigPatchesUrl = j["sigPatchesUrl"].get<std::string>();
|
||||
usbAck = j["usbAck"].get<bool>();
|
||||
validateNCAs = j["validateNCAs"].get<bool>();
|
||||
lastNetUrl = j["lastNetUrl"].get<std::string>();
|
||||
}
|
||||
catch (...) {
|
||||
// If loading values from the config fails, we just load the defaults and overwrite the old config
|
||||
|
@ -61,6 +64,7 @@ namespace inst::config {
|
|||
overClock = false;
|
||||
usbAck = false;
|
||||
validateNCAs = true;
|
||||
lastNetUrl = "https://";
|
||||
setConfig();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue