Merge pull request #52 from oneill/fix-auto-detect-settings

[BUG_FIXED] Fix file status auto-detection settings.
This commit is contained in:
Don HO 2015-05-12 10:40:56 +02:00
commit 4ab13f02cb

View File

@ -906,15 +906,26 @@ BOOL CALLBACK SettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
case IDC_CHECK_FILEAUTODETECTION:
{
bool isChecked = isCheckedOrNot(IDC_CHECK_FILEAUTODETECTION);
if (!isChecked)
{
::SendDlgItemMessage(_hSelf, IDC_CHECK_UPDATESILENTLY, BM_SETCHECK, BST_UNCHECKED, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_UPDATEGOTOEOF, BM_SETCHECK, BST_UNCHECKED, 0);
}
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_UPDATESILENTLY), isChecked);
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_UPDATEGOTOEOF), isChecked);
nppGUI._fileAutoDetection = isChecked?cdAutoUpdate:cdDisabled;
bool isSilent = isCheckedOrNot(IDC_CHECK_UPDATESILENTLY);
bool isGo2End = isCheckedOrNot(IDC_CHECK_UPDATEGOTOEOF);
ChangeDetect cd;
if (!isChecked)
cd = cdDisabled;
else if (!isSilent && !isGo2End)
cd = cdEnabled;
else if (!isSilent && isGo2End)
cd = cdGo2end;
else if (isSilent && !isGo2End)
cd = cdAutoUpdate;
else //(isSilent && isGo2End)
cd = cdAutoUpdateGo2end;
nppGUI._fileAutoDetection = cd;
}
return TRUE;