Changeset 17 for trunk/UCore.pas


Ignore:
Timestamp:
Feb 28, 2018, 12:56:11 PM (7 years ago)
Author:
chronos
Message:
  • Added: New Generate contacts Tools menu action to generate multiple random contacts.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r16 r17  
    2626  TCore = class(TDataModule)
    2727    AAbout: TAction;
     28    AGenerate: TAction;
    2829    AFindDuplicate: TAction;
    2930    AFileMerge: TAction;
     
    5758    procedure AFileCloseExecute(Sender: TObject);
    5859    procedure AFindDuplicateExecute(Sender: TObject);
     60    procedure AGenerateExecute(Sender: TObject);
    5961    procedure AHomePageExecute(Sender: TObject);
    6062    procedure ASettingsExecute(Sender: TObject);
     
    9395
    9496uses
    95   UFormMain, UFormAbout, UFormSettings, UContact, UFormContacts, UFormFindDuplicity;
     97  UFormMain, UFormAbout, UFormSettings, UContact, UFormContacts, UFormFindDuplicity,
     98  UFormGenerate;
    9699
    97100resourcestring
     
    178181    Contacts := TContactsFile(DataFile).Contacts;
    179182    ShowModal;
     183    Free;
     184  end;
     185end;
     186
     187procedure TCore.AGenerateExecute(Sender: TObject);
     188begin
     189  FormGenerate := TFormGenerate.Create(nil);
     190  with FormGenerate do begin
     191    Contacts := TContactsFile(DataFile).Contacts;
     192    ShowModal;
     193    FormContacts.ReloadList;
     194    FormContacts.UpdateInterface;
     195    DataFile.Modified := True;
     196    FormMain.UpdateInterface;
    180197    Free;
    181198  end;
Note: See TracChangeset for help on using the changeset viewer.