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/FormImportSource.pas

    r218 r219  
    1 unit UFormImportSource;
    2 
    3 {$mode delphi}
     1unit FormImportSource;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ActnList, Menus, ExtCtrls, UAcronym, LCLIntf;
     7  ActnList, Menus, ExtCtrls, Acronym, LCLIntf;
    108
    119type
     
    4442    procedure ButtonOpenURLClick(Sender: TObject);
    4543    procedure ButtonShowFormatClick(Sender: TObject);
    46     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    47     procedure FormCreate(Sender: TObject);
    4844    procedure FormShow(Sender: TObject);
    49   private
    50     { private declarations }
    5145  public
    5246    procedure UpdateInterface;
     
    5549  end;
    5650
    57 var
    58   FormImportSource: TFormImportSource;
    5951
    6052implementation
     
    6355
    6456uses
    65   UCore, UFormImportFormat, UFormCategorySelect;
     57  Core, FormImportFormat, FormCategorySelect;
    6658
    6759{ TFormImportSource }
     
    7062var
    7163  NewImportFormat: TImportFormat;
     64  FormImportFormat: TFormImportFormat;
    7265begin
    7366  if ComboBox1.ItemIndex <> -1 then begin
     
    8073        FormImportFormat.Save(NewImportFormat);
    8174        TImportFormat(ComboBox1.Items.Objects[ComboBox1.ItemIndex]).Assign(NewImportFormat);
    82         Core.AcronymDb.Modified := True;
     75        Core.Core.AcronymDb.Modified := True;
    8376        ComboBox1.Items.Strings[ComboBox1.ItemIndex] := NewImportFormat.Name;
    8477      end;
     
    9083end;
    9184
    92 procedure TFormImportSource.FormClose(Sender: TObject;
    93   var CloseAction: TCloseAction);
    94 begin
    95   Core.PersistentForm1.Save(Self);
    96 end;
    97 
    98 procedure TFormImportSource.FormCreate(Sender: TObject);
    99 begin
    100   Core.Translator.TranslateComponentRecursive(Self);
    101   Core.ThemeManager.UseTheme(Self);
    102 end;
    103 
    10485procedure TFormImportSource.FormShow(Sender: TObject);
    10586begin
    106   Core.PersistentForm1.Load(Self);
    10787  UpdateInterface;
    10888end;
     
    11696var
    11797  I: Integer;
     98  FormCategorySelect: TFormCategorySelect;
    11899begin
    119100  FormCategorySelect := TFormCategorySelect.Create(Self);
     
    155136  EditName.Text := ImportSource.Name;
    156137  EditURL.Text := ImportSource.URL;
    157   while ComboBox1.Items.Count > Core.AcronymDb.ImportFormats.Count do
     138  while ComboBox1.Items.Count > Core.Core.AcronymDb.ImportFormats.Count do
    158139    ComboBox1.Items.Delete(ComboBox1.Items.Count - 1);
    159   while ComboBox1.Items.Count < Core.AcronymDb.ImportFormats.Count do
     140  while ComboBox1.Items.Count < Core.Core.AcronymDb.ImportFormats.Count do
    160141    ComboBox1.Items.Add('');
    161   for I := 0 to Core.AcronymDb.ImportFormats.Count - 1 do begin
    162     ComboBox1.Items[I] := TImportFormat(Core.AcronymDb.ImportFormats[I]).Name;
    163     ComboBox1.Items.Objects[I] := Core.AcronymDb.ImportFormats[I];
     142  for I := 0 to Core.Core.AcronymDb.ImportFormats.Count - 1 do begin
     143    ComboBox1.Items[I] := TImportFormat(Core.Core.AcronymDb.ImportFormats[I]).Name;
     144    ComboBox1.Items.Objects[I] := Core.Core.AcronymDb.ImportFormats[I];
    164145  end;
    165146  ComboBox1.ItemIndex := ComboBox1.Items.IndexOfObject(ImportSource.Format);
Note: See TracChangeset for help on using the changeset viewer.