Ignore:
Timestamp:
Jul 12, 2016, 4:28:22 PM (8 years ago)
Author:
chronos
Message:
  • Added: Import format items can be repetitive.
  • Added: Show total count of imported items.
  • Added: Button for direct open of import format definition from import source window.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormImportSource.pas

    r22 r28  
    1414
    1515  TFormImportSource = class(TForm)
     16    ButtonShowFormat: TButton;
    1617    ButtonOk: TButton;
    1718    ButtonCancel: TButton;
     
    2223    Label2: TLabel;
    2324    Label3: TLabel;
     25    procedure ButtonShowFormatClick(Sender: TObject);
    2426  private
    2527    { private declarations }
     
    3739
    3840uses
    39   UFormMain;
     41  UFormMain, UFormImportFormat;
    4042
    4143{ TFormImportSource }
     44
     45procedure TFormImportSource.ButtonShowFormatClick(Sender: TObject);
     46var
     47  NewImportFormat: TImportFormat;
     48begin
     49  if ComboBox1.ItemIndex <> -1 then begin
     50    NewImportFormat := TImportFormat.Create;
     51    NewImportFormat.Assign(TImportFormat(ComboBox1.Items.Objects[ComboBox1.ItemIndex]));
     52    FormImportFormat.Load(NewImportFormat);
     53    if FormImportFormat.ShowModal = mrOk then begin
     54      FormImportFormat.Save(NewImportFormat);
     55      TImportFormat(ComboBox1.Items.Objects[ComboBox1.ItemIndex]).Assign(NewImportFormat);
     56      FormMain.AcronymDb.Modified := True;
     57      ComboBox1.Items.Strings[ComboBox1.ItemIndex] := NewImportFormat.Name;
     58    end;
     59    if Assigned(NewImportFormat) then NewImportFormat.Free;
     60  end;
     61end;
    4262
    4363procedure TFormImportSource.Load(ImportSource: TImportSource);
Note: See TracChangeset for help on using the changeset viewer.