Fixed bug between XML files and active edit boxes

When loading XML files, settings with active edit boxes open will not be
adjusted. This adds an additional tab-reload before the load begins to
forcibly close any active edit boxes.
This commit is contained in:
thisismy-github
2021-08-12 15:31:42 -04:00
committed by Ibuprophen
parent daa1d96f12
commit 68379f4098

View File

@@ -1713,6 +1713,7 @@ LRESULT CSettingsDlg::OnBackup( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL&
ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR;
if (GetOpenFileName(&ofn))
{
SetCurTab(m_Index,true); // reload tab once to force-close any active edit boxes
CString error=g_SettingsManager.LoadSettingsXml(path);
if (!error.IsEmpty())
{
@@ -1722,7 +1723,7 @@ LRESULT CSettingsDlg::OnBackup( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL&
::MessageBox(m_hWnd,text,LoadStringEx(IDS_ERROR_TITLE),MB_OK|MB_ICONERROR);
}
SetSettingsDirty();
SetCurTab(m_Index,true);
SetCurTab(m_Index,true); // reload tab again to show the new settings
}
}
if (res==3)