Ignore:
Timestamp:
Feb 9, 2022, 5:07:14 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Updated speed of loading of big number of contacts.
  • Added: Contact field indexes cache for faster reverse search of contact fields by its index.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormContacts.pas

    r103 r104  
    258258  Text: string;
    259259  SelectedCount: Integer;
    260 begin
     260  Selected: Boolean;
     261begin
     262  Selected := Assigned(ListView1.Selected);
    261263  AAdd.Enabled := Assigned(Contacts);
    262   AModify.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected);
    263   ARemove.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected);
     264  AModify.Enabled := Assigned(Contacts) and Selected;
     265  ARemove.Enabled := Assigned(Contacts) and Selected;
     266  AAdd.Enabled := Assigned(Contacts);
     267  AModify.Enabled := Assigned(Contacts) and Selected;
     268  AClone.Enabled := Assigned(Contacts) and Selected;
     269  ARemove.Enabled := Assigned(Contacts) and Selected;
     270  ASelectAll.Enabled := ListView1.Items.Count > 0;
     271  ALoadFromFile.Enabled := Assigned(Contacts) and Selected;
     272  ASaveToFile.Enabled := Assigned(Contacts) and Selected;
     273  ACopy.Enabled := Assigned(Contacts) and Selected;
     274  ACut.Enabled := Assigned(Contacts) and Selected;
     275  APaste.Enabled := Assigned(Contacts) and (Clipboard.AsText <> '');
    264276
    265277  Text := '';
     
    273285  end;
    274286  StatusBar1.Panels[0].Text := Text;
     287
     288  UpdateColumns;
    275289end;
    276290
     
    613627begin
    614628  if FUpdateCount = 0 then DoUpdateInterface;
    615   AAdd.Enabled := Assigned(Contacts);
    616   AModify.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected);
    617   AClone.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected);
    618   ARemove.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected);
    619   ASelectAll.Enabled := ListView1.Items.Count > 0;
    620   ALoadFromFile.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected);
    621   ASaveToFile.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected);
    622   ACopy.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected);
    623   ACut.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected);
    624   APaste.Enabled := Assigned(Contacts) and (Clipboard.AsText <> '');
    625 
    626   UpdateColumns;
    627629end;
    628630
Note: See TracChangeset for help on using the changeset viewer.