- Timestamp:
- Jun 6, 2023, 11:15:57 AM (19 months ago)
- Location:
- trunk
- Files:
-
- 3 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Core.pas
r149 r151 7 7 LastOpenedList, ApplicationInfo, PersistentForm, ScaleDPI, Common, 8 8 Translator, DataFile, VCard, Menus, RegistryEx, Theme, AboutDialog, 9 Registry ;9 Registry, VCardFile; 10 10 11 11 type … … 87 87 procedure AddItemToLastOpenedList(FileName: string); 88 88 procedure DoDataFileChange; 89 function GetDefaultCompareTool: string; 89 90 public 90 91 DefaultDataFileClass: TDataFileClass; … … 94 95 LastContactTabIndex: Integer; 95 96 LastContactFileName: string; 96 LastCompareFileName: string;97 97 LastPhotoFileName: string; 98 98 LastQrCodeFileName: string; … … 102 102 ToolbarVisible: Boolean; 103 103 DefaultVcardVersion: string; 104 DefaultPhoneCountryPrefix: string; 105 CompareTool: string; 104 106 function GetProfileImage: TImage; 107 function GetTempDir: string; 105 108 procedure FileNew; 106 109 procedure FileOpen(FileName: string); … … 123 126 124 127 uses 125 FormMain, FormSettings, FormFindDuplicity, TestCase,126 FormGenerate, FormError, FormFind, FormTest, FormSource, FormCompare ,127 TestCases , VCardFile;128 FormMain, FormSettings, FormFindDuplicity, FormCompare, TestCase, 129 FormGenerate, FormError, FormFind, FormTest, FormSource, FormCompareSideBySide, 130 TestCases; 128 131 129 132 resourcestring … … 184 187 procedure TCore.AFileCompareExecute(Sender: TObject); 185 188 var 186 TempFile: TDataFile; 187 TempFileName: string; 188 begin 189 TempFile := DefaultDataFileClass.Create(nil); 190 try 191 OpenDialog1.Filter := TempFile.GetFileFilter; 192 finally 193 TempFile.Free; 194 end; 195 OpenDialog1.DefaultExt := ''; 196 OpenDialog1.InitialDir := ExtractFileDir(Core.LastCompareFileName); 197 OpenDialog1.FileName := ExtractFileName(Core.LastCompareFileName); 198 OpenDialog1.Options := OpenDialog1.Options - [ofAllowMultiSelect]; 199 if OpenDialog1.Execute then begin 200 with TFormCompare.Create(nil) do 201 try 202 TempFileName := GetTempDir + DirectorySeparator + Application.Title + 203 DirectorySeparator + 'Compare' + VCardFileExt; 204 ForceDirectories(ExtractFileDir(TempFileName)); 205 TVCardFile(DataFile).SaveToFile(TempFileName); 206 LoadFileLeft(TempFileName); 207 LoadFileRight(OpenDialog1.FileName); 208 ShowModal; 209 finally 210 Free; 211 end; 212 Core.LastCompareFileName := OpenDialog1.FileName; 189 FormCompare: TFormCompare; 190 begin 191 FormCompare := TFormCompare.Create(nil); 192 try 193 FormCompare.ShowModal; 194 finally 195 FreeAndNil(FormCompare); 213 196 end; 214 197 end; … … 556 539 LastPhotoFileName := ReadStringWithDefault('LastPhotoFileName', ''); 557 540 LastQrCodeFileName := ReadStringWithDefault('LastQrCodeFileName', ''); 558 LastCompareFileName := ReadStringWithDefault('LastCompareFileName', ''); 541 CompareTool := ReadStringWithDefault('CompareTool', GetDefaultCompareTool); 542 DefaultPhoneCountryPrefix := ReadStringWithDefault('DefaultPhoneCountryPrefix', DefaultPhoneCountryPrefix); 559 543 finally 560 544 Free; … … 583 567 WriteString('LastPhotoFileName', LastPhotoFileName); 584 568 WriteString('LastQrCodeFileName', LastQrCodeFileName); 585 WriteString('LastCompareFileName', LastCompareFileName); 569 WriteString('CompareTool', CompareTool); 570 WriteString('DefaultPhoneCountryPrefix', DefaultPhoneCountryPrefix); 586 571 finally 587 572 Free; … … 609 594 end; 610 595 596 function TCore.GetDefaultCompareTool: string; 597 const 598 KDiff3 = '/usr/bin/kdiff3'; 599 Kompare = '/usr/bin/kompare'; 600 Meld = '/usr/bin/meld'; 601 Diffuse = '/usr/bin/diffuse'; 602 BeyondCompare = '/usr/bin/bcompare'; 603 begin 604 if FileExists(KDiff3) then Result := KDiff3 605 else if FileExists(Meld) then Result := Meld 606 else if FileExists(Kompare) then Result := Kompare 607 else if FileExists(Diffuse) then Result := Diffuse 608 else if FileExists(BeyondCompare) then Result := BeyondCompare 609 else Result := ''; 610 end; 611 611 612 function TCore.GetProfileImage: TImage; 612 613 begin … … 617 618 end; 618 619 Result := ProfileImage; 620 end; 621 622 function TCore.GetTempDir: string; 623 begin 624 Result := SysUtils.GetTempDir + Application.Title; 619 625 end; 620 626 -
trunk/Forms/FormCompare.lfm
r149 r151 1 1 object FormCompare: TFormCompare 2 Left = 5743 Height = 8884 Top = 3225 Width = 11912 Left = 602 3 Height = 456 4 Top = 639 5 Width = 867 6 6 Caption = 'Compare' 7 ClientHeight = 8548 ClientWidth = 11917 ClientHeight = 456 8 ClientWidth = 867 9 9 DesignTimePPI = 144 10 Menu = MainMenu111 OnActivate = FormActivate12 10 OnClose = FormClose 13 11 OnCreate = FormCreate 14 12 OnDestroy = FormDestroy 15 OnResize = FormResize16 13 OnShow = FormShow 17 LCLVersion = '2.2.0.4' 18 object PanelLeft: TPanel 19 Left = 0 20 Height = 854 21 Top = 0 22 Width = 584 23 Align = alLeft 24 BevelOuter = bvNone 25 ClientHeight = 854 26 ClientWidth = 584 14 LCLVersion = '2.2.6.0' 15 object EditAnotherFile: TEdit 16 Left = 144 17 Height = 43 18 Top = 19 19 Width = 570 20 Anchors = [akTop, akLeft, akRight] 27 21 TabOrder = 0 28 object EditLeftFileName: TEdit29 Left = 1530 Height = 4231 Top = 1132 Width = 52333 Anchors = [akTop, akLeft, akRight]34 ReadOnly = True35 TabOrder = 036 end37 inline SynEditLeft: TSynEditEx38 Left = 1539 Height = 78140 Top = 6141 Width = 56242 Anchors = [akTop, akLeft, akRight, akBottom]43 Font.Height = 1244 Font.Name = 'DejaVu Sans Mono'45 Font.Pitch = fpFixed46 Font.Quality = fqNonAntialiased47 ParentColor = False48 ParentFont = False49 TabOrder = 150 Gutter.Width = 7551 Gutter.MouseActions = <>52 RightGutter.Width = 053 RightGutter.MouseActions = <>54 Keystrokes = <55 item56 Command = ecUp57 ShortCut = 3858 end59 item60 Command = ecSelUp61 ShortCut = 823062 end63 item64 Command = ecScrollUp65 ShortCut = 1642266 end67 item68 Command = ecDown69 ShortCut = 4070 end71 item72 Command = ecSelDown73 ShortCut = 823274 end75 item76 Command = ecScrollDown77 ShortCut = 1642478 end79 item80 Command = ecLeft81 ShortCut = 3782 end83 item84 Command = ecSelLeft85 ShortCut = 822986 end87 item88 Command = ecWordLeft89 ShortCut = 1642190 end91 item92 Command = ecSelWordLeft93 ShortCut = 2461394 end95 item96 Command = ecRight97 ShortCut = 3998 end99 item100 Command = ecSelRight101 ShortCut = 8231102 end103 item104 Command = ecWordRight105 ShortCut = 16423106 end107 item108 Command = ecSelWordRight109 ShortCut = 24615110 end111 item112 Command = ecPageDown113 ShortCut = 34114 end115 item116 Command = ecSelPageDown117 ShortCut = 8226118 end119 item120 Command = ecPageBottom121 ShortCut = 16418122 end123 item124 Command = ecSelPageBottom125 ShortCut = 24610126 end127 item128 Command = ecPageUp129 ShortCut = 33130 end131 item132 Command = ecSelPageUp133 ShortCut = 8225134 end135 item136 Command = ecPageTop137 ShortCut = 16417138 end139 item140 Command = ecSelPageTop141 ShortCut = 24609142 end143 item144 Command = ecLineStart145 ShortCut = 36146 end147 item148 Command = ecSelLineStart149 ShortCut = 8228150 end151 item152 Command = ecEditorTop153 ShortCut = 16420154 end155 item156 Command = ecSelEditorTop157 ShortCut = 24612158 end159 item160 Command = ecLineEnd161 ShortCut = 35162 end163 item164 Command = ecSelLineEnd165 ShortCut = 8227166 end167 item168 Command = ecEditorBottom169 ShortCut = 16419170 end171 item172 Command = ecSelEditorBottom173 ShortCut = 24611174 end175 item176 Command = ecToggleMode177 ShortCut = 45178 end179 item180 Command = ecCopy181 ShortCut = 16429182 end183 item184 Command = ecPaste185 ShortCut = 8237186 end187 item188 Command = ecDeleteChar189 ShortCut = 46190 end191 item192 Command = ecCut193 ShortCut = 8238194 end195 item196 Command = ecDeleteLastChar197 ShortCut = 8198 end199 item200 Command = ecDeleteLastChar201 ShortCut = 8200202 end203 item204 Command = ecDeleteLastWord205 ShortCut = 16392206 end207 item208 Command = ecUndo209 ShortCut = 32776210 end211 item212 Command = ecRedo213 ShortCut = 40968214 end215 item216 Command = ecLineBreak217 ShortCut = 13218 end219 item220 Command = ecSelectAll221 ShortCut = 16449222 end223 item224 Command = ecCopy225 ShortCut = 16451226 end227 item228 Command = ecBlockIndent229 ShortCut = 24649230 end231 item232 Command = ecLineBreak233 ShortCut = 16461234 end235 item236 Command = ecInsertLine237 ShortCut = 16462238 end239 item240 Command = ecDeleteWord241 ShortCut = 16468242 end243 item244 Command = ecBlockUnindent245 ShortCut = 24661246 end247 item248 Command = ecPaste249 ShortCut = 16470250 end251 item252 Command = ecCut253 ShortCut = 16472254 end255 item256 Command = ecDeleteLine257 ShortCut = 16473258 end259 item260 Command = ecDeleteEOL261 ShortCut = 24665262 end263 item264 Command = ecUndo265 ShortCut = 16474266 end267 item268 Command = ecRedo269 ShortCut = 24666270 end271 item272 Command = ecGotoMarker0273 ShortCut = 16432274 end275 item276 Command = ecGotoMarker1277 ShortCut = 16433278 end279 item280 Command = ecGotoMarker2281 ShortCut = 16434282 end283 item284 Command = ecGotoMarker3285 ShortCut = 16435286 end287 item288 Command = ecGotoMarker4289 ShortCut = 16436290 end291 item292 Command = ecGotoMarker5293 ShortCut = 16437294 end295 item296 Command = ecGotoMarker6297 ShortCut = 16438298 end299 item300 Command = ecGotoMarker7301 ShortCut = 16439302 end303 item304 Command = ecGotoMarker8305 ShortCut = 16440306 end307 item308 Command = ecGotoMarker9309 ShortCut = 16441310 end311 item312 Command = ecSetMarker0313 ShortCut = 24624314 end315 item316 Command = ecSetMarker1317 ShortCut = 24625318 end319 item320 Command = ecSetMarker2321 ShortCut = 24626322 end323 item324 Command = ecSetMarker3325 ShortCut = 24627326 end327 item328 Command = ecSetMarker4329 ShortCut = 24628330 end331 item332 Command = ecSetMarker5333 ShortCut = 24629334 end335 item336 Command = ecSetMarker6337 ShortCut = 24630338 end339 item340 Command = ecSetMarker7341 ShortCut = 24631342 end343 item344 Command = ecSetMarker8345 ShortCut = 24632346 end347 item348 Command = ecSetMarker9349 ShortCut = 24633350 end351 item352 Command = EcFoldLevel1353 ShortCut = 41009354 end355 item356 Command = EcFoldLevel2357 ShortCut = 41010358 end359 item360 Command = EcFoldLevel3361 ShortCut = 41011362 end363 item364 Command = EcFoldLevel4365 ShortCut = 41012366 end367 item368 Command = EcFoldLevel5369 ShortCut = 41013370 end371 item372 Command = EcFoldLevel6373 ShortCut = 41014374 end375 item376 Command = EcFoldLevel7377 ShortCut = 41015378 end379 item380 Command = EcFoldLevel8381 ShortCut = 41016382 end383 item384 Command = EcFoldLevel9385 ShortCut = 41017386 end387 item388 Command = EcFoldLevel0389 ShortCut = 41008390 end391 item392 Command = EcFoldCurrent393 ShortCut = 41005394 end395 item396 Command = EcUnFoldCurrent397 ShortCut = 41003398 end399 item400 Command = EcToggleMarkupWord401 ShortCut = 32845402 end403 item404 Command = ecNormalSelect405 ShortCut = 24654406 end407 item408 Command = ecColumnSelect409 ShortCut = 24643410 end411 item412 Command = ecLineSelect413 ShortCut = 24652414 end415 item416 Command = ecTab417 ShortCut = 9418 end419 item420 Command = ecShiftTab421 ShortCut = 8201422 end423 item424 Command = ecMatchBracket425 ShortCut = 24642426 end427 item428 Command = ecColSelUp429 ShortCut = 40998430 end431 item432 Command = ecColSelDown433 ShortCut = 41000434 end435 item436 Command = ecColSelLeft437 ShortCut = 40997438 end439 item440 Command = ecColSelRight441 ShortCut = 40999442 end443 item444 Command = ecColSelPageDown445 ShortCut = 40994446 end447 item448 Command = ecColSelPageBottom449 ShortCut = 57378450 end451 item452 Command = ecColSelPageUp453 ShortCut = 40993454 end455 item456 Command = ecColSelPageTop457 ShortCut = 57377458 end459 item460 Command = ecColSelLineStart461 ShortCut = 40996462 end463 item464 Command = ecColSelLineEnd465 ShortCut = 40995466 end467 item468 Command = ecColSelEditorTop469 ShortCut = 57380470 end471 item472 Command = ecColSelEditorBottom473 ShortCut = 57379474 end>475 MouseActions = <>476 MouseTextActions = <>477 MouseSelActions = <>478 VisibleSpecialChars = [vscSpace, vscTabAtLast]479 SelectedColor.BackPriority = 50480 SelectedColor.ForePriority = 50481 SelectedColor.FramePriority = 50482 SelectedColor.BoldPriority = 50483 SelectedColor.ItalicPriority = 50484 SelectedColor.UnderlinePriority = 50485 SelectedColor.StrikeOutPriority = 50486 BracketHighlightStyle = sbhsBoth487 BracketMatchColor.Background = clNone488 BracketMatchColor.Foreground = clNone489 BracketMatchColor.Style = [fsBold]490 FoldedCodeColor.Background = clNone491 FoldedCodeColor.Foreground = clGray492 FoldedCodeColor.FrameColor = clGray493 MouseLinkColor.Background = clNone494 MouseLinkColor.Foreground = clBlue495 LineHighlightColor.Background = clNone496 LineHighlightColor.Foreground = clNone497 OnChange = SynEditLeftChange498 OnScroll = SynEditLeftScroll499 inline SynLeftGutterPartList1: TSynGutterPartList500 object SynGutterMarks1: TSynGutterMarks501 Width = 36502 MouseActions = <>503 end504 object SynGutterLineNumber1: TSynGutterLineNumber505 Width = 15506 MouseActions = <>507 MarkupInfo.Background = clBtnFace508 MarkupInfo.Foreground = clNone509 DigitCount = 2510 ShowOnlyLineNumbersMultiplesOf = 1511 ZeroStart = False512 LeadingZeros = False513 end514 object SynGutterChanges1: TSynGutterChanges515 Width = 6516 MouseActions = <>517 ModifiedColor = 59900518 SavedColor = clGreen519 end520 object SynGutterSeparator1: TSynGutterSeparator521 Width = 3522 MouseActions = <>523 MarkupInfo.Background = clWhite524 MarkupInfo.Foreground = clGray525 end526 object SynGutterCodeFolding1: TSynGutterCodeFolding527 Width = 15528 MouseActions = <>529 MarkupInfo.Background = clNone530 MarkupInfo.Foreground = clGray531 MouseActionsExpanded = <>532 MouseActionsCollapsed = <>533 end534 end535 end536 object SpeedButtonOpenLeft: TSpeedButton537 Left = 542538 Height = 33539 Top = 14540 Width = 35541 Action = AFileOpenLeft542 Anchors = [akTop, akRight]543 Images = Core.ImageList1544 ImageIndex = 5545 ShowCaption = False546 end547 22 end 548 object Splitter1: TSplitter 549 Left = 584 550 Height = 854 551 Top = 0 552 Width = 8 23 object ButtonBrowse: TButton 24 Left = 730 25 Height = 38 26 Top = 19 27 Width = 113 28 Anchors = [akTop, akRight] 29 Caption = 'Browse' 30 OnClick = ButtonBrowseClick 31 TabOrder = 1 553 32 end 554 object PanelRight: TPanel 555 Left = 592 556 Height = 854 557 Top = 0 558 Width = 599 559 Align = alClient 560 BevelOuter = bvNone 561 ClientHeight = 854 562 ClientWidth = 599 33 object Label1: TLabel 34 Left = 21 35 Height = 26 36 Top = 26 37 Width = 104 38 Caption = 'Another file:' 39 ParentColor = False 40 end 41 object ButtonCancel: TButton 42 Left = 730 43 Height = 38 44 Top = 389 45 Width = 113 46 Anchors = [akRight, akBottom] 47 Caption = 'Cancel' 48 ModalResult = 2 563 49 TabOrder = 2 564 object EditRightFileName: TEdit565 Left = 12566 Height = 42567 Top = 11568 Width = 527569 Anchors = [akTop, akLeft, akRight]570 ReadOnly = True571 TabOrder = 0572 end573 inline SynEditRight: TSynEditEx574 Left = 15575 Height = 781576 Top = 61577 Width = 571578 Anchors = [akTop, akLeft, akRight, akBottom]579 Font.Height = 12580 Font.Name = 'DejaVu Sans Mono'581 Font.Pitch = fpFixed582 Font.Quality = fqNonAntialiased583 ParentColor = False584 ParentFont = False585 TabOrder = 1586 Gutter.Width = 75587 Gutter.MouseActions = <>588 RightGutter.Width = 0589 RightGutter.MouseActions = <>590 Keystrokes = <591 item592 Command = ecUp593 ShortCut = 38594 end595 item596 Command = ecSelUp597 ShortCut = 8230598 end599 item600 Command = ecScrollUp601 ShortCut = 16422602 end603 item604 Command = ecDown605 ShortCut = 40606 end607 item608 Command = ecSelDown609 ShortCut = 8232610 end611 item612 Command = ecScrollDown613 ShortCut = 16424614 end615 item616 Command = ecLeft617 ShortCut = 37618 end619 item620 Command = ecSelLeft621 ShortCut = 8229622 end623 item624 Command = ecWordLeft625 ShortCut = 16421626 end627 item628 Command = ecSelWordLeft629 ShortCut = 24613630 end631 item632 Command = ecRight633 ShortCut = 39634 end635 item636 Command = ecSelRight637 ShortCut = 8231638 end639 item640 Command = ecWordRight641 ShortCut = 16423642 end643 item644 Command = ecSelWordRight645 ShortCut = 24615646 end647 item648 Command = ecPageDown649 ShortCut = 34650 end651 item652 Command = ecSelPageDown653 ShortCut = 8226654 end655 item656 Command = ecPageBottom657 ShortCut = 16418658 end659 item660 Command = ecSelPageBottom661 ShortCut = 24610662 end663 item664 Command = ecPageUp665 ShortCut = 33666 end667 item668 Command = ecSelPageUp669 ShortCut = 8225670 end671 item672 Command = ecPageTop673 ShortCut = 16417674 end675 item676 Command = ecSelPageTop677 ShortCut = 24609678 end679 item680 Command = ecLineStart681 ShortCut = 36682 end683 item684 Command = ecSelLineStart685 ShortCut = 8228686 end687 item688 Command = ecEditorTop689 ShortCut = 16420690 end691 item692 Command = ecSelEditorTop693 ShortCut = 24612694 end695 item696 Command = ecLineEnd697 ShortCut = 35698 end699 item700 Command = ecSelLineEnd701 ShortCut = 8227702 end703 item704 Command = ecEditorBottom705 ShortCut = 16419706 end707 item708 Command = ecSelEditorBottom709 ShortCut = 24611710 end711 item712 Command = ecToggleMode713 ShortCut = 45714 end715 item716 Command = ecCopy717 ShortCut = 16429718 end719 item720 Command = ecPaste721 ShortCut = 8237722 end723 item724 Command = ecDeleteChar725 ShortCut = 46726 end727 item728 Command = ecCut729 ShortCut = 8238730 end731 item732 Command = ecDeleteLastChar733 ShortCut = 8734 end735 item736 Command = ecDeleteLastChar737 ShortCut = 8200738 end739 item740 Command = ecDeleteLastWord741 ShortCut = 16392742 end743 item744 Command = ecUndo745 ShortCut = 32776746 end747 item748 Command = ecRedo749 ShortCut = 40968750 end751 item752 Command = ecLineBreak753 ShortCut = 13754 end755 item756 Command = ecSelectAll757 ShortCut = 16449758 end759 item760 Command = ecCopy761 ShortCut = 16451762 end763 item764 Command = ecBlockIndent765 ShortCut = 24649766 end767 item768 Command = ecLineBreak769 ShortCut = 16461770 end771 item772 Command = ecInsertLine773 ShortCut = 16462774 end775 item776 Command = ecDeleteWord777 ShortCut = 16468778 end779 item780 Command = ecBlockUnindent781 ShortCut = 24661782 end783 item784 Command = ecPaste785 ShortCut = 16470786 end787 item788 Command = ecCut789 ShortCut = 16472790 end791 item792 Command = ecDeleteLine793 ShortCut = 16473794 end795 item796 Command = ecDeleteEOL797 ShortCut = 24665798 end799 item800 Command = ecUndo801 ShortCut = 16474802 end803 item804 Command = ecRedo805 ShortCut = 24666806 end807 item808 Command = ecGotoMarker0809 ShortCut = 16432810 end811 item812 Command = ecGotoMarker1813 ShortCut = 16433814 end815 item816 Command = ecGotoMarker2817 ShortCut = 16434818 end819 item820 Command = ecGotoMarker3821 ShortCut = 16435822 end823 item824 Command = ecGotoMarker4825 ShortCut = 16436826 end827 item828 Command = ecGotoMarker5829 ShortCut = 16437830 end831 item832 Command = ecGotoMarker6833 ShortCut = 16438834 end835 item836 Command = ecGotoMarker7837 ShortCut = 16439838 end839 item840 Command = ecGotoMarker8841 ShortCut = 16440842 end843 item844 Command = ecGotoMarker9845 ShortCut = 16441846 end847 item848 Command = ecSetMarker0849 ShortCut = 24624850 end851 item852 Command = ecSetMarker1853 ShortCut = 24625854 end855 item856 Command = ecSetMarker2857 ShortCut = 24626858 end859 item860 Command = ecSetMarker3861 ShortCut = 24627862 end863 item864 Command = ecSetMarker4865 ShortCut = 24628866 end867 item868 Command = ecSetMarker5869 ShortCut = 24629870 end871 item872 Command = ecSetMarker6873 ShortCut = 24630874 end875 item876 Command = ecSetMarker7877 ShortCut = 24631878 end879 item880 Command = ecSetMarker8881 ShortCut = 24632882 end883 item884 Command = ecSetMarker9885 ShortCut = 24633886 end887 item888 Command = EcFoldLevel1889 ShortCut = 41009890 end891 item892 Command = EcFoldLevel2893 ShortCut = 41010894 end895 item896 Command = EcFoldLevel3897 ShortCut = 41011898 end899 item900 Command = EcFoldLevel4901 ShortCut = 41012902 end903 item904 Command = EcFoldLevel5905 ShortCut = 41013906 end907 item908 Command = EcFoldLevel6909 ShortCut = 41014910 end911 item912 Command = EcFoldLevel7913 ShortCut = 41015914 end915 item916 Command = EcFoldLevel8917 ShortCut = 41016918 end919 item920 Command = EcFoldLevel9921 ShortCut = 41017922 end923 item924 Command = EcFoldLevel0925 ShortCut = 41008926 end927 item928 Command = EcFoldCurrent929 ShortCut = 41005930 end931 item932 Command = EcUnFoldCurrent933 ShortCut = 41003934 end935 item936 Command = EcToggleMarkupWord937 ShortCut = 32845938 end939 item940 Command = ecNormalSelect941 ShortCut = 24654942 end943 item944 Command = ecColumnSelect945 ShortCut = 24643946 end947 item948 Command = ecLineSelect949 ShortCut = 24652950 end951 item952 Command = ecTab953 ShortCut = 9954 end955 item956 Command = ecShiftTab957 ShortCut = 8201958 end959 item960 Command = ecMatchBracket961 ShortCut = 24642962 end963 item964 Command = ecColSelUp965 ShortCut = 40998966 end967 item968 Command = ecColSelDown969 ShortCut = 41000970 end971 item972 Command = ecColSelLeft973 ShortCut = 40997974 end975 item976 Command = ecColSelRight977 ShortCut = 40999978 end979 item980 Command = ecColSelPageDown981 ShortCut = 40994982 end983 item984 Command = ecColSelPageBottom985 ShortCut = 57378986 end987 item988 Command = ecColSelPageUp989 ShortCut = 40993990 end991 item992 Command = ecColSelPageTop993 ShortCut = 57377994 end995 item996 Command = ecColSelLineStart997 ShortCut = 40996998 end999 item1000 Command = ecColSelLineEnd1001 ShortCut = 409951002 end1003 item1004 Command = ecColSelEditorTop1005 ShortCut = 573801006 end1007 item1008 Command = ecColSelEditorBottom1009 ShortCut = 573791010 end>1011 MouseActions = <>1012 MouseTextActions = <>1013 MouseSelActions = <>1014 VisibleSpecialChars = [vscSpace, vscTabAtLast]1015 SelectedColor.BackPriority = 501016 SelectedColor.ForePriority = 501017 SelectedColor.FramePriority = 501018 SelectedColor.BoldPriority = 501019 SelectedColor.ItalicPriority = 501020 SelectedColor.UnderlinePriority = 501021 SelectedColor.StrikeOutPriority = 501022 BracketHighlightStyle = sbhsBoth1023 BracketMatchColor.Background = clNone1024 BracketMatchColor.Foreground = clNone1025 BracketMatchColor.Style = [fsBold]1026 FoldedCodeColor.Background = clNone1027 FoldedCodeColor.Foreground = clGray1028 FoldedCodeColor.FrameColor = clGray1029 MouseLinkColor.Background = clNone1030 MouseLinkColor.Foreground = clBlue1031 LineHighlightColor.Background = clNone1032 LineHighlightColor.Foreground = clNone1033 OnChange = SynEditRightChange1034 OnScroll = SynEditRightScroll1035 inline SynLeftGutterPartList1: TSynGutterPartList1036 object SynGutterMarks1: TSynGutterMarks1037 Width = 361038 MouseActions = <>1039 end1040 object SynGutterLineNumber1: TSynGutterLineNumber1041 Width = 151042 MouseActions = <>1043 MarkupInfo.Background = clBtnFace1044 MarkupInfo.Foreground = clNone1045 DigitCount = 21046 ShowOnlyLineNumbersMultiplesOf = 11047 ZeroStart = False1048 LeadingZeros = False1049 end1050 object SynGutterChanges1: TSynGutterChanges1051 Width = 61052 MouseActions = <>1053 ModifiedColor = 599001054 SavedColor = clGreen1055 end1056 object SynGutterSeparator1: TSynGutterSeparator1057 Width = 31058 MouseActions = <>1059 MarkupInfo.Background = clWhite1060 MarkupInfo.Foreground = clGray1061 end1062 object SynGutterCodeFolding1: TSynGutterCodeFolding1063 Width = 151064 MouseActions = <>1065 MarkupInfo.Background = clNone1066 MarkupInfo.Foreground = clGray1067 MouseActionsExpanded = <>1068 MouseActionsCollapsed = <>1069 end1070 end1071 end1072 object SpeedButtonOpenRight: TSpeedButton1073 Left = 5511074 Height = 331075 Top = 151076 Width = 351077 Action = AFileOpenRight1078 Anchors = [akTop, akRight]1079 Images = Core.ImageList11080 ImageIndex = 21081 ShowCaption = False1082 end1083 50 end 1084 object OpenDialogSide: TOpenDialog 1085 Left = 323 1086 Top = 346 51 object ButtonCompare: TButton 52 Left = 586 53 Height = 38 54 Top = 389 55 Width = 113 56 Anchors = [akRight, akBottom] 57 Caption = 'Compare' 58 ModalResult = 1 59 OnClick = ButtonCompareClick 60 TabOrder = 3 1087 61 end 1088 object MainMenu1: TMainMenu 1089 Images = Core.ImageList1 1090 Left = 330 1091 Top = 476 1092 object MenuItem1: TMenuItem 1093 Caption = 'File' 1094 object MenuItem2: TMenuItem 1095 Action = AFileOpenLeft 1096 end 1097 object MenuItem3: TMenuItem 1098 Action = AFileOpenRight 1099 end 1100 object MenuItem4: TMenuItem 1101 Action = AReloadFiles 1102 end 1103 object MenuItem5: TMenuItem 1104 Action = ASwitchSides 1105 end 1106 object MenuItemClose: TMenuItem 1107 Caption = 'Close' 1108 OnClick = MenuItemCloseClick 1109 end 1110 end 62 object CheckBoxSortContacts: TCheckBox 63 Left = 23 64 Height = 30 65 Top = 81 66 Width = 136 67 Caption = 'Sort contacts' 68 Checked = True 69 State = cbChecked 70 TabOrder = 4 1111 71 end 1112 object ActionList1: TActionList 1113 Images = Core.ImageList1 1114 Left = 733 1115 Top = 346 1116 object AFileOpenLeft: TAction 1117 Caption = 'Open left file' 1118 ImageIndex = 5 1119 OnExecute = AFileOpenLeftExecute 1120 end 1121 object AFileOpenRight: TAction 1122 Caption = 'Open right file' 1123 ImageIndex = 2 1124 OnExecute = AFileOpenRightExecute 1125 end 1126 object AReloadFiles: TAction 1127 Caption = 'Reload files' 1128 OnExecute = AReloadFilesExecute 1129 end 1130 object ASwitchSides: TAction 1131 Caption = 'Switch sides' 1132 OnExecute = ASwitchSidesExecute 1133 end 72 object CheckBoxNormalizePhoneNumbers: TCheckBox 73 Left = 23 74 Height = 30 75 Top = 120 76 Width = 253 77 Caption = 'Normalize phone numbers' 78 Checked = True 79 State = cbChecked 80 TabOrder = 5 81 end 82 object CheckBoxWithoutPhotos: TCheckBox 83 Left = 24 84 Height = 30 85 Top = 160 86 Width = 157 87 Caption = 'Without photos' 88 Checked = True 89 State = cbChecked 90 TabOrder = 6 91 end 92 object CheckBoxRemoveExactDuplicates: TCheckBox 93 Left = 24 94 Height = 30 95 Top = 200 96 Width = 236 97 Caption = 'Remove exact duplicates' 98 Checked = True 99 State = cbChecked 100 TabOrder = 7 101 end 102 object OpenDialog1: TOpenDialog 103 Left = 713 104 Top = 113 1134 105 end 1135 106 end -
trunk/Forms/FormCompare.lrj
r149 r151 1 1 {"version":1,"strings":[ 2 2 {"hash":174352581,"name":"tformcompare.caption","sourcebytes":[67,111,109,112,97,114,101],"value":"Compare"}, 3 {"hash":315429,"name":"tformcompare.menuitem1.caption","sourcebytes":[70,105,108,101],"value":"File"}, 4 {"hash":4863637,"name":"tformcompare.menuitemclose.caption","sourcebytes":[67,108,111,115,101],"value":"Close"}, 5 {"hash":195475957,"name":"tformcompare.afileopenleft.caption","sourcebytes":[79,112,101,110,32,108,101,102,116,32,102,105,108,101],"value":"Open left file"}, 6 {"hash":56694677,"name":"tformcompare.afileopenright.caption","sourcebytes":[79,112,101,110,32,114,105,103,104,116,32,102,105,108,101],"value":"Open right file"}, 7 {"hash":65066931,"name":"tformcompare.areloadfiles.caption","sourcebytes":[82,101,108,111,97,100,32,102,105,108,101,115],"value":"Reload files"}, 8 {"hash":265810003,"name":"tformcompare.aswitchsides.caption","sourcebytes":[83,119,105,116,99,104,32,115,105,100,101,115],"value":"Switch sides"} 3 {"hash":77164181,"name":"tformcompare.buttonbrowse.caption","sourcebytes":[66,114,111,119,115,101],"value":"Browse"}, 4 {"hash":205155338,"name":"tformcompare.label1.caption","sourcebytes":[65,110,111,116,104,101,114,32,102,105,108,101,58],"value":"Another file:"}, 5 {"hash":77089212,"name":"tformcompare.buttoncancel.caption","sourcebytes":[67,97,110,99,101,108],"value":"Cancel"}, 6 {"hash":174352581,"name":"tformcompare.buttoncompare.caption","sourcebytes":[67,111,109,112,97,114,101],"value":"Compare"}, 7 {"hash":3349587,"name":"tformcompare.checkboxsortcontacts.caption","sourcebytes":[83,111,114,116,32,99,111,110,116,97,99,116,115],"value":"Sort contacts"}, 8 {"hash":198682019,"name":"tformcompare.checkboxnormalizephonenumbers.caption","sourcebytes":[78,111,114,109,97,108,105,122,101,32,112,104,111,110,101,32,110,117,109,98,101,114,115],"value":"Normalize phone numbers"}, 9 {"hash":130155747,"name":"tformcompare.checkboxwithoutphotos.caption","sourcebytes":[87,105,116,104,111,117,116,32,112,104,111,116,111,115],"value":"Without photos"}, 10 {"hash":78724163,"name":"tformcompare.checkboxremoveexactduplicates.caption","sourcebytes":[82,101,109,111,118,101,32,101,120,97,99,116,32,100,117,112,108,105,99,97,116,101,115],"value":"Remove exact duplicates"} 9 11 ]} -
trunk/Forms/FormCompare.pas
r149 r151 4 4 5 5 uses 6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls, 7 VCard, Diff, LCLType, LCLIntf, ComCtrls, Buttons, Menus, ActnList, SynEdit, 8 SynEditMiscClasses, SynHighlighterPosition, SynEditHighlighter, Common, 9 USynEditEx; 6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, DataFile, 7 VCardFile, VCard, Common, RegistryEx; 10 8 11 9 type … … 14 12 15 13 TFormCompare = class(TForm) 16 ASwitchSides: TAction; 17 AReloadFiles: TAction; 18 AFileOpenLeft: TAction; 19 AFileOpenRight: TAction; 20 ActionList1: TActionList; 21 EditLeftFileName: TEdit; 22 EditRightFileName: TEdit; 23 MainMenu1: TMainMenu; 24 MenuItem1: TMenuItem; 25 MenuItem2: TMenuItem; 26 MenuItem3: TMenuItem; 27 MenuItem4: TMenuItem; 28 MenuItem5: TMenuItem; 29 MenuItemClose: TMenuItem; 30 OpenDialogSide: TOpenDialog; 31 PanelLeft: TPanel; 32 PanelRight: TPanel; 33 SpeedButtonOpenLeft: TSpeedButton; 34 SpeedButtonOpenRight: TSpeedButton; 35 Splitter1: TSplitter; 36 SynEditLeft: TSynEditEx; 37 SynEditRight: TSynEditEx; 38 procedure AFileOpenLeftExecute(Sender: TObject); 39 procedure AFileOpenRightExecute(Sender: TObject); 40 procedure AReloadFilesExecute(Sender: TObject); 41 procedure ASwitchSidesExecute(Sender: TObject); 42 procedure FormActivate(Sender: TObject); 14 ButtonCancel: TButton; 15 ButtonCompare: TButton; 16 ButtonBrowse: TButton; 17 CheckBoxWithoutPhotos: TCheckBox; 18 CheckBoxSortContacts: TCheckBox; 19 CheckBoxNormalizePhoneNumbers: TCheckBox; 20 CheckBoxRemoveExactDuplicates: TCheckBox; 21 EditAnotherFile: TEdit; 22 Label1: TLabel; 23 OpenDialog1: TOpenDialog; 24 procedure ButtonBrowseClick(Sender: TObject); 25 procedure ButtonCompareClick(Sender: TObject); 43 26 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 44 27 procedure FormCreate(Sender: TObject); 45 28 procedure FormDestroy(Sender: TObject); 46 procedure FormResize(Sender: TObject);47 29 procedure FormShow(Sender: TObject); 48 procedure MenuItemCloseClick(Sender: TObject);49 procedure SynEditLeftChange(Sender: TObject);50 procedure SynEditLeftScroll(Sender: TObject);51 procedure SynEditRightChange(Sender: TObject);52 procedure SynEditRightScroll(Sender: TObject);53 30 private 54 FLeftSide: string; 55 FRightSide: string; 56 Diff: TDiff; 57 HighlighterLeft: TSynPositionHighlighter; 58 HighlighterRight: TSynPositionHighlighter; 59 AttrAdded: TtkTokenKind; 60 AttrDeleted: TtkTokenKind; 61 AttrModified: TtkTokenKind; 62 LastWidth: Integer; 63 procedure SetLeftSide(AValue: string); 64 procedure SetRightSide(AValue: string); 65 procedure ReloadContent; 66 procedure UpdateInterface; 67 procedure UpdateHighlight; 68 function LoadFile(AFileName: string): string; 69 public 70 procedure LoadFileLeft(FileName: string); 71 procedure LoadFileRight(FileName: string); 72 property LeftSide: string read FLeftSide write SetLeftSide; 73 property RightSide: string read FRightSide write SetRightSide; 31 LeftVCard: TVCardFile; 32 RightVCard: TVCardFile; 33 procedure CompareInternal; 34 procedure CompareExternal; 35 procedure LoadConfig; 36 procedure RemoveExactDuplicates(Contacts: TContacts); 37 procedure NormalizePhoneNumbers(Contacts: TContacts); 38 procedure RemovePhotos(Contacts: TContacts); 39 procedure SaveConfig; 74 40 end; 75 41 … … 80 46 81 47 uses 82 Core, VCardFile;48 Core, FormCompareSideBySide; 83 49 84 50 { TFormCompare } 51 52 procedure TFormCompare.FormCreate(Sender: TObject); 53 begin 54 Core.Core.Translator.TranslateComponentRecursive(Self); 55 Core.Core.ThemeManager1.UseTheme(Self); 56 LeftVCard := TVCardFile.Create(nil); 57 RightVCard := TVCardFile.Create(nil); 58 end; 59 60 procedure TFormCompare.FormDestroy(Sender: TObject); 61 begin 62 FreeAndNil(LeftVCard); 63 FreeAndNil(RightVCard); 64 end; 85 65 86 66 procedure TFormCompare.FormClose(Sender: TObject; var CloseAction: TCloseAction 87 67 ); 88 68 begin 69 SaveConfig; 89 70 Core.Core.PersistentForm1.Save(Self); 90 71 end; 91 72 92 procedure TFormCompare.ASwitchSidesExecute(Sender: TObject); 73 procedure TFormCompare.ButtonCompareClick(Sender: TObject); 74 begin 75 LeftVCard.Assign(TVCardFile(Core.Core.DataFile)); 76 RightVCard.LoadFromFile(EditAnotherFile.Text); 77 78 if CheckBoxSortContacts.Checked then begin 79 LeftVCard.VCard.Contacts.Sort; 80 RightVCard.VCard.Contacts.Sort; 81 end; 82 83 if CheckBoxWithoutPhotos.Checked then begin 84 RemovePhotos(LeftVCard.VCard.Contacts); 85 RemovePhotos(RightVCard.VCard.Contacts); 86 end; 87 88 if CheckBoxNormalizePhoneNumbers.Checked then begin 89 NormalizePhoneNumbers(LeftVCard.VCard.Contacts); 90 NormalizePhoneNumbers(RightVCard.VCard.Contacts); 91 end; 92 93 if CheckBoxRemoveExactDuplicates.Checked then begin 94 RemoveExactDuplicates(LeftVCard.VCard.Contacts); 95 RemoveExactDuplicates(RightVCard.VCard.Contacts); 96 end; 97 98 CompareExternal; 99 end; 100 101 procedure TFormCompare.RemovePhotos(Contacts: TContacts); 102 var 103 I: Integer; 104 J: Integer; 105 ContactProperties: TContactProperties; 106 begin 107 for I := 0 to Contacts.Count - 1 do 108 with Contacts[I].Properties do begin 109 ContactProperties := GetMultipleByName('PHOTO'); 110 for J := ContactProperties.Count - 1 downto 0 do 111 Remove(ContactProperties[J]); 112 ContactProperties.Free; 113 end; 114 end; 115 116 procedure TFormCompare.NormalizePhoneNumbers(Contacts: TContacts); 117 var 118 I: Integer; 119 J: Integer; 120 ContactProperties: TContactProperties; 121 begin 122 for I := 0 to Contacts.Count - 1 do 123 with Contacts[I].Properties do begin 124 ContactProperties := GetMultipleByName('TEL'); 125 for J := 0 to ContactProperties.Count - 1 do begin 126 ContactProperties[J].Value := StringReplace(ContactProperties[J].Value, ' ', '', [rfReplaceAll]); 127 if not ContactProperties[J].Value.StartsWith('+') then 128 ContactProperties[J].Value := Core.Core.DefaultPhoneCountryPrefix + ContactProperties[J].Value; 129 end; 130 ContactProperties.Free; 131 end; 132 end; 133 134 procedure TFormCompare.ButtonBrowseClick(Sender: TObject); 135 var 136 TempFile: TDataFile; 137 begin 138 TempFile := Core.Core.DefaultDataFileClass.Create(nil); 139 try 140 OpenDialog1.Filter := TempFile.GetFileFilter; 141 finally 142 TempFile.Free; 143 end; 144 145 OpenDialog1.DefaultExt := ''; 146 OpenDialog1.InitialDir := ExtractFileDir(EditAnotherFile.Text); 147 OpenDialog1.FileName := ExtractFileName(EditAnotherFile.Text); 148 OpenDialog1.Options := OpenDialog1.Options - [ofAllowMultiSelect]; 149 if OpenDialog1.Execute then begin 150 EditAnotherFile.Text := OpenDialog1.FileName; 151 end; 152 end; 153 154 procedure TFormCompare.FormShow(Sender: TObject); 155 begin 156 Core.Core.PersistentForm1.Load(Self); 157 LoadConfig; 158 end; 159 160 procedure TFormCompare.CompareInternal; 93 161 var 94 162 TempFileName: string; 95 TempContent: string; 96 begin 97 TempContent := SynEditLeft.Text; 98 SynEditLeft.Text := SynEditRight.Text; 99 SynEditRight.Text := TempContent; 100 101 TempFileName := EditLeftFileName.Text; 102 EditLeftFileName.Text := EditRightFileName.Text; 103 EditRightFileName.Text := TempFileName; 104 105 UpdateInterface; 106 UpdateHighlight; 107 end; 108 109 procedure TFormCompare.FormActivate(Sender: TObject); 110 begin 111 if LastWidth = -1 then LastWidth := Width; 112 end; 113 114 procedure TFormCompare.AReloadFilesExecute(Sender: TObject); 115 begin 116 LoadFileLeft(EditLeftFileName.Text); 117 LoadFileRight(EditRightFileName.Text); 118 UpdateHighlight; 119 UpdateInterface; 120 end; 121 122 procedure TFormCompare.AFileOpenLeftExecute(Sender: TObject); 123 begin 124 OpenDialogSide.InitialDir := ExtractFileDir(EditLeftFileName.Text); 125 OpenDialogSide.FileName := ExtractFileName(EditLeftFileName.Text); 126 if OpenDialogSide.Execute then begin 127 EditLeftFileName.Text := OpenDialogSide.FileName; 128 SynEditLeft.Text := LoadFileToStr(OpenDialogSide.FileName); 129 end; 130 end; 131 132 procedure TFormCompare.AFileOpenRightExecute(Sender: TObject); 133 begin 134 OpenDialogSide.InitialDir := ExtractFileDir(EditRightFileName.Text); 135 OpenDialogSide.FileName := ExtractFileName(EditRightFileName.Text); 136 if OpenDialogSide.Execute then begin 137 EditRightFileName.Text := OpenDialogSide.FileName; 138 SynEditRight.Text := LoadFileToStr(OpenDialogSide.FileName); 139 end; 140 UpdateHighlight; 141 end; 142 143 procedure TFormCompare.FormCreate(Sender: TObject); 144 begin 145 Core.Core.Translator.TranslateComponentRecursive(Self); 146 Core.Core.ThemeManager1.UseTheme(Self); 147 Diff := TDiff.Create(Self); 148 149 HighlighterLeft := TSynPositionHighlighter.Create(Self); 150 with HighlighterLeft do begin 151 AttrAdded := CreateTokenID('Added', clNone, clLightGreen, []); 152 AttrDeleted := CreateTokenID('Deleted', clNone, clLightBlue, []); 153 AttrModified := CreateTokenID('Modified', clNone, clLightRed, []); 154 end; 155 SynEditLeft.Highlighter := HighlighterLeft; 156 157 HighlighterRight := TSynPositionHighlighter.Create(Self); 158 with HighlighterRight do begin 159 AttrAdded := CreateTokenID('Added', clNone, clLightGreen, []); 160 AttrDeleted := CreateTokenID('Deleted', clNone, clLightBlue, []); 161 AttrModified := CreateTokenID('Modified', clNone, clLightRed, []); 162 end; 163 SynEditRight.Highlighter := HighlighterRight; 164 165 LastWidth := -1; 166 end; 167 168 procedure TFormCompare.FormDestroy(Sender: TObject); 169 begin 170 FreeAndNil(HighlighterLeft); 171 FreeAndNil(HighlighterRight); 172 FreeAndNil(Diff); 173 end; 174 175 procedure TFormCompare.FormResize(Sender: TObject); 176 var 177 LastHandler: TNotifyEvent; 178 NewPanelWidth: Integer; 179 const 180 MaxRatio = 0.8; 181 begin 182 if LastWidth <> -1 then begin 183 LastHandler := PanelLeft.OnResize; 184 try 185 PanelLeft.OnResize := nil; 186 NewPanelWidth := Round((PanelLeft.Width / LastWidth) * Width); 187 if NewPanelWidth > Round(Width * MaxRatio) then NewPanelWidth := Round(Width * MaxRatio); 188 PanelLeft.Width := NewPanelWidth; 189 finally 190 PanelLeft.OnResize := LastHandler; 191 end; 192 LastWidth := Width; 193 end; 194 end; 195 196 procedure TFormCompare.FormShow(Sender: TObject); 197 begin 198 Core.Core.PersistentForm1.Load(Self); 199 UpdateInterface; 200 ReloadContent; 201 end; 202 203 procedure TFormCompare.MenuItemCloseClick(Sender: TObject); 204 begin 205 Close; 206 end; 207 208 procedure TFormCompare.SynEditLeftChange(Sender: TObject); 209 begin 210 UpdateHighlight; 211 end; 212 213 procedure TFormCompare.SynEditLeftScroll(Sender: TObject); 214 begin 215 SynEditRight.TopLine := SynEditLeft.TopLine; 216 end; 217 218 procedure TFormCompare.SynEditRightChange(Sender: TObject); 219 begin 220 UpdateHighlight; 221 end; 222 223 procedure TFormCompare.SynEditRightScroll(Sender: TObject); 224 begin 225 SynEditLeft.TopLine := SynEditRight.TopLine; 226 end; 227 228 procedure TFormCompare.SetLeftSide(AValue: string); 229 begin 230 if FLeftSide = AValue then Exit; 231 FLeftSide := AValue; 232 end; 233 234 procedure TFormCompare.SetRightSide(AValue: string); 235 begin 236 if FRightSide = AValue then Exit; 237 FRightSide := AValue; 238 end; 239 240 procedure TFormCompare.ReloadContent; 241 begin 242 UpdateHighlight; 243 end; 244 245 procedure TFormCompare.UpdateInterface; 246 begin 247 end; 248 249 procedure TFormCompare.UpdateHighlight; 250 var 251 LeftText: string; 252 RightText: string; 163 begin 164 with TFormCompareSideBySide.Create(nil) do 165 try 166 TempFileName := Core.Core.GetTempDir + 167 DirectorySeparator + 'Compare' + VCardFileExt; 168 ForceDirectories(ExtractFileDir(TempFileName)); 169 TVCardFile(Core.Core.DataFile).SaveToFile(TempFileName); 170 LoadFileLeft(TempFileName); 171 LoadFileRight(EditAnotherFile.Text); 172 ShowModal; 173 finally 174 Free; 175 end; 176 end; 177 178 procedure CompareText(TextLeft, TextRight: string; FileNameLeft: string = 'FileLeft.txt'; 179 FileNameRight: string = 'FileRight.txt'); 180 var 181 TempFileRight: string; 182 TempFileLeft: string; 183 begin 184 if not DirectoryExists(Core.Core.GetTempDir) then 185 CreateDir(Core.Core.GetTempDir); 186 TempFileLeft := Core.Core.GetTempDir + DirectorySeparator + FileNameLeft; 187 TempFileRight := Core.Core.GetTempDir + DirectorySeparator + FileNameRight; 188 SaveStringToFile(TextLeft, TempFileLeft); 189 SaveStringToFile(TextRight, TempFileRight); 190 ExecuteProgram(Core.Core.CompareTool, [TempFileLeft, TempFileRight]); 191 end; 192 193 procedure TFormCompare.CompareExternal; 194 begin 195 CompareText(LeftVCard.VCard.AsString, RightVCard.Vcard.AsString, 196 ExtractFileName(LeftVCard.FileName), ExtractFileName(EditAnotherFile.Text)); 197 end; 198 199 procedure TFormCompare.LoadConfig; 200 begin 201 with TRegistryEx.Create do 202 try 203 CurrentContext := Core.Core.ApplicationInfo1.GetRegistryContext; 204 EditAnotherFile.Text := ReadStringWithDefault('LastCompareFileName', ''); 205 CheckBoxWithoutPhotos.Checked := ReadBoolWithDefault('WithoutPhotos', True); 206 CheckBoxSortContacts.Checked := ReadBoolWithDefault('SortContacts', True); 207 CheckBoxNormalizePhoneNumbers.Checked := ReadBoolWithDefault('NormalizePhoneNumbers', True); 208 CheckBoxRemoveExactDuplicates.Checked := ReadBoolWithDefault('RemoveExactDuplicates', True); 209 finally 210 Free; 211 end; 212 end; 213 214 procedure TFormCompare.RemoveExactDuplicates(Contacts: TContacts); 215 var 253 216 I: Integer; 254 LastKind: TChangeKind; 255 P1: TPoint; 256 P2: TPoint; 257 Rec: TCompareRec; 258 NextToken1: TtkTokenKind; 259 NextToken2: TtkTokenKind; 260 begin 261 LeftText := SynEditLeft.Lines.Text; 262 RightText := SynEditRight.Lines.Text; 263 264 Diff.Execute(PChar(LeftText), PChar(RightText), Length(LeftText), Length(RightText)); 265 266 HighlighterLeft.ClearAllTokens; 267 HighlighterRight.ClearAllTokens; 268 LeftText := ''; 269 RightText := ''; 270 LastKind := ckNone; 271 P1 := Point(1, 0); 272 P2 := Point(1, 0); 273 NextToken1 := tkText; 274 NextToken2 := tkText; 275 for I := 0 to Diff.Count - 1 do 276 with Diff.Compares[I] do begin 277 Rec := Diff.Compares[I]; 278 if Rec.Chr1 = LineEnding then begin 279 if NextToken1 <> tkText then begin 280 HighlighterLeft.AddToken(P1.Y, 0, NextToken1); 281 NextToken1 := tkText; 282 end; 283 Inc(P1.Y); 284 P1.X := 0; 285 LeftText := LeftText + Rec.Chr1; 286 end else begin 287 if Kind = ckAdd then LeftText := LeftText + ' ' 288 else LeftText := LeftText + Rec.chr1; 289 if Kind <> LastKind then begin 290 HighlighterLeft.AddToken(P1.Y, P1.X, NextToken1); 291 if Kind = ckNone then NextToken1 := tkText 292 //else if Kind = ckAdd then NextToken1 := AttrAdded 293 else if Kind = ckDelete then NextToken1 := AttrDeleted 294 else if Kind = ckModify then NextToken1 := AttrModified; 295 end; 296 Inc(P1.X); 297 end; 298 299 if Rec.Chr2 = LineEnding then begin 300 if NextToken2 <> tkText then begin 301 HighlighterRight.AddToken(P2.Y, 0, NextToken2); 302 NextToken2 := tkText; 303 end; 304 Inc(P2.Y); 305 P2.X := 0; 306 RightText := RightText + Rec.Chr2; 307 end else begin 308 if Kind = ckDelete then RightText := RightText + ' ' 309 else RightText := RightText + Rec.Chr2; 310 if Kind <> LastKind then begin 311 HighlighterRight.AddToken(P2.Y, P2.X, NextToken2); 312 if Kind = ckNone then NextToken2 := tkText 313 else if Kind = ckAdd then NextToken2 := AttrAdded 314 //else if Kind = ckDelete then NextToken2 := AttrDeleted 315 else if Kind = ckModify then NextToken2 := AttrModified; 316 end; 317 Inc(P2.X); 318 end; 319 320 LastKind := Kind; 321 end; 322 323 //SynEditLeft.Lines.Text := LeftText; 324 //SynEditRight.Lines.Text := RightText; 325 end; 326 327 function TFormCompare.LoadFile(AFileName: string): string; 328 var 329 Ext: string; 330 begin 331 Ext := ExtractFileExt(AFileName); 332 if Ext = VCardFileExt then begin 333 with TVCardFile.Create(nil) do 334 try 335 LoadFromFile(AFileName); 336 Result := VCard.AsString; 337 finally 338 Free; 339 end; 340 end else Result := LoadFileToStr(AFileName); 341 end; 342 343 procedure TFormCompare.LoadFileLeft(FileName: string); 344 begin 345 EditLeftFileName.Text := FileName; 346 LeftSide := LoadFile(FileName); 347 SynEditLeft.Text := LeftSide; 348 end; 349 350 procedure TFormCompare.LoadFileRight(FileName: string); 351 begin 352 EditRightFileName.Text := FileName; 353 RightSide := LoadFile(FileName); 354 SynEditRight.Text := RightSide; 217 begin 218 Contacts.RemoveExactDuplicates; 219 for I := 0 to Contacts.Count - 1 do 220 Contacts[I].Properties.RemoveExactDuplicates; 221 end; 222 223 procedure TFormCompare.SaveConfig; 224 begin 225 with TRegistryEx.Create do 226 try 227 CurrentContext := Core.Core.ApplicationInfo1.GetRegistryContext; 228 WriteString('LastCompareFileName', EditAnotherFile.Text); 229 WriteBool('WithoutPhotos', CheckBoxWithoutPhotos.Checked); 230 WriteBool('SortContacts', CheckBoxSortContacts.Checked); 231 WriteBool('NormalizePhoneNumbers', CheckBoxNormalizePhoneNumbers.Checked); 232 WriteBool('RemoveExactDuplicates', CheckBoxRemoveExactDuplicates.Checked); 233 finally 234 Free; 235 end; 355 236 end; 356 237 -
trunk/Forms/FormSettings.lfm
r149 r151 1 1 object FormSettings: TFormSettings 2 2 Left = 798 3 Height = 4044 Top = 3215 Width = 5263 Height = 521 4 Top = 204 5 Width = 857 6 6 Caption = 'Settings' 7 ClientHeight = 4048 ClientWidth = 5267 ClientHeight = 521 8 ClientWidth = 857 9 9 Constraints.MinHeight = 404 10 10 Constraints.MinWidth = 526 … … 15 15 Position = poScreenCenter 16 16 LCLVersion = '2.2.6.0' 17 object ComboBoxLanguage: TComboBox18 Left = 24019 Height = 4220 Top = 1621 Width = 26422 ItemHeight = 023 ParentFont = False24 Style = csDropDownList25 TabOrder = 026 end27 object Label1: TLabel28 Left = 2429 Height = 2630 Top = 2431 Width = 8832 Caption = 'Language:'33 ParentColor = False34 ParentFont = False35 end36 17 object ButtonOk: TButton 37 Left = 40018 Left = 731 38 19 Height = 37 39 Top = 35120 Top = 468 40 21 Width = 113 41 22 Anchors = [akRight, akBottom] … … 44 25 OnClick = ButtonOkClick 45 26 ParentFont = False 46 TabOrder = 727 TabOrder = 1 47 28 end 48 29 object ButtonCancel: TButton 49 Left = 25630 Left = 587 50 31 Height = 37 51 Top = 35132 Top = 468 52 33 Width = 113 53 34 Anchors = [akRight, akBottom] … … 55 36 ModalResult = 2 56 37 ParentFont = False 57 TabOrder = 6 58 end 59 object CheckBoxAutomaticDPI: TCheckBox 60 Left = 23 61 Height = 30 62 Top = 247 63 Width = 148 64 Caption = 'Automatic DPI' 65 OnChange = CheckBoxAutomaticDPIChange 66 ParentFont = False 67 TabOrder = 4 68 Visible = False 69 end 70 object SpinEditDPI: TSpinEdit 71 Left = 239 72 Height = 43 73 Top = 279 74 Width = 145 75 MaxValue = 300 76 MinValue = 96 77 ParentFont = False 78 TabOrder = 5 79 Value = 96 80 Visible = False 81 end 82 object LabelDPI: TLabel 83 Left = 55 84 Height = 26 85 Top = 287 86 Width = 35 87 Caption = 'DPI:' 88 ParentColor = False 89 ParentFont = False 90 Visible = False 91 end 92 object CheckBoxReopenLastFileOnStart: TCheckBox 93 Left = 23 94 Height = 30 95 Top = 207 96 Width = 226 97 Caption = 'Reopen last file on start' 98 ParentFont = False 99 TabOrder = 3 100 end 101 object Bevel1: TBevel 102 Left = 12 103 Height = 2 104 Top = 332 105 Width = 496 106 Anchors = [akLeft, akRight, akBottom] 107 end 108 object Label2: TLabel 109 Left = 24 110 Height = 26 111 Top = 72 112 Width = 63 113 Caption = 'Theme:' 114 ParentColor = False 115 ParentFont = False 116 end 117 object ComboBoxTheme: TComboBox 118 Left = 240 119 Height = 42 120 Top = 64 121 Width = 264 122 ItemHeight = 0 123 ParentFont = False 124 Style = csDropDownList 125 TabOrder = 1 126 end 127 object Label3: TLabel 128 Left = 24 129 Height = 26 130 Top = 120 131 Width = 186 132 Caption = 'Default vCard version:' 133 ParentColor = False 134 end 135 object EditDefaultVcardVersion: TEdit 136 Left = 240 137 Height = 43 138 Top = 112 139 Width = 144 38 TabOrder = 0 39 end 40 object ScrollBox1: TScrollBox 41 Left = 8 42 Height = 448 43 Top = 8 44 Width = 845 45 HorzScrollBar.Page = 504 46 VertScrollBar.Page = 427 47 Anchors = [akTop, akLeft, akRight, akBottom] 48 ClientHeight = 446 49 ClientWidth = 843 140 50 TabOrder = 2 141 end 142 object Label4: TLabel 143 Left = 24 144 Height = 26 145 Top = 165 146 Width = 133 147 Caption = 'Map query URL:' 148 ParentColor = False 149 end 150 object EditMapUrl: TEdit 151 Left = 240 152 Height = 43 153 Top = 161 154 Width = 267 155 Anchors = [akTop, akLeft, akRight] 156 TabOrder = 8 51 object Label1: TLabel 52 Left = 24 53 Height = 26 54 Top = 24 55 Width = 88 56 Caption = 'Language:' 57 ParentColor = False 58 ParentFont = False 59 end 60 object ComboBoxLanguage: TComboBox 61 Left = 240 62 Height = 42 63 Top = 16 64 Width = 264 65 ItemHeight = 0 66 ParentFont = False 67 Style = csDropDownList 68 TabOrder = 0 69 end 70 object CheckBoxAutomaticDPI: TCheckBox 71 Left = 23 72 Height = 30 73 Top = 247 74 Width = 148 75 Caption = 'Automatic DPI' 76 OnChange = CheckBoxAutomaticDPIChange 77 ParentFont = False 78 TabOrder = 1 79 Visible = False 80 end 81 object SpinEditDPI: TSpinEdit 82 Left = 240 83 Height = 43 84 Top = 279 85 Width = 145 86 MaxValue = 300 87 MinValue = 96 88 ParentFont = False 89 TabOrder = 2 90 Value = 96 91 Visible = False 92 end 93 object LabelDPI: TLabel 94 Left = 55 95 Height = 26 96 Top = 287 97 Width = 35 98 Caption = 'DPI:' 99 ParentColor = False 100 ParentFont = False 101 Visible = False 102 end 103 object CheckBoxReopenLastFileOnStart: TCheckBox 104 Left = 23 105 Height = 30 106 Top = 207 107 Width = 226 108 Caption = 'Reopen last file on start' 109 ParentFont = False 110 TabOrder = 3 111 end 112 object Label2: TLabel 113 Left = 24 114 Height = 26 115 Top = 72 116 Width = 63 117 Caption = 'Theme:' 118 ParentColor = False 119 ParentFont = False 120 end 121 object ComboBoxTheme: TComboBox 122 Left = 240 123 Height = 42 124 Top = 64 125 Width = 264 126 ItemHeight = 0 127 ParentFont = False 128 Style = csDropDownList 129 TabOrder = 4 130 end 131 object Label3: TLabel 132 Left = 24 133 Height = 26 134 Top = 120 135 Width = 186 136 Caption = 'Default vCard version:' 137 ParentColor = False 138 end 139 object EditDefaultVcardVersion: TEdit 140 Left = 240 141 Height = 43 142 Top = 112 143 Width = 144 144 TabOrder = 5 145 end 146 object Label4: TLabel 147 Left = 24 148 Height = 26 149 Top = 165 150 Width = 133 151 Caption = 'Map query URL:' 152 ParentColor = False 153 end 154 object EditMapUrl: TEdit 155 Left = 240 156 Height = 43 157 Top = 160 158 Width = 588 159 Anchors = [akTop, akLeft, akRight] 160 TabOrder = 6 161 end 162 object Label5: TLabel 163 Left = 23 164 Height = 26 165 Top = 340 166 Width = 120 167 Caption = 'Compare tool:' 168 ParentColor = False 169 end 170 object EditCompareTool: TEdit 171 Left = 240 172 Height = 43 173 Top = 336 174 Width = 472 175 Anchors = [akTop, akLeft, akRight] 176 TabOrder = 7 177 end 178 object ButtonBrowse: TButton 179 Left = 720 180 Height = 38 181 Top = 340 182 Width = 113 183 Anchors = [akTop, akRight] 184 Caption = 'Browse' 185 OnClick = ButtonBrowseClick 186 TabOrder = 8 187 end 188 object Label6: TLabel 189 Left = 23 190 Height = 26 191 Top = 392 192 Width = 248 193 Caption = 'Default phone country prefix:' 194 ParentColor = False 195 end 196 object EditDefaultPhoneCountryPrefix: TEdit 197 Left = 296 198 Height = 43 199 Top = 384 200 Width = 144 201 TabOrder = 9 202 end 203 end 204 object OpenDialog1: TOpenDialog 205 Left = 506 206 Top = 258 157 207 end 158 208 end -
trunk/Forms/FormSettings.lrj
r149 r151 1 1 {"version":1,"strings":[ 2 2 {"hash":213582195,"name":"tformsettings.caption","sourcebytes":[83,101,116,116,105,110,103,115],"value":"Settings"}, 3 {"hash":82521866,"name":"tformsettings.label1.caption","sourcebytes":[76,97,110,103,117,97,103,101,58],"value":"Language:"},4 3 {"hash":1371,"name":"tformsettings.buttonok.caption","sourcebytes":[79,107],"value":"Ok"}, 5 4 {"hash":77089212,"name":"tformsettings.buttoncancel.caption","sourcebytes":[67,97,110,99,101,108],"value":"Cancel"}, 5 {"hash":82521866,"name":"tformsettings.label1.caption","sourcebytes":[76,97,110,103,117,97,103,101,58],"value":"Language:"}, 6 6 {"hash":37628553,"name":"tformsettings.checkboxautomaticdpi.caption","sourcebytes":[65,117,116,111,109,97,116,105,99,32,68,80,73],"value":"Automatic DPI"}, 7 7 {"hash":300234,"name":"tformsettings.labeldpi.caption","sourcebytes":[68,80,73,58],"value":"DPI:"}, … … 9 9 {"hash":95339402,"name":"tformsettings.label2.caption","sourcebytes":[84,104,101,109,101,58],"value":"Theme:"}, 10 10 {"hash":232157114,"name":"tformsettings.label3.caption","sourcebytes":[68,101,102,97,117,108,116,32,118,67,97,114,100,32,118,101,114,115,105,111,110,58],"value":"Default vCard version:"}, 11 {"hash":26355722,"name":"tformsettings.label4.caption","sourcebytes":[77,97,112,32,113,117,101,114,121,32,85,82,76,58],"value":"Map query URL:"} 11 {"hash":26355722,"name":"tformsettings.label4.caption","sourcebytes":[77,97,112,32,113,117,101,114,121,32,85,82,76,58],"value":"Map query URL:"}, 12 {"hash":220155194,"name":"tformsettings.label5.caption","sourcebytes":[67,111,109,112,97,114,101,32,116,111,111,108,58],"value":"Compare tool:"}, 13 {"hash":77164181,"name":"tformsettings.buttonbrowse.caption","sourcebytes":[66,114,111,119,115,101],"value":"Browse"}, 14 {"hash":99356634,"name":"tformsettings.label6.caption","sourcebytes":[68,101,102,97,117,108,116,32,112,104,111,110,101,32,99,111,117,110,116,114,121,32,112,114,101,102,105,120,58],"value":"Default phone country prefix:"} 12 15 ]} -
trunk/Forms/FormSettings.pas
r149 r151 12 12 13 13 TFormSettings = class(TForm) 14 B evel1: TBevel;14 ButtonBrowse: TButton; 15 15 ButtonOk: TButton; 16 16 ButtonCancel: TButton; 17 CheckBoxAutomaticDPI: TCheckBox; 17 18 CheckBoxReopenLastFileOnStart: TCheckBox; 18 CheckBoxAutomaticDPI: TCheckBox;19 19 ComboBoxLanguage: TComboBox; 20 20 ComboBoxTheme: TComboBox; 21 EditCompareTool: TEdit; 21 22 EditDefaultVcardVersion: TEdit; 23 EditDefaultPhoneCountryPrefix: TEdit; 22 24 EditMapUrl: TEdit; 23 25 Label1: TLabel; 24 26 Label2: TLabel; 25 27 Label3: TLabel; 28 Label4: TLabel; 29 Label5: TLabel; 30 Label6: TLabel; 26 31 LabelDPI: TLabel; 32 OpenDialog1: TOpenDialog; 33 ScrollBox1: TScrollBox; 27 34 SpinEditDPI: TSpinEdit; 35 procedure ButtonBrowseClick(Sender: TObject); 28 36 procedure ButtonOkClick(Sender: TObject); 29 37 procedure CheckBoxAutomaticDPIChange(Sender: TObject); … … 71 79 end; 72 80 81 procedure TFormSettings.ButtonBrowseClick(Sender: TObject); 82 begin 83 OpenDialog1.InitialDir := ExtractFileDir(EditCompareTool.Text); 84 OpenDialog1.FileName := ExtractFileName(EditCompareTool.Text); 85 if OpenDialog1.Execute then begin 86 EditCompareTool.Text := OpenDialog1.FileName; 87 end; 88 end; 89 73 90 procedure TFormSettings.CheckBoxAutomaticDPIChange(Sender: TObject); 74 91 begin … … 101 118 EditDefaultVcardVersion.Text := DefaultVcardVersion; 102 119 EditMapUrl.Text := MapUrl; 120 EditCompareTool.Text := CompareTool; 121 EditDefaultPhoneCountryPrefix.Text := DefaultPhoneCountryPrefix; 103 122 end; 104 123 UpdateInterface; … … 113 132 DefaultVcardVersion := EditDefaultVcardVersion.Text; 114 133 MapUrl := EditMapUrl.Text; 134 CompareTool := EditCompareTool.Text; 135 DefaultPhoneCountryPrefix := EditDefaultPhoneCountryPrefix.Text; 115 136 end; 116 137 end; -
trunk/Languages/vCardStudio.cs.po
r150 r151 227 227 228 228 #: tcore.aremoveexactduplicates.caption 229 msgctxt "tcore.aremoveexactduplicates.caption" 229 230 msgid "Remove exact duplicates" 230 231 msgstr "Odstranit přesné duplikáty" … … 306 307 msgstr "Dostupné:" 307 308 308 #: tformcompare.afileopenleft.caption 309 #: tformcompare.buttonbrowse.caption 310 msgctxt "tformcompare.buttonbrowse.caption" 311 msgid "Browse" 312 msgstr "Procházet" 313 314 #: tformcompare.buttoncancel.caption 315 msgctxt "tformcompare.buttoncancel.caption" 316 msgid "Cancel" 317 msgstr "Zrušit" 318 319 #: tformcompare.buttoncompare.caption 320 msgctxt "tformcompare.buttoncompare.caption" 321 msgid "Compare" 322 msgstr "Porovnat" 323 324 #: tformcompare.caption 325 msgctxt "tformcompare.caption" 326 msgid "Compare" 327 msgstr "Porovnat" 328 329 #: tformcompare.checkboxnormalizephonenumbers.caption 330 msgid "Normalize phone numbers" 331 msgstr "Normalizovat telefonní čísla:" 332 333 #: tformcompare.checkboxremoveexactduplicates.caption 334 msgctxt "tformcompare.checkboxremoveexactduplicates.caption" 335 msgid "Remove exact duplicates" 336 msgstr "Odstranit přesné duplikáty" 337 338 #: tformcompare.checkboxsortcontacts.caption 339 msgid "Sort contacts" 340 msgstr "Seřadit kontakty" 341 342 #: tformcompare.checkboxwithoutphotos.caption 343 msgid "Without photos" 344 msgstr "Bez fotek" 345 346 #: tformcompare.label1.caption 347 msgid "Another file:" 348 msgstr "Druhý soubor:" 349 350 #: tformcomparesidebyside.afileopenleft.caption 351 msgctxt "tformcomparesidebyside.afileopenleft.caption" 309 352 msgid "Open left file" 310 353 msgstr "Otevřít levý soubor" 311 354 312 #: tformcompare.afileopenright.caption 355 #: tformcomparesidebyside.afileopenright.caption 356 msgctxt "tformcomparesidebyside.afileopenright.caption" 313 357 msgid "Open right file" 314 358 msgstr "Otevřít pravý soubor" 315 359 316 #: tformcompare.areloadfiles.caption 360 #: tformcomparesidebyside.areloadfiles.caption 361 msgctxt "tformcomparesidebyside.areloadfiles.caption" 317 362 msgid "Reload files" 318 363 msgstr "Znovu načíst soubory" 319 364 320 #: tformcompare.aswitchsides.caption 365 #: tformcomparesidebyside.aswitchsides.caption 366 msgctxt "tformcomparesidebyside.aswitchsides.caption" 321 367 msgid "Switch sides" 322 368 msgstr "Prohodit strany" 323 369 324 #: tformcompare.caption 325 msgid "Compare" 326 msgstr "Porovnat" 327 328 #: tformcompare.menuitem1.caption 329 msgctxt "tformcompare.menuitem1.caption" 370 #: tformcomparesidebyside.caption 371 msgctxt "tformcomparesidebyside.caption" 372 msgid "Compare side by side" 373 msgstr "Porovnat vedle sebe" 374 375 #: tformcomparesidebyside.menuitem1.caption 376 msgctxt "tformcomparesidebyside.menuitem1.caption" 330 377 msgid "File" 331 378 msgstr "Soubor" 332 379 333 #: tformcompare .menuitemclose.caption334 msgctxt "tformcompare .menuitemclose.caption"380 #: tformcomparesidebyside.menuitemclose.caption 381 msgctxt "tformcomparesidebyside.menuitemclose.caption" 335 382 msgid "Close" 336 383 msgstr "Zavřít" … … 1153 1200 msgstr "Pole:" 1154 1201 1202 #: tformsettings.buttonbrowse.caption 1203 msgctxt "tformsettings.buttonbrowse.caption" 1204 msgid "Browse" 1205 msgstr "Procházet" 1206 1155 1207 #: tformsettings.buttoncancel.caption 1156 1208 msgctxt "tformsettings.buttoncancel.caption" … … 1191 1243 msgstr "URL dotazu mapy:" 1192 1244 1245 #: tformsettings.label5.caption 1246 msgid "Compare tool:" 1247 msgstr "Nástroj porovnání:" 1248 1249 #: tformsettings.label6.caption 1250 msgid "Default phone country prefix:" 1251 msgstr "Výchozí telefonní prefix země:" 1252 1193 1253 #: tformsettings.labeldpi.caption 1194 1254 msgid "DPI:" -
trunk/Languages/vCardStudio.pot
r150 r151 217 217 218 218 #: tcore.aremoveexactduplicates.caption 219 msgctxt "tcore.aremoveexactduplicates.caption" 219 220 msgid "Remove exact duplicates" 220 221 msgstr "" … … 296 297 msgstr "" 297 298 298 #: tformcompare.afileopenleft.caption 299 #: tformcompare.buttonbrowse.caption 300 msgctxt "tformcompare.buttonbrowse.caption" 301 msgid "Browse" 302 msgstr "" 303 304 #: tformcompare.buttoncancel.caption 305 msgctxt "tformcompare.buttoncancel.caption" 306 msgid "Cancel" 307 msgstr "" 308 309 #: tformcompare.buttoncompare.caption 310 msgctxt "tformcompare.buttoncompare.caption" 311 msgid "Compare" 312 msgstr "" 313 314 #: tformcompare.caption 315 msgctxt "tformcompare.caption" 316 msgid "Compare" 317 msgstr "" 318 319 #: tformcompare.checkboxnormalizephonenumbers.caption 320 msgid "Normalize phone numbers" 321 msgstr "" 322 323 #: tformcompare.checkboxremoveexactduplicates.caption 324 msgctxt "tformcompare.checkboxremoveexactduplicates.caption" 325 msgid "Remove exact duplicates" 326 msgstr "" 327 328 #: tformcompare.checkboxsortcontacts.caption 329 msgid "Sort contacts" 330 msgstr "" 331 332 #: tformcompare.checkboxwithoutphotos.caption 333 msgid "Without photos" 334 msgstr "" 335 336 #: tformcompare.label1.caption 337 msgid "Another file:" 338 msgstr "" 339 340 #: tformcomparesidebyside.afileopenleft.caption 341 msgctxt "tformcomparesidebyside.afileopenleft.caption" 299 342 msgid "Open left file" 300 343 msgstr "" 301 344 302 #: tformcompare.afileopenright.caption 345 #: tformcomparesidebyside.afileopenright.caption 346 msgctxt "tformcomparesidebyside.afileopenright.caption" 303 347 msgid "Open right file" 304 348 msgstr "" 305 349 306 #: tformcompare.areloadfiles.caption 350 #: tformcomparesidebyside.areloadfiles.caption 351 msgctxt "tformcomparesidebyside.areloadfiles.caption" 307 352 msgid "Reload files" 308 353 msgstr "" 309 354 310 #: tformcompare.aswitchsides.caption 355 #: tformcomparesidebyside.aswitchsides.caption 356 msgctxt "tformcomparesidebyside.aswitchsides.caption" 311 357 msgid "Switch sides" 312 358 msgstr "" 313 359 314 #: tformcompare.caption 315 msgid "Compare" 316 msgstr "" 317 318 #: tformcompare.menuitem1.caption 319 msgctxt "tformcompare.menuitem1.caption" 360 #: tformcomparesidebyside.caption 361 msgctxt "tformcomparesidebyside.caption" 362 msgid "Compare side by side" 363 msgstr "" 364 365 #: tformcomparesidebyside.menuitem1.caption 366 msgctxt "tformcomparesidebyside.menuitem1.caption" 320 367 msgid "File" 321 368 msgstr "" 322 369 323 #: tformcompare .menuitemclose.caption324 msgctxt "tformcompare .menuitemclose.caption"370 #: tformcomparesidebyside.menuitemclose.caption 371 msgctxt "tformcomparesidebyside.menuitemclose.caption" 325 372 msgid "Close" 326 373 msgstr "" … … 1143 1190 msgstr "" 1144 1191 1192 #: tformsettings.buttonbrowse.caption 1193 msgctxt "tformsettings.buttonbrowse.caption" 1194 msgid "Browse" 1195 msgstr "" 1196 1145 1197 #: tformsettings.buttoncancel.caption 1146 1198 msgctxt "tformsettings.buttoncancel.caption" … … 1181 1233 msgstr "" 1182 1234 1235 #: tformsettings.label5.caption 1236 msgid "Compare tool:" 1237 msgstr "" 1238 1239 #: tformsettings.label6.caption 1240 msgid "Default phone country prefix:" 1241 msgstr "" 1242 1183 1243 #: tformsettings.labeldpi.caption 1184 1244 msgid "DPI:" -
trunk/Languages/vCardStudio.sv.po
r150 r151 228 228 229 229 #: tcore.aremoveexactduplicates.caption 230 msgctxt "tcore.aremoveexactduplicates.caption" 230 231 msgid "Remove exact duplicates" 231 232 msgstr "" … … 307 308 msgstr "" 308 309 309 #: tformcompare.afileopenleft.caption 310 #: tformcompare.buttonbrowse.caption 311 msgctxt "tformcompare.buttonbrowse.caption" 312 msgid "Browse" 313 msgstr "" 314 315 #: tformcompare.buttoncancel.caption 316 #, fuzzy 317 msgctxt "tformcompare.buttoncancel.caption" 318 msgid "Cancel" 319 msgstr "Avbryt" 320 321 #: tformcompare.buttoncompare.caption 322 msgctxt "tformcompare.buttoncompare.caption" 323 msgid "Compare" 324 msgstr "" 325 326 #: tformcompare.caption 327 msgctxt "tformcompare.caption" 328 msgid "Compare" 329 msgstr "" 330 331 #: tformcompare.checkboxnormalizephonenumbers.caption 332 msgid "Normalize phone numbers" 333 msgstr "" 334 335 #: tformcompare.checkboxremoveexactduplicates.caption 336 msgctxt "tformcompare.checkboxremoveexactduplicates.caption" 337 msgid "Remove exact duplicates" 338 msgstr "" 339 340 #: tformcompare.checkboxsortcontacts.caption 341 msgid "Sort contacts" 342 msgstr "" 343 344 #: tformcompare.checkboxwithoutphotos.caption 345 msgid "Without photos" 346 msgstr "" 347 348 #: tformcompare.label1.caption 349 msgid "Another file:" 350 msgstr "" 351 352 #: tformcomparesidebyside.afileopenleft.caption 353 msgctxt "tformcomparesidebyside.afileopenleft.caption" 310 354 msgid "Open left file" 311 355 msgstr "" 312 356 313 #: tformcompare.afileopenright.caption 357 #: tformcomparesidebyside.afileopenright.caption 358 msgctxt "tformcomparesidebyside.afileopenright.caption" 314 359 msgid "Open right file" 315 360 msgstr "" 316 361 317 #: tformcompare.areloadfiles.caption 362 #: tformcomparesidebyside.areloadfiles.caption 363 msgctxt "tformcomparesidebyside.areloadfiles.caption" 318 364 msgid "Reload files" 319 365 msgstr "" 320 366 321 #: tformcompare.aswitchsides.caption 367 #: tformcomparesidebyside.aswitchsides.caption 368 msgctxt "tformcomparesidebyside.aswitchsides.caption" 322 369 msgid "Switch sides" 323 370 msgstr "" 324 371 325 #: tformcompare.caption 326 msgid "Compare" 327 msgstr "" 328 329 #: tformcompare.menuitem1.caption 330 #, fuzzy 331 msgctxt "tformcompare.menuitem1.caption" 372 #: tformcomparesidebyside.caption 373 msgctxt "tformcomparesidebyside.caption" 374 msgid "Compare side by side" 375 msgstr "" 376 377 #: tformcomparesidebyside.menuitem1.caption 378 #, fuzzy 379 msgctxt "tformcomparesidebyside.menuitem1.caption" 332 380 msgid "File" 333 381 msgstr "Fil" 334 382 335 #: tformcompare .menuitemclose.caption336 #, fuzzy 337 msgctxt "tformcompare .menuitemclose.caption"383 #: tformcomparesidebyside.menuitemclose.caption 384 #, fuzzy 385 msgctxt "tformcomparesidebyside.menuitemclose.caption" 338 386 msgid "Close" 339 387 msgstr "Stäng" … … 1189 1237 msgstr "" 1190 1238 1239 #: tformsettings.buttonbrowse.caption 1240 msgctxt "tformsettings.buttonbrowse.caption" 1241 msgid "Browse" 1242 msgstr "" 1243 1191 1244 #: tformsettings.buttoncancel.caption 1192 1245 msgctxt "tformsettings.buttoncancel.caption" … … 1227 1280 msgstr "Kart söknings URL:" 1228 1281 1282 #: tformsettings.label5.caption 1283 msgid "Compare tool:" 1284 msgstr "" 1285 1286 #: tformsettings.label6.caption 1287 msgid "Default phone country prefix:" 1288 msgstr "" 1289 1229 1290 #: tformsettings.labeldpi.caption 1230 1291 msgid "DPI:" -
trunk/Packages/Common/DataFile.pas
r148 r151 77 77 procedure TDataFile.Assign(Source: TPersistent); 78 78 begin 79 inherited;80 79 if Source is TDataFile then begin 81 80 FFileName := TDataFile(Source).FFileName; 82 81 FModified := TDataFile(Source).FModified; 83 end ;82 end else inherited; 84 83 end; 85 84 -
trunk/Packages/VCard/VCard.pas
r148 r151 147 147 procedure AssignToList(List: TObjects); 148 148 function GetByName(Name: string): TContactProperty; 149 function GetMultipleByName(Name: string): TContactProperties; 149 150 function GetByNameGroups(Name: string; Groups: TStringArray; 150 151 NoGroups: TStringArray): TContactProperty; 151 152 function GetByNameGroupsMultiple(Name: string; Groups: TStringArray; 152 153 NoGroups: TStringArray): TContactProperties; 154 function RemoveExactDuplicates: Integer; 153 155 end; 154 156 … … 572 574 procedure TVCard.Assign(Source: TPersistent); 573 575 begin 574 inherited; 575 if Source is TVCard then Contacts.Assign((Source as TVCard).Contacts); 576 if Source is TVCard then 577 Contacts.Assign((Source as TVCard).Contacts) 578 else inherited; 576 579 end; 577 580 … … 1005 1008 end; 1006 1009 1010 function TContactProperties.GetMultipleByName(Name: string): TContactProperties; 1011 var 1012 I: Integer; 1013 begin 1014 Result := TContactProperties.Create(False); 1015 for I := 0 to Count - 1 do 1016 if (Items[I].Name = Name) or EndsWith(Items[I].Name, '.' + Name) then 1017 Result.Add(Items[I]); 1018 end; 1019 1007 1020 function TContactProperties.GetByNameGroups(Name: string; Groups: TStringArray; 1008 1021 NoGroups: TStringArray): TContactProperty; … … 1025 1038 if Items[I].MatchNameGroups(Name, Groups, NoGroups) then 1026 1039 Result.Add(Items[I]); 1040 end; 1041 1042 function TContactProperties.RemoveExactDuplicates: Integer; 1043 var 1044 I: Integer; 1045 J: Integer; 1046 begin 1047 Result := 0; 1048 for I := 0 to Count - 1 do 1049 for J := Count - 1 downto I + 1 do 1050 if Items[I].CompareTo(Items[J]) then begin 1051 Remove(Items[J]); 1052 Inc(Result); 1053 end; 1027 1054 end; 1028 1055 -
trunk/TestCases.pas
r149 r151 181 181 VCardEnd + VCardLineEnding; 182 182 end; 183 184 with TTestCaseLoadSave(AddNew('Merge same cell phone', TTestCaseLoadSave)) do begin 185 Input := VCardBegin + MacLineEnding + 186 VCardVersion + MacLineEnding + 187 'N:Surname;Name' + MacLineEnding + 188 'FN:Name Surname' + MacLineEnding + 189 'TEL;CELL:123456789' + MacLineEnding + 190 VCardEnd + MacLineEnding + 191 192 VCardBegin + MacLineEnding + 193 VCardVersion + MacLineEnding + 194 'N:Surname2;Name' + MacLineEnding + 195 'FN:Name Surname2' + MacLineEnding + 196 'TEL;CELL:123456789' + MacLineEnding + 197 VCardEnd + MacLineEnding; 198 Output := VCardBegin + VCardLineEnding + 199 VCardVersion + VCardLineEnding + 200 'N:Surname;Name' + VCardLineEnding + 201 'FN:Name Surname' + VCardLineEnding + 202 'TEL;CELL:123456789' + MacLineEnding + 203 VCardEnd + VCardLineEnding; 204 end; 183 205 end; 184 206 end; -
trunk/VCardFile.pas
r149 r151 67 67 begin 68 68 inherited; 69 if Source is TVCardFile then 70 VCard.Assign(TVCardFile(Source).VCard); 69 VCard.Assign(TVCardFile(Source).VCard) 71 70 end; 72 71 -
trunk/vCardStudio.lpi
r149 r151 123 123 </Item7> 124 124 </RequiredPackages> 125 <Units Count="2 4">125 <Units Count="25"> 126 126 <Unit0> 127 127 <Filename Value="vCardStudio.lpr"/> … … 249 249 </Unit18> 250 250 <Unit19> 251 <Filename Value="Forms\FormCompare .pas"/>252 <IsPartOfProject Value="True"/> 253 <ComponentName Value="FormCompare "/>251 <Filename Value="Forms\FormCompareSideBySide.pas"/> 252 <IsPartOfProject Value="True"/> 253 <ComponentName Value="FormCompareSideBySide"/> 254 254 <HasResources Value="True"/> 255 255 <ResourceBaseClass Value="Form"/> … … 274 274 <ResourceBaseClass Value="Form"/> 275 275 </Unit23> 276 <Unit24> 277 <Filename Value="Forms\FormCompare.pas"/> 278 <IsPartOfProject Value="True"/> 279 <ComponentName Value="FormCompare"/> 280 <HasResources Value="True"/> 281 <ResourceBaseClass Value="Form"/> 282 </Unit24> 276 283 </Units> 277 284 </ProjectOptions> -
trunk/vCardStudio.lpr
r149 r151 6 6 {$ENDIF} 7 7 Interfaces, // this includes the LCL widgetset 8 Forms, FormMain, Core, Diff, SysUtils, FormCompare , TestCases,9 VCardFile, FormColumns ;8 Forms, FormMain, Core, Diff, SysUtils, FormCompareSideBySide, TestCases, 9 VCardFile, FormColumns, FormCompare; 10 10 11 11 {$R *.res} … … 17 17 18 18 begin 19 Application.Scaled :=True;20 Application.Title :='vCard Studio';19 Application.Scaled := True; 20 Application.Title := 'vCard Studio'; 21 21 {$if declared(UseHeapTrace)} 22 22 DeleteFile(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 23 23 SetHeapTraceOutput(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 24 24 {$ENDIF} 25 RequireDerivedFormResource :=True;25 RequireDerivedFormResource := True; 26 26 Application.Initialize; 27 27 Application.CreateForm(TCore, Core.Core);
Note:
See TracChangeset
for help on using the changeset viewer.