- Timestamp:
- Dec 2, 2021, 3:19:57 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContact.lfm
r43 r45 25 25 object TabSheetGeneral: TTabSheet 26 26 Caption = 'General' 27 ClientHeight = 74 228 ClientWidth = 9 2927 ClientHeight = 744 28 ClientWidth = 931 29 29 OnShow = TabSheetGeneralShow 30 30 ParentFont = False 31 31 object Label1: TLabel 32 32 Left = 240 33 Height = 2 433 Height = 25 34 34 Top = 80 35 Width = 9435 Width = 86 36 36 Caption = 'First name:' 37 37 ParentColor = False … … 40 40 object EditFirstName: TEdit 41 41 Left = 360 42 Height = 4242 Height = 33 43 43 Top = 72 44 44 Width = 155 … … 48 48 object Label2: TLabel 49 49 Left = 16 50 Height = 2 450 Height = 25 51 51 Top = 250 52 Width = 6352 Width = 59 53 53 Caption = 'Mobile:' 54 54 ParentColor = False … … 57 57 object EditMobile: TEdit 58 58 Left = 144 59 Height = 4259 Height = 33 60 60 Top = 240 61 61 Width = 254 … … 65 65 object EditPhone: TEdit 66 66 Left = 144 67 Height = 4267 Height = 33 68 68 Top = 286 69 69 Width = 254 … … 73 73 object Label3: TLabel 74 74 Left = 16 75 Height = 2 475 Height = 25 76 76 Top = 290 77 Width = 5 977 Width = 54 78 78 Caption = 'Phone:' 79 79 ParentColor = False … … 82 82 object EditEmail: TEdit 83 83 Left = 144 84 Height = 4284 Height = 33 85 85 Top = 328 86 86 Width = 254 … … 90 90 object Label4: TLabel 91 91 Left = 16 92 Height = 2 492 Height = 25 93 93 Top = 336 94 Width = 5 894 Width = 53 95 95 Caption = 'E-mail:' 96 96 ParentColor = False … … 99 99 object EditLastName: TEdit 100 100 Left = 671 101 Height = 42101 Height = 33 102 102 Top = 72 103 103 Width = 155 … … 107 107 object Label5: TLabel 108 108 Left = 536 109 Height = 2 4109 Height = 25 110 110 Top = 80 111 Width = 8 7111 Width = 80 112 112 Caption = 'Last name' 113 113 ParentColor = False … … 116 116 object EditBirthday: TEdit 117 117 Left = 144 118 Height = 42118 Height = 33 119 119 Top = 424 120 120 Width = 254 … … 124 124 object Label22: TLabel 125 125 Left = 16 126 Height = 2 4126 Height = 25 127 127 Top = 432 128 Width = 76128 Width = 69 129 129 Caption = 'Birthday:' 130 130 ParentColor = False … … 136 136 Top = 16 137 137 Width = 207 138 PopupMenu = PopupMenuPhoto 138 139 Proportional = True 139 140 Stretch = True … … 141 142 object Label24: TLabel 142 143 Left = 240 143 Height = 2 4144 Height = 25 144 145 Top = 32 145 Width = 8 8146 Width = 80 146 147 Caption = 'Full name:' 147 148 ParentColor = False … … 150 151 object EditFullName: TEdit 151 152 Left = 360 152 Height = 42153 Height = 33 153 154 Top = 24 154 155 Width = 467 … … 158 159 object Label25: TLabel 159 160 Left = 536 160 Height = 2 4161 Height = 25 161 162 Top = 128 162 Width = 1 16163 Width = 108 163 164 Caption = 'Middle name:' 164 165 ParentColor = False … … 167 168 object EditMiddleName: TEdit 168 169 Left = 671 169 Height = 42170 Height = 33 170 171 Top = 120 171 172 Width = 155 … … 175 176 object Label26: TLabel 176 177 Left = 240 177 Height = 2 4178 Height = 25 178 179 Top = 176 179 Width = 101180 Width = 93 180 181 Caption = 'Title before:' 181 182 ParentColor = False … … 184 185 object EditTitleBefore: TEdit 185 186 Left = 360 186 Height = 42187 Height = 33 187 188 Top = 168 188 189 Width = 155 … … 192 193 object Label27: TLabel 193 194 Left = 536 194 Height = 2 4195 Height = 25 195 196 Top = 176 196 Width = 85197 Width = 77 197 198 Caption = 'Title after:' 198 199 ParentColor = False … … 201 202 object EditTitleAfter: TEdit 202 203 Left = 671 203 Height = 42204 Height = 33 204 205 Top = 168 205 206 Width = 155 … … 209 210 object Label44: TLabel 210 211 Left = 240 211 Height = 2 4212 Height = 25 212 213 Top = 128 213 Width = 91214 Width = 82 214 215 Caption = 'Nickname:' 215 216 ParentColor = False … … 218 219 object EditNickName: TEdit 219 220 Left = 360 220 Height = 42221 Height = 33 221 222 Top = 120 222 223 Width = 155 … … 226 227 object Label45: TLabel 227 228 Left = 432 228 Height = 2 4229 Height = 25 229 230 Top = 432 230 Width = 105231 Width = 96 231 232 Caption = 'Anniversary:' 232 233 ParentColor = False … … 235 236 object EditAniversary: TEdit 236 237 Left = 575 237 Height = 42238 Height = 33 238 239 Top = 424 239 240 Width = 254 … … 243 244 object Label9: TLabel 244 245 Left = 432 245 Height = 2 4246 Height = 25 246 247 Top = 248 247 Width = 34248 Width = 29 248 249 Caption = 'Fax:' 249 250 ParentColor = False … … 252 253 object EditFax: TEdit 253 254 Left = 575 254 Height = 42255 Height = 33 255 256 Top = 240 256 257 Width = 254 … … 260 261 object EditPager: TEdit 261 262 Left = 575 262 Height = 42263 Height = 33 263 264 Top = 286 264 265 Width = 254 … … 268 269 object Label10: TLabel 269 270 Left = 432 270 Height = 2 4271 Height = 25 271 272 Top = 290 272 Width = 54273 Width = 48 273 274 Caption = 'Pager:' 274 275 ParentColor = False … … 277 278 object Label46: TLabel 278 279 Left = 16 279 Height = 2 4280 Height = 25 280 281 Top = 384 281 Width = 1 14282 Width = 107 282 283 Caption = 'Web address:' 283 284 ParentColor = False … … 286 287 object EditWeb: TEdit 287 288 Left = 144 288 Height = 42289 Height = 33 289 290 Top = 376 290 291 Width = 683 … … 390 391 Anchors = [akTop, akLeft, akRight] 391 392 Caption = 'Address' 392 ClientHeight = 21 5393 ClientWidth = 88 8393 ClientHeight = 212 394 ClientWidth = 886 394 395 TabOrder = 6 395 396 object Label36: TLabel … … 611 612 Width = 911 612 613 Caption = 'Address' 613 ClientHeight = 2 20614 ClientWidth = 90 9614 ClientHeight = 217 615 ClientWidth = 907 615 616 TabOrder = 4 616 617 object Label31: TLabel … … 900 901 object ActionList1: TActionList 901 902 Images = Core.ImageList1 902 Left = 848 903 Top = 488 904 object AEditField: TAction 905 Caption = 'Edit' 903 Left = 592 904 Top = 528 905 object APhotoLoad: TAction 906 Caption = 'Load from file' 907 OnExecute = APhotoLoadExecute 908 end 909 object APhotoSave: TAction 910 Caption = 'Save to file' 911 OnExecute = APhotoSaveExecute 906 912 end 907 913 end 908 object PopupMenu 1: TPopupMenu914 object PopupMenuPhoto: TPopupMenu 909 915 Images = Core.ImageList1 910 Left = 856911 Top = 368916 Left = 408 917 Top = 528 912 918 object MenuItem1: TMenuItem 913 Action = AEditField 919 Action = APhotoLoad 920 end 921 object MenuItem2: TMenuItem 922 Action = APhotoSave 914 923 end 915 924 end 925 object OpenPictureDialog1: TOpenPictureDialog 926 Left = 197 927 Top = 535 928 end 929 object SavePictureDialog1: TSavePictureDialog 930 Left = 197 931 Top = 617 932 end 916 933 end -
trunk/Forms/UFormContact.lrj
r43 r45 57 57 {"hash":147653555,"name":"tformcontact.buttonprevious.caption","sourcebytes":[80,114,101,118,105,111,117,115],"value":"Previous"}, 58 58 {"hash":347380,"name":"tformcontact.buttonnext.caption","sourcebytes":[78,101,120,116],"value":"Next"}, 59 {"hash":310020,"name":"tformcontact.aeditfield.caption","sourcebytes":[69,100,105,116],"value":"Edit"} 59 {"hash":8431845,"name":"tformcontact.aphotoload.caption","sourcebytes":[76,111,97,100,32,102,114,111,109,32,102,105,108,101],"value":"Load from file"}, 60 {"hash":9308581,"name":"tformcontact.aphotosave.caption","sourcebytes":[83,97,118,101,32,116,111,32,102,105,108,101],"value":"Save to file"} 60 61 ]} -
trunk/Forms/UFormContact.pas
r43 r45 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ComCtrls, ActnList, Menus, ExtCtrls, UContact, UFormProperties;9 ComCtrls, ActnList, Menus, ExtCtrls, ExtDlgs, UContact, UFormProperties; 10 10 11 11 type … … 14 14 15 15 TFormContact = class(TForm) 16 AEditField: TAction; 16 APhotoSave: TAction; 17 APhotoLoad: TAction; 17 18 ActionList1: TActionList; 18 19 ButtonCancel: TButton; … … 114 115 MemoNotes: TMemo; 115 116 MenuItem1: TMenuItem; 117 MenuItem2: TMenuItem; 118 OpenPictureDialog1: TOpenPictureDialog; 116 119 PageControlContact: TPageControl; 117 PopupMenu1: TPopupMenu; 120 PopupMenuPhoto: TPopupMenu; 121 SavePictureDialog1: TSavePictureDialog; 118 122 TabSheetOthers: TTabSheet; 119 123 TabSheetHome: TTabSheet; … … 121 125 TabSheetGeneral: TTabSheet; 122 126 TabSheetAll: TTabSheet; 127 procedure APhotoLoadExecute(Sender: TObject); 128 procedure APhotoSaveExecute(Sender: TObject); 123 129 procedure ButtonNextClick(Sender: TObject); 124 130 procedure ButtonOkClick(Sender: TObject); … … 140 146 procedure LoadData; 141 147 procedure SaveData; 148 procedure UpdateInterface; 142 149 property Contact: TContact read FContact write SetContact; 143 150 property OnPrevious: TNotifyEvent read FOnPrevious write FOnPrevious; … … 166 173 FormProperties.Align := alClient; 167 174 FormProperties.Show; 175 UpdateInterface; 168 176 end; 169 177 … … 195 203 if FContact = AValue then Exit; 196 204 FContact := AValue; 197 LoadData;205 if Visible then LoadData; 198 206 end; 199 207 … … 212 220 begin 213 221 if Assigned(FOnNext) then FOnNext(Self); 222 end; 223 224 procedure TFormContact.APhotoLoadExecute(Sender: TObject); 225 begin 226 if OpenPictureDialog1.Execute then begin 227 ImagePhoto.Picture.LoadFromFile(OpenPictureDialog1.FileName); 228 end; 229 end; 230 231 procedure TFormContact.APhotoSaveExecute(Sender: TObject); 232 begin 233 if SavePictureDialog1.Execute then begin 234 ImagePhoto.Picture.SaveToFile(SavePictureDialog1.FileName); 235 end; 214 236 end; 215 237 … … 294 316 MemoNotes.Lines.Text := Contact.Fields[cfNote]; 295 317 318 // Photo 296 319 ImagePhoto.Picture.Bitmap.Clear; 297 320 PhotoProperty := Contact.GetProperty(cfPhoto); … … 326 349 end; 327 350 end; 351 UpdateInterface; 328 352 end; 329 353 330 354 procedure TFormContact.SaveData; 355 var 356 Photo: string; 357 PhotoProperty: TContactProperty; 358 Stream: TMemoryStream; 359 JpegImage: TJpegImage; 331 360 begin 332 361 // General … … 382 411 // Others 383 412 Contact.Fields[cfNote] := MemoNotes.Lines.Text; 413 414 // Photo 415 if (ImagePhoto.Picture.Bitmap.Width <> 0) and (ImagePhoto.Picture.Bitmap.Height <> 0) then begin 416 PhotoProperty := Contact.GetProperty(cfPhoto); 417 if not Assigned(PhotoProperty) then begin 418 PhotoProperty := TContactProperty.Create; 419 PhotoProperty.Name := 'PHOTO'; 420 PhotoProperty.Attributes.DelimitedText := 'JPEG'; 421 Contact.Properties.Add(PhotoProperty); 422 end; 423 PhotoProperty.Encoding := 'BASE64'; 424 Stream := TMemoryStream.Create; 425 try 426 if PhotoProperty.Attributes.IndexOf('JPEG') <> -1 then begin 427 JpegImage := TJPEGImage.Create; 428 try 429 try 430 JpegImage.SetSize(ImagePhoto.Picture.Bitmap.Width, ImagePhoto.Picture.Bitmap.Height); 431 JpegImage.Canvas.Draw(0, 0, ImagePhoto.Picture.Bitmap); 432 JpegImage.SaveToStream(Stream); 433 except 434 end; 435 finally 436 JpegImage.Free; 437 end; 438 end else begin 439 try 440 ImagePhoto.Picture.SaveToStream(Stream); 441 except 442 end; 443 end; 444 445 SetLength(Photo, Stream.Size); 446 Stream.Position := 0; 447 Stream.Read(Photo[1], Length(Photo)); 448 Contact.Fields[cfPhoto] := Photo; 449 finally 450 Stream.Free; 451 end; 452 end; 453 end; 454 455 procedure TFormContact.UpdateInterface; 456 begin 457 APhotoSave.Enabled := (ImagePhoto.Picture.Bitmap.Width <> 0) and 458 (ImagePhoto.Picture.Bitmap.Height <> 0); 384 459 end; 385 460 -
trunk/Languages/vCardStudio.cs.po
r43 r45 12 12 "X-Generator: Poedit 3.0\n" 13 13 14 #: tcore.aabout.caption 15 msgid "About..." 16 msgstr "O aplikaci..." 17 18 #: tcore.aexit.caption 19 msgid "Exit" 20 msgstr "Ukončit" 21 22 #: tcore.afileclose.caption 23 msgctxt "tcore.afileclose.caption" 24 msgid "Close" 25 msgstr "Zavřít" 26 27 #: tcore.afilemerge.caption 28 msgid "Merge..." 29 msgstr "Sloučení..." 30 31 #: tcore.afilenew.caption 32 msgid "New" 33 msgstr "Nový" 34 35 #: tcore.afileopen.caption 36 msgid "Open..." 37 msgstr "Otevřít..." 38 39 #: tcore.afileopenrecent.caption 40 msgctxt "tcore.afileopenrecent.caption" 41 msgid "Open recent" 42 msgstr "Otevřít nedávné" 43 44 #: tcore.afilesave.caption 45 msgid "Save" 46 msgstr "Uložit" 47 48 #: tcore.afilesaveas.caption 49 msgid "Save as..." 50 msgstr "Uložit jako..." 51 52 #: tcore.afindduplicate.caption 53 msgctxt "tcore.afindduplicate.caption" 54 msgid "Find duplicities" 55 msgstr "Najít duplikáty" 56 57 #: tcore.agenerate.caption 58 msgctxt "tcore.agenerate.caption" 59 msgid "Generate contacts" 60 msgstr "Generovat kontakty" 61 62 #: tcore.ahomepage.caption 63 msgctxt "tcore.ahomepage.caption" 64 msgid "Home page" 65 msgstr "Domovská stránka" 66 67 #: tcore.applicationinfo1.description 68 msgid "vCard files management tool" 69 msgstr "Nástroj pro správu souborů vCard" 70 71 #: tcore.asettings.caption 72 msgctxt "tcore.asettings.caption" 73 msgid "Settings" 74 msgstr "Nastavení" 75 76 #: tformcontact.aeditfield.caption 77 msgid "Edit" 78 msgstr "Upravit" 14 #: tformcontact.aphotoload.caption 15 msgid "Load from file" 16 msgstr "Načíst ze souboru" 17 18 #: tformcontact.aphotosave.caption 19 msgid "Save to file" 20 msgstr "Uložit do souboru" 79 21 80 22 #: tformcontact.buttoncancel.caption -
trunk/Languages/vCardStudio.po
r43 r45 2 2 msgstr "Content-Type: text/plain; charset=UTF-8" 3 3 4 #: tcore.aabout.caption 5 msgid "About..." 6 msgstr "" 7 8 #: tcore.aexit.caption 9 msgid "Exit" 10 msgstr "" 11 12 #: tcore.afileclose.caption 13 msgctxt "tcore.afileclose.caption" 14 msgid "Close" 15 msgstr "" 16 17 #: tcore.afilemerge.caption 18 msgid "Merge..." 19 msgstr "" 20 21 #: tcore.afilenew.caption 22 msgid "New" 23 msgstr "" 24 25 #: tcore.afileopen.caption 26 msgid "Open..." 27 msgstr "" 28 29 #: tcore.afileopenrecent.caption 30 msgctxt "tcore.afileopenrecent.caption" 31 msgid "Open recent" 32 msgstr "" 33 34 #: tcore.afilesave.caption 35 msgid "Save" 36 msgstr "" 37 38 #: tcore.afilesaveas.caption 39 msgid "Save as..." 40 msgstr "" 41 42 #: tcore.afindduplicate.caption 43 msgctxt "tcore.afindduplicate.caption" 44 msgid "Find duplicities" 45 msgstr "" 46 47 #: tcore.agenerate.caption 48 msgctxt "tcore.agenerate.caption" 49 msgid "Generate contacts" 50 msgstr "" 51 52 #: tcore.ahomepage.caption 53 msgctxt "tcore.ahomepage.caption" 54 msgid "Home page" 55 msgstr "" 56 57 #: tcore.applicationinfo1.description 58 msgid "vCard files management tool" 59 msgstr "" 60 61 #: tcore.asettings.caption 62 msgctxt "tcore.asettings.caption" 63 msgid "Settings" 64 msgstr "" 65 66 #: tformcontact.aeditfield.caption 67 msgid "Edit" 4 #: tformcontact.aphotoload.caption 5 msgid "Load from file" 6 msgstr "" 7 8 #: tformcontact.aphotosave.caption 9 msgid "Save to file" 68 10 msgstr "" 69 11 -
trunk/UContact.pas
r42 r45 64 64 procedure EvaluateAttributes; 65 65 function GetDecodedValue: string; 66 function GetEncodedValue: string; 66 67 function MatchNameGroups(AName: string; Groups: TStringArray; 67 68 NoGroups: TStringArray): Boolean; … … 343 344 begin 344 345 if Encoding = 'BASE64' then begin 345 Result := DecodeStringBase64(Value) 346 Result := DecodeStringBase64(Value); 346 347 end else 347 348 if Encoding = 'QUOTED-PRINTABLE' then begin 348 Result := DecodeQuotedPrintable(Value) 349 Result := DecodeQuotedPrintable(Value); 349 350 end 350 351 else Result := ''; 351 352 end; 352 353 354 function TContactProperty.GetEncodedValue: string; 355 begin 356 if Encoding = 'BASE64' then begin 357 Result := EncodeStringBase64(Value); 358 end else 359 if Encoding = 'QUOTED-PRINTABLE' then begin 360 Result := EncodeQuotedPrintable(Value); 361 end 362 else Result := ''; 363 end; 364 353 365 function TContactProperty.MatchNameGroups(AName: string; Groups: TStringArray; 354 366 NoGroups: TStringArray): Boolean; 355 367 var 356 368 I: Integer; 357 Attr: string; 358 begin 359 Attr := Attributes.DelimitedText; 369 begin 360 370 Result := Name = AName; 361 371 if Result and (Length(Groups) > 0) then begin … … 680 690 J: Integer; 681 691 NameText: string; 692 Value2: string; 682 693 begin 683 694 inherited; … … 689 700 for J := 0 to Properties.Count - 1 do 690 701 with Properties[J] do begin 691 if Pos(LineEnding, Value) > 0 then begin 692 NameText := Name; 693 if Attributes.Count > 0 then 694 NameText := NameText + ';' + Attributes.DelimitedText; 695 Add(NameText + ':' + GetNext(Value, LineEnding)); 696 while Pos(LineEnding, Value) > 0 do begin 697 Add(' ' + GetNext(Value, LineEnding)); 702 NameText := Name; 703 if Attributes.Count > 0 then 704 NameText := NameText + ';' + Attributes.DelimitedText; 705 if Encoding <> '' then begin 706 Value2 := GetEncodedValue; 707 NameText := NameText + ';' + Encoding; 708 end else Value2 := Value; 709 if Pos(LineEnding, Value2) > 0 then begin 710 Add(NameText + ':' + GetNext(Value2, LineEnding)); 711 while Pos(LineEnding, Value2) > 0 do begin 712 Add(' ' + GetNext(Value2, LineEnding)); 698 713 end; 699 Add(' ' + GetNext(Value , LineEnding));714 Add(' ' + GetNext(Value2, LineEnding)); 700 715 Add(''); 701 716 end else begin 702 NameText := Name; 703 if Attributes.Count > 0 then 704 NameText := NameText + ';' + Attributes.DelimitedText; 705 Add(NameText + ':' + Value); 717 Add(NameText + ':' + Value2); 706 718 end; 707 719 end; … … 769 781 NewRecord.Properties.Add(NewProperty); 770 782 end; 771 NewProperty.Attributes.DelimitedText := UpperCase(Names);783 NewProperty.Attributes.DelimitedText := Names; 772 784 if NewProperty.Attributes.Count > 0 then begin 773 785 NewProperty.Name := NewProperty.Attributes[0]; -
trunk/UQuotedPrintable.pas
r42 r45 9 9 10 10 function DecodeQuotedPrintable(Text: string): string; 11 function EncodeQuotedPrintable(Text: string): string; 11 12 12 13 … … 201 202 end; 202 203 204 function EncodeQuotedPrintable(Text: string): string; 205 begin 206 Result := Text; 207 end; 208 203 209 end. 204 210
Note:
See TracChangeset
for help on using the changeset viewer.