Skip to content

Commit 68379f4

Browse files
thisismy-githubIbuprophen
authored andcommitted
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.
1 parent daa1d96 commit 68379f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Src/Lib/Settings.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1713,6 +1713,7 @@ LRESULT CSettingsDlg::OnBackup( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL&
17131713
ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR;
17141714
if (GetOpenFileName(&ofn))
17151715
{
1716+
SetCurTab(m_Index,true); // reload tab once to force-close any active edit boxes
17161717
CString error=g_SettingsManager.LoadSettingsXml(path);
17171718
if (!error.IsEmpty())
17181719
{
@@ -1722,7 +1723,7 @@ LRESULT CSettingsDlg::OnBackup( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL&
17221723
::MessageBox(m_hWnd,text,LoadStringEx(IDS_ERROR_TITLE),MB_OK|MB_ICONERROR);
17231724
}
17241725
SetSettingsDirty();
1725-
SetCurTab(m_Index,true);
1726+
SetCurTab(m_Index,true); // reload tab again to show the new settings
17261727
}
17271728
}
17281729
if (res==3)

0 commit comments

Comments
 (0)