Skip to content

Commit

Permalink
installer: skip Experimental Options page, if empty
Browse files Browse the repository at this point in the history
As of a75602a (installer: hide the "experimental" FSMonitor setting by
default, 2024-07-17), the FSMonitor option is hidden from the options
page unless the user had enabled it previously.

However, this then left the page blank (or: all options hidden), not a
good user experience. So let's skip it if it would appear blank.

This fixes git-for-windows/git#5231.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Oct 27, 2024
1 parent 532c384 commit 70911c3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion installer/install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ const
GP_BuiltinAddI = 4;
GP_EnablePCon = 5;
GP_EnableFSMonitor = 6;
GP_Max = 6;
#endif
var
Expand Down Expand Up @@ -506,7 +507,7 @@ var
#ifdef HAVE_EXPERIMENTAL_OPTIONS
// Wizard page and variables for the experimental options.
ExperimentalOptionsPage:TWizardPage;
RdbExperimentalOptions:array[GP_BuiltinDifftool..GP_EnableFSMonitor] of TCheckBox;
RdbExperimentalOptions:array[GP_BuiltinDifftool..GP_Max] of TCheckBox;
#endif
// Mapping controls to hyperlinks
Expand Down Expand Up @@ -2549,6 +2550,7 @@ function ShouldSkipPage(PageID:Integer):Boolean;
var
Msg,Cmd,StdOut,StdErr:String;
Res:DWORD;
i:Integer;
begin
if (ProcessesPage<>NIL) and (PageID=ProcessesPage.ID) then begin
// This page is only reached forward (by pressing "Next", never by pressing "Back").
Expand Down Expand Up @@ -2577,6 +2579,14 @@ begin
Result:=False
else
Result:=(PageID<>wpInfoBefore) and (PageID<>wpFinished);
#ifdef HAVE_EXPERIMENTAL_OPTIONS
// Skip experimental options page if all options are hidden
end else if (PageID=ExperimentalOptionsPage.ID) then begin
Result:=True;
for i:=1 to GP_Max do
if (RdbExperimentalOptions[i]<>nil) and RdbExperimentalOptions[i].Visible then
Result:=False;
#endif
end else
Result:=False;
#ifdef DEBUG_WIZARD_PAGE
Expand Down

0 comments on commit 70911c3

Please sign in to comment.