From a75602aa089e9a119764187484c8fcb775750231 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 17 Jul 2024 22:40:21 +0200 Subject: [PATCH] installer: hide the "experimental" FSMonitor setting by default Seeing a disabled option that the user never enabled may be quite confusing. So maybe just disabling it may be desirable only in scenarios where users had enabled it? So let's in fact not even show the FSMonitor option unless the user is upgrading and had the option checked in the previous run. Signed-off-by: Johannes Schindelin --- installer/install.iss | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/installer/install.iss b/installer/install.iss index 533590a4e4..367024b58d 100644 --- a/installer/install.iss +++ b/installer/install.iss @@ -1807,6 +1807,7 @@ var Data:String; LblInfo:TLabel; AslrSetting: AnsiString; + WasFSMonitorEnabled:Boolean; begin SanitizeGitEnvironmentVariables(); @@ -2410,12 +2411,19 @@ begin #endif #ifdef WITH_EXPERIMENTAL_BUILTIN_FSMONITOR - RdbExperimentalOptions[GP_EnableFSMonitor]:=CreateCheckBox(ExperimentalOptionsPage,'Built-in file system monitor','The FSMonitor feature is no longer experimental, and now needs to be'+#13+'configured per repository via the core.fsmonitor config setting.',TabOrder,Top,Left); + WasFSMonitorEnabled:=ReplayChoice('Enable FSMonitor','Auto')='Enabled'; + Data:='The FSMonitor feature is no longer experimental, and now needs to be'+#13+'configured per repository via the core.fsmonitor config setting.'; + if not WasFSMonitorEnabled then + Data:=''; // Avoid rendering in red because we want to hide the option, and the way we render red text, it is added as separate `TLabel` that would _still_ be shown. + RdbExperimentalOptions[GP_EnableFSMonitor]:=CreateCheckBox(ExperimentalOptionsPage,'Built-in file system monitor',Data,TabOrder,Top,Left); // Restore the settings chosen during a previous install - RdbExperimentalOptions[GP_EnableFSMonitor].Checked:=ReplayChoice('Enable FSMonitor','Auto')='Enabled'; + RdbExperimentalOptions[GP_EnableFSMonitor].Checked:=WasFSMonitorEnabled; // FSMonitor is no longer experimental, and it is also no longer supported to be enabled by the installer for all repositories. RdbExperimentalOptions[GP_EnableFSMonitor].Enabled:=False; + // If the FSMonitor was not enabled previously, do not even bother to show the option. + if not WasFSMonitorEnabled then + RdbExperimentalOptions[GP_EnableFSMonitor].Visible:=False; #endif #endif