@@ -41,6 +41,8 @@ OutputBaseFilename=ado-lens-setup-{#Version}
4141Compression = lzma2 /max
4242SolidCompression = yes
4343WizardStyle = modern
44+ ; Taller and wider than the default: the environments page lists release stages and branches.
45+ WizardSizePercent= 120 ,130
4446UninstallDisplayName = ADO Lens
4547UninstallDisplayIcon = {app} \bin\adolens.exe
4648LicenseFile = {#Source}\LICENSE
@@ -88,6 +90,7 @@ en.EnvLater=Later: Start menu > ADO Lens - settings > Environments (change, add,
8890en .EnvMine= Save for me only (this computer)
8991en .EnvTeam= Save for the whole team (wiki page " ADO Lens" of the project)
9092en .EnvSkip= Skip - Claude asks when needed
93+ en .EnvMore= ... and %1 more: Start menu > ADO Lens - settings > Environments.
9194en .EnvFailed= Saving the environments did not work:%n%n%1
9295en .ReadmeUrl= https://github.com/willowdev-code/ado-lens#readme
9396en .IconSettings= ADO Lens - settings
@@ -104,6 +107,7 @@ pl.EnvLater=Później: menu Start > ADO Lens - ustawienia > Środowiska (zmiana,
104107pl.EnvMine=Zapisz tylko dla mnie (ten komputer)
105108pl.EnvTeam=Zapisz dla całego zespołu (strona wiki "ADO Lens" w projekcie)
106109pl.EnvSkip=Pomiń - Claude zapyta, gdy będzie trzeba
110+ pl.EnvMore=... i jeszcze %1 : menu Start > ADO Lens - ustawienia > Środowiska.
107111pl.EnvFailed=Nie udało się zapisać środowisk:%n%n%1
108112pl.ReadmeUrl=https://github.com/willowdev-code/ado-lens/blob/main/README.pl.md
109113pl.IconSettings=ADO Lens - ustawienia
170174 EnvKeys: TArrayOfString;
171175 EnvLabels: array of TNewStaticText;
172176 EnvEdits: array of TNewEdit;
173- EnvMine, EnvTeam, EnvSkip: TNewRadioButton;
177+ EnvScope: TNewComboBox;
178+ EnvMore: TNewStaticText;
174179 EnvDetected: Boolean;
175180
176181function SetEnvironmentVariable (lpName: String; lpValue: String): Boolean;
@@ -384,22 +389,7 @@ begin
384389 EnvInfo.Width := EnvPage.SurfaceWidth;
385390 EnvInfo.Height := ScaleY(40 );
386391 EnvInfo.Caption := CustomMessage(' EnvDetecting' );
387- EnvMine := TNewRadioButton.Create(EnvPage);
388- EnvTeam := TNewRadioButton.Create(EnvPage);
389- EnvSkip := TNewRadioButton.Create(EnvPage);
390- EnvMine.Parent := EnvPage.Surface;
391- EnvTeam.Parent := EnvPage.Surface;
392- EnvSkip.Parent := EnvPage.Surface;
393- EnvMine.Caption := CustomMessage(' EnvMine' );
394- EnvTeam.Caption := CustomMessage(' EnvTeam' );
395- EnvSkip.Caption := CustomMessage(' EnvSkip' );
396- EnvMine.Width := EnvPage.SurfaceWidth;
397- EnvTeam.Width := EnvPage.SurfaceWidth;
398- EnvSkip.Width := EnvPage.SurfaceWidth;
399- EnvMine.Checked := True;
400- EnvMine.Visible := False;
401- EnvTeam.Visible := False;
402- EnvSkip.Visible := False;
392+ { One drop-down for where to save, at the bottom above the hint: always visible, whatever the number of rows. }
403393 EnvLater := TNewStaticText.Create(EnvPage);
404394 EnvLater.Parent := EnvPage.Surface;
405395 EnvLater.AutoSize := False;
@@ -408,17 +398,37 @@ begin
408398 EnvLater.Height := ScaleY(30 );
409399 EnvLater.Caption := CustomMessage(' EnvLater' );
410400 EnvLater.Top := EnvPage.SurfaceHeight - EnvLater.Height;
401+ EnvScope := TNewComboBox.Create(EnvPage);
402+ EnvScope.Parent := EnvPage.Surface;
403+ EnvScope.Style := csDropDownList;
404+ EnvScope.Width := EnvPage.SurfaceWidth;
405+ EnvScope.Items.Add(CustomMessage(' EnvMine' ));
406+ EnvScope.Items.Add(CustomMessage(' EnvTeam' ));
407+ EnvScope.Items.Add(CustomMessage(' EnvSkip' ));
408+ EnvScope.ItemIndex := 0 ;
409+ EnvScope.Top := EnvLater.Top - EnvScope.Height - ScaleY(6 );
410+ EnvScope.Visible := False;
411+ EnvMore := TNewStaticText.Create(EnvPage);
412+ EnvMore.Parent := EnvPage.Surface;
413+ EnvMore.AutoSize := False;
414+ EnvMore.Width := EnvPage.SurfaceWidth;
415+ EnvMore.Height := ScaleY(16 );
416+ EnvMore.Top := EnvScope.Top - EnvMore.Height - ScaleY(2 );
417+ EnvMore.Visible := False;
411418end ;
412419
413420{ Fills the environment page from "adolens setup --detect": the map already in use, or one row per stage or branch
414421 found with a suggested name. }
415422procedure DetectEnvironments ;
416423var
417- Exe, OutFile, Line, Key, Guess: String;
424+ Exe, OutFile, Line, Key, Guess, Caption : String;
418425 Lines: TArrayOfString;
419- I, P, N, Top: Integer;
426+ I, P, N, Top, MaxRows, Skipped : Integer;
420427 Code: Integer;
421428begin
429+ { As many rows as fit between the text and the drop-down; the rest is named and can be set in the settings later. }
430+ MaxRows := (EnvMore.Top - (EnvInfo.Top + EnvInfo.Height + ScaleY(4 ))) div ScaleY(26 );
431+ Skipped := 0 ;
422432 EnvDetected := True;
423433 Exe := ExpandConstant(' {tmp}\adolens.exe' );
424434 OutFile := ExpandConstant(' {tmp}\adolens-envs.txt' );
@@ -437,7 +447,9 @@ begin
437447 EnvInfo.Caption := FmtMessage(CustomMessage(' EnvExisting' ), [Copy(Line, 1 , P - 1 ), Copy(Line, P + 1 , Length(Line))]);
438448 Exit;
439449 end ;
440- if (Copy(Line, 1 , 4 ) = ' row' + #9 ) and (N < 8 ) then
450+ if (Copy(Line, 1 , 4 ) = ' row' + #9 ) and (N >= MaxRows) then
451+ Skipped := Skipped + 1
452+ else if Copy(Line, 1 , 4 ) = ' row' + #9 then
441453 begin
442454 Delete(Line, 1 , 4 );
443455 P := Pos(#9 , Line);
@@ -459,7 +471,14 @@ begin
459471 Top := EnvInfo.Top + EnvInfo.Height + ScaleY(4 ) + (N - 1 ) * ScaleY(26 );
460472 EnvLabels[N - 1 ] := TNewStaticText.Create(EnvPage);
461473 EnvLabels[N - 1 ].Parent := EnvPage.Surface;
462- EnvLabels[N - 1 ].Caption := Key;
474+ { "D365FO:staging" is the branch staging of the repository D365FO. }
475+ Caption := Key;
476+ P := Pos(' :' , Key);
477+ if (P > 1 ) and (Pos(' /' , Key) = 0 ) then
478+ Caption := Copy(Key, P + 1 , Length(Key)) + ' (' + Copy(Key, 1 , P - 1 ) + ' )' ;
479+ EnvLabels[N - 1 ].Caption := Caption;
480+ EnvLabels[N - 1 ].AutoSize := False;
481+ EnvLabels[N - 1 ].Height := ScaleY(18 );
463482 EnvLabels[N - 1 ].Top := Top + ScaleY(3 );
464483 EnvLabels[N - 1 ].Width := EnvPage.SurfaceWidth div 2 - ScaleX(8 );
465484 EnvEdits[N - 1 ] := TNewEdit.Create(EnvPage);
@@ -476,13 +495,12 @@ begin
476495 Exit;
477496 end ;
478497 EnvInfo.Caption := CustomMessage(' EnvText' );
479- Top := EnvInfo.Top + EnvInfo.Height + ScaleY(10 ) + N * ScaleY(26 );
480- EnvMine.Top := Top;
481- EnvTeam.Top := Top + ScaleY(20 );
482- EnvSkip.Top := Top + ScaleY(40 );
483- EnvMine.Visible := True;
484- EnvTeam.Visible := True;
485- EnvSkip.Visible := True;
498+ if Skipped > 0 then
499+ begin
500+ EnvMore.Caption := FmtMessage(CustomMessage(' EnvMore' ), [IntToStr(Skipped)]);
501+ EnvMore.Visible := True;
502+ end ;
503+ EnvScope.Visible := True;
486504end ;
487505
488506{ Saves the names typed on the environment page; returns False to stay on the page when it failed. }
492510 I, Code: Integer;
493511begin
494512 Result := True;
495- if EnvSkip.Checked or (GetArrayLength(EnvKeys) = 0 ) then Exit;
513+ if (EnvScope.ItemIndex = 2 ) or (GetArrayLength(EnvKeys) = 0 ) then Exit;
496514 Env := ' ' ;
497515 for I := 0 to GetArrayLength(EnvKeys) - 1 do
498516 begin
@@ -506,7 +524,7 @@ begin
506524 end ;
507525 end ;
508526 if Env = ' ' then Exit;
509- if EnvTeam.Checked then Scope := ' team' else Scope := ' local' ;
527+ if EnvScope.ItemIndex = 1 then Scope := ' team' else Scope := ' local' ;
510528 Code := RunAdoLens(ExpandConstant(' {tmp}\adolens.exe' ), ' setup --env "' + Env + ' " --scope ' + Scope, Output);
511529 if Code <> 0 then
512530 begin
0 commit comments