diff --git a/src/Config/Config.cpp b/src/Config/Config.cpp index c1b294dc5..2a10f2c39 100644 --- a/src/Config/Config.cpp +++ b/src/Config/Config.cpp @@ -1726,6 +1726,7 @@ void LoadSettings() GET_BOOL_VALUE_FROM_INISECTION(SaveBeforeRunningTools, false); GET_BOOL_VALUE_FROM_INISECTION(EvalTinyExprOnSelection, true); GET_BOOL_VALUE_FROM_INISECTION(ResetFileWatching, true); + GET_BOOL_VALUE_FROM_INISECTION(MonitoringLog, false); // View -> Monitoring Log - fixes #5037 GET_INT_VALUE_FROM_INISECTION(EscFunction, 0, 0, 2); GET_BOOL_VALUE_FROM_INISECTION(AlwaysOnTop, false); if (Globals.CmdLnFlag_AlwaysOnTop) { Settings.AlwaysOnTop = (Globals.CmdLnFlag_AlwaysOnTop == 2); } @@ -2148,6 +2149,8 @@ static bool _SaveSettings(bool bForceSaveSettings) if (bForceSaveSettings) { Settings.FileWatchingMode = FileWatching.FileWatchingMode; } SAVE_VALUE_IF_NOT_EQ_DEFAULT(Int, FileWatchingMode); SAVE_VALUE_IF_NOT_EQ_DEFAULT(Bool, ResetFileWatching); + if (bForceSaveSettings) { Settings.MonitoringLog = FileWatching.MonitoringLog; } // fixes #5037 + SAVE_VALUE_IF_NOT_EQ_DEFAULT(Bool, MonitoringLog); SAVE_VALUE_IF_NOT_EQ_DEFAULT(Int, AutoSaveInterval); SAVE_VALUE_IF_NOT_EQ_DEFAULT(Int, AutoSaveOptions); diff --git a/src/Notepad3.c b/src/Notepad3.c index f70db7d6d..f3c06f2d9 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -1947,6 +1947,9 @@ HWND InitInstance(const HINSTANCE hInstance, int nCmdShow) break; } + // Restore saved Monitoring Log setting - fixes #5037 + FileWatching.MonitoringLog = Settings.MonitoringLog; + // initial set text in front of ShowWindow() EditSetNewText(Globals.hwndEdit, "", 0, false, false); diff --git a/src/TypeDefs.h b/src/TypeDefs.h index 2092748cd..2576f7c4f 100644 --- a/src/TypeDefs.h +++ b/src/TypeDefs.h @@ -643,6 +643,7 @@ typedef struct SETTINGS_T { bool EvalTinyExprOnSelection; FILE_WATCHING_MODE FileWatchingMode; bool ResetFileWatching; + bool MonitoringLog; // View -> Monitoring Log setting - fixes #5037 int EscFunction; bool AlwaysOnTop; bool MinimizeToTray; diff --git a/todo/TODO.md b/todo/TODO.md index 6c170f4d2..5e9a426b5 100644 --- a/todo/TODO.md +++ b/todo/TODO.md @@ -39,8 +39,9 @@ - Old bug from v5.21 - needs verification - [ ] **(Q2) BUG: Minipath options don't save** - FullRowSelect/TrackSelect broken - Issue: [#4116](https://github.com/rizonesoft/Notepad3/issues/4116) -- [ ] **(Q1) BUG: Monitoring log not saved** - Setting not persisted +- [x] **(Q1) BUG: Monitoring log not saved** - ✅ FIXED - Issue: [#5037](https://github.com/rizonesoft/Notepad3/issues/5037) + - Fix: Added `MonitoringLog` to Settings struct with INI load/save in Config.cpp - [ ] **(Q3) BUG: LAN file freeze** - Freezes when network host offline - Issue: [#5050](https://github.com/rizonesoft/Notepad3/issues/5050) - [ ] **(Q1) BUG: Find/Replace patterns not updating** - Dropdown not refreshed immediately