Changeset 219 for trunk/Forms/FormExport.pas
- Timestamp:
- Jan 17, 2025, 9:05:54 PM (4 days ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormExport.pas
r218 r219 1 unit UFormExport; 2 3 {$mode delphi} 1 unit FormExport; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 UJobProgressView;7 JobProgressView; 10 8 11 9 type … … 21 19 procedure ButtonProcessClick(Sender: TObject); 22 20 procedure ButtonSaveToFileClick(Sender: TObject); 23 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);24 procedure FormCreate(Sender: TObject);25 procedure FormShow(Sender: TObject);26 21 private 27 22 ItemCount: Integer; … … 30 25 procedure JobExportMediaWiki(Job: TJob); 31 26 procedure JobExportMediaWikiTable(Job: TJob); 32 public33 { public declarations }34 27 end; 35 28 36 var37 FormExport: TFormExport;38 29 39 30 implementation … … 42 33 43 34 uses 44 UCore, UAcronym;35 Core, Acronym; 45 36 46 37 resourcestring … … 60 51 end; 61 52 62 procedure TFormExport.FormClose(Sender: TObject; var CloseAction: TCloseAction);63 begin64 Core.PersistentForm1.Save(Self);65 end;66 67 procedure TFormExport.FormCreate(Sender: TObject);68 begin69 Core.Translator.TranslateComponentRecursive(Self);70 Core.ThemeManager.UseTheme(Self);71 end;72 73 procedure TFormExport.FormShow(Sender: TObject);74 begin75 Core.PersistentForm1.Load(Self);76 end;77 78 53 procedure TFormExport.JobExportCSV(Job: TJob); 79 54 var … … 81 56 J: Integer; 82 57 begin 83 Job.Progress.Max := Core. AcronymDb.Acronyms.Count;58 Job.Progress.Max := Core.Core.AcronymDb.Acronyms.Count; 84 59 ItemCount := 0; 85 60 Content := ''; 86 for I := 0 to Core. AcronymDb.Acronyms.Count - 1 do87 with TAcronym(Core.AcronymDb.Acronyms[I])do begin61 for I := 0 to Core.Core.AcronymDb.Acronyms.Count - 1 do 62 with Core.Core.AcronymDb.Acronyms[I] do begin 88 63 for J := 0 to Meanings.Count - 1 do 89 with TAcronymMeaning(Meanings[J])do begin64 with Meanings[J] do begin 90 65 Content := Content + '"' + Acronym.Name + '","' + Name + '","' + Description + '","' + Categories.GetString + '"' + LineEnding; 91 66 Inc(ItemCount); … … 101 76 J: Integer; 102 77 begin 103 Job.Progress.Max := Core. AcronymDb.Acronyms.Count;78 Job.Progress.Max := Core.Core.AcronymDb.Acronyms.Count; 104 79 ItemCount := 0; 105 80 Content := ''; 106 for I := 0 to Core. AcronymDb.Acronyms.Count - 1 do107 with TAcronym(Core.AcronymDb.Acronyms[I])do begin81 for I := 0 to Core.Core.AcronymDb.Acronyms.Count - 1 do 82 with Core.Core.AcronymDb.Acronyms[I] do begin 108 83 Content := Content + '; ' + Name + LineEnding; 109 84 for J := 0 to Meanings.Count - 1 do 110 with TAcronymMeaning(Meanings[J])do begin85 with Meanings[J] do begin 111 86 Content := Content + ': ' + Name + LineEnding; 112 87 Inc(ItemCount); … … 122 97 J: Integer; 123 98 begin 124 Job.Progress.Max := Core. AcronymDb.Acronyms.Count;99 Job.Progress.Max := Core.Core.AcronymDb.Acronyms.Count; 125 100 ItemCount := 0; 126 101 Content := '{| class="wikitable sortable"' + LineEnding + 127 102 '! Name !! Meaning !! Description !! Categories' + LineEnding; 128 for I := 0 to Core. AcronymDb.Acronyms.Count - 1 do129 with TAcronym(Core.AcronymDb.Acronyms[I])do begin103 for I := 0 to Core.Core.AcronymDb.Acronyms.Count - 1 do 104 with Core.Core.AcronymDb.Acronyms[I] do begin 130 105 for J := 0 to Meanings.Count - 1 do 131 with TAcronymMeaning(Meanings[J])do begin106 with Meanings[J] do begin 132 107 Content := Content + '|-' + LineEnding + 133 108 '| ' + Acronym.Name + LineEnding + '| ' + Name + LineEnding + … … 144 119 begin 145 120 if ComboBoxDataFormat.ItemIndex = 0 then 146 Core. JobProgressView1.AddJob(SExporting, JobExportCSV);121 Core.Core.JobProgressView1.AddJob(SExporting, JobExportCSV); 147 122 if ComboBoxDataFormat.ItemIndex = 1 then 148 Core. JobProgressView1.AddJob(SExporting, JobExportMediaWiki);123 Core.Core.JobProgressView1.AddJob(SExporting, JobExportMediaWiki); 149 124 if ComboBoxDataFormat.ItemIndex = 2 then 150 Core. JobProgressView1.AddJob(SExporting, JobExportMediaWikiTable);151 Core. JobProgressView1.Start;125 Core.Core.JobProgressView1.AddJob(SExporting, JobExportMediaWikiTable); 126 Core.Core.JobProgressView1.Start; 152 127 Memo1.Lines.Text := Content; 153 128 ShowMessage(Format(SExportedAcronyms, [ItemCount]));
Note:
See TracChangeset
for help on using the changeset viewer.