Changeset 76 for trunk/UCore.pas


Ignore:
Timestamp:
Dec 15, 2021, 8:56:06 PM (3 years ago)
Author:
chronos
Message:
  • Added: Find dialog to search text value by given contact field or by any field.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r73 r76  
    1717    AAbout: TAction;
    1818    AboutDialog1: TAboutDialog;
     19    AFind: TAction;
    1920    AFileSplit: TAction;
    2021    AGenerate: TAction;
     
    5253    procedure AFileSplitExecute(Sender: TObject);
    5354    procedure AFindDuplicateExecute(Sender: TObject);
     55    procedure AFindExecute(Sender: TObject);
    5456    procedure AGenerateExecute(Sender: TObject);
    5557    procedure AHomePageExecute(Sender: TObject);
     
    99101uses
    100102  UFormMain, UFormSettings, UContact, UFormContacts, UFormFindDuplicity,
    101   UFormGenerate, UFormError;
     103  UFormGenerate, UFormError, UFormFind;
    102104
    103105resourcestring
     
    202204procedure TCore.AFindDuplicateExecute(Sender: TObject);
    203205begin
    204   FormFindDuplicity := TFormFindDuplicity.Create(nil);
    205   with FormFindDuplicity do begin
     206  with TFormFindDuplicity.Create(nil) do
     207  try
    206208    Contacts := TContactsFile(DataFile).Contacts;
    207209    ShowModal;
    208210    FormContacts.ReloadList;
    209211    FormMain.UpdateInterface;
     212  finally
    210213    Free;
    211214  end;
    212215end;
    213216
     217procedure TCore.AFindExecute(Sender: TObject);
     218begin
     219  with TFormFind.Create(nil) do
     220  try
     221    Contacts := TContactsFile(DataFile).Contacts;
     222    ShowModal;
     223    FormContacts.ReloadList;
     224    FormMain.UpdateInterface;
     225  finally
     226    Free;
     227  end;
     228end;
     229
    214230procedure TCore.AGenerateExecute(Sender: TObject);
    215231begin
    216   FormGenerate := TFormGenerate.Create(nil);
    217   with FormGenerate do begin
     232  with TFormGenerate.Create(nil) do
     233  try
    218234    Contacts := TContactsFile(DataFile).Contacts;
    219235    ShowModal;
     
    222238    DataFile.Modified := True;
    223239    FormMain.UpdateInterface;
     240  finally
    224241    Free;
    225242  end;
     
    233250procedure TCore.ASettingsExecute(Sender: TObject);
    234251begin
    235   FormSettings := TFormSettings.Create(nil);
    236   try
    237     FormSettings.LoadData;
    238     if FormSettings.ShowModal = mrOK then begin
    239       FormSettings.SaveData;
     252  with TFormSettings.Create(nil) do
     253  try
     254    LoadData;
     255    if ShowModal = mrOK then begin
     256      SaveData;
    240257      ThemeManager1.UseTheme(FormMain);
    241258      ThemeManager1.UseTheme(FormContacts);
    242259    end;
    243260  finally
    244     FormSettings.Free;
     261    Free;
    245262  end;
    246263end;
Note: See TracChangeset for help on using the changeset viewer.