Changeset 152 for trunk/Forms
- Timestamp:
- Jun 6, 2023, 5:05:18 PM (18 months ago)
- Location:
- trunk/Forms
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormCompare.pas
r151 r152 34 34 procedure CompareExternal; 35 35 procedure LoadConfig; 36 procedure RemoveExactDuplicates(Contacts: TContacts);37 procedure NormalizePhoneNumbers(Contacts: TContacts);38 procedure RemovePhotos(Contacts: TContacts);39 36 procedure SaveConfig; 40 37 end; … … 46 43 47 44 uses 48 Core, FormCompareSideBySide ;45 Core, FormCompareSideBySide, VCardProcessor; 49 46 50 47 { TFormCompare } … … 72 69 73 70 procedure TFormCompare.ButtonCompareClick(Sender: TObject); 71 var 72 VCardProcessor: TVCardProcessor; 74 73 begin 75 74 LeftVCard.Assign(TVCardFile(Core.Core.DataFile)); 76 75 RightVCard.LoadFromFile(EditAnotherFile.Text); 77 76 78 if CheckBoxSortContacts.Checked then begin 79 LeftVCard.VCard.Contacts.Sort; 80 RightVCard.VCard.Contacts.Sort; 77 VCardProcessor := TVCardProcessor.Create(nil); 78 with VCardProcessor do 79 try 80 DefaultPhoneCountryCode := Core.Core.DefaultPhoneCountryCode; 81 RemovePhotos := CheckBoxWithoutPhotos.Checked; 82 RemovePhoneSpaces := CheckBoxNormalizePhoneNumbers.Checked; 83 AddDefaultPhoneCountryPrefix := CheckBoxNormalizePhoneNumbers.Checked; 84 RemoveExactDuplicates := CheckBoxRemoveExactDuplicates.Checked; 85 Order := CheckBoxSortContacts.Checked; 86 finally 87 Free; 81 88 end; 82 89 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; 90 LeftVCard.VCard.Contacts.Sort; 91 RightVCard.VCard.Contacts.Sort; 97 92 98 93 CompareExternal; 99 end;100 101 procedure TFormCompare.RemovePhotos(Contacts: TContacts);102 var103 I: Integer;104 J: Integer;105 ContactProperties: TContactProperties;106 begin107 for I := 0 to Contacts.Count - 1 do108 with Contacts[I].Properties do begin109 ContactProperties := GetMultipleByName('PHOTO');110 for J := ContactProperties.Count - 1 downto 0 do111 Remove(ContactProperties[J]);112 ContactProperties.Free;113 end;114 end;115 116 procedure TFormCompare.NormalizePhoneNumbers(Contacts: TContacts);117 var118 I: Integer;119 J: Integer;120 ContactProperties: TContactProperties;121 begin122 for I := 0 to Contacts.Count - 1 do123 with Contacts[I].Properties do begin124 ContactProperties := GetMultipleByName('TEL');125 for J := 0 to ContactProperties.Count - 1 do begin126 ContactProperties[J].Value := StringReplace(ContactProperties[J].Value, ' ', '', [rfReplaceAll]);127 if not ContactProperties[J].Value.StartsWith('+') then128 ContactProperties[J].Value := Core.Core.DefaultPhoneCountryPrefix + ContactProperties[J].Value;129 end;130 ContactProperties.Free;131 end;132 94 end; 133 95 … … 212 174 end; 213 175 214 procedure TFormCompare.RemoveExactDuplicates(Contacts: TContacts);215 var216 I: Integer;217 begin218 Contacts.RemoveExactDuplicates;219 for I := 0 to Contacts.Count - 1 do220 Contacts[I].Properties.RemoveExactDuplicates;221 end;222 223 176 procedure TFormCompare.SaveConfig; 224 177 begin -
trunk/Forms/FormFindDuplicity.lfm
r149 r152 12 12 OnDestroy = FormDestroy 13 13 OnShow = FormShow 14 LCLVersion = '2.2. 0.4'14 LCLVersion = '2.2.6.0' 15 15 object ListView1: TListView 16 16 Left = 5 … … 55 55 TabOrder = 1 56 56 object ComboBoxField: TComboBox 57 Left = 1 6058 Height = 4 159 Top = 1 657 Left = 192 58 Height = 42 59 Top = 14 60 60 Width = 326 61 61 ItemHeight = 0 … … 71 71 Width = 135 72 72 Caption = 'By contact field:' 73 ParentColor = False 73 74 ParentFont = False 74 75 end 75 76 object ButtonMerge: TButton 76 Left = 49677 Left = 528 77 78 Height = 38 78 79 Top = 14 -
trunk/Forms/FormFindDuplicity.pas
r149 r152 5 5 uses 6 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 7 ExtCtrls, StdCtrls, ActnList, Menus, VCard, Generics.Collections, 7 ExtCtrls, StdCtrls, ActnList, Menus, VCard, Generics.Collections, RegistryEx, 8 8 Generics.Defaults; 9 9 … … 189 189 Form.Contacts := TContacts.Create(False); 190 190 Form.Contacts.ParentVCard := Contacts.ParentVCard; 191 Form.Context := TRegistryContext.Create(Core.Core.ApplicationInfo1.RegistryRoot, 192 Core.Core.ApplicationInfo1.RegistryKey + '\ContactsColumns'); 191 193 with TFoundItem(ListView1.Selected.Data) do 192 194 for I := 0 to Contacts.Count - 1 do -
trunk/Forms/FormMain.lfm
r149 r152 190 190 Caption = '-' 191 191 end 192 object MenuItem14: TMenuItem 193 Action = Core.ANormalize 194 end 192 195 object MenuItem13: TMenuItem 193 196 Action = Core.ARemoveExactDuplicates -
trunk/Forms/FormMain.pas
r150 r152 19 19 MenuItem12: TMenuItem; 20 20 MenuItem13: TMenuItem; 21 MenuItem14: TMenuItem; 21 22 MenuItemColumns: TMenuItem; 22 23 MenuItem3: TMenuItem; -
trunk/Forms/FormSettings.lfm
r151 r152 1 1 object FormSettings: TFormSettings 2 2 Left = 798 3 Height = 5213 Height = 613 4 4 Top = 204 5 5 Width = 857 6 6 Caption = 'Settings' 7 ClientHeight = 5217 ClientHeight = 613 8 8 ClientWidth = 857 9 9 Constraints.MinHeight = 404 … … 18 18 Left = 731 19 19 Height = 37 20 Top = 46820 Top = 560 21 21 Width = 113 22 22 Anchors = [akRight, akBottom] … … 30 30 Left = 587 31 31 Height = 37 32 Top = 46832 Top = 560 33 33 Width = 113 34 34 Anchors = [akRight, akBottom] … … 40 40 object ScrollBox1: TScrollBox 41 41 Left = 8 42 Height = 44842 Height = 540 43 43 Top = 8 44 44 Width = 845 45 45 HorzScrollBar.Page = 504 46 VertScrollBar.Page = 4 2746 VertScrollBar.Page = 475 47 47 Anchors = [akTop, akLeft, akRight, akBottom] 48 ClientHeight = 44648 ClientHeight = 538 49 49 ClientWidth = 843 50 50 TabOrder = 2 … … 195 195 end 196 196 object EditDefaultPhoneCountryPrefix: TEdit 197 Left = 296197 Left = 312 198 198 Height = 43 199 199 Top = 384 … … 201 201 TabOrder = 9 202 202 end 203 object Label7: TLabel 204 Left = 23 205 Height = 26 206 Top = 440 207 Width = 267 208 Caption = 'Default international call prefix:' 209 ParentColor = False 210 end 211 object EditDefaultInternationalCallPrefix: TEdit 212 Left = 312 213 Height = 43 214 Top = 432 215 Width = 144 216 TabOrder = 10 217 end 203 218 end 204 219 object OpenDialog1: TOpenDialog -
trunk/Forms/FormSettings.lrj
r151 r152 12 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 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:"} 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:"}, 15 {"hash":112394474,"name":"tformsettings.label7.caption","sourcebytes":[68,101,102,97,117,108,116,32,105,110,116,101,114,110,97,116,105,111,110,97,108,32,99,97,108,108,32,112,114,101,102,105,120,58],"value":"Default international call prefix:"} 15 16 ]} -
trunk/Forms/FormSettings.pas
r151 r152 20 20 ComboBoxTheme: TComboBox; 21 21 EditCompareTool: TEdit; 22 EditDefaultInternationalCallPrefix: TEdit; 22 23 EditDefaultVcardVersion: TEdit; 23 24 EditDefaultPhoneCountryPrefix: TEdit; … … 29 30 Label5: TLabel; 30 31 Label6: TLabel; 32 Label7: TLabel; 31 33 LabelDPI: TLabel; 32 34 OpenDialog1: TOpenDialog; … … 119 121 EditMapUrl.Text := MapUrl; 120 122 EditCompareTool.Text := CompareTool; 121 EditDefaultPhoneCountryPrefix.Text := DefaultPhoneCountryPrefix; 123 EditDefaultPhoneCountryPrefix.Text := DefaultPhoneCountryCode; 124 EditDefaultInternationalCallPrefix.Text := DefaultInternationalCallPrefix; 122 125 end; 123 126 UpdateInterface; … … 133 136 MapUrl := EditMapUrl.Text; 134 137 CompareTool := EditCompareTool.Text; 135 DefaultPhoneCountryPrefix := EditDefaultPhoneCountryPrefix.Text; 138 DefaultPhoneCountryCode := EditDefaultPhoneCountryPrefix.Text; 139 DefaultInternationalCallPrefix := EditDefaultInternationalCallPrefix.Text; 136 140 end; 137 141 end;
Note:
See TracChangeset
for help on using the changeset viewer.