Save settings before restart, and check the value afterwards

Must not be "", else keep the toggle disabled.
This commit is contained in:
Kawe Mazidjatari 2023-10-29 23:17:56 +01:00
parent c87ee1b81d
commit 69c6de4638

View File

@ -228,7 +228,10 @@ void CBaseSurface::LoadSettings()
return;
attributeView = pSubKey->attribs["experimentalBuilds"];
this->m_ExperimentalBuildsCheckbox->SetChecked(attributeView != "0");
// Make sure it at least has a value.
if (!attributeView.empty())
this->m_ExperimentalBuildsCheckbox->SetChecked(attributeView != "0");
}
catch (const std::exception& e)
{
@ -293,7 +296,7 @@ void CBaseSurface::SaveSettings()
void CBaseSurface::OnUpdateClick(Forms::Control* Sender)
{
//CBaseSurface* pSurf = (CBaseSurface*)Sender;
CBaseSurface* pSurf = (CBaseSurface*)Sender->FindForm();
vector<HWND> vecHandles;
EnumWindows(EnumWindowsProc, reinterpret_cast<LPARAM>(&vecHandles));
@ -339,7 +342,8 @@ void CBaseSurface::OnUpdateClick(Forms::Control* Sender)
pProgress->ShowDialog();
// Restart the launcher process from here through updater.exe!
// Save settings and restart the launcher process from here through updater.exe!
pSurf->SaveSettings();
SDKLauncher_Restart();
}