Ignore:
Timestamp:
Jan 17, 2025, 9:05:54 PM (4 days ago)
Author:
chronos
Message:
  • Modified: Updated Common package.
  • Modified: Remove U prefix from unit names.
  • Modified: Use Gneeric.Collections instead of fgl.
  • Modified: Do not use global form variables.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormExport.pas

    r218 r219  
    1 unit UFormExport;
    2 
    3 {$mode delphi}
     1unit FormExport;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   UJobProgressView;
     7  JobProgressView;
    108
    119type
     
    2119    procedure ButtonProcessClick(Sender: TObject);
    2220    procedure ButtonSaveToFileClick(Sender: TObject);
    23     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    24     procedure FormCreate(Sender: TObject);
    25     procedure FormShow(Sender: TObject);
    2621  private
    2722    ItemCount: Integer;
     
    3025    procedure JobExportMediaWiki(Job: TJob);
    3126    procedure JobExportMediaWikiTable(Job: TJob);
    32   public
    33     { public declarations }
    3427  end;
    3528
    36 var
    37   FormExport: TFormExport;
    3829
    3930implementation
     
    4233
    4334uses
    44   UCore, UAcronym;
     35  Core, Acronym;
    4536
    4637resourcestring
     
    6051end;
    6152
    62 procedure TFormExport.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    63 begin
    64   Core.PersistentForm1.Save(Self);
    65 end;
    66 
    67 procedure TFormExport.FormCreate(Sender: TObject);
    68 begin
    69   Core.Translator.TranslateComponentRecursive(Self);
    70   Core.ThemeManager.UseTheme(Self);
    71 end;
    72 
    73 procedure TFormExport.FormShow(Sender: TObject);
    74 begin
    75   Core.PersistentForm1.Load(Self);
    76 end;
    77 
    7853procedure TFormExport.JobExportCSV(Job: TJob);
    7954var
     
    8156  J: Integer;
    8257begin
    83   Job.Progress.Max := Core.AcronymDb.Acronyms.Count;
     58  Job.Progress.Max := Core.Core.AcronymDb.Acronyms.Count;
    8459  ItemCount := 0;
    8560  Content := '';
    86   for I := 0 to Core.AcronymDb.Acronyms.Count - 1 do
    87   with TAcronym(Core.AcronymDb.Acronyms[I]) do begin
     61  for I := 0 to Core.Core.AcronymDb.Acronyms.Count - 1 do
     62  with Core.Core.AcronymDb.Acronyms[I] do begin
    8863    for J := 0 to Meanings.Count - 1 do
    89     with TAcronymMeaning(Meanings[J]) do begin
     64    with Meanings[J] do begin
    9065      Content := Content + '"' + Acronym.Name + '","' + Name + '","' + Description + '","' + Categories.GetString + '"' + LineEnding;
    9166      Inc(ItemCount);
     
    10176  J: Integer;
    10277begin
    103   Job.Progress.Max := Core.AcronymDb.Acronyms.Count;
     78  Job.Progress.Max := Core.Core.AcronymDb.Acronyms.Count;
    10479  ItemCount := 0;
    10580  Content := '';
    106   for I := 0 to Core.AcronymDb.Acronyms.Count - 1 do
    107   with TAcronym(Core.AcronymDb.Acronyms[I]) do begin
     81  for I := 0 to Core.Core.AcronymDb.Acronyms.Count - 1 do
     82  with Core.Core.AcronymDb.Acronyms[I] do begin
    10883    Content := Content + '; ' + Name + LineEnding;
    10984    for J := 0 to Meanings.Count - 1 do
    110     with TAcronymMeaning(Meanings[J]) do begin
     85    with Meanings[J] do begin
    11186      Content := Content + ': ' + Name + LineEnding;
    11287      Inc(ItemCount);
     
    12297  J: Integer;
    12398begin
    124   Job.Progress.Max := Core.AcronymDb.Acronyms.Count;
     99  Job.Progress.Max := Core.Core.AcronymDb.Acronyms.Count;
    125100  ItemCount := 0;
    126101  Content := '{| class="wikitable sortable"' + LineEnding +
    127102    '! Name !! Meaning !! Description !! Categories' + LineEnding;
    128   for I := 0 to Core.AcronymDb.Acronyms.Count - 1 do
    129   with TAcronym(Core.AcronymDb.Acronyms[I]) do begin
     103  for I := 0 to Core.Core.AcronymDb.Acronyms.Count - 1 do
     104  with Core.Core.AcronymDb.Acronyms[I] do begin
    130105    for J := 0 to Meanings.Count - 1 do
    131     with TAcronymMeaning(Meanings[J]) do begin
     106    with Meanings[J] do begin
    132107      Content := Content + '|-' + LineEnding +
    133108        '| ' + Acronym.Name + LineEnding + '| ' + Name + LineEnding +
     
    144119begin
    145120  if ComboBoxDataFormat.ItemIndex = 0 then
    146     Core.JobProgressView1.AddJob(SExporting, JobExportCSV);
     121    Core.Core.JobProgressView1.AddJob(SExporting, JobExportCSV);
    147122  if ComboBoxDataFormat.ItemIndex = 1 then
    148     Core.JobProgressView1.AddJob(SExporting, JobExportMediaWiki);
     123    Core.Core.JobProgressView1.AddJob(SExporting, JobExportMediaWiki);
    149124  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;
    152127  Memo1.Lines.Text := Content;
    153128  ShowMessage(Format(SExportedAcronyms, [ItemCount]));
Note: See TracChangeset for help on using the changeset viewer.