Changeset 72 for trunk/Forms


Ignore:
Timestamp:
Aug 1, 2016, 11:00:05 PM (8 years ago)
Author:
chronos
Message:
  • Added: Allow enable/disable import source by context menu in import sources list.
Location:
trunk/Forms
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormImportSources.lfm

    r69 r72  
    1010  OnShow = FormShow
    1111  Position = poScreenCenter
    12   LCLVersion = '1.6.0.4'
     12  LCLVersion = '1.7'
    1313  object ListView1: TListView
    1414    Left = 8
     
    3737      item
    3838        Caption = 'Date'
    39         Width = 100
     39        Width = 108
    4040      end>
    4141    MultiSelect = True
     
    108108      ImageIndex = 5
    109109      OnExecute = AProcessExecute
     110    end
     111    object AEnable: TAction
     112      Caption = 'Enable'
     113      OnExecute = AEnableExecute
     114    end
     115    object ADisable: TAction
     116      Caption = 'Disable'
     117      OnExecute = ADisableExecute
    110118    end
    111119  end
     
    270278      }
    271279    end
     280    object MenuItem6: TMenuItem
     281      Action = AEnable
     282    end
     283    object MenuItem5: TMenuItem
     284      Action = ADisable
     285    end
    272286  end
    273287  object JobProgressView1: TJobProgressView
  • trunk/Forms/UFormImportSources.lrt

    r52 r72  
    1010TFORMIMPORTSOURCES.AMODIFY.CAPTION=Modify
    1111TFORMIMPORTSOURCES.APROCESS.CAPTION=Process
     12TFORMIMPORTSOURCES.AENABLE.CAPTION=Enable
     13TFORMIMPORTSOURCES.ADISABLE.CAPTION=Disable
  • trunk/Forms/UFormImportSources.pas

    r56 r72  
    1515  TFormImportSources = class(TForm)
    1616    AAdd: TAction;
     17    AEnable: TAction;
     18    ADisable: TAction;
    1719    AProcess: TAction;
    1820    ActionList1: TActionList;
     
    2527    MenuItem3: TMenuItem;
    2628    MenuItem4: TMenuItem;
     29    MenuItem5: TMenuItem;
     30    MenuItem6: TMenuItem;
    2731    PopupMenuImportSource: TPopupMenu;
    2832    ToolBar1: TToolBar;
     
    3236    ToolButton4: TToolButton;
    3337    procedure AAddExecute(Sender: TObject);
     38    procedure ADisableExecute(Sender: TObject);
     39    procedure AEnableExecute(Sender: TObject);
    3440    procedure AModifyExecute(Sender: TObject);
    3541    procedure AProcessExecute(Sender: TObject);
     
    131137  end;
    132138  if Assigned(NewImportSource) then NewImportSource.Free;
     139end;
     140
     141procedure TFormImportSources.ADisableExecute(Sender: TObject);
     142var
     143  I: Integer;
     144begin
     145  for I := ListView1.Items.Count - 1 downto 0 do
     146  if ListView1.Items[I].Selected then
     147    TImportSource(ListView1.Items[I].Data).Enabled := False;
     148  UpdateList;
     149end;
     150
     151procedure TFormImportSources.AEnableExecute(Sender: TObject);
     152var
     153  I: Integer;
     154begin
     155  for I := ListView1.Items.Count - 1 downto 0 do
     156  if ListView1.Items[I].Selected then
     157    TImportSource(ListView1.Items[I].Data).Enabled := True;
     158  UpdateList;
    133159end;
    134160
Note: See TracChangeset for help on using the changeset viewer.