- Timestamp:
- May 4, 2016, 6:50:29 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AcronymDecoder.lpi
r17 r20 92 92 </Item5> 93 93 </RequiredPackages> 94 <Units Count=" 9">94 <Units Count="11"> 95 95 <Unit0> 96 96 <Filename Value="AcronymDecoder.lpr"/> … … 146 146 <ResourceBaseClass Value="Form"/> 147 147 </Unit8> 148 <Unit9> 149 <Filename Value="Forms\UFormImportSource.pas"/> 150 <IsPartOfProject Value="True"/> 151 <ComponentName Value="FormImportSource"/> 152 <ResourceBaseClass Value="Form"/> 153 </Unit9> 154 <Unit10> 155 <Filename Value="Forms\UFormImportSources.pas"/> 156 <IsPartOfProject Value="True"/> 157 <ComponentName Value="FormImportSources"/> 158 <ResourceBaseClass Value="Form"/> 159 </Unit10> 148 160 </Units> 149 161 </ProjectOptions> -
trunk/AcronymDecoder.lpr
r17 r20 10 10 Forms, UAcronym, synapse, Common, SysUtils, TemplateGenerics, UFormImport, 11 11 CoolTranslator, UFormCategorySelect, UFormMain, UFormAcronym, UFormSettings, 12 UFormCategories, UFormAcronyms 12 UFormCategories, UFormAcronyms, UFormImportSource, UFormImportSources 13 13 { you can add units after this }; 14 14 … … 38 38 Application.CreateForm(TFormSettings, FormSettings); 39 39 Application.CreateForm(TFormImport, FormImport); 40 Application.CreateForm(TFormImportSource, FormImportSource); 41 Application.CreateForm(TFormImportSources, FormImportSources); 40 42 Application.Run; 41 43 end. -
trunk/Forms/UFormCategories.lfm
r19 r20 10 10 LCLVersion = '1.6.0.4' 11 11 object ListViewCategories: TListView 12 Left = 1612 Left = 9 13 13 Height = 432 14 14 Top = 8 15 Width = 76 015 Width = 767 16 16 Anchors = [akTop, akLeft, akRight, akBottom] 17 17 Columns = < -
trunk/Forms/UFormCategories.pas
r14 r20 36 36 { private declarations } 37 37 public 38 Categories: TAcronymCategories; 38 39 procedure UpdateList; 39 40 procedure UpdateInterface; … … 53 54 SCategory = 'Category'; 54 55 SCategoryQuery = 'Enter name of category'; 55 SRemoveCategory = 'Remove categor y';56 SRemoveCategoryQuery = 'Do you really want to remove category?';56 SRemoveCategory = 'Remove categories'; 57 SRemoveCategoryQuery = 'Do you really want to remove selected categories?'; 57 58 SCategoryAlreadyExists = 'Category %s already exists!'; 58 59 … … 95 96 96 97 procedure TFormCategories.ARemoveExecute(Sender: TObject); 98 var 99 I: Integer; 97 100 begin 98 101 if Assigned(ListViewCategories.Selected) then begin 99 102 if MessageDlg(SRemoveCategory, SRemoveCategoryQuery, 100 103 TMsgDlgType.mtConfirmation, [mbCancel, mbOk], 0) = mrOk then begin 101 FormMain.AcronymDb.Categories.Remove(ListViewCategories.Selected.Data); 104 for I := ListViewCategories.Items.Count - 1 downto 0 do 105 if ListViewCategories.Items[I].Selected then 106 Categories.Remove(ListViewCategories.Items[I].Data); 102 107 UpdateList; 103 108 end; -
trunk/Forms/UFormMain.lfm
r19 r20 1 1 object FormMain: TFormMain 2 Left = 3932 Left = 427 3 3 Height = 446 4 Top = 4 054 Top = 423 5 5 Width = 631 6 6 Caption = 'Acronym Decoder' … … 4416 4416 OnExecute = AShowAcronymsExecute 4417 4417 end 4418 object AShowImportSources: TAction 4419 Caption = 'Import sources' 4420 OnExecute = AShowImportSourcesExecute 4421 end 4418 4422 end 4419 4423 object PersistentForm1: TPersistentForm … … 4462 4466 Action = AShowCategories 4463 4467 end 4468 object MenuItem4: TMenuItem 4469 Action = AShowImportSources 4470 end 4464 4471 end 4465 4472 object MenuItem16: TMenuItem -
trunk/Forms/UFormMain.lrt
r19 r20 15 15 TFORMMAIN.ASHOWCATEGORIES.CAPTION=Categories 16 16 TFORMMAIN.ASHOWACRONYMS.CAPTION=Acronyms 17 TFORMMAIN.ASHOWIMPORTSOURCES.CAPTION=Import sources 17 18 TFORMMAIN.MENUITEM8.CAPTION=File 18 19 TFORMMAIN.MENUITEMOPENRECENT.CAPTION=Open recent -
trunk/Forms/UFormMain.pas
r19 r20 16 16 17 17 TFormMain = class(TForm) 18 AShowImportSources: TAction; 18 19 AShowAcronyms: TAction; 19 20 AShowCategories: TAction; … … 50 51 MenuItem21: TMenuItem; 51 52 MenuItem22: TMenuItem; 53 MenuItem4: TMenuItem; 52 54 MenuItemOpenRecent: TMenuItem; 53 55 MenuItem2: TMenuItem; … … 71 73 procedure AShowCategoriesExecute(Sender: TObject); 72 74 procedure AShowExecute(Sender: TObject); 75 procedure AShowImportSourcesExecute(Sender: TObject); 73 76 procedure CheckBoxExactMathChange(Sender: TObject); 74 77 procedure EditSearchChange(Sender: TObject); … … 111 114 112 115 uses 113 UFormImport, UFormAcronym, UFormSettings, UFormCategories, UFormAcronyms; 116 UFormImport, UFormAcronym, UFormSettings, UFormCategories, UFormAcronyms, 117 UFormImportSource, UFormImportSources; 114 118 115 119 resourcestring … … 155 159 var 156 160 ModalResult: TModalResult; 157 begin 158 if Assigned(AcronymDb) and AcronymDb.Modified then begin 159 ModalResult := MessageDlg(SAppExit, SAppExitQuery, 160 mtConfirmation, [mbYes, mbNo, mbCancel], 0); 161 if ModalResult = mrYes then begin 162 AFileSave.Execute; 163 FreeAndNil(AcronymDb); 164 UpdateAcronymsList; 165 UpdateInterface; 166 ProjectClosed := True; 167 end 168 else if ModalResult = mrNo then begin 169 FreeAndNil(AcronymDb); 170 UpdateAcronymsList; 171 UpdateInterface; 172 ProjectClosed := True; 173 end else ProjectClosed := False; 174 end else ProjectClosed := True; 161 DoClose: Boolean; 162 begin 163 DoClose := False; 164 if Assigned(AcronymDb) then begin 165 if AcronymDb.Modified then begin 166 ModalResult := MessageDlg(SAppExit, SAppExitQuery, 167 mtConfirmation, [mbYes, mbNo, mbCancel], 0); 168 if ModalResult = mrYes then begin 169 AFileSave.Execute; 170 DoClose := True; 171 end 172 else if ModalResult = mrNo then begin 173 DoClose := True; 174 end else ProjectClosed := False; 175 end else DoClose := True; 176 end; 177 if DoClose then begin 178 FreeAndNil(AcronymDb); 179 UpdateAcronymsList; 180 UpdateInterface; 181 ProjectClosed := True; 182 end; 175 183 end; 176 184 … … 245 253 procedure TFormMain.AShowCategoriesExecute(Sender: TObject); 246 254 begin 255 FormCategories.Categories := AcronymDb.Categories; 247 256 FormCategories.ShowModal; 248 257 UpdateAcronymsList; … … 253 262 begin 254 263 Show; 264 end; 265 266 procedure TFormMain.AShowImportSourcesExecute(Sender: TObject); 267 begin 268 FormImportSources.ImportSources := AcronymDb.ImportSources; 269 FormImportSources.ShowModal; 270 UpdateInterface; 255 271 end; 256 272 … … 418 434 AImport.Enabled := Assigned(AcronymDb); 419 435 AShowCategories.Enabled := Assigned(AcronymDb); 436 AShowAcronyms.Enabled := Assigned(AcronymDb); 437 AShowImportSources.Enabled := Assigned(AcronymDb); 420 438 421 439 Title := Application.Title; -
trunk/Languages/AcronymDecoder.cs.po
r19 r20 37 37 38 38 #: tformacronym.label1.caption 39 msgctxt "tformacronym.label1.caption" 39 40 msgid "Name:" 40 41 msgstr "Název:" … … 159 160 msgstr "Formát dat:" 160 161 162 #: tformimportsource.buttoncancel.caption 163 #, fuzzy 164 msgctxt "tformimportsource.buttoncancel.caption" 165 msgid "Cancel" 166 msgstr "Zrušit" 167 168 #: tformimportsource.buttonok.caption 169 #, fuzzy 170 msgctxt "tformimportsource.buttonok.caption" 171 msgid "Ok" 172 msgstr "Ok" 173 174 #: tformimportsource.caption 175 msgctxt "tformimportsource.caption" 176 msgid "Import source" 177 msgstr "" 178 179 #: tformimportsource.label1.caption 180 #, fuzzy 181 msgctxt "tformimportsource.label1.caption" 182 msgid "Name:" 183 msgstr "Název:" 184 185 #: tformimportsource.label2.caption 186 msgid "Source URL:" 187 msgstr "" 188 189 #: tformimportsources.aadd.caption 190 #, fuzzy 191 msgctxt "tformimportsources.aadd.caption" 192 msgid "Add" 193 msgstr "Přidat" 194 195 #: tformimportsources.amodify.caption 196 #, fuzzy 197 msgctxt "tformimportsources.amodify.caption" 198 msgid "Modify" 199 msgstr "Upravit" 200 201 #: tformimportsources.aremove.caption 202 #, fuzzy 203 msgctxt "tformimportsources.aremove.caption" 204 msgid "Remove" 205 msgstr "Odebrat" 206 207 #: tformimportsources.caption 208 msgctxt "tformimportsources.caption" 209 msgid "Import sources" 210 msgstr "" 211 212 #: tformimportsources.listview1.columns[0].caption 213 #, fuzzy 214 msgctxt "tformimportsources.listview1.columns[0].caption" 215 msgid "Name" 216 msgstr "Název" 217 218 #: tformimportsources.listview1.columns[1].caption 219 msgid "URL" 220 msgstr "" 221 161 222 #: tformmain.aexit.caption 162 223 msgid "Exit" … … 207 268 msgstr "Kategorie" 208 269 270 #: tformmain.ashowimportsources.caption 271 msgctxt "tformmain.ashowimportsources.caption" 272 msgid "Import sources" 273 msgstr "" 274 209 275 #: tformmain.caption 210 276 msgid "Acronym Decoder" … … 283 349 284 350 #: uformacronym.sremovecategory 351 msgctxt "uformacronym.sremovecategory" 285 352 msgid "Remove categories" 286 353 msgstr "Odebrat kategorie" 287 354 288 355 #: uformacronym.sremovecategoryquery 356 msgctxt "uformacronym.sremovecategoryquery" 289 357 msgid "Do you really want to remove selected categories?" 290 358 msgstr "Opravdu chcete odebrat vybrané kategorie?" … … 328 396 329 397 #: uformcategories.sremovecategory 330 msgid "Remove category" 398 #, fuzzy 399 #| msgid "Remove category" 400 msgctxt "uformcategories.sremovecategory" 401 msgid "Remove categories" 331 402 msgstr "Odebrat kategorii" 332 403 333 404 #: uformcategories.sremovecategoryquery 334 msgid "Do you really want to remove category?" 405 #, fuzzy 406 #| msgid "Do you really want to remove category?" 407 msgctxt "uformcategories.sremovecategoryquery" 408 msgid "Do you really want to remove selected categories?" 335 409 msgstr "Opravdu chcete odebrat kategorii?" 336 410 … … 339 413 msgstr "Importováno %d nových zkratek." 340 414 415 #: uformimportsources.simportsource 416 msgctxt "uformimportsources.simportsource" 417 msgid "Import source" 418 msgstr "" 419 420 #: uformimportsources.simportsourcealreadyexists 421 msgid "Import source %s already exists!" 422 msgstr "" 423 424 #: uformimportsources.simportsourcequery 425 msgid "Enter name of import source" 426 msgstr "" 427 428 #: uformimportsources.sremoveimportsource 429 msgid "Remove import sources" 430 msgstr "" 431 432 #: uformimportsources.sremoveimportsourcequery 433 msgid "Do you really want to remove selected import sources?" 434 msgstr "" 435 341 436 #: uformmain.sappexit 342 437 msgid "Application exit" -
trunk/Languages/AcronymDecoder.po
r19 r20 27 27 28 28 #: tformacronym.label1.caption 29 msgctxt "tformacronym.label1.caption" 29 30 msgid "Name:" 30 31 msgstr "" … … 144 145 msgstr "" 145 146 147 #: tformimportsource.buttoncancel.caption 148 msgctxt "TFORMIMPORTSOURCE.BUTTONCANCEL.CAPTION" 149 msgid "Cancel" 150 msgstr "" 151 152 #: tformimportsource.buttonok.caption 153 msgctxt "TFORMIMPORTSOURCE.BUTTONOK.CAPTION" 154 msgid "Ok" 155 msgstr "" 156 157 #: tformimportsource.caption 158 msgctxt "tformimportsource.caption" 159 msgid "Import source" 160 msgstr "" 161 162 #: tformimportsource.label1.caption 163 msgctxt "TFORMIMPORTSOURCE.LABEL1.CAPTION" 164 msgid "Name:" 165 msgstr "" 166 167 #: tformimportsource.label2.caption 168 msgid "Source URL:" 169 msgstr "" 170 171 #: tformimportsources.aadd.caption 172 msgctxt "TFORMIMPORTSOURCES.AADD.CAPTION" 173 msgid "Add" 174 msgstr "" 175 176 #: tformimportsources.amodify.caption 177 msgctxt "TFORMIMPORTSOURCES.AMODIFY.CAPTION" 178 msgid "Modify" 179 msgstr "" 180 181 #: tformimportsources.aremove.caption 182 msgctxt "TFORMIMPORTSOURCES.AREMOVE.CAPTION" 183 msgid "Remove" 184 msgstr "" 185 186 #: tformimportsources.caption 187 msgctxt "tformimportsources.caption" 188 msgid "Import sources" 189 msgstr "" 190 191 #: tformimportsources.listview1.columns[0].caption 192 msgctxt "TFORMIMPORTSOURCES.LISTVIEW1.COLUMNS[0].CAPTION" 193 msgid "Name" 194 msgstr "" 195 196 #: tformimportsources.listview1.columns[1].caption 197 msgid "URL" 198 msgstr "" 199 146 200 #: tformmain.aexit.caption 147 201 msgid "Exit" … … 192 246 msgstr "" 193 247 248 #: tformmain.ashowimportsources.caption 249 msgctxt "TFORMMAIN.ASHOWIMPORTSOURCES.CAPTION" 250 msgid "Import sources" 251 msgstr "" 252 194 253 #: tformmain.caption 195 254 msgid "Acronym Decoder" … … 268 327 269 328 #: uformacronym.sremovecategory 329 msgctxt "uformacronym.sremovecategory" 270 330 msgid "Remove categories" 271 331 msgstr "" 272 332 273 333 #: uformacronym.sremovecategoryquery 334 msgctxt "uformacronym.sremovecategoryquery" 274 335 msgid "Do you really want to remove selected categories?" 275 336 msgstr "" … … 309 370 310 371 #: uformcategories.sremovecategory 311 msgid "Remove category" 372 msgctxt "uformcategories.sremovecategory" 373 msgid "Remove categories" 312 374 msgstr "" 313 375 314 376 #: uformcategories.sremovecategoryquery 315 msgid "Do you really want to remove category?" 377 msgctxt "uformcategories.sremovecategoryquery" 378 msgid "Do you really want to remove selected categories?" 316 379 msgstr "" 317 380 … … 320 383 msgstr "" 321 384 385 #: uformimportsources.simportsource 386 msgctxt "uformimportsources.simportsource" 387 msgid "Import source" 388 msgstr "" 389 390 #: uformimportsources.simportsourcealreadyexists 391 msgid "Import source %s already exists!" 392 msgstr "" 393 394 #: uformimportsources.simportsourcequery 395 msgid "Enter name of import source" 396 msgstr "" 397 398 #: uformimportsources.sremoveimportsource 399 msgid "Remove import sources" 400 msgstr "" 401 402 #: uformimportsources.sremoveimportsourcequery 403 msgid "Do you really want to remove selected import sources?" 404 msgstr "" 405 322 406 #: uformmain.sappexit 323 407 msgid "Application exit" -
trunk/UAcronym.pas
r17 r20 13 13 TAcronymMeanings = class; 14 14 TAcronymDb = class; 15 TImportSources = class; 15 16 16 17 TAcronymSource = class … … 107 108 end; 108 109 110 TImportPattern = record 111 StartString: string; 112 EndString: string; 113 NewItem: Boolean; 114 end; 115 116 { TImportFormat } 117 118 TImportFormat = class 119 Id: Integer; 120 Name: string; 121 Acronym: TImportPattern; 122 Meaning: TImportPattern; 123 Description: TImportPattern; 124 procedure SaveToNode(Node: TDOMNode); 125 procedure LoadFromNode(Node: TDOMNode); 126 end; 127 128 { TImportFormats } 129 130 TImportFormats = class(TObjectList) 131 procedure UpdateIds; 132 procedure SaveToNode(Node: TDOMNode); 133 procedure LoadFromNode(Node: TDOMNode); 134 function SearchById(Id: Integer): TImportFormat; 135 end; 136 137 { TImportSource } 138 139 TImportSource = class 140 Name: string; 141 URL: string; 142 Format: TImportFormat; 143 LastTime: TDateTime; 144 Sources: TImportSources; 145 procedure Assign(Source: TImportSource); 146 procedure SaveToNode(Node: TDOMNode); 147 procedure LoadFromNode(Node: TDOMNode); 148 constructor Create; 149 destructor Destroy; override; 150 end; 151 152 { TImportSources } 153 154 TImportSources = class(TObjectList) 155 AcronymDb: TAcronymDb; 156 function SearchByName(Name: string): TImportSource; 157 procedure SaveToNode(Node: TDOMNode); 158 procedure LoadFromNode(Node: TDOMNode); 159 end; 160 109 161 { TAcronymDb } 110 162 … … 114 166 Acronyms: TAcronyms; 115 167 Categories: TAcronymCategories; 168 ImportSources: TImportSources; 169 ImportFormats: TImportFormats; 116 170 Modified: Boolean; 117 171 constructor Create; … … 140 194 end; 141 195 196 { TImportFormat } 197 198 procedure TImportFormat.SaveToNode(Node: TDOMNode); 199 begin 200 WriteInteger(Node, 'Id', Id); 201 WriteString(Node, 'Name', Name); 202 WriteString(Node, 'AcronymStartString', Acronym.StartString); 203 WriteString(Node, 'AcronymEndString', Acronym.EndString); 204 WriteString(Node, 'MeaningStartString', Meaning.StartString); 205 WriteString(Node, 'MeaningEndString', Meaning.EndString); 206 WriteString(Node, 'DescriptionStartString', Description.StartString); 207 WriteString(Node, 'DescriptionEndString', Description.EndString); 208 end; 209 210 procedure TImportFormat.LoadFromNode(Node: TDOMNode); 211 begin 212 Id := ReadInteger(Node, 'Id', 0); 213 Name := ReadString(Node, 'Name', ''); 214 Acronym.StartString := ReadString(Node, 'AcronymStartString', ''); 215 Acronym.EndString := ReadString(Node, 'AcronymEndString', ''); 216 Meaning.StartString := ReadString(Node, 'MeaningStartString', ''); 217 Meaning.EndString := ReadString(Node, 'MeaningEndString', ''); 218 Description.StartString := ReadString(Node, 'DescriptionStartString', ''); 219 Description.EndString := ReadString(Node, 'DescriptionEndString', ''); 220 end; 221 222 { TImportSources } 223 224 function TImportSources.SearchByName(Name: string): TImportSource; 225 var 226 I: Integer; 227 begin 228 I := 0; 229 while (I < Count) and (TImportSource(Items[I]).Name <> Name) do Inc(I); 230 if I < Count then Result := TImportSource(Items[I]) 231 else Result := nil; 232 end; 233 234 procedure TImportSources.SaveToNode(Node: TDOMNode); 235 var 236 I: Integer; 237 NewNode2: TDOMNode; 238 begin 239 for I := 0 to Count - 1 do 240 with TImportSource(Items[I]) do begin 241 NewNode2 := Node.OwnerDocument.CreateElement('ImportSource'); 242 Node.AppendChild(NewNode2); 243 SaveToNode(NewNode2); 244 end; 245 end; 246 247 procedure TImportSources.LoadFromNode(Node: TDOMNode); 248 var 249 Node2: TDOMNode; 250 NewItem: TImportSource; 251 begin 252 Count := 0; 253 Node2 := Node.FirstChild; 254 while Assigned(Node2) and (Node2.NodeName = 'ImportSource') do begin 255 NewItem := TImportSource.Create; 256 NewItem.Sources := Self; 257 NewItem.LoadFromNode(Node2); 258 Add(NewItem); 259 Node2 := Node2.NextSibling; 260 end; 261 end; 262 263 { TImportFormats } 264 265 procedure TImportFormats.UpdateIds; 266 var 267 LastId: Integer; 268 I: Integer; 269 begin 270 // Get highest used ID 271 LastId := 0; 272 for I := 0 to Count - 1 do begin 273 if TImportFormat(Items[I]).Id > LastId then LastId := TImportFormat(Items[I]).Id; 274 end; 275 // Add ID to new items without ID 276 for I := 0 to Count - 1 do begin 277 if TImportFormat(Items[I]).Id = 0 then begin 278 Inc(LastId); 279 TImportFormat(Items[I]).Id := LastId; 280 end; 281 end; 282 end; 283 284 procedure TImportFormats.SaveToNode(Node: TDOMNode); 285 var 286 I: Integer; 287 NewNode2: TDOMNode; 288 begin 289 UpdateIds; 290 for I := 0 to Count - 1 do 291 with TImportFormat(Items[I]) do begin 292 NewNode2 := Node.OwnerDocument.CreateElement('ImportFormat'); 293 Node.AppendChild(NewNode2); 294 SaveToNode(NewNode2); 295 end; 296 end; 297 298 procedure TImportFormats.LoadFromNode(Node: TDOMNode); 299 var 300 Node2: TDOMNode; 301 NewItem: TImportFormat; 302 begin 303 Count := 0; 304 Node2 := Node.FirstChild; 305 while Assigned(Node2) and (Node2.NodeName = 'ImportFormat') do begin 306 NewItem := TImportFormat.Create; 307 NewItem.LoadFromNode(Node2); 308 Add(NewItem); 309 Node2 := Node2.NextSibling; 310 end; 311 UpdateIds; 312 end; 313 314 function TImportFormats.SearchById(Id: Integer): TImportFormat; 315 var 316 I: Integer; 317 begin 318 I := 0; 319 while (I < Count) and (TImportFormat(Items[I]).Id <> Id) do Inc(I); 320 if I < Count then Result := TImportFormat(Items[I]) 321 else Result := nil; 322 end; 323 324 { TImportSource } 325 326 procedure TImportSource.Assign(Source: TImportSource); 327 begin 328 Name := Source.Name; 329 URL := Source.URL; 330 Format := Source.Format; 331 end; 332 333 procedure TImportSource.SaveToNode(Node: TDOMNode); 334 begin 335 WriteString(Node, 'Name', Name); 336 WriteString(Node, 'URL', URL); 337 if Assigned(Format) then WriteInteger(Node, 'ImportFormat', Format.Id) 338 else WriteInteger(Node, 'ImportFormat', -1); 339 end; 340 341 procedure TImportSource.LoadFromNode(Node: TDOMNode); 342 begin 343 Name := ReadString(Node, 'Name', ''); 344 URL := ReadString(Node, 'URL', ''); 345 Format := Sources.AcronymDb.ImportFormats.SearchById(ReadInteger(Node, 'ImportFormat', -1)); 346 end; 347 348 constructor TImportSource.Create; 349 begin 350 Format := nil; 351 end; 352 353 destructor TImportSource.Destroy; 354 begin 355 inherited Destroy; 356 end; 357 142 358 { TAcronymEntry } 143 359 … … 149 365 destructor TAcronymEntry.Destroy; 150 366 begin 151 Categories.Free;367 FreeAndNil(Categories); 152 368 inherited Destroy; 153 369 end; … … 492 708 Acronyms.Db := Self; 493 709 Categories := TAcronymCategories.Create; 710 ImportSources := TImportSources.Create; 711 ImportSources.AcronymDb := Self; 712 ImportFormats := TImportFormats.Create; 494 713 end; 495 714 496 715 destructor TAcronymDb.Destroy; 497 716 begin 717 FreeAndNil(ImportFormats); 718 FreeAndNil(ImportSources); 498 719 FreeAndNil(Sources); 499 720 FreeAndNil(Acronyms); … … 527 748 if Assigned(NewNode) then 528 749 Acronyms.LoadFromNode(NewNode); 750 751 NewNode := FindNode('ImportFormats'); 752 if Assigned(NewNode) then 753 ImportFormats.LoadFromNode(NewNode); 754 755 NewNode := FindNode('ImportSources'); 756 if Assigned(NewNode) then 757 ImportSources.LoadFromNode(NewNode); 529 758 end; 530 759 finally … … 557 786 AppendChild(NewNode); 558 787 Acronyms.SaveToNode(NewNode); 788 789 NewNode := OwnerDocument.CreateElement('ImportFormats'); 790 AppendChild(NewNode); 791 ImportFormats.SaveToNode(NewNode); 792 793 NewNode := OwnerDocument.CreateElement('ImportSources'); 794 AppendChild(NewNode); 795 ImportSources.SaveToNode(NewNode); 559 796 end; 560 797 ForceDirectories(ExtractFileDir(FileName));
Note:
See TracChangeset
for help on using the changeset viewer.