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

[BUG_FIXED] Fix file status auto-detection settings.
pull/16/merge
Don HO 10 years ago
commit 4ab13f02cb

@ -906,15 +906,26 @@ BOOL CALLBACK SettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
case IDC_CHECK_FILEAUTODETECTION: case IDC_CHECK_FILEAUTODETECTION:
{ {
bool isChecked = isCheckedOrNot(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_UPDATESILENTLY), isChecked);
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_UPDATEGOTOEOF), 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; return TRUE;

Loading…
Cancel
Save