Changeset 120 for trunk/UCore.pas
- Timestamp:
- Feb 19, 2022, 12:09:21 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r117 r120 17 17 AAbout: TAction; 18 18 AboutDialog1: TAboutDialog; 19 AFileCompare: TAction; 19 20 AViewSource: TAction; 20 21 ATest: TAction; … … 47 48 procedure AExitExecute(Sender: TObject); 48 49 procedure AFileCombineExecute(Sender: TObject); 50 procedure AFileCompareExecute(Sender: TObject); 49 51 procedure AFileNewExecute(Sender: TObject); 50 52 procedure AFileOpenExecute(Sender: TObject); … … 110 112 uses 111 113 UFormMain, UFormSettings, UContact, UFormContacts, UFormFindDuplicity, 112 UFormGenerate, UFormError, UFormFind, UFormTest, UFormSource ;114 UFormGenerate, UFormError, UFormFind, UFormTest, UFormSource, UFormCompare; 113 115 114 116 resourcestring … … 163 165 ShowMessage(Format(SCombinedContacts, [LoadedFiles])); 164 166 UpdateFile; 167 end; 168 end; 169 170 procedure TCore.AFileCompareExecute(Sender: TObject); 171 var 172 TempFile: TDataFile; 173 LeftContacts: TContactsFile; 174 RightContacts: TContactsFile; 175 begin 176 TempFile := DefaultDataFileClass.Create; 177 try 178 OpenDialog1.Filter := TempFile.GetFileFilter; 179 finally 180 TempFile.Free; 181 end; 182 OpenDialog1.DefaultExt := ''; 183 if Assigned(DataFile) then begin 184 OpenDialog1.InitialDir := ExtractFileDir(DataFile.FileName); 185 OpenDialog1.FileName := ExtractFileName(DataFile.FileName); 186 end; 187 OpenDialog1.Options := OpenDialog1.Options - [ofAllowMultiSelect]; 188 if OpenDialog1.Execute then begin 189 with TFormCompare.Create(nil) do 190 try 191 LeftContacts := TContactsFile(DefaultDataFileClass.Create); 192 RightContacts := TContactsFile(DefaultDataFileClass.Create); 193 try 194 LeftContacts.Assign(TContactsFile(DataFile)); 195 LeftSide := LeftContacts; 196 RightContacts.LoadFromFile(OpenDialog1.FileName); 197 RightSide := RightContacts; 198 ShowModal; 199 finally 200 LeftContacts.Free; 201 RightContacts.Free; 202 end; 203 finally 204 Free; 205 end; 165 206 end; 166 207 end; … … 553 594 AFileSplit.Enabled := Assigned(DataFile); 554 595 AFileCombine.Enabled := Assigned(DataFile); 596 AFileCompare.Enabled := Assigned(DataFile); 555 597 AFind.Enabled := Assigned(DataFile); 556 598 AFindDuplicate.Enabled := Assigned(DataFile);
Note:
See TracChangeset
for help on using the changeset viewer.