Changeset 93 for trunk/Forms/UFormContact.pas
- Timestamp:
- Feb 3, 2022, 10:30:03 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContact.pas
r77 r93 203 203 private 204 204 FProfilePhotoActive: Boolean; 205 FProfilePhotoLoaded: Boolean; 206 FProfilePhotoModified: Boolean; 205 207 procedure SetProfilePhotoActive(AValue: Boolean); 206 208 private … … 240 242 FormProperties.Align := alClient; 241 243 FormProperties.Show; 244 245 FProfilePhotoLoaded := False; 242 246 243 247 // Force to load default profile image … … 320 324 321 325 // Photo 326 if FProfilePhotoModified then begin 322 327 if ProfilePhotoActive then begin 323 328 PhotoProperty := Contact.GetProperty(cfPhoto); … … 388 393 Contact.Properties.Remove(PhotoProperty); 389 394 end; 395 FProfilePhotoModified := False; 396 end; 390 397 391 398 ReloadAllPropertiesTab; … … 421 428 // Photo 422 429 PhotoProperty := Contact.GetProperty(cfPhoto); 430 if not FProfilePhotoLoaded then begin 423 431 if Assigned(PhotoProperty) then begin 432 FProfilePhotoLoaded := True; 433 FProfilePhotoModified := True; 424 434 Photo := Contact.Fields[cfPhoto]; 425 435 if (Photo <> '') and (PhotoProperty.Encoding <> '') then begin … … 497 507 end else ProfilePhotoActive := False; 498 508 end else ProfilePhotoActive := False; 509 end; 499 510 end; 500 511 … … 662 673 if OpenPictureDialog1.Execute then begin 663 674 ImagePhoto.Picture.LoadFromFile(OpenPictureDialog1.FileName); 675 FProfilePhotoModified := True; 676 FProfilePhotoLoaded := True; 664 677 ProfilePhotoActive := True; 665 678 end; … … 668 681 procedure TFormContact.APhotoClearExecute(Sender: TObject); 669 682 begin 683 FProfilePhotoModified := True; 670 684 ProfilePhotoActive := False; 671 685 end;
Note:
See TracChangeset
for help on using the changeset viewer.