Ignore:
Timestamp:
May 4, 2016, 11:43:42 PM (9 years ago)
Author:
chronos
Message:
  • Added: Now import formats can be specified using new edit windows.
  • Added: Import source can now be downloaded and processed including download from https URLs.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormImportSource.pas

    r20 r22  
    1616    ButtonOk: TButton;
    1717    ButtonCancel: TButton;
     18    ComboBox1: TComboBox;
    1819    EditName: TEdit;
    1920    EditURL: TEdit;
    2021    Label1: TLabel;
    2122    Label2: TLabel;
     23    Label3: TLabel;
    2224  private
    2325    { private declarations }
     
    3436{$R *.lfm}
    3537
     38uses
     39  UFormMain;
     40
    3641{ TFormImportSource }
    3742
    3843procedure TFormImportSource.Load(ImportSource: TImportSource);
     44var
     45  I: Integer;
    3946begin
    4047  EditName.Text := ImportSource.Name;
    4148  EditURL.Text := ImportSource.URL;
     49  while ComboBox1.Items.Count > FormMain.AcronymDb.ImportFormats.Count do
     50    ComboBox1.Items.Delete(ComboBox1.Items.Count - 1);
     51  while ComboBox1.Items.Count < FormMain.AcronymDb.ImportFormats.Count do
     52    ComboBox1.Items.Add('');
     53  for I := 0 to FormMain.AcronymDb.ImportFormats.Count - 1 do begin
     54    ComboBox1.Items[I] := TImportFormat(FormMain.AcronymDb.ImportFormats[I]).Name;
     55    ComboBox1.Items.Objects[I] := FormMain.AcronymDb.ImportFormats[I];
     56  end;
     57  ComboBox1.ItemIndex := ComboBox1.Items.IndexOfObject(ImportSource.Format);
     58  if (ComboBox1.ItemIndex = -1) and (ComboBox1.Items.Count > 0) then
     59    ComboBox1.ItemIndex := 0;
    4260end;
    4361
     
    4664  ImportSource.Name := EditName.Text;
    4765  ImportSource.URL := EditURL.Text;
     66  ImportSource.Format := TImportFormat(ComboBox1.Items.Objects[ComboBox1.ItemIndex]);
    4867end;
    4968
Note: See TracChangeset for help on using the changeset viewer.