Changeset 121 for trunk/UCore.pas
- Timestamp:
- Feb 22, 2022, 11:07:27 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r120 r121 88 88 LastContactTabIndex: Integer; 89 89 LastContactFileName: string; 90 LastCompareFileName: string; 90 91 LastPhotoFileName: string; 91 92 LastPropertyValueFileName: string; … … 171 172 var 172 173 TempFile: TDataFile; 173 LeftContacts: TContactsFile; 174 RightContacts: TContactsFile; 174 TempFileName: string; 175 175 begin 176 176 TempFile := DefaultDataFileClass.Create; … … 181 181 end; 182 182 OpenDialog1.DefaultExt := ''; 183 if Assigned(DataFile) then begin 184 OpenDialog1.InitialDir := ExtractFileDir(DataFile.FileName); 185 OpenDialog1.FileName := ExtractFileName(DataFile.FileName); 186 end; 183 OpenDialog1.InitialDir := ExtractFileDir(Core.LastCompareFileName); 184 OpenDialog1.FileName := ExtractFileName(Core.LastCompareFileName); 187 185 OpenDialog1.Options := OpenDialog1.Options - [ofAllowMultiSelect]; 188 186 if OpenDialog1.Execute then begin 189 187 with TFormCompare.Create(nil) do 190 188 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; 189 TempFileName := GetTempDir + DirectorySeparator + Application.Title + 190 DirectorySeparator + 'Compare' + VCardFileExt; 191 ForceDirectories(ExtractFileDir(TempFileName)); 192 TContactsFile(DataFile).SaveToFile(TempFileName); 193 LoadFileLeft(TempFileName); 194 LoadFileRight(OpenDialog1.FileName); 195 ShowModal; 203 196 finally 204 197 Free; 205 198 end; 199 Core.LastCompareFileName := OpenDialog1.FileName; 206 200 end; 207 201 end; … … 532 526 MapUrl := ReadStringWithDefault('MapUrl', 'https://www.openstreetmap.org/search?query='); 533 527 LastPhotoFileName := ReadStringWithDefault('LastPhotoFileName', ''); 528 LastCompareFileName := ReadStringWithDefault('LastCompareFileName', ''); 534 529 finally 535 530 Free; … … 558 553 WriteString('MapUrl', MapUrl); 559 554 WriteString('LastPhotoFileName', LastPhotoFileName); 555 WriteString('LastCompareFileName', LastCompareFileName); 560 556 finally 561 557 Free;
Note:
See TracChangeset
for help on using the changeset viewer.