Ignore:
Timestamp:
Dec 21, 2021, 5:16:41 PM (3 years ago)
Author:
chronos
Message:
  • Fixed: Settings option to load previously opened file wasn't working for disabled state.
  • Fixed: Disable Find action if no file is opened.
  • Modified: Move fields initialization method to TContact class and made it static so it is initialized only once.
  • Added: Allow to set default vCard version in settings dialog.
  • Modified: Add GTK2 theming support to snap package.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormContacts.pas

    r77 r82  
    203203        for J := 0 to FilterItems.Count - 1 do begin
    204204          if FilterItems[J].FieldIndex = cfNone then begin
    205             for K := 0 to TContact(List.Items[I]).Parent.Fields.Count - 1 do begin
     205            for K := 0 to TContact(List.Items[I]).GetFields.Count - 1 do begin
    206206              if Pos(UTF8LowerCase(FilterItems[J].Value),
    207                 UTF8LowerCase(TContact(List.Items[I]).Fields[TContact(List.Items[I]).Parent.Fields[K].Index])) > 0 then begin
     207                UTF8LowerCase(TContact(List.Items[I]).Fields[TContact(List.Items[I]).GetFields[K].Index])) > 0 then begin
    208208                  Inc(FoundCount);
    209209                  Break;
     
    286286  for I := 0 to ListView1.Columns.Count - 1 do begin
    287287    if Assigned(Contacts) and Assigned(Contacts.ContactsFile) then begin
    288       Field := Contacts.ContactsFile.Fields.GetByIndex(ListViewColumns[I]);
     288      Field := TContact.GetFields.GetByIndex(ListViewColumns[I]);
    289289      if Assigned(Field) then
    290290        ListView1.Columns[I].Caption := Field.Title;
     
    312312    Contact := TContact.Create;
    313313    try
    314       Contact.Parent := Contacts.ContactsFile;
     314      Contact.ContactsFile := Contacts.ContactsFile;
    315315      FormContact.Contact := Contact;
    316316      FormContact.OnGetPrevious := GetPreviousContact;
    317317      FormContact.OnGetNext := GetNextContact;
     318      Contact.Properties.AddNew('VERSION', Core.DefaultVcardVersion);
    318319      if FormContact.ShowModal = mrOK then begin
    319320        Contacts.Add(Contact);
     
    341342    Contact := TContact.Create;
    342343    try
    343       Contact.Parent := Contacts.ContactsFile;
     344      Contact.ContactsFile := Contacts.ContactsFile;
    344345      Contact.Assign(TContact(ListView1.Selected.Data));
    345346      FormContact.Contact := Contact;
     
    442443    Contact := TContact.Create;
    443444    try
    444       Contact.Parent := Contacts.ContactsFile;
     445      Contact.ContactsFile := Contacts.ContactsFile;
    445446      Contact.Assign(TContact(ListView1.Selected.Data));
    446447      FormContact.Contact := Contact;
Note: See TracChangeset for help on using the changeset viewer.