From d98232b76e7555118d97d48d5546ea39e9ab3d9f Mon Sep 17 00:00:00 2001 From: "oneill@users.noreply.github.com" Date: Tue, 12 May 2015 01:24:16 +0200 Subject: [PATCH 1/2] Fix the file status auto-detection setting not being set correctly --- .../WinControls/Preference/preferenceDlg.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 3c6283798..0d3f52cc9 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -914,7 +914,23 @@ BOOL CALLBACK SettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) ::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; From cf0f8df7a8f4f3137b0f643d4335c283be91200a Mon Sep 17 00:00:00 2001 From: "oneill@users.noreply.github.com" Date: Tue, 12 May 2015 01:28:00 +0200 Subject: [PATCH 2/2] Retain field values when disabling status auto-detection --- PowerEditor/src/WinControls/Preference/preferenceDlg.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 0d3f52cc9..150703e5f 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -906,11 +906,6 @@ 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);