Changeset 34 for trunk/UCore.pas


Ignore:
Timestamp:
Dec 10, 2016, 10:00:19 PM (7 years ago)
Author:
chronos
Message:
  • Added: Interface localization support.
  • Added: Global settings dialog.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r33 r34  
    77uses
    88  Classes, SysUtils, XMLConf, FileUtil, Controls, UProject, UPhysDrive,
    9   UCoolTranslator, UPersistentForm, UApplicationInfo;
     9  UCoolTranslator, UPersistentForm, UApplicationInfo, URegistry, UScaleDPI;
    1010
    1111type
     
    1818    ImageList1: TImageList;
    1919    PersistentForm1: TPersistentForm;
     20    ScaleDPI1: TScaleDPI;
    2021    XMLConfig1: TXMLConfig;
    2122    procedure DataModuleCreate(Sender: TObject);
    2223    procedure DataModuleDestroy(Sender: TObject);
    2324  private
    24     { private declarations }
     25    RegistryContext: TRegistryContext;
    2526  public
     27    DevelMode: Boolean;
    2628    DriveList: TDriveList;
    2729    Project: TProject;
     30    procedure LoadConfig;
     31    procedure SaveConfig;
    2832  end;
    2933
     
    5155end;
    5256
     57procedure TCore.LoadConfig;
     58begin
     59  RegistryContext := RegContext(Integer(ApplicationInfo1.RegistryRoot), ApplicationInfo1.RegistryKey);
     60  PersistentForm1.RegistryContext := RegistryContext;
     61  XMLConfig1.Filename := GetAppConfigDir(False) + 'Config.xml';
     62
     63  CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(XMLConfig1.GetValue('Language', ''));
     64end;
     65
     66procedure TCore.SaveConfig;
     67begin
     68  XMLConfig1.SetValue('Language', CoolTranslator1.Language.Code);
     69end;
     70
    5371end.
    5472
Note: See TracChangeset for help on using the changeset viewer.