Changeset 30
- Timestamp:
- Nov 24, 2021, 8:42:24 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContact.lfm
r23 r30 1 1 object FormContact: TFormContact 2 Left = 4232 Left = 604 3 3 Height = 588 4 Top = 2714 Top = 429 5 5 Width = 914 6 6 Caption = 'Contact' … … 29 29 object Label1: TLabel 30 30 Left = 16 31 Height = 2 032 Top = 1633 Width = 4331 Height = 24 32 Top = 24 33 Width = 56 34 34 Caption = 'Name:' 35 35 ParentColor = False … … 38 38 object EditName: TEdit 39 39 Left = 144 40 Height = 2841 Top = 1 940 Height = 42 41 Top = 16 42 42 Width = 254 43 43 ParentFont = False … … 46 46 object Label2: TLabel 47 47 Left = 16 48 Height = 2 049 Top = 5650 Width = 7448 Height = 24 49 Top = 72 50 Width = 95 51 51 Caption = 'Cell phone:' 52 52 ParentColor = False … … 55 55 object EditCellPhone: TEdit 56 56 Left = 144 57 Height = 2858 Top = 5657 Height = 42 58 Top = 62 59 59 Width = 254 60 60 ParentFont = False … … 63 63 object EditPhone: TEdit 64 64 Left = 144 65 Height = 2866 Top = 10 065 Height = 42 66 Top = 108 67 67 Width = 254 68 68 ParentFont = False … … 71 71 object Label3: TLabel 72 72 Left = 16 73 Height = 2 074 Top = 9775 Width = 4473 Height = 24 74 Top = 112 75 Width = 59 76 76 Caption = 'Phone:' 77 77 ParentColor = False … … 80 80 object EditEmail: TEdit 81 81 Left = 575 82 Height = 2883 Top = 5982 Height = 42 83 Top = 62 84 84 Width = 254 85 85 ParentFont = False … … 88 88 object Label4: TLabel 89 89 Left = 432 90 Height = 2 091 Top = 5692 Width = 4690 Height = 24 91 Top = 72 92 Width = 58 93 93 Caption = 'E-mail:' 94 94 ParentColor = False … … 97 97 object EditSurname: TEdit 98 98 Left = 575 99 Height = 28100 Top = 1 899 Height = 42 100 Top = 16 101 101 Width = 254 102 102 ParentFont = False … … 105 105 object Label5: TLabel 106 106 Left = 432 107 Height = 2 0108 Top = 16109 Width = 61107 Height = 24 108 Top = 24 109 Width = 81 110 110 Caption = 'Surname:' 111 111 ParentColor = False … … 116 116 Height = 146 117 117 Top = 230 118 Width = 702118 Width = 846 119 119 Anchors = [akTop, akLeft, akRight, akBottom] 120 120 ParentFont = False … … 123 123 object Label6: TLabel 124 124 Left = 19 125 Height = 2 0125 Height = 24 126 126 Top = 202 127 Width = 42127 Width = 55 128 128 Caption = 'Notes:' 129 129 ParentColor = False … … 132 132 object EditEmailHome: TEdit 133 133 Left = 575 134 Height = 28135 Top = 10 0134 Height = 42 135 Top = 108 136 136 Width = 254 137 137 ParentFont = False … … 140 140 object Label20: TLabel 141 141 Left = 432 142 Height = 2 0143 Top = 96144 Width = 1 01142 Height = 24 143 Top = 112 144 Width = 124 145 145 Caption = 'E-mail (Home):' 146 146 ParentColor = False … … 149 149 object EditEmailWork: TEdit 150 150 Left = 575 151 Height = 28152 Top = 1 46151 Height = 42 152 Top = 152 153 153 Width = 254 154 154 ParentFont = False … … 157 157 object Label21: TLabel 158 158 Left = 432 159 Height = 2 0160 Top = 1 44161 Width = 95159 Height = 24 160 Top = 160 161 Width = 117 162 162 Caption = 'E-mail (Work):' 163 163 ParentColor = False … … 166 166 object EditBirthday: TEdit 167 167 Left = 144 168 Height = 28169 Top = 1 44168 Height = 42 169 Top = 152 170 170 Width = 254 171 171 ParentFont = False … … 174 174 object Label22: TLabel 175 175 Left = 16 176 Height = 2 0177 Top = 1 44178 Width = 58176 Height = 24 177 Top = 160 178 Width = 76 179 179 Caption = 'Birthday:' 180 180 ParentColor = False … … 189 189 object Label7: TLabel 190 190 Left = 10 191 Height = 2 0191 Height = 24 192 192 Top = 18 193 Width = 99193 Width = 125 194 194 Caption = 'Phone (Home):' 195 195 ParentColor = False … … 198 198 object EditPhoneHome: TEdit 199 199 Left = 173 200 Height = 28201 Top = 1 8200 Height = 42 201 Top = 16 202 202 Width = 254 203 203 ParentFont = False … … 206 206 object Label8: TLabel 207 207 Left = 10 208 Height = 2 0209 Top = 6 1210 Width = 93208 Height = 24 209 Top = 64 210 Width = 118 211 211 Caption = 'Phone (Work):' 212 212 ParentColor = False … … 215 215 object EditPhoneWork: TEdit 216 216 Left = 173 217 Height = 28218 Top = 6 1217 Height = 42 218 Top = 62 219 219 Width = 254 220 220 ParentFont = False … … 223 223 object Label9: TLabel 224 224 Left = 10 225 Height = 2 0226 Top = 1 06227 Width = 1 29225 Height = 24 226 Top = 112 227 Width = 161 228 228 Caption = 'Cell phone (Home):' 229 229 ParentColor = False … … 232 232 object EditCellPhoneHome: TEdit 233 233 Left = 173 234 Height = 28234 Height = 42 235 235 Top = 108 236 236 Width = 254 … … 240 240 object Label10: TLabel 241 241 Left = 10 242 Height = 2 0243 Top = 1 46244 Width = 1 23242 Height = 24 243 Top = 160 244 Width = 154 245 245 Caption = 'Cell phone (Work):' 246 246 ParentColor = False … … 249 249 object EditCellPhoneWork: TEdit 250 250 Left = 173 251 Height = 28252 Top = 1 46251 Height = 42 252 Top = 152 253 253 Width = 254 254 254 ParentFont = False … … 257 257 object Label11: TLabel 258 258 Left = 451 259 Height = 2 0259 Height = 24 260 260 Top = 16 261 Width = 25261 Width = 34 262 262 Caption = 'Fax:' 263 263 ParentColor = False … … 266 266 object EditFax: TEdit 267 267 Left = 584 268 Height = 28268 Height = 42 269 269 Top = 18 270 270 Width = 254 … … 274 274 object Label12: TLabel 275 275 Left = 451 276 Height = 2 0276 Height = 24 277 277 Top = 58 278 Width = 80278 Width = 100 279 279 Caption = 'Fax (Home):' 280 280 ParentColor = False … … 283 283 object EditFaxHome: TEdit 284 284 Left = 584 285 Height = 28286 Top = 6 1285 Height = 42 286 Top = 62 287 287 Width = 254 288 288 ParentFont = False … … 291 291 object Label13: TLabel 292 292 Left = 451 293 Height = 2 0293 Height = 24 294 294 Top = 106 295 Width = 74295 Width = 93 296 296 Caption = 'Fax (Work):' 297 297 ParentColor = False … … 300 300 object EditFaxWork: TEdit 301 301 Left = 584 302 Height = 28302 Height = 42 303 303 Top = 108 304 304 Width = 254 … … 308 308 object Label14: TLabel 309 309 Left = 451 310 Height = 2 0310 Height = 24 311 311 Top = 144 312 Width = 41312 Width = 54 313 313 Caption = 'Pager:' 314 314 ParentColor = False … … 317 317 object EditPager: TEdit 318 318 Left = 584 319 Height = 28320 Top = 1 46319 Height = 42 320 Top = 152 321 321 Width = 254 322 322 ParentFont = False … … 325 325 object Label15: TLabel 326 326 Left = 10 327 Height = 2 0328 Top = 22 1329 Width = 72327 Height = 24 328 Top = 224 329 Width = 89 330 330 Caption = 'Web page:' 331 331 ParentColor = False … … 334 334 object EditWebPage: TEdit 335 335 Left = 173 336 Height = 28337 Top = 22 1336 Height = 42 337 Top = 220 338 338 Width = 254 339 339 ParentFont = False … … 342 342 object Label16: TLabel 343 343 Left = 10 344 Height = 2 0345 Top = 2 59346 Width = 1 27344 Height = 24 345 Top = 272 346 Width = 155 347 347 Caption = 'Web page (Home):' 348 348 ParentColor = False … … 351 351 object EditWebPageHome: TEdit 352 352 Left = 173 353 Height = 28354 Top = 2 59353 Height = 42 354 Top = 262 355 355 Width = 254 356 356 ParentFont = False … … 359 359 object Label17: TLabel 360 360 Left = 10 361 Height = 2 0362 Top = 298363 Width = 1 21361 Height = 24 362 Top = 312 363 Width = 148 364 364 Caption = 'Web page (Work):' 365 365 ParentColor = False … … 368 368 object EditWebPageWork: TEdit 369 369 Left = 173 370 Height = 28371 Top = 298370 Height = 42 371 Top = 306 372 372 Width = 254 373 373 ParentFont = False … … 376 376 object Label18: TLabel 377 377 Left = 450 378 Height = 2 0379 Top = 22 1380 Width = 32378 Height = 24 379 Top = 224 380 Width = 41 381 381 Caption = 'Title:' 382 382 ParentColor = False … … 385 385 object EditTitle: TEdit 386 386 Left = 584 387 Height = 28388 Top = 22 1387 Height = 42 388 Top = 220 389 389 Width = 254 390 390 ParentFont = False … … 393 393 object Label19: TLabel 394 394 Left = 450 395 Height = 2 0396 Top = 2 59397 Width = 56395 Height = 24 396 Top = 272 397 Width = 74 398 398 Caption = 'Address:' 399 399 ParentColor = False … … 401 401 end 402 402 object EditAddress: TEdit 403 Left = 58 6404 Height = 28405 Top = 2 59403 Left = 584 404 Height = 42 405 Top = 262 406 406 Width = 254 407 407 ParentFont = False … … 409 409 end 410 410 object LabelOrganization: TLabel 411 Left = 4 51412 Height = 2 0413 Top = 298414 Width = 89411 Left = 448 412 Height = 24 413 Top = 312 414 Width = 114 415 415 Caption = 'Organization:' 416 416 ParentColor = False … … 419 419 object EditOrganization: TEdit 420 420 Left = 584 421 Height = 28422 Top = 298421 Height = 42 422 Top = 306 423 423 Width = 254 424 424 ParentFont = False … … 483 483 object ActionList1: TActionList 484 484 Images = Core.ImageList1 485 Left = 3 80486 Top = 188485 Left = 320 486 Top = 416 487 487 object AEditField: TAction 488 488 Caption = 'Edit' … … 492 492 object PopupMenu1: TPopupMenu 493 493 Images = Core.ImageList1 494 Left = 206495 Top = 191494 Left = 184 495 Top = 416 496 496 object MenuItem1: TMenuItem 497 497 Action = AEditField -
trunk/Languages/vCardStudio.cs.po
r22 r30 10 10 "Content-Transfer-Encoding: 8bit\n" 11 11 "Language: cs\n" 12 "X-Generator: Poedit 1.8.8\n"12 "X-Generator: Poedit 3.0\n" 13 13 14 14 #: tcore.aabout.caption … … 67 67 #: tcore.applicationinfo1.description 68 68 msgid "vCard files management tool" 69 msgstr " "69 msgstr "Nástroj pro správu souborů vCard" 70 70 71 71 #: tcore.asettings.caption … … 254 254 msgstr "Domácí telefon" 255 255 256 #: tformerror.caption 257 msgid "Load errors" 258 msgstr "Chyby načítání" 259 256 260 #: tformfindduplicity.ashowcontacts.caption 257 261 msgid "Show contacts" … … 360 364 msgstr "DPI:" 361 365 366 #: ucontact.sfoundblockendwithoutblockstart 367 msgid "Found block end without block start" 368 msgstr "Nalezen konec bloku bez začátku bloku" 369 370 #: ucontact.sfoundpropertiesbeforeblockstart 371 msgid "Found properties before the start of block" 372 msgstr "Nalezena vlastnost před začátkem bloku" 373 374 #: ucontact.sunknowncommand 375 msgid "Unknown command: %s" 376 msgstr "Neznámý příkaz: %s" 377 362 378 #: ucontact.sunsupportedcontactfieldsindex 363 379 msgid "Unsupported contact field index" … … 381 397 msgstr "Soubor '%s' nenalezen." 382 398 399 #: ucore.sline 400 msgid "Line %d: %s" 401 msgstr "Řádek %d: %s" 402 383 403 #: ucore.smergedcontacts 384 404 msgid "Contacts merged. Loaded: %d, New: %d, Updated: %d" … … 418 438 msgid "Modified" 419 439 msgstr "Upraveno" 420 -
trunk/Languages/vCardStudio.po
r22 r30 240 240 msgstr "" 241 241 242 #: tformerror.caption 243 msgid "Load errors" 244 msgstr "" 245 242 246 #: tformfindduplicity.ashowcontacts.caption 243 247 msgid "Show contacts" … … 344 348 msgstr "" 345 349 350 #: ucontact.sfoundblockendwithoutblockstart 351 msgid "Found block end without block start" 352 msgstr "" 353 354 #: ucontact.sfoundpropertiesbeforeblockstart 355 msgid "Found properties before the start of block" 356 msgstr "" 357 358 #: ucontact.sunknowncommand 359 msgid "Unknown command: %s" 360 msgstr "" 361 346 362 #: ucontact.sunsupportedcontactfieldsindex 347 363 msgid "Unsupported contact field index" … … 365 381 msgstr "" 366 382 383 #: ucore.sline 384 msgid "Line %d: %s" 385 msgstr "" 386 367 387 #: ucore.smergedcontacts 368 388 msgid "Contacts merged. Loaded: %d, New: %d, Updated: %d" -
trunk/Release Notes.txt
r26 r30 1 Version 1.0.0 ( 19-08-2021)1 Version 1.0.0 (2021-08-19) 2 2 ========================== 3 3 -
trunk/UContact.pas
r29 r30 11 11 TContactsFile = class; 12 12 13 T StringEvent = procedure (Text: string) of object;13 TErrorEvent = procedure (Text: string; Line: Integer) of object; 14 14 15 15 TDataType = (dtString, dtInteger, dtDate, dtDateTime, dtImage); … … 19 19 cfTelCell, cfTelHome, cfTelHome2, cfTelWork, cfTelVoip, 20 20 cfTelPrefWorkVoice, cfTelPrefHomeVoice, cfTelHomeVoice, cfTelWorkVoice, 21 cfTelVoice, cfTelMain, 21 22 cfEmailHome, cfEmailInternet, cfNickName, cfNote, cfRole, cfTitle, 22 23 cfCategories, cfOrganization, cfAdrHome, cfHomeAddressStreet, … … 63 64 TelHomeVoice: string; 64 65 TelWorkVoice: string; 66 TelVoice: string; 67 TelMain: string; 65 68 EmailHome: string; 66 69 EmailInternet: string; … … 97 100 TContactsFile = class(TDataFile) 98 101 private 99 FOnError: T StringEvent;102 FOnError: TErrorEvent; 100 103 function GetNext(var Text: string; Separator: string): string; 101 104 procedure InitFields; 105 procedure Error(Text: string; Line: Integer); 102 106 public 103 107 Fields: TContactFields; … … 110 114 constructor Create; override; 111 115 destructor Destroy; override; 112 property OnError: T StringEvent read FOnError write FOnError;116 property OnError: TErrorEvent read FOnError write FOnError; 113 117 end; 114 118 … … 119 123 SVCardFile = 'vCard file'; 120 124 SUnsupportedContactFieldsIndex = 'Unsupported contact field index'; 125 SUnknownCommand = 'Unknown command: %s'; 126 SFoundPropertiesBeforeBlockStart = 'Found properties before the start of block'; 127 SFoundBlockEndWithoutBlockStart = 'Found block end without block start'; 121 128 122 129 { TContacts } … … 195 202 cfTelHomeVoice: Result := TelHomeVoice; 196 203 cfTelWorkVoice: Result := TelWorkVoice; 204 cfTelVoice: Result := TelVoice; 205 cfTelMain: Result := TelMain; 197 206 cfEmailHome: Result := EmailHome; 198 207 cfEmailInternet: Result := EmailInternet; … … 234 243 cfTelHomeVoice: TelHomeVoice := AValue; 235 244 cfTelWorkVoice: TelWorkVoice := AValue; 245 cfTelVoice: TelVoice := AValue; 246 cfTelMain: TelMain := AValue; 236 247 cfEmailHome: EmailHome := AValue; 237 248 cfEmailInternet: EmailInternet := AValue; … … 338 349 AddNew('Tel Home Voice', cfTelHomeVoice, dtString); 339 350 AddNew('Tel Work Voice', cfTelWorkVoice, dtString); 351 AddNew('Tel Voice', cfTelVoice, dtString); 352 AddNew('Tel Main', cfTelMain, dtString); 340 353 AddNew('Email Home', cfEmailHome, dtString); 341 354 AddNew('Email Internet', cfEmailInternet, dtString); … … 355 368 AddNew('Jabber', cfXJabber, dtString); 356 369 end; 370 end; 371 372 procedure TContactsFile.Error(Text: string; Line: Integer); 373 begin 374 if Assigned(FOnError) then FOnError(Text, Line); 357 375 end; 358 376 … … 423 441 if TelHomeVoice <> '' then Add('TEL;HOME;VOICE:' + TelHomeVoice); 424 442 if TelWorkVoice <> '' then Add('TEL;WORK;VOICE:' + TelWorkVoice); 443 if TelVoice <> '' then Add('TEL;VOICE:' + TelVoice); 444 if TelMain <> '' then Add('TEL;MAIN:' + TelMain); 425 445 if Note <> '' then Add('NOTE:' + Note); 426 446 if AdrHome <> '' then Add('ADR;HOME:' + AdrHome); … … 469 489 begin 470 490 inherited; 491 NewRecord := nil; 471 492 Contacts.Clear; 472 493 Lines := TStringList.Create; … … 483 504 end else 484 505 if Line = 'END:VCARD' then begin 485 Contacts.Add(NewRecord); 486 NewRecord := nil; 506 if Assigned(NewRecord) then begin 507 Contacts.Add(NewRecord); 508 NewRecord := nil; 509 end else Error(SFoundBlockEndWithoutBlockStart, I + 1); 487 510 end else 488 511 if Pos(':', Line) > 0 then begin … … 503 526 Command := CommandItems.DelimitedText; 504 527 505 if Command = 'FN' then NewRecord.FullName := Line 506 else if Command = 'N' then begin 507 NewRecord.LastName := GetNext(Line, ';'); 508 NewRecord.FirstName := GetNext(Line, ';'); 509 NewRecord.MiddleName := GetNext(Line, ';'); 510 NewRecord.TitleBefore := GetNext(Line, ';'); 511 NewRecord.TitleAfter := GetNext(Line, ';'); 512 end 513 else if Command = 'VERSION' then NewRecord.Version := Line 514 else if Command = 'TEL;PREF;CELL' then NewRecord.TelPrefCell := Line 515 else if Command = 'TEL;CELL' then NewRecord.TelCell := Line 516 else if Command = 'TEL;HOME' then NewRecord.TelHome := Line 517 else if Command = 'TEL;HOME2' then NewRecord.TelHome2 := Line 518 else if Command = 'TEL;WORK' then NewRecord.TelWork := Line 519 else if Command = 'TEL;VOIP' then NewRecord.TelVoip := Line 520 else if Command = 'TEL;PREF;WORK;VOICE' then NewRecord.TelPrefWorkVoice := Line 521 else if Command = 'TEL;PREF;HOME;VOICE' then NewRecord.TelPrefHOMEVoice := Line 522 else if Command = 'TEL;HOME;VOICE' then NewRecord.TelHomeVoice := Line 523 else if Command = 'TEL;WORK;VOICE' then NewRecord.TelWorkVoice := Line 524 else if Command = 'ADR;HOME' then NewRecord.AdrHome := Line 525 else if Command = 'X-NICKNAME' then NewRecord.NickName := Line 526 else if Command = 'EMAIL;HOME' then NewRecord.EmailHome := Line 527 else if Command = 'EMAIL;INTERNET' then NewRecord.EmailInternet := Line 528 else if Command = 'NOTE' then NewRecord.Note := Line 529 else if Command = 'ORG' then NewRecord.Organization := Line 530 else if Command = 'X-JABBER' then NewRecord.XJabber := Line 531 else if Command = 'TITLE' then NewRecord.Role := Line 532 else if Command = 'X-TIMES_CONTACTED' then NewRecord.XTimesContacted := Line 533 else if Command = 'X-LAST_TIME_CONTACTED' then NewRecord.XLastTimeContacted := Line 534 else if Command = 'PHOTO;JPEG' then begin 535 NewRecord.Photo := Trim(Line); 536 repeat 537 Inc(I); 538 Line := Trim(Lines[I]); 539 if Line <> '' then NewRecord.Photo := NewRecord.Photo + Line; 540 until Line = ''; 541 NewRecord.Photo := DecodeStringBase64(NewRecord.Photo); 542 end 543 else if Assigned(FOnError) then FOnError('Unknown command: ' + Command); 528 if Assigned(NewRecord) then begin 529 if Command = 'FN' then NewRecord.FullName := Line 530 else if Command = 'N' then begin 531 NewRecord.LastName := GetNext(Line, ';'); 532 NewRecord.FirstName := GetNext(Line, ';'); 533 NewRecord.MiddleName := GetNext(Line, ';'); 534 NewRecord.TitleBefore := GetNext(Line, ';'); 535 NewRecord.TitleAfter := GetNext(Line, ';'); 536 end 537 else if Command = 'VERSION' then NewRecord.Version := Line 538 else if Command = 'TEL;PREF;CELL' then NewRecord.TelPrefCell := Line 539 else if Command = 'TEL;CELL' then NewRecord.TelCell := Line 540 else if Command = 'TEL;HOME' then NewRecord.TelHome := Line 541 else if Command = 'TEL;HOME2' then NewRecord.TelHome2 := Line 542 else if Command = 'TEL;WORK' then NewRecord.TelWork := Line 543 else if Command = 'TEL;VOIP' then NewRecord.TelVoip := Line 544 else if Command = 'TEL;PREF;WORK;VOICE' then NewRecord.TelPrefWorkVoice := Line 545 else if Command = 'TEL;PREF;HOME;VOICE' then NewRecord.TelPrefHOMEVoice := Line 546 else if Command = 'TEL;HOME;VOICE' then NewRecord.TelHomeVoice := Line 547 else if Command = 'TEL;WORK;VOICE' then NewRecord.TelWorkVoice := Line 548 else if Command = 'TEL;VOICE' then NewRecord.TelVoice := Line 549 else if Command = 'TEL;MAIN' then NewRecord.TelMain := Line 550 else if Command = 'ADR;HOME' then NewRecord.AdrHome := Line 551 else if Command = 'X-NICKNAME' then NewRecord.NickName := Line 552 else if Command = 'EMAIL;HOME' then NewRecord.EmailHome := Line 553 else if Command = 'EMAIL;INTERNET' then NewRecord.EmailInternet := Line 554 else if Command = 'NOTE' then NewRecord.Note := Line 555 else if Command = 'ORG' then NewRecord.Organization := Line 556 else if Command = 'X-JABBER' then NewRecord.XJabber := Line 557 else if Command = 'TITLE' then NewRecord.Role := Line 558 else if Command = 'X-TIMES_CONTACTED' then NewRecord.XTimesContacted := Line 559 else if Command = 'X-LAST_TIME_CONTACTED' then NewRecord.XLastTimeContacted := Line 560 else if Command = 'PHOTO;JPEG' then begin 561 NewRecord.Photo := Trim(Line); 562 repeat 563 Inc(I); 564 Line := Trim(Lines[I]); 565 if Line <> '' then NewRecord.Photo := NewRecord.Photo + Line; 566 until Line = ''; 567 NewRecord.Photo := DecodeStringBase64(NewRecord.Photo); 568 end 569 else Error(Format(SUnknownCommand, [Command]), I + 1); 570 end else Error(SFoundPropertiesBeforeBlockStart, I + 1); 544 571 end; 545 572 Inc(I); -
trunk/UCore.pas
r29 r30 68 68 InitializeStarted: Boolean; 69 69 InitializeFinished: Boolean; 70 LoadErrors: string; 70 71 procedure FileModified(Sender: TObject); 71 72 function FindFirstNonOption: string; … … 73 74 procedure LoadConfig; 74 75 procedure SaveConfig; 76 procedure DoError(Text: string; Line: Integer); 75 77 public 76 78 DefaultDataFileClass: TDataFileClass; … … 97 99 uses 98 100 UFormMain, UFormSettings, UContact, UFormContacts, UFormFindDuplicity, 99 UFormGenerate ;101 UFormGenerate, UFormError; 100 102 101 103 resourcestring … … 104 106 SFileNotFound = 'File ''%s'' not found.'; 105 107 SMergedContacts = 'Contacts merged. Loaded: %d, New: %d, Updated: %d'; 108 SLine = 'Line %d: %s'; 106 109 107 110 { TMergeResult } … … 310 313 if FileClosed then begin 311 314 FileNew; 315 LoadErrors := ''; 312 316 DataFile.LoadFromFile(FileName); 313 317 LastOpenedList1.AddItem(FileName); 318 if LoadErrors <> '' then begin 319 FormError := TFormError.Create(nil); 320 FormError.MemoErrors.Text := LoadErrors; 321 FormError.ShowModal; 322 FreeAndNil(FormError); 323 end; 314 324 end; 315 325 end else ShowMessage(Format(SFileNotFound, [FileName])); … … 379 389 DataFile := DefaultDataFileClass.Create; 380 390 DataFile.OnModify := FileModified; 391 TContactsFile(DataFile).OnError := DoError; 381 392 end; 382 393 end; … … 437 448 end; 438 449 450 procedure TCore.DoError(Text: string; Line: Integer); 451 begin 452 LoadErrors := LoadErrors + Format(SLine, [Line, Text]) + LineEnding; 453 end; 454 439 455 procedure TCore.UpdateInterface; 440 456 begin -
trunk/vCardStudio.lpi
r29 r30 101 101 </Item2> 102 102 </RequiredPackages> 103 <Units Count="1 0">103 <Units Count="11"> 104 104 <Unit0> 105 105 <Filename Value="vCardStudio.lpr"/> … … 163 163 <ResourceBaseClass Value="Form"/> 164 164 </Unit9> 165 <Unit10> 166 <Filename Value="Forms\UFormError.pas"/> 167 <IsPartOfProject Value="True"/> 168 <ComponentName Value="FormError"/> 169 <ResourceBaseClass Value="Form"/> 170 </Unit10> 165 171 </Units> 166 172 </ProjectOptions> -
trunk/vCardStudio.lpr
r29 r30 8 8 {$ENDIF} 9 9 Interfaces, // this includes the LCL widgetset 10 Forms, UFormMain, UCore, Common, UDataFile, 11 SysUtils, UFormContacts, UFormContact, UFormFindDuplicity, UFormGenerate10 Forms, UFormMain, UCore, Common, UDataFile, SysUtils, UFormContacts, 11 UFormContact, UFormFindDuplicity, UFormGenerate, UFormError 12 12 { you can add units after this }; 13 13
Note:
See TracChangeset
for help on using the changeset viewer.