Changeset 8 for trunk/UFormMain.pas
- Timestamp:
- Apr 21, 2016, 1:12:45 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UFormMain.pas
r7 r8 136 136 'Acronyms were modified. Do you want to save them to file before exit?', 137 137 mtConfirmation, [mbYes, mbNo, mbCancel], 0); 138 if ModalResult = mrYes then AFileSave.Execute 139 else if ModalResult = mrNo then CanClose := True 140 else CanClose := False; 138 if ModalResult = mrYes then begin 139 AFileSave.Execute; 140 CanClose := True; 141 end 142 else if ModalResult = mrNo then begin 143 CanClose := True; 144 AcronymDb.Modified := False; 145 end else CanClose := False; 141 146 end; 142 147 end; … … 202 207 var 203 208 TempEntry: TAcronymEntry; 209 Meaning: TAcronymMeaning; 204 210 begin 205 211 if Assigned(ListViewAcronyms.Selected) then … … 208 214 TempEntry.Name := Acronym.Name; 209 215 TempEntry.Meaning := Name; 216 TempEntry.Description := Description; 210 217 FormAcronym.Load(TempEntry); 211 218 if FormAcronym.ShowModal = mrOk then begin 212 219 FormAcronym.Save(TempEntry); 213 220 if (TempEntry.Name <> Acronym.Name) or 214 (TempEntry.Meaning <> Name) then begin 221 (TempEntry.Meaning <> Name) or 222 (TempEntry.Description <> Description) then begin 215 223 // TODO: Update item inplace if possible 216 224 AcronymDb.RemoveAcronym(Acronym.Name, Name); 217 AcronymDb.AddAcronym(TempEntry.Name, TempEntry.Meaning); 225 Meaning := AcronymDb.AddAcronym(TempEntry.Name, TempEntry.Meaning); 226 Meaning.Description := TempEntry.Description; 218 227 UpdateAcronymsList; 219 228 UpdateInterface; … … 250 259 var 251 260 TempEntry: TAcronymEntry; 261 Meaning: TAcronymMeaning; 252 262 begin 253 263 TempEntry := TAcronymEntry.Create; 254 264 TempEntry.Name := ''; 255 265 TempEntry.Meaning := ''; 266 TempEntry.Description := ''; 256 267 FormAcronym.Load(TempEntry); 257 268 if FormAcronym.ShowModal = mrOk then begin 258 269 FormAcronym.Save(TempEntry); 259 AcronymDb.AddAcronym(TempEntry.Name, TempEntry.Meaning); 270 Meaning := AcronymDb.AddAcronym(TempEntry.Name, TempEntry.Meaning); 271 Meaning.Description := TempEntry.Description; 260 272 UpdateAcronymsList; 261 273 UpdateInterface; … … 267 279 FormImport.ShowModal; 268 280 UpdateAcronymsList; 281 UpdateInterface; 269 282 end; 270 283
Note:
See TracChangeset
for help on using the changeset viewer.