Skip to content

AutoGeIt RadStudio 13 #25

@edgarpiresreis-sketch

Description

@edgarpiresreis-sketch

For RadStudio 13 Florence
function TfrmAutoGetItMain.SwitchFlavor(const DelphiVersionStr: string): Integer;
{ inspired by GitHub user toxinon12345 }
var
DVer: string;
begin
DVer := LeftStr(DelphiVersionStr, 4);
if DVer = '19.0' then
Result := 1 // BDS 19 | Delphi 10.2 Tokyo
else if DVer = '20.0' then
Result := 1 // BDS 20 | Delphi 10.3 Rio
else if DVer = '21.0' then
Result := 2 // BDS 21 | Delphi 10.4 Sydney
else if DVer = '22.0' then
Result := 2 // BDS 22 | Delphi 11.0 Alexandria
else if DVer = '23.0' then
Result := 2 // BDS 23 | Delphi 12.0 Athens
else if DVer = '37.0' then
Result := 3 // BDS 23 | Delphi 13.0
else
Result := -1; // unsupported Delphi version
end;

procedure TfrmAutoGetItMain.actRefreshExecute(Sender: TObject);
var
SortField: string;
CmdLineArgs: string;
begin
actRefresh.Enabled := False;
try
lbPackages.Items.Clear;
FPastFirstItem := False;
FFinished := False;

case rgrpSortBy.ItemIndex of
  0:
    SortField := 'name';
  1:
    SortField := 'vendor';
  2:
    SortField := 'date';
end;

DosCommand.CurrentDir := BDSBinDir;

case SwitchFlavor(cmbRADVersions.Text) of
  1:
    CmdLineArgs := Format('-listavailable:%s -sort:%s -filter:%s ', [edtNameFilter.Text, SortField, IfThen(chkInstalledOnly.Checked, 'Installed', 'All')]);
  2:
    CmdLineArgs := Format('--list=%s --sort=%s --filter=%s', [edtNameFilter.Text, SortField, IfThen(chkInstalledOnly.Checked, 'installed', 'all')]);
  3:
    CmdLineArgs := Format('--list=%s --sort=%s --filter=%s', [edtNameFilter.Text, SortField, IfThen(chkInstalledOnly.Checked, 'installed', 'all')]);
else
  raise ENotImplemented.Create(GETIT_VR_NOT_SUPPORTED_MSG);
end;

...
procedure TfrmAutoGetItMain.LoadRADVersionsCombo;
const
MAX_VERSIONS = 6;
BDS_VERSIONS: array[1..MAX_VERSIONS] of string = ('19.0', '20.0', '21.0', '22.0', '23.0', '37.0');
DELPHI_NAMES: array[1..MAX_VERSIONS] of string = ('10.2 Tokyo', '10.3 Rio', '10.4 Sydney', '11 Alexandria', '12 Athens', '13 Florence');
.....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions