Changeset 207 for trunk/UCore.pas


Ignore:
Timestamp:
Sep 20, 2021, 10:16:37 AM (3 years ago)
Author:
chronos
Message:
  • Modified: Updated Common package.
  • Modified: CoolTranslator package merged into Common package.
  • Fixed: Build with Lazarus 2.0.12
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r200 r207  
    66
    77uses
    8   Classes, SysUtils, FileUtil, UAcronym, UCoolTranslator, UPersistentForm,
     8  Classes, SysUtils, FileUtil, UAcronym, UTranslator, UPersistentForm,
    99  UJobProgressView, UScaleDPI, Forms, Controls, ExtCtrls, Menus, LazFileUtils,
    10   URegistry, UApplicationInfo, Registry, UTheme;
     10  URegistry, UApplicationInfo, Registry, UTheme, UAboutDialog;
    1111
    1212type
     
    1616  TCore = class(TDataModule)
    1717    ApplicationInfo1: TApplicationInfo;
    18     CoolTranslator1: TCoolTranslator;
     18    ThemeManager: TThemeManager;
     19    Translator: TTranslator;
    1920    ImageList1: TImageList;
    2021    ImageListLarge: TImageList;
     
    3132    ScaleDPI1: TScaleDPI;
    3233    TrayIcon1: TTrayIcon;
    33     procedure CoolTranslator1Translate(Sender: TObject);
     34    procedure TranslatorTranslate(Sender: TObject);
    3435    procedure DataModuleCreate(Sender: TObject);
    3536    procedure DataModuleDestroy(Sender: TObject);
     
    4849    InitializeStarted: Boolean;
    4950    InitializeFinished: Boolean;
    50     ThemeManager: TThemeManager;
    5151    procedure Initialize;
    5252    procedure LoadConfig;
     
    8787  InitializeFinished := False;
    8888  StoredDimension := TControlDimension.Create;
    89   ThemeManager := TThemeManager.Create(nil);
    9089end;
    9190
    9291procedure TCore.DataModuleDestroy(Sender: TObject);
    9392begin
    94   FreeAndNil(ThemeManager);
    9593  FreeAndNil(StoredDimension);
    9694  FreeAndNil(AcronymDb);
     
    103101end;
    104102
    105 procedure TCore.CoolTranslator1Translate(Sender: TObject);
     103procedure TCore.TranslatorTranslate(Sender: TObject);
    106104begin
    107105  UAcronym.Translate;
     
    211209    ScaleDPI1.AutoDetect := ReadBoolWithDefault('DPIAuto', True);
    212210    if ValueExists('LanguageCode') then
    213       CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(ReadStringWithDefault('LanguageCode', ''))
    214       else CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode('');
     211      Translator.Language := Translator.Languages.SearchByCode(ReadStringWithDefault('LanguageCode', ''))
     212      else Translator.Language := Translator.Languages.SearchByCode('');
    215213    AlwaysOnTop := ReadBoolWithDefault('AlwaysOnTop', False);
    216214    StartMinimizedToTray := ReadBoolWithDefault('StartMinimizedToTray', False);
     
    233231    WriteInteger('DPIY', ScaleDPI1.DPI.Y);
    234232    WriteBool('DPIAuto', ScaleDPI1.AutoDetect);
    235     if Assigned(CoolTranslator1.Language) and (CoolTranslator1.Language.Code <> '') then
    236       WriteString('LanguageCode', CoolTranslator1.Language.Code)
     233    if Assigned(Translator.Language) and (Translator.Language.Code <> '') then
     234      WriteString('LanguageCode', Translator.Language.Code)
    237235      else DeleteValue('LanguageCode');
    238236    WriteBool('AlwaysOnTop', AlwaysOnTop);
Note: See TracChangeset for help on using the changeset viewer.