- Timestamp:
- Feb 9, 2022, 3:51:26 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContact.lfm
r102 r103 1 1 object FormContact: TFormContact 2 Left = 1 1212 Left = 1063 3 3 Height = 773 4 Top = 4 724 Top = 449 5 5 Width = 1032 6 6 Caption = 'Contact' … … 18 18 Top = 8 19 19 Width = 1009 20 ActivePage = TabSheet Work20 ActivePage = TabSheetGeneral 21 21 Anchors = [akTop, akLeft, akRight, akBottom] 22 22 ParentFont = False 23 TabIndex = 223 TabIndex = 0 24 24 TabOrder = 0 25 25 object TabSheetGeneral: TTabSheet … … 132 132 Width = 216 133 133 Center = True 134 OnClick = APhotoLoadExecute134 OnClick = ImagePhotoClick 135 135 PopupMenu = PopupMenuPhoto 136 136 Proportional = True … … 150 150 Top = 25 151 151 Width = 486 152 OnChange = EditFullNameChange 152 153 ParentFont = False 153 154 TabOrder = 0 … … 1390 1391 object ActionList1: TActionList 1391 1392 Images = Core.ImageList1 1392 Left = 6 171393 Top = 5501393 Left = 632 1394 Top = 608 1394 1395 object APhotoLoad: TAction 1395 1396 Caption = 'Load from file' … … 1404 1405 OnExecute = APhotoClearExecute 1405 1406 end 1407 object APhotoShow: TAction 1408 Caption = 'Show' 1409 OnExecute = APhotoShowExecute 1410 end 1411 object APhotoSetUrl: TAction 1412 Caption = 'Set URL' 1413 OnExecute = APhotoSetUrlExecute 1414 end 1406 1415 end 1407 1416 object PopupMenuPhoto: TPopupMenu 1408 1417 Images = Core.ImageList1 1409 Left = 872 1410 Top = 592 1418 Left = 864 1419 Top = 608 1420 object MenuItem4: TMenuItem 1421 Action = APhotoShow 1422 end 1411 1423 object MenuItem1: TMenuItem 1412 1424 Action = APhotoLoad … … 1417 1429 object MenuItem3: TMenuItem 1418 1430 Action = APhotoClear 1431 end 1432 object MenuItem5: TMenuItem 1433 Action = APhotoSetUrl 1419 1434 end 1420 1435 end -
trunk/Forms/UFormContact.lrj
r101 r103 97 97 {"hash":9308581,"name":"tformcontact.aphotosave.caption","sourcebytes":[83,97,118,101,32,116,111,32,102,105,108,101],"value":"Save to file"}, 98 98 {"hash":4860802,"name":"tformcontact.aphotoclear.caption","sourcebytes":[67,108,101,97,114],"value":"Clear"}, 99 {"hash":368487,"name":"tformcontact.aphotoshow.caption","sourcebytes":[83,104,111,119],"value":"Show"}, 100 {"hash":163994172,"name":"tformcontact.aphotoseturl.caption","sourcebytes":[83,101,116,32,85,82,76],"value":"Set URL"}, 99 101 {"hash":218146437,"name":"tformcontact.openpicturedialog1.title","sourcebytes":[79,112,101,110,32,101,120,105,115,116,105,110,103,32,102,105,108,101],"value":"Open existing file"}, 100 102 {"hash":159035875,"name":"tformcontact.savepicturedialog1.title","sourcebytes":[83,97,118,101,32,102,105,108,101,32,97,115],"value":"Save file as"}, -
trunk/Forms/UFormContact.pas
r102 r103 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 9 ComCtrls, ActnList, Menus, ExtCtrls, ExtDlgs, Buttons, UContact, LCLIntf, 10 UFormProperties, DateUtils{$IFDEF LCLGTK2}, Gtk2Globals{$ENDIF} ;10 UFormProperties, DateUtils{$IFDEF LCLGTK2}, Gtk2Globals{$ENDIF}, UContactImage; 11 11 12 12 type … … 15 15 16 16 TFormContact = class(TForm) 17 APhotoSetUrl: TAction; 18 APhotoShow: TAction; 17 19 APhotoClear: TAction; 18 20 APhotoSave: TAction; … … 172 174 MenuItem2: TMenuItem; 173 175 MenuItem3: TMenuItem; 176 MenuItem4: TMenuItem; 177 MenuItem5: TMenuItem; 174 178 OpenPictureDialog1: TOpenPictureDialog; 175 179 PageControlContact: TPageControl; … … 194 198 procedure APhotoLoadExecute(Sender: TObject); 195 199 procedure APhotoSaveExecute(Sender: TObject); 200 procedure APhotoSetUrlExecute(Sender: TObject); 201 procedure APhotoShowExecute(Sender: TObject); 196 202 procedure ButtonHomeAddressShowClick(Sender: TObject); 197 203 procedure ButtonNextClick(Sender: TObject); 198 204 procedure ButtonPreviousClick(Sender: TObject); 199 205 procedure ButtonWorkAddressShowClick(Sender: TObject); 206 procedure EditFullNameChange(Sender: TObject); 200 207 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 201 208 procedure FormCreate(Sender: TObject); 202 209 procedure FormDestroy(Sender: TObject); 203 210 procedure FormShow(Sender: TObject); 211 procedure ImagePhotoClick(Sender: TObject); 204 212 procedure SpeedButtonHomeWebClick(Sender: TObject); 205 213 procedure SpeedButtonAniversaryClick(Sender: TObject); … … 224 232 procedure TabSheetWorkShow(Sender: TObject); 225 233 private 226 FProfilePhotoActive: Boolean; 227 FProfilePhotoLoaded: Boolean; 228 FProfilePhotoModified: Boolean; 229 procedure SetProfilePhotoActive(AValue: Boolean); 234 FPhoto: TContactImage; 235 procedure PhotoChange(Sender: TObject); 230 236 private 231 237 FContact: TContact; … … 235 241 procedure SetContact(AValue: TContact); 236 242 procedure ReloadAllPropertiesTab; 237 property ProfilePhotoActive: Boolean read FProfilePhotoActive238 write SetProfilePhotoActive;239 243 public 240 244 procedure UpdateInterface; … … 253 257 254 258 uses 255 UCore, UCommon; 259 UCore, UCommon, UFormImage; 260 261 resourcestring 262 SContact = 'Contact'; 263 SPhotoUrl = 'Photo URL'; 264 SPhotoUrlQuery = 'Enter URL for profile photo'; 256 265 257 266 function DateToISO(Date: TDateTime): string; … … 274 283 275 284 {$IF FPC_FULLVERSION<30200} 276 function TryISOStrToDate(const aString: string; out outDate: TDateTime): Boolean;285 function TryISOStrToDate(const aString: string; out OutDate: TDateTime): Boolean; 277 286 var 278 287 xYear, xMonth, xDay: LongInt; … … 280 289 case Length(aString) of 281 290 8: Result := 282 283 284 285 TryEncodeDate(xYear, xMonth, xDay, outDate);291 TryStrToInt(Copy(aString, 1, 4), xYear) and 292 TryStrToInt(Copy(aString, 5, 2), xMonth) and 293 TryStrToInt(Copy(aString, 7, 2), xDay) and 294 TryEncodeDate(xYear, xMonth, xDay, OutDate); 286 295 10: Result := 287 288 289 290 TryEncodeDate(xYear, xMonth, xDay, outDate);296 TryStrToInt(Copy(aString, 1, 4), xYear) and 297 TryStrToInt(Copy(aString, 6, 2), xMonth) and 298 TryStrToInt(Copy(aString, 9, 2), xDay) and 299 TryEncodeDate(xYear, xMonth, xDay, OutDate); 291 300 else 292 301 Result := False; 293 302 end; 294 303 if not Result then 295 outDate := 0;304 OutDate := 0; 296 305 end; 297 306 {$ENDIF} … … 311 320 FormProperties.Show; 312 321 313 FProfilePhotoLoaded := False; 314 315 // Force to load default profile image 316 ProfilePhotoActive := True; 317 ProfilePhotoActive := False; 322 PhotoChange(nil); 318 323 319 324 PageControlContact.TabIndex := Core.LastContactTabIndex; 320 325 UpdateInterface; 326 end; 327 328 procedure TFormContact.ImagePhotoClick(Sender: TObject); 329 begin 330 APhotoShow.Execute; 321 331 end; 322 332 … … 417 427 418 428 procedure TFormContact.TabSheetGeneralHide(Sender: TObject); 419 var420 Photo: string;421 PhotoProperty: TContactProperty;422 Stream: TMemoryStream;423 JpegImage: TJpegImage;424 GifImage: TGIFImage;425 PngImage: TPortableNetworkGraphic;426 429 begin 427 430 Contact.Fields[cfFullName] := EditFullName.Text; … … 443 446 Contact.Fields[cfCategories] := EditCategories.Text; 444 447 445 // Photo 446 if FProfilePhotoModified then begin 447 if ProfilePhotoActive then begin 448 PhotoProperty := Contact.GetProperty(cfPhoto); 449 if not Assigned(PhotoProperty) then begin 450 PhotoProperty := TContactProperty.Create; 451 PhotoProperty.Name := 'PHOTO'; 452 PhotoProperty.Attributes.DelimitedText := 'JPEG'; 453 Contact.Properties.Add(PhotoProperty); 454 end; 455 PhotoProperty.Encoding := 'BASE64'; 456 Stream := TMemoryStream.Create; 457 try 458 if PhotoProperty.Attributes.IndexOf('JPEG') <> -1 then begin 459 JpegImage := TJPEGImage.Create; 460 try 461 try 462 JpegImage.SetSize(ImagePhoto.Picture.Bitmap.Width, ImagePhoto.Picture.Bitmap.Height); 463 JpegImage.Canvas.Draw(0, 0, ImagePhoto.Picture.Bitmap); 464 JpegImage.SaveToStream(Stream); 465 except 466 end; 467 finally 468 JpegImage.Free; 469 end; 470 end else 471 if PhotoProperty.Attributes.IndexOf('PNG') <> -1 then begin 472 PngImage := TPortableNetworkGraphic.Create; 473 try 474 try 475 PngImage.SetSize(ImagePhoto.Picture.Bitmap.Width, ImagePhoto.Picture.Bitmap.Height); 476 PngImage.Canvas.Draw(0, 0, ImagePhoto.Picture.Bitmap); 477 PngImage.SaveToStream(Stream); 478 except 479 end; 480 finally 481 PngImage.Free; 482 end; 483 end else 484 if PhotoProperty.Attributes.IndexOf('GIF') <> -1 then begin 485 GifImage := TGIFImage.Create; 486 try 487 try 488 GifImage.SetSize(ImagePhoto.Picture.Bitmap.Width, ImagePhoto.Picture.Bitmap.Height); 489 GifImage.Canvas.Draw(0, 0, ImagePhoto.Picture.Bitmap); 490 GifImage.SaveToStream(Stream); 491 except 492 end; 493 finally 494 GifImage.Free; 495 end; 496 end else begin 497 try 498 ImagePhoto.Picture.SaveToStream(Stream); 499 except 500 end; 501 end; 502 503 SetLength(Photo, Stream.Size); 504 Stream.Position := 0; 505 Stream.Read(Photo[1], Length(Photo)); 506 Contact.Fields[cfPhoto] := Photo; 507 finally 508 Stream.Free; 509 end; 510 end else begin 511 PhotoProperty := Contact.GetProperty(cfPhoto); 512 if Assigned(PhotoProperty) then 513 Contact.Properties.Remove(PhotoProperty); 514 end; 515 FProfilePhotoModified := False; 516 end; 448 FPhoto.Contact := Contact; 449 FPhoto.Save; 517 450 518 451 ReloadAllPropertiesTab; … … 520 453 521 454 procedure TFormContact.TabSheetGeneralShow(Sender: TObject); 522 var523 Photo: string;524 JpegImage: TJpegImage;525 PngImage: TPortableNetworkGraphic;526 GifImage: TGIFImage;527 Stream: TMemoryStream;528 PhotoProperty: TContactProperty;529 455 begin 530 456 EditFullName.Text := Contact.Fields[cfFullName]; … … 546 472 EditCategories.Text := Contact.Fields[cfCategories]; 547 473 548 // Photo 549 PhotoProperty := Contact.GetProperty(cfPhoto); 550 if not FProfilePhotoLoaded then begin 551 if Assigned(PhotoProperty) then begin 552 FProfilePhotoLoaded := True; 553 FProfilePhotoModified := True; 554 Photo := Contact.Fields[cfPhoto]; 555 if (Photo <> '') and (PhotoProperty.Encoding <> '') then begin 556 Stream := TMemoryStream.Create; 557 try 558 Stream.Write(Photo[1], Length(Photo)); 559 Stream.Position := 0; 560 if (PhotoProperty.Attributes.IndexOf('JPEG') <> -1) or 561 (PhotoProperty.Attributes.IndexOf('jpeg') <> -1) then begin 562 JpegImage := TJPEGImage.Create; 563 try 564 try 565 JpegImage.LoadFromStream(Stream); 566 with ImagePhoto.Picture.Bitmap do begin 567 PixelFormat := pf24bit; 568 SetSize(JpegImage.Width, JpegImage.Height); 569 Canvas.Draw(0, 0, JpegImage); 570 end; 571 ProfilePhotoActive := True; 572 except 573 ProfilePhotoActive := False; 574 end; 575 finally 576 JpegImage.Free; 577 end; 578 end else 579 if (PhotoProperty.Attributes.IndexOf('PNG') <> -1) or 580 (PhotoProperty.Attributes.IndexOf('png') <> -1) then begin 581 PngImage := TPortableNetworkGraphic.Create; 582 try 583 try 584 PngImage.LoadFromStream(Stream); 585 with ImagePhoto.Picture.Bitmap do begin 586 PixelFormat := pf24bit; 587 SetSize(PngImage.Width, PngImage.Height); 588 Canvas.Draw(0, 0, PngImage); 589 end; 590 ProfilePhotoActive := True; 591 except 592 ProfilePhotoActive := False; 593 end; 594 finally 595 PngImage.Free; 596 end; 597 end else 598 if (PhotoProperty.Attributes.IndexOf('GIF') <> -1) or 599 (PhotoProperty.Attributes.IndexOf('gif') <> -1) then begin 600 GifImage := TGIFImage.Create; 601 try 602 try 603 GifImage.LoadFromStream(Stream); 604 with ImagePhoto.Picture.Bitmap do begin 605 PixelFormat := pf24bit; 606 SetSize(GifImage.Width, GifImage.Height); 607 Canvas.Draw(0, 0, GifImage); 608 end; 609 ProfilePhotoActive := True; 610 except 611 ProfilePhotoActive := False; 612 end; 613 finally 614 GifImage.Free; 615 end; 616 end else begin 617 try 618 ImagePhoto.Picture.LoadFromStream(Stream); 619 ProfilePhotoActive := True; 620 except 621 ProfilePhotoActive := False; 622 end; 623 end; 624 finally 625 Stream.Free; 626 end; 627 end else ProfilePhotoActive := False; 628 end else ProfilePhotoActive := False; 629 end; 474 FPhoto.Contact := Contact; 475 FPhoto.Load; 630 476 end; 631 477 … … 750 596 end; 751 597 752 procedure TFormContact.SetProfilePhotoActive(AValue: Boolean); 753 begin 754 if FProfilePhotoActive = AValue then Exit; 755 FProfilePhotoActive := AValue; 756 if not FProfilePhotoActive then begin 757 ImagePhoto.Picture.Assign(Core.GetProfileImage.Picture); 758 end; 598 procedure TFormContact.PhotoChange(Sender: TObject); 599 begin 600 if FPhoto.Used and (FPhoto.Url = '') then 601 ImagePhoto.Picture.Bitmap.Assign(FPhoto.Bitmap) 602 else ImagePhoto.Picture.Assign(Core.GetProfileImage.Picture); 759 603 UpdateInterface; 760 604 end; … … 791 635 procedure TFormContact.APhotoLoadExecute(Sender: TObject); 792 636 begin 637 OpenPictureDialog1.FileName := Core.LastPhotoFileName; 793 638 if OpenPictureDialog1.Execute then begin 794 ImagePhoto.Picture.LoadFromFile(OpenPictureDialog1.FileName); 795 FProfilePhotoModified := True; 796 FProfilePhotoLoaded := True; 797 ProfilePhotoActive := True; 639 FPhoto.LoadFromFile(OpenPictureDialog1.FileName); 640 Core.LastPhotoFileName := OpenPictureDialog1.FileName; 798 641 end; 799 642 end; … … 801 644 procedure TFormContact.APhotoClearExecute(Sender: TObject); 802 645 begin 803 FProfilePhotoModified := True; 804 ProfilePhotoActive := False; 646 FPhoto.Clear; 805 647 end; 806 648 807 649 procedure TFormContact.APhotoSaveExecute(Sender: TObject); 808 650 begin 651 SavePictureDialog1.FileName := Core.LastPhotoFileName; 809 652 if SavePictureDialog1.Execute then begin 810 653 ImagePhoto.Picture.SaveToFile(SavePictureDialog1.FileName); 654 Core.LastPhotoFileName := SavePictureDialog1.FileName; 655 end; 656 end; 657 658 procedure TFormContact.APhotoSetUrlExecute(Sender: TObject); 659 begin 660 FPhoto.Url := InputBox(SPhotoUrl, SPhotoUrlQuery, FPhoto.Url); 661 end; 662 663 procedure TFormContact.APhotoShowExecute(Sender: TObject); 664 begin 665 with TFormImage.Create(nil) do 666 try 667 Image.Assign(FPhoto); 668 if ShowModal = mrOK then begin 669 FPhoto.Assign(Image); 670 UpdateInterface; 671 end; 672 finally 673 Free; 811 674 end; 812 675 end; … … 844 707 end; 845 708 709 procedure TFormContact.EditFullNameChange(Sender: TObject); 710 begin 711 UpdateInterface; 712 end; 713 846 714 procedure TFormContact.FormCreate(Sender: TObject); 847 715 begin … … 850 718 FContact := nil; 851 719 FormProperties := TFormProperties.Create(nil); 720 FPhoto := TContactImage.Create; 721 FPhoto.FieldIndex := cfPhoto; 722 FPhoto.OnChange := PhotoChange; 852 723 end; 853 724 854 725 procedure TFormContact.FormDestroy(Sender: TObject); 855 726 begin 727 FreeAndNil(FPhoto); 856 728 FreeAndNil(FormProperties); 857 729 end; … … 859 731 procedure TFormContact.UpdateInterface; 860 732 begin 861 APhotoSave.Enabled := ProfilePhotoActive; 862 APhotoClear.Enabled := ProfilePhotoActive; 733 Caption := EditFullName.Text + ' - ' + SContact; 734 APhotoSave.Enabled := FPhoto.Used; 735 APhotoClear.Enabled := FPhoto.Used; 863 736 //ButtonNext.Enabled := Assigned(FOnGetNext) and Assigned(FOnGetNext(Contact)); 864 737 //ButtonPrevious.Enabled := Assigned(FOnGetPrevious) and Assigned(FOnGetPrevious(Contact)); -
trunk/Forms/UFormContacts.pas
r98 r103 300 300 procedure TFormContacts.FormShow(Sender: TObject); 301 301 begin 302 Core.Translator.TranslateComponentRecursive(Self); 303 Core.ThemeManager1.UseTheme(Self); 302 304 Core.PersistentForm1.Load(Self); 303 Core.ThemeManager1.UseTheme(Self);304 Core.Translator.TranslateComponentRecursive(Self);305 305 ReloadList; 306 306 UpdateInterface; -
trunk/Forms/UFormFind.lfm
r82 r103 1 1 object FormFind: TFormFind 2 2 Left = 469 3 Height = 5 233 Height = 545 4 4 Top = 407 5 Width = 8 075 Width = 841 6 6 ActiveControl = EditValue 7 7 Caption = 'Find' 8 ClientHeight = 5 239 ClientWidth = 8 0710 DesignTimePPI = 1 448 ClientHeight = 545 9 ClientWidth = 841 10 DesignTimePPI = 150 11 11 OnClose = FormClose 12 12 OnCreate = FormCreate 13 13 OnDestroy = FormDestroy 14 14 OnShow = FormShow 15 LCLVersion = '2. 0.12.0'15 LCLVersion = '2.2.0.4' 16 16 object Panel1: TPanel 17 17 Left = 0 18 Height = 5818 Height = 60 19 19 Top = 0 20 Width = 8 0720 Width = 841 21 21 Align = alTop 22 22 BevelOuter = bvNone 23 ClientHeight = 5824 ClientWidth = 8 0723 ClientHeight = 60 24 ClientWidth = 841 25 25 ParentFont = False 26 26 TabOrder = 0 27 27 object ComboBoxField: TComboBox 28 Left = 1 8429 Height = 4 130 Top = 1 631 Width = 2 4028 Left = 192 29 Height = 42 30 Top = 17 31 Width = 250 32 32 ItemHeight = 0 33 33 OnChange = ComboBoxFieldChange … … 37 37 end 38 38 object Label1: TLabel 39 Left = 1 340 Height = 2 441 Top = 1942 Width = 1 3539 Left = 14 40 Height = 27 41 Top = 20 42 Width = 142 43 43 Caption = 'By contact field:' 44 ParentColor = False45 44 ParentFont = False 46 45 end 47 46 object EditValue: TEdit 48 Left = 4 4049 Height = 4 250 Top = 1 651 Width = 2 0847 Left = 458 48 Height = 43 49 Top = 17 50 Width = 217 52 51 OnKeyPress = EditValueKeyPress 53 52 TabOrder = 1 54 53 end 55 54 object ButtonFind: TButton 56 Left = 6 6457 Height = 3858 Top = 1 659 Width = 11 355 Left = 692 56 Height = 40 57 Top = 17 58 Width = 118 60 59 Caption = 'Find' 61 60 OnClick = ButtonFindClick -
trunk/Forms/UFormFind.pas
r82 r103 100 100 Core.Translator.TranslateComponentRecursive(Self); 101 101 Core.ThemeManager1.UseTheme(Self); 102 102 103 ContactFieldIndex := cfNone; 103 104 -
trunk/Forms/UFormFindDuplicity.lfm
r82 r103 1 1 object FormFindDuplicity: TFormFindDuplicity 2 2 Left = 455 3 Height = 5 233 Height = 545 4 4 Top = 355 5 Width = 8 075 Width = 841 6 6 Caption = 'Find duplicities' 7 ClientHeight = 5 238 ClientWidth = 8 079 DesignTimePPI = 1 447 ClientHeight = 545 8 ClientWidth = 841 9 DesignTimePPI = 150 10 10 OnClose = FormClose 11 11 OnCreate = FormCreate 12 12 OnDestroy = FormDestroy 13 13 OnShow = FormShow 14 LCLVersion = '2. 0.12.0'14 LCLVersion = '2.2.0.4' 15 15 object ListView1: TListView 16 16 Left = 5 17 Height = 4 5518 Top = 6 319 Width = 79717 Height = 475 18 Top = 65 19 Width = 831 20 20 Align = alClient 21 21 BorderSpacing.Around = 5 … … 23 23 item 24 24 Caption = 'Field' 25 Width = 18 025 Width = 188 26 26 end 27 27 item 28 28 Caption = 'Contacts' 29 Width = 3 6029 Width = 375 30 30 end 31 31 item 32 32 Caption = 'Count' 33 Width = 2 4233 Width = 253 34 34 end> 35 35 OwnerData = True … … 45 45 object Panel1: TPanel 46 46 Left = 0 47 Height = 5847 Height = 60 48 48 Top = 0 49 Width = 8 0749 Width = 841 50 50 Align = alTop 51 51 BevelOuter = bvNone 52 ClientHeight = 5853 ClientWidth = 8 0752 ClientHeight = 60 53 ClientWidth = 841 54 54 ParentFont = False 55 55 TabOrder = 1 56 56 object ComboBoxField: TComboBox 57 Left = 16 058 Height = 4 159 Top = 1 660 Width = 3 2657 Left = 167 58 Height = 42 59 Top = 17 60 Width = 340 61 61 ItemHeight = 0 62 62 OnChange = ComboBoxFieldChange … … 66 66 end 67 67 object Label1: TLabel 68 Left = 1 369 Height = 2 470 Top = 1971 Width = 1 3568 Left = 14 69 Height = 27 70 Top = 20 71 Width = 142 72 72 Caption = 'By contact field:' 73 ParentColor = False74 73 ParentFont = False 75 74 end 76 75 object ButtonMerge: TButton 77 Left = 49678 Height = 3879 Top = 1 480 Width = 11 376 Left = 517 77 Height = 40 78 Top = 15 79 Width = 118 81 80 Caption = 'Merge' 82 81 OnClick = ButtonMergeClick … … 85 84 end 86 85 object ActionList1: TActionList 87 Left = 2 6288 Top = 1 5486 Left = 273 87 Top = 160 89 88 object AShowContacts: TAction 90 89 Caption = 'Show contacts' … … 93 92 end 94 93 object PopupMenu1: TPopupMenu 95 Left = 9 096 Top = 1 4994 Left = 94 95 Top = 155 97 96 object MenuItem1: TMenuItem 98 97 Action = AShowContacts -
trunk/Forms/UFormFindDuplicity.pas
r82 r103 169 169 procedure TFormFindDuplicity.FormCreate(Sender: TObject); 170 170 begin 171 FoundItems := TFoundItems.Create;172 171 Core.Translator.TranslateComponentRecursive(Self); 173 172 Core.ThemeManager1.UseTheme(Self); 173 174 FoundItems := TFoundItems.Create; 174 175 ContactFieldIndex := cfFullName; 175 176 end; -
trunk/Forms/UFormGenerate.lfm
r69 r103 1 1 object FormGenerate: TFormGenerate 2 2 Left = 470 3 Height = 5 623 Height = 585 4 4 Top = 372 5 Width = 8 125 Width = 846 6 6 Caption = 'Generate contacts' 7 ClientHeight = 5 628 ClientWidth = 8 129 DesignTimePPI = 1 447 ClientHeight = 585 8 ClientWidth = 846 9 DesignTimePPI = 150 10 10 OnClose = FormClose 11 11 OnCreate = FormCreate 12 12 OnShow = FormShow 13 LCLVersion = '2. 0.12.0'13 LCLVersion = '2.2.0.4' 14 14 object Label1: TLabel 15 Left = 1916 Height = 2 417 Top = 1918 Width = 5 515 Left = 20 16 Height = 27 17 Top = 20 18 Width = 59 19 19 Caption = 'Count:' 20 ParentColor = False21 20 ParentFont = False 22 21 end 23 22 object SpinEditCount: TSpinEdit 24 Left = 1 5525 Height = 4 226 Top = 1 827 Width = 15 223 Left = 161 24 Height = 43 25 Top = 19 26 Width = 158 28 27 MaxValue = 1000000000 29 28 MinValue = 1 … … 33 32 end 34 33 object ButtonGenerate: TButton 35 Left = 1936 Height = 3 737 Top = 1 7338 Width = 11 334 Left = 20 35 Height = 39 36 Top = 180 37 Width = 118 39 38 Caption = 'Generate' 40 39 OnClick = ButtonGenerateClick -
trunk/Forms/UFormGenerate.pas
r69 r103 46 46 for I := 1 to SpinEditCount.Value do begin 47 47 Contact := Contacts.AddNew; 48 Contact.Fields[cfVersion] := '2.1';48 Contact.Fields[cfVersion] := Core.DefaultVcardVersion; 49 49 Contact.Fields[cfFirstName] := 'First ' + IntToStr(Random(10000)); 50 50 Contact.Fields[cfLastName] := 'Last ' + IntToStr(Random(10000)); … … 54 54 end; 55 55 Close; 56 ModalResult := mrOk; 56 57 end; 57 58 -
trunk/Forms/UFormProperties.pas
r98 r103 205 205 begin 206 206 Core.PersistentForm1.Load(Self); 207 Core.ThemeManager1.UseTheme(Self);208 Core.Translator.TranslateComponentRecursive(Self);209 207 ReloadList; 210 208 UpdateInterface; … … 352 350 I: Integer; 353 351 begin 352 Core.Translator.TranslateComponentRecursive(Self); 353 Core.ThemeManager1.UseTheme(Self); 354 354 355 FProperties := nil; 355 356 for I := 0 to ToolBar1.ButtonCount - 1 do begin -
trunk/Forms/UFormProperty.lfm
r89 r103 1 1 object FormProperty: TFormProperty 2 2 Left = 760 3 Height = 4 183 Height = 435 4 4 Top = 576 5 Width = 7 265 Width = 756 6 6 Caption = 'Field' 7 ClientHeight = 4 188 ClientWidth = 7 269 DesignTimePPI = 1 447 ClientHeight = 435 8 ClientWidth = 756 9 DesignTimePPI = 150 10 10 OnClose = FormClose 11 11 OnCreate = FormCreate 12 12 OnShow = FormShow 13 LCLVersion = '2. 0.12.0'13 LCLVersion = '2.2.0.4' 14 14 object ButtonOk: TButton 15 Left = 4 6016 Height = 3 717 Top = 3 6518 Width = 1 1915 Left = 479 16 Height = 39 17 Top = 379 18 Width = 124 19 19 Anchors = [akRight, akBottom] 20 20 Caption = 'OK' … … 25 25 end 26 26 object ButtonCancel: TButton 27 Left = 59628 Height = 3 729 Top = 3 6530 Width = 1 1527 Left = 620 28 Height = 39 29 Top = 379 30 Width = 120 31 31 Anchors = [akRight, akBottom] 32 32 Caption = 'Cancel' … … 36 36 end 37 37 object Label1: TLabel 38 Left = 2 439 Height = 2 440 Top = 8 041 Width = 5 638 Left = 25 39 Height = 27 40 Top = 83 41 Width = 59 42 42 Caption = 'Name:' 43 ParentColor = False44 43 end 45 44 object EditName: TEdit 46 Left = 1 6847 Height = 4 248 Top = 7 249 Width = 5 3245 Left = 175 46 Height = 43 47 Top = 75 48 Width = 554 50 49 Anchors = [akTop, akLeft, akRight] 51 50 OnChange = EditNameChange … … 53 52 end 54 53 object Label2: TLabel 55 Left = 2 456 Height = 2 457 Top = 1 2858 Width = 8854 Left = 25 55 Height = 27 56 Top = 133 57 Width = 95 59 58 Caption = 'Attributes:' 60 ParentColor = False61 59 end 62 60 object EditAttributes: TEdit 63 Left = 1 6864 Height = 4 265 Top = 12 466 Width = 5 3261 Left = 175 62 Height = 43 63 Top = 129 64 Width = 554 67 65 Anchors = [akTop, akLeft, akRight] 68 66 OnChange = EditAttributesChange … … 70 68 end 71 69 object Label3: TLabel 72 Left = 2 473 Height = 2 474 Top = 18 075 Width = 6 070 Left = 25 71 Height = 27 72 Top = 188 73 Width = 64 76 74 Caption = 'Values:' 77 ParentColor = False78 75 end 79 76 object EditValues: TEdit 80 Left = 1 6881 Height = 4 282 Top = 17 283 Width = 5 3277 Left = 175 78 Height = 43 79 Top = 179 80 Width = 554 84 81 Anchors = [akTop, akLeft, akRight] 85 82 TabOrder = 3 86 83 end 87 84 object Label4: TLabel 88 Left = 2 489 Height = 2 490 Top = 3 291 Width = 4 585 Left = 25 86 Height = 27 87 Top = 33 88 Width = 48 92 89 Caption = 'Field:' 93 ParentColor = False94 90 end 95 91 object ComboBoxField: TComboBox 96 Left = 1 6897 Height = 4 198 Top = 2 499 Width = 5 3292 Left = 175 93 Height = 42 94 Top = 25 95 Width = 554 100 96 Anchors = [akTop, akLeft, akRight] 101 97 ItemHeight = 0 -
trunk/Forms/UFormProperty.pas
r82 r103 101 101 Core.Translator.TranslateComponentRecursive(Self); 102 102 Core.ThemeManager1.UseTheme(Self); 103 103 104 FContactProperty := nil; 104 105 TContact.GetFields.LoadToStrings(ComboBoxField.Items); -
trunk/Forms/UFormTest.pas
r97 r103 35 35 procedure ReloadList; 36 36 procedure UpdateInterface; 37 procedure InitTestCases; 37 38 public 38 39 TestCases: TTestCases; … … 78 79 ARun.Enabled := Assigned(ListViewTestCases.Selected); 79 80 AShow.Enabled := Assigned(ListViewTestCases.Selected); 81 end; 82 83 procedure TFormTest.InitTestCases; 84 const 85 VCardVersion = 'VERSION:2.1'; 86 begin 87 TestCases := TTestCases.Create; 88 with TestCases do begin 89 with TTestCaseLoadSave(AddNew('Load and save', TTestCaseLoadSave)) do begin 90 Input := VCardBegin + LineEnding + 91 VCardVersion + LineEnding + 92 'N:Surname;Name' + LineEnding + 93 'FN:Name Surname' + LineEnding + 94 VCardEnd + LineEnding; 95 Output := Input; 96 end; 97 with TTestCaseLoadSave(AddNew('Long text', TTestCaseLoadSave)) do begin 98 Input := VCardBegin + LineEnding + 99 VCardVersion + LineEnding + 100 'NOTE:This is some long test which is really multi-lined each line is on d' + LineEnding + 101 ' ifferent line so it is on multiple lines.' + LineEnding + 102 VCardEnd + LineEnding; 103 Output := Input; 104 end; 105 with TTestCaseLoadSave(AddNew('Multi-line', TTestCaseLoadSave)) do begin 106 Input := VCardBegin + LineEnding + 107 VCardVersion + LineEnding + 108 'NOTE:First line\nsecond line\nempty line\n\nlast line' + LineEnding + 109 VCardEnd + LineEnding; 110 Output := Input; 111 end; 112 with TTestCaseLoadSave(AddNew('Quoted-printable load-save', TTestCaseLoadSave)) do begin 113 Input := VCardBegin + LineEnding + 114 VCardVersion + LineEnding + 115 'FN;ENCODING=QUOTED-PRINTABLE:Jm=C3=A9no=20P=C5=99=C3=ADjmen=C3=AD' + LineEnding + 116 VCardEnd + LineEnding; 117 Output := Input; 118 end; 119 with TTestCaseLoadSave(AddNew('Quoted-printable load-save multi-line', TTestCaseLoadSave)) do begin 120 Input := VCardBegin + LineEnding + 121 VCardVersion + LineEnding + 122 'FN;ENCODING=QUOTED-PRINTABLE:Jm=C3=A9no=20P=C5=99=C3=ADjmen=C3=AD=' + LineEnding + 123 'Jm=C3=A9no=20P=C5=99=C3=ADjmen=C3=AD' + LineEnding + 124 VCardEnd + LineEnding; 125 Output := Input; 126 end; 127 //AddNew('Encoding base64', TTestCaseLoadSave); 128 //AddNew('Encoding quoted-printable', TTestCaseLoadSave); 129 //AddNew('Image format', TTestCaseLoadSave); 130 with TTestCaseLoadSave(AddNew('Empty', TTestCaseLoadSave)) do begin 131 Input := ''; 132 Output := ''; 133 end; 134 with TTestCaseLoadSave(AddNew('Begin only', TTestCaseLoadSave)) do begin 135 Input := VCardBegin; 136 Output := ''; 137 end; 138 with TTestCaseLoadSave(AddNew('Missing end', TTestCaseLoadSave)) do begin 139 Input := VCardBegin + LineEnding + 140 VCardVersion + LineEnding + 141 'N:Surname;Name' + LineEnding + 142 'FN:Name Surname' + LineEnding; 143 Output := ''; 144 end; 145 with TTestCaseLoadSave(AddNew('Missing start', TTestCaseLoadSave)) do begin 146 Input := VCardVersion + LineEnding + 147 'N:Surname;Name' + LineEnding + 148 'FN:Name Surname' + LineEnding + 149 VCardEnd + LineEnding; 150 Output := ''; 151 end; 152 with TTestCaseCheckProperty(AddNew('Propery FN', TTestCaseCheckProperty)) do begin 153 Index := cfFullName; 154 Value := 'Name Surname'; 155 Input := VCardBegin + LineEnding + 156 VCardVersion + LineEnding + 157 'FN:' + Value + LineEnding + 158 VCardEnd + LineEnding; 159 end; 160 with TTestCaseCheckProperty(AddNew('Escaped new lines in text', TTestCaseCheckProperty)) do begin 161 Index := cfNote; 162 Value := 'Line' + #13#10 + 'Line'; 163 Input := VCardBegin + LineEnding + 164 VCardVersion + LineEnding + 165 'NOTE:Line\nLine' + LineEnding + 166 VCardEnd + LineEnding; 167 end; 168 with TTestCaseCheckProperty(AddNew('Compound value', TTestCaseCheckProperty)) do begin 169 Index := cfFirstName; 170 Value := 'FirstName'; 171 Input := VCardBegin + LineEnding + 172 VCardVersion + LineEnding + 173 'N:Surname;FirstName;;;' + LineEnding + 174 VCardEnd + LineEnding; 175 end; 176 with TTestCaseCheckProperty(AddNew('Quoted-printable special symbols', TTestCaseCheckProperty)) do begin 177 Index := cfFullName; 178 Value := 'Jméno Příjmení'; 179 Input := VCardBegin + LineEnding + 180 VCardVersion + LineEnding + 181 'FN;ENCODING=QUOTED-PRINTABLE:Jm=C3=A9no=20P=C5=99=C3=ADjmen=C3=AD' + LineEnding + 182 VCardEnd + LineEnding; 183 end; 184 end; 80 185 end; 81 186 … … 115 220 116 221 procedure TFormTest.FormCreate(Sender: TObject); 117 const 118 VCardVersion = 'VERSION:2.1'; 119 begin 120 TestCases := TTestCases.Create; 121 with TestCases do begin 122 with TTestCaseLoadSave(AddNew('Load and save', TTestCaseLoadSave)) do begin 123 Input := VCardBegin + LineEnding + 124 VCardVersion + LineEnding + 125 'N:Surname;Name' + LineEnding + 126 'FN:Name Surname' + LineEnding + 127 VCardEnd + LineEnding; 128 Output := Input; 129 end; 130 with TTestCaseLoadSave(AddNew('Long text', TTestCaseLoadSave)) do begin 131 Input := VCardBegin + LineEnding + 132 VCardVersion + LineEnding + 133 'NOTE:This is some long test which is really multi-lined each line is on d' + LineEnding + 134 ' ifferent line so it is on multiple lines.' + LineEnding + 135 VCardEnd + LineEnding; 136 Output := Input; 137 end; 138 with TTestCaseLoadSave(AddNew('Multi-line', TTestCaseLoadSave)) do begin 139 Input := VCardBegin + LineEnding + 140 VCardVersion + LineEnding + 141 'NOTE:First line\nsecond line\nempty line\n\nlast line' + LineEnding + 142 VCardEnd + LineEnding; 143 Output := Input; 144 end; 145 with TTestCaseLoadSave(AddNew('Quoted-printable load-save', TTestCaseLoadSave)) do begin 146 Input := VCardBegin + LineEnding + 147 VCardVersion + LineEnding + 148 'FN;ENCODING=QUOTED-PRINTABLE:Jm=C3=A9no=20P=C5=99=C3=ADjmen=C3=AD' + LineEnding + 149 VCardEnd + LineEnding; 150 Output := Input; 151 end; 152 with TTestCaseLoadSave(AddNew('Quoted-printable load-save multi-line', TTestCaseLoadSave)) do begin 153 Input := VCardBegin + LineEnding + 154 VCardVersion + LineEnding + 155 'FN;ENCODING=QUOTED-PRINTABLE:Jm=C3=A9no=20P=C5=99=C3=ADjmen=C3=AD=' + LineEnding + 156 'Jm=C3=A9no=20P=C5=99=C3=ADjmen=C3=AD' + LineEnding + 157 VCardEnd + LineEnding; 158 Output := Input; 159 end; 160 //AddNew('Encoding base64', TTestCaseLoadSave); 161 //AddNew('Encoding quoted-printable', TTestCaseLoadSave); 162 //AddNew('Image format', TTestCaseLoadSave); 163 with TTestCaseLoadSave(AddNew('Empty', TTestCaseLoadSave)) do begin 164 Input := ''; 165 Output := ''; 166 end; 167 with TTestCaseLoadSave(AddNew('Begin only', TTestCaseLoadSave)) do begin 168 Input := VCardBegin; 169 Output := ''; 170 end; 171 with TTestCaseLoadSave(AddNew('Missing end', TTestCaseLoadSave)) do begin 172 Input := VCardBegin + LineEnding + 173 VCardVersion + LineEnding + 174 'N:Surname;Name' + LineEnding + 175 'FN:Name Surname' + LineEnding; 176 Output := ''; 177 end; 178 with TTestCaseLoadSave(AddNew('Missing start', TTestCaseLoadSave)) do begin 179 Input := VCardVersion + LineEnding + 180 'N:Surname;Name' + LineEnding + 181 'FN:Name Surname' + LineEnding + 182 VCardEnd + LineEnding; 183 Output := ''; 184 end; 185 with TTestCaseCheckProperty(AddNew('Propery FN', TTestCaseCheckProperty)) do begin 186 Index := cfFullName; 187 Value := 'Name Surname'; 188 Input := VCardBegin + LineEnding + 189 VCardVersion + LineEnding + 190 'FN:' + Value + LineEnding + 191 VCardEnd + LineEnding; 192 end; 193 with TTestCaseCheckProperty(AddNew('Escaped new lines in text', TTestCaseCheckProperty)) do begin 194 Index := cfNote; 195 Value := 'Line' + #13#10 + 'Line'; 196 Input := VCardBegin + LineEnding + 197 VCardVersion + LineEnding + 198 'NOTE:Line\nLine' + LineEnding + 199 VCardEnd + LineEnding; 200 end; 201 with TTestCaseCheckProperty(AddNew('Compound value', TTestCaseCheckProperty)) do begin 202 Index := cfFirstName; 203 Value := 'FirstName'; 204 Input := VCardBegin + LineEnding + 205 VCardVersion + LineEnding + 206 'N:Surname;FirstName;;;' + LineEnding + 207 VCardEnd + LineEnding; 208 end; 209 with TTestCaseCheckProperty(AddNew('Quoted-printable special symbols', TTestCaseCheckProperty)) do begin 210 Index := cfFullName; 211 Value := 'Jméno Příjmení'; 212 Input := VCardBegin + LineEnding + 213 VCardVersion + LineEnding + 214 'FN;ENCODING=QUOTED-PRINTABLE:Jm=C3=A9no=20P=C5=99=C3=ADjmen=C3=AD' + LineEnding + 215 VCardEnd + LineEnding; 216 end; 217 end; 222 begin 223 Core.Translator.TranslateComponentRecursive(Self); 224 Core.ThemeManager1.UseTheme(Self); 225 226 InitTestCases; 218 227 end; 219 228 -
trunk/Forms/UFormTestCase.lfm
r91 r103 9 9 DesignTimePPI = 150 10 10 OnClose = FormClose 11 OnCreate = FormCreate 11 12 OnShow = FormShow 12 13 LCLVersion = '2.2.0.4' -
trunk/Forms/UFormTestCase.pas
r91 r103 15 15 MemoLog: TMemo; 16 16 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 17 procedure FormCreate(Sender: TObject); 17 18 procedure FormShow(Sender: TObject); 18 19 private … … 40 41 end; 41 42 43 procedure TFormTestCase.FormCreate(Sender: TObject); 44 begin 45 Core.Translator.TranslateComponentRecursive(Self); 46 Core.ThemeManager1.UseTheme(Self); 47 end; 48 42 49 procedure TFormTestCase.FormShow(Sender: TObject); 43 50 begin -
trunk/Languages/vCardStudio.cs.po
r101 r103 100 100 101 101 #: tformcontact.aphotoclear.caption 102 msgctxt "tformcontact.aphotoclear.caption" 102 103 msgid "Clear" 103 104 msgstr "Vyčistit" … … 113 114 msgstr "Uložit do souboru" 114 115 116 #: tformcontact.aphotoseturl.caption 117 msgid "Set URL" 118 msgstr "Nastavit URL" 119 120 #: tformcontact.aphotoshow.caption 121 msgctxt "tformcontact.aphotoshow.caption" 122 msgid "Show" 123 msgstr "Ukázat" 124 115 125 #: tformcontact.buttoncancel.caption 116 126 msgctxt "tformcontact.buttoncancel.caption" … … 142 152 143 153 #: tformcontact.calendardialog1.cancelcaption 144 #, fuzzy145 154 msgctxt "tformcontact.calendardialog1.cancelcaption" 146 155 msgid "Cancel" … … 157 166 158 167 #: tformcontact.caption 168 msgctxt "tformcontact.caption" 159 169 msgid "Contact" 160 170 msgstr "Kontakt" … … 719 729 msgstr "Počet:" 720 730 731 #: tformimage.buttoncancel.caption 732 msgctxt "tformimage.buttoncancel.caption" 733 msgid "Cancel" 734 msgstr "Zrušit" 735 736 #: tformimage.buttonclear.caption 737 msgctxt "tformimage.buttonclear.caption" 738 msgid "Clear" 739 msgstr "Vyčistit" 740 741 #: tformimage.buttonload.caption 742 msgctxt "tformimage.buttonload.caption" 743 msgid "Load from file" 744 msgstr "Načíst ze souboru" 745 746 #: tformimage.buttonok.caption 747 msgctxt "tformimage.buttonok.caption" 748 msgid "OK" 749 msgstr "OK" 750 751 #: tformimage.buttonsave.caption 752 msgctxt "tformimage.buttonsave.caption" 753 msgid "Save to file" 754 msgstr "Uložit do souboru" 755 756 #: tformimage.caption 757 msgctxt "tformimage.caption" 758 msgid "Photo" 759 msgstr "Fotka" 760 761 #: tformimage.label1.caption 762 msgctxt "tformimage.label1.caption" 763 msgid "URL:" 764 msgstr "URL:" 765 721 766 #: tformmain.caption 722 767 msgid "vCard Studio" … … 906 951 907 952 #: tformtest.listviewtestcases.columns[0].caption 908 #, fuzzy909 953 msgctxt "tformtest.listviewtestcases.columns[0].caption" 910 954 msgid "Name" … … 1131 1175 1132 1176 #: ucontact.sphoto 1177 msgctxt "ucontact.sphoto" 1133 1178 msgid "Photo" 1134 1179 msgstr "Fotka" … … 1315 1360 msgstr "Soubor" 1316 1361 1362 #: uformcontact.scontact 1363 msgctxt "uformcontact.scontact" 1364 msgid "Contact" 1365 msgstr "Kontakt" 1366 1367 #: uformcontact.sphotourl 1368 msgid "Photo URL" 1369 msgstr "URL fotky" 1370 1371 #: uformcontact.sphotourlquery 1372 msgid "Enter URL for profile photo" 1373 msgstr "Zadejte URL pro profilovou fotku" 1374 1317 1375 #: uformcontacts.sendupdatetoolow 1318 1376 msgid "Update counter error" -
trunk/Languages/vCardStudio.pot
r101 r103 90 90 91 91 #: tformcontact.aphotoclear.caption 92 msgctxt "tformcontact.aphotoclear.caption" 92 93 msgid "Clear" 93 94 msgstr "" 94 95 95 96 #: tformcontact.aphotoload.caption 97 msgctxt "tformcontact.aphotoload.caption" 96 98 msgid "Load from file" 97 99 msgstr "" 98 100 99 101 #: tformcontact.aphotosave.caption 102 msgctxt "tformcontact.aphotosave.caption" 100 103 msgid "Save to file" 104 msgstr "" 105 106 #: tformcontact.aphotoseturl.caption 107 msgid "Set URL" 108 msgstr "" 109 110 #: tformcontact.aphotoshow.caption 111 msgctxt "tformcontact.aphotoshow.caption" 112 msgid "Show" 101 113 msgstr "" 102 114 … … 144 156 145 157 #: tformcontact.caption 158 msgctxt "tformcontact.caption" 146 159 msgid "Contact" 147 160 msgstr "" … … 697 710 msgstr "" 698 711 712 #: tformimage.buttoncancel.caption 713 msgctxt "tformimage.buttoncancel.caption" 714 msgid "Cancel" 715 msgstr "" 716 717 #: tformimage.buttonclear.caption 718 msgctxt "tformimage.buttonclear.caption" 719 msgid "Clear" 720 msgstr "" 721 722 #: tformimage.buttonload.caption 723 msgctxt "tformimage.buttonload.caption" 724 msgid "Load from file" 725 msgstr "" 726 727 #: tformimage.buttonok.caption 728 msgctxt "tformimage.buttonok.caption" 729 msgid "OK" 730 msgstr "" 731 732 #: tformimage.buttonsave.caption 733 msgctxt "tformimage.buttonsave.caption" 734 msgid "Save to file" 735 msgstr "" 736 737 #: tformimage.caption 738 msgctxt "tformimage.caption" 739 msgid "Photo" 740 msgstr "" 741 742 #: tformimage.label1.caption 743 msgctxt "tformimage.label1.caption" 744 msgid "URL:" 745 msgstr "" 746 699 747 #: tformmain.caption 700 748 msgid "vCard Studio" … … 1101 1149 1102 1150 #: ucontact.sphoto 1151 msgctxt "ucontact.sphoto" 1103 1152 msgid "Photo" 1104 1153 msgstr "" … … 1283 1332 msgstr "" 1284 1333 1334 #: uformcontact.scontact 1335 msgctxt "uformcontact.scontact" 1336 msgid "Contact" 1337 msgstr "" 1338 1339 #: uformcontact.sphotourl 1340 msgid "Photo URL" 1341 msgstr "" 1342 1343 #: uformcontact.sphotourlquery 1344 msgid "Enter URL for profile photo" 1345 msgstr "" 1346 1285 1347 #: uformcontacts.sendupdatetoolow 1286 1348 msgid "Update counter error" -
trunk/UContact.pas
r98 r103 6 6 7 7 uses 8 Classes, SysUtils, fgl, Dialogs, UDataFile, LazUTF8, Base64 ;8 Classes, SysUtils, fgl, Dialogs, UDataFile, LazUTF8, Base64, Graphics; 9 9 10 10 type … … 195 195 VCardBegin = 'BEGIN:VCARD'; 196 196 VCardEnd = 'END:VCARD'; 197 VCardBase64 = 'BASE64'; 198 VCardQuotedPrintable = 'QUOTED-PRINTABLE'; 197 199 198 200 … … 571 573 I: Integer; 572 574 begin 573 if Attributes.IndexOf( 'BASE64') <> -1 then begin574 Encoding := 'BASE64';575 if Attributes.IndexOf(VCardBase64) <> -1 then begin 576 Encoding := VCardBase64; 575 577 Value := GetDecodedValue; 576 578 end else 577 579 if Attributes.IndexOfName('ENCODING') <> -1 then begin 578 580 Encoding := Attributes.Values['ENCODING']; 579 if (Encoding = 'B') or (Encoding = 'b') then Encoding := 'BASE64';580 if (Encoding = 'Q') or (Encoding = 'q') then Encoding := 'QUOTED-PRINTABLE';581 if (Encoding = 'QUOTED-PRINTABLE') or (Encoding = 'BASE64') then begin581 if (Encoding = 'B') or (Encoding = 'b') then Encoding := VCardBase64; 582 if (Encoding = 'Q') or (Encoding = 'q') then Encoding := VCardQuotedPrintable; 583 if (Encoding = VCardQuotedPrintable) or (Encoding = VCardBase64) then begin 582 584 Value := GetDecodedValue; 583 585 Attributes.Delete(Attributes.IndexOfName('ENCODING')); … … 600 602 function TContactProperty.GetDecodedValue: string; 601 603 begin 602 if Encoding = 'BASE64'then begin604 if Encoding = VCardBase64 then begin 603 605 Result := DecodeStringBase64(Value); 604 606 end else 605 if Encoding = 'QUOTED-PRINTABLE'then begin607 if Encoding = VCardQuotedPrintable then begin 606 608 Result := DecodeQuotedPrintable(Value, True); 607 609 end … … 611 613 function TContactProperty.GetEncodedValue: string; 612 614 begin 613 if Encoding = 'BASE64'then begin615 if Encoding = VCardBase64 then begin 614 616 Result := EncodeStringBase64(Value); 615 617 end else 616 if Encoding = 'QUOTED-PRINTABLE'then begin618 if Encoding = VCardQuotedPrintable then begin 617 619 Result := EncodeQuotedPrintable(Value, True); 618 620 end … … 1164 1166 if UTF8Length(OutText) > ContactsFile.MaxLineLength then begin 1165 1167 CutLength := ContactsFile.MaxLineLength; 1166 if Encoding = 'QUOTED-PRINTABLE'then begin1168 if Encoding = VCardQuotedPrintable then begin 1167 1169 Dec(CutLength); // There will be softline break at the end 1168 1170 // Do not cut encoded items at the end of line … … 1175 1177 CutText := UTF8Copy(OutText, 1, CutLength); 1176 1178 System.Delete(OutText, 1, Length(CutText)); 1177 if Encoding = 'QUOTED-PRINTABLE'then1179 if Encoding = VCardQuotedPrintable then 1178 1180 CutText := CutText + QuotedPrintableEscapeCharacter; // Add soft line break 1179 1181 Add(LinePrefix + CutText); 1180 if Encoding <> 'QUOTED-PRINTABLE'then1182 if Encoding <> VCardQuotedPrintable then 1181 1183 LinePrefix := ' '; 1182 1184 Inc(LineIndex); -
trunk/UCore.pas
r101 r103 82 82 LastContactTabIndex: Integer; 83 83 LastContactFileName: string; 84 LastPhotoFileName: string; 84 85 LastPropertyValueFileName: string; 85 86 MapUrl: string; … … 237 238 try 238 239 Contacts := TContactsFile(DataFile).Contacts; 239 ShowModal; 240 FormContacts.ReloadList; 241 FormContacts.UpdateInterface; 242 DataFile.Modified := True; 243 FormMain.UpdateInterface; 240 if ShowModal = mrOk then begin 241 FormContacts.ReloadList; 242 FormContacts.UpdateInterface; 243 DataFile.Modified := True; 244 FormMain.UpdateInterface; 245 end; 244 246 finally 245 247 Free; … … 469 471 DefaultVcardVersion := ReadStringWithDefault('DefaultVcardVersion', '2.1'); 470 472 MapUrl := ReadStringWithDefault('MapUrl', 'https://www.openstreetmap.org/search?query='); 473 LastPhotoFileName := ReadStringWithDefault('LastPhotoFileName', ''); 471 474 finally 472 475 Free; … … 497 500 WriteString('DefaultVcardVersion', DefaultVcardVersion); 498 501 WriteString('MapUrl', MapUrl); 502 WriteString('LastPhotoFileName', LastPhotoFileName); 499 503 finally 500 504 Free; -
trunk/vCardStudio.lpi
r92 r103 104 104 </Item2> 105 105 </RequiredPackages> 106 <Units Count=" 18">106 <Units Count="20"> 107 107 <Unit0> 108 108 <Filename Value="vCardStudio.lpr"/> … … 216 216 <ResourceBaseClass Value="Form"/> 217 217 </Unit17> 218 <Unit18> 219 <Filename Value="Forms\UFormImage.pas"/> 220 <IsPartOfProject Value="True"/> 221 <ComponentName Value="FormImage"/> 222 <HasResources Value="True"/> 223 <ResourceBaseClass Value="Form"/> 224 </Unit18> 225 <Unit19> 226 <Filename Value="UContactImage.pas"/> 227 <IsPartOfProject Value="True"/> 228 </Unit19> 218 229 </Units> 219 230 </ProjectOptions> -
trunk/vCardStudio.lpr
r98 r103 8 8 {$ENDIF} 9 9 Interfaces, // this includes the LCL widgetset 10 Forms, UFormMain, UCore, Common, SysUtils ;10 Forms, UFormMain, UCore, Common, SysUtils, UFormImage, UContactImage; 11 11 12 12 {$R *.res}
Note:
See TracChangeset
for help on using the changeset viewer.