Changeset 29 for trunk/Forms


Ignore:
Timestamp:
Jul 12, 2016, 4:41:03 PM (9 years ago)
Author:
chronos
Message:
  • Added: New import source state called Enabled to allow to select only currently needed imports for importing from all sources.
Location:
trunk/Forms
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormImportSource.lfm

    r28 r29  
    11object FormImportSource: TFormImportSource
    22  Left = 506
    3   Height = 422
     3  Height = 282
    44  Top = 363
    5   Width = 599
     5  Width = 507
    66  Caption = 'Import source'
    7   ClientHeight = 422
    8   ClientWidth = 599
     7  ClientHeight = 282
     8  ClientWidth = 507
    99  LCLVersion = '1.6.0.4'
    1010  object EditName: TEdit
     
    1212    Height = 28
    1313    Top = 10
    14     Width = 432
     14    Width = 340
    1515    Anchors = [akTop, akLeft, akRight]
    1616    TabOrder = 0
     
    3636    Height = 28
    3737    Top = 49
    38     Width = 432
     38    Width = 340
    3939    Anchors = [akTop, akLeft, akRight]
    4040    TabOrder = 1
    4141  end
    4242  object ButtonOk: TButton
    43     Left = 504
     43    Left = 412
    4444    Height = 25
    45     Top = 384
     45    Top = 244
    4646    Width = 75
    4747    Anchors = [akRight, akBottom]
     
    5151  end
    5252  object ButtonCancel: TButton
    53     Left = 408
     53    Left = 316
    5454    Height = 25
    55     Top = 384
     55    Top = 244
    5656    Width = 75
    5757    Anchors = [akRight, akBottom]
     
    7272    Height = 28
    7373    Top = 91
    74     Width = 304
     74    Width = 212
    7575    Anchors = [akTop, akLeft, akRight]
    7676    ItemHeight = 20
     
    7979  end
    8080  object ButtonShowFormat: TButton
    81     Left = 472
     81    Left = 380
    8282    Height = 25
    8383    Top = 91
     
    8888    TabOrder = 5
    8989  end
     90  object CheckBoxEnabled: TCheckBox
     91    Left = 11
     92    Height = 24
     93    Top = 136
     94    Width = 78
     95    Caption = 'Enabled'
     96    TabOrder = 6
     97  end
    9098end
  • trunk/Forms/UFormImportSource.lrt

    r28 r29  
    66TFORMIMPORTSOURCE.LABEL3.CAPTION=Data format:
    77TFORMIMPORTSOURCE.BUTTONSHOWFORMAT.CAPTION=Configure
     8TFORMIMPORTSOURCE.CHECKBOXENABLED.CAPTION=Enabled
  • trunk/Forms/UFormImportSource.pas

    r28 r29  
    1717    ButtonOk: TButton;
    1818    ButtonCancel: TButton;
     19    CheckBoxEnabled: TCheckBox;
    1920    ComboBox1: TComboBox;
    2021    EditName: TEdit;
     
    7879  if (ComboBox1.ItemIndex = -1) and (ComboBox1.Items.Count > 0) then
    7980    ComboBox1.ItemIndex := 0;
     81  CheckBoxEnabled.Checked := ImportSource.Enabled;
    8082end;
    8183
     
    8587  ImportSource.URL := EditURL.Text;
    8688  ImportSource.Format := TImportFormat(ComboBox1.Items.Objects[ComboBox1.ItemIndex]);
     89  ImportSource.Enabled := CheckBoxEnabled.Checked;
    8790end;
    8891
  • trunk/Forms/UFormImportSources.lfm

    r22 r29  
    1515    Width = 577
    1616    Anchors = [akTop, akLeft, akRight, akBottom]
     17    Checkboxes = True
    1718    Columns = <   
    1819      item
  • trunk/Forms/UFormImportSources.pas

    r28 r29  
    6767    Item.Data := ImportSources[Item.Index];
    6868    Item.SubItems.Add(URL);
     69    Item.Checked := Enabled;
    6970  end;
    7071end;
  • trunk/Forms/UFormMain.pas

    r28 r29  
    259259begin
    260260  TotalItemCount := 0;
    261   for I := 0 to AcronymDb.ImportSources.Count - 1 do begin
    262     TImportSource(AcronymDb.ImportSources[I]).Process;
    263     TotalItemCount := TotalItemCount + TImportSource(AcronymDb.ImportSources[I]).ItemCount;
     261  for I := 0 to AcronymDb.ImportSources.Count - 1 do
     262  with TImportSource(AcronymDb.ImportSources[I]) do
     263  if Enabled then begin
     264    Process;
     265    TotalItemCount := TotalItemCount + ItemCount;
    264266  end;
    265267  ShowMessage(Format(SAddedCount, [TotalItemCount]));
Note: See TracChangeset for help on using the changeset viewer.