Changeset 129 for trunk/Forms/UFormContacts.pas
- Timestamp:
- Apr 9, 2022, 11:52:13 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContacts.pas
r128 r129 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 7 Menus, ActnList, U Contact, UListViewSort, LazUTF8, Clipbrd,7 Menus, ActnList, UVCard, UListViewSort, LazUTF8, Clipbrd, 8 8 Generics.Collections; 9 9 … … 102 102 103 103 uses 104 UFormContact, UCore ;104 UFormContact, UCore, UVCardFile; 105 105 106 106 resourcestring … … 304 304 ListView1.Columns.Delete(ListView1.Columns.Count - 1); 305 305 for I := 0 to ListView1.Columns.Count - 1 do begin 306 if Assigned(Contacts) and Assigned(Contacts. ContactsFile) then begin306 if Assigned(Contacts) and Assigned(Contacts.ParentVCard) then begin 307 307 Field := TContact.GetFields.GetByIndex(ListViewColumns[I]); 308 308 if Assigned(Field) then … … 334 334 Contact := TContact.Create; 335 335 try 336 Contact. ContactsFile := Contacts.ContactsFile;336 Contact.ParentVCard := Contacts.ParentVCard; 337 337 FormContact.Contact := Contact; 338 338 FormContact.OnGetPrevious := GetPreviousContact; … … 364 364 Contact := TContact.Create; 365 365 try 366 Contact. ContactsFile := Contacts.ContactsFile;366 Contact.ParentVCard := Contacts.ParentVCard; 367 367 Contact.Assign(TContact(ListView1.Selected.Data)); 368 368 FormContact.Contact := Contact; … … 436 436 procedure TFormContacts.ALoadFromFileExecute(Sender: TObject); 437 437 var 438 TempFile: T ContactsFile;438 TempFile: TVCardFile; 439 439 begin 440 440 if Assigned(ListView1.Selected) then begin 441 TempFile := T ContactsFile.Create;441 TempFile := TVCardFile.Create; 442 442 try 443 443 OpenDialog1.Filter := TempFile.GetFileFilter; … … 465 465 Contact := TContact.Create; 466 466 try 467 Contact. ContactsFile := Contacts.ContactsFile;467 Contact.ParentVCard := Contacts.ParentVCard; 468 468 Contact.Assign(TContact(ListView1.Selected.Data)); 469 469 FormContact.Contact := Contact; … … 486 486 procedure TFormContacts.APasteExecute(Sender: TObject); 487 487 var 488 PasteContacts: T ContactsFile;488 PasteContacts: TVCardFile; 489 489 Lines: TStringList; 490 490 begin 491 PasteContacts := T ContactsFile.Create;491 PasteContacts := TVCardFile.Create; 492 492 Lines := TStringList.Create; 493 493 try 494 494 Lines.Text := Clipboard.AsText; 495 PasteContacts. LoadFromStrings(Lines);496 if PasteContacts. Contacts.Count > 0 then begin495 PasteContacts.VCard.LoadFromStrings(Lines); 496 if PasteContacts.VCard.Contacts.Count > 0 then begin 497 497 if Assigned(ListView1.Selected) then begin 498 498 Contacts.InsertContacts(Contacts.IndexOf(ListView1.Selected.Data), 499 PasteContacts. Contacts);500 end else Contacts.AddContacts(PasteContacts. Contacts);499 PasteContacts.VCard.Contacts); 500 end else Contacts.AddContacts(PasteContacts.VCard.Contacts); 501 501 Core.DataFile.Modified := True; 502 502 ReloadList; … … 528 528 procedure TFormContacts.ASaveToFileExecute(Sender: TObject); 529 529 var 530 TempFile: T ContactsFile;530 TempFile: TVCardFile; 531 531 begin 532 532 if Assigned(ListView1.Selected) then begin 533 TempFile := T ContactsFile.Create;533 TempFile := TVCardFile.Create; 534 534 try 535 535 SaveDialog1.Filter := TempFile.GetFileFilter;
Note:
See TracChangeset
for help on using the changeset viewer.