Changeset 25 for trunk/UCore.pas


Ignore:
Timestamp:
Sep 10, 2022, 6:54:43 PM (2 years ago)
Author:
chronos
Message:
  • Modified: CoolTranslator replaced by Common package.
  • Modified: Update common package.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r22 r25  
    66
    77uses
    8   Classes, SysUtils, FileUtil, Controls, ActnList, UDatabase, UCoolTranslator,
     8  Classes, SysUtils, FileUtil, Controls, ActnList, UDatabase, UTranslator,
    99  UApplicationInfo, UPersistentForm, Forms, URegistry, UScaleDPI;
    1010
     
    2020    AExit: TAction;
    2121    ActionList1: TActionList;
    22     CoolTranslator1: TCoolTranslator;
     22    Translator1: TTranslator;
    2323    ImageList1: TImageList;
    2424    PersistentForm1: TPersistentForm;
     
    2929    procedure AExitExecute(Sender: TObject);
    3030    procedure APreferencesExecute(Sender: TObject);
    31     procedure CoolTranslator1Translate(Sender: TObject);
     31    procedure Translator1Translate(Sender: TObject);
    3232    procedure DataModuleCreate(Sender: TObject);
    3333    procedure DataModuleDestroy(Sender: TObject);
     
    5757
    5858uses
    59   UFormTables, UFormConnect,
    60   UFormDatabases, UFormPreferences, UFormMain, UFormAbout;
     59  UFormTables, UFormConnect, UAboutDialog, UFormDatabases, UFormPreferences,
     60  UFormMain;
    6161
    6262{$R *.lfm}
     
    9797procedure TCore.AAboutExecute(Sender: TObject);
    9898begin
    99   FormAbout := TFormAbout.Create(nil);
    100   FormAbout.ApplicationInfo := ApplicationInfo1;
    101   FormAbout.ShowModal;
    102   FormAbout.Free;
     99  with TAboutDialog.Create(nil) do
     100  try
     101    ApplicationInfo := ApplicationInfo1;
     102    Show;
     103  finally
     104    Free;
     105  end;
    103106end;
    104107
     
    111114end;
    112115
    113 procedure TCore.CoolTranslator1Translate(Sender: TObject);
     116procedure TCore.Translator1Translate(Sender: TObject);
    114117var
    115118  I: Integer;
    116119begin
    117120  for I := 0 to DbManager.DataTypes.Count - 1 do begin
    118     TDataType(DbManager.DataTypes[I]).Title := CoolTranslator1.TranslateText(TDataType(DbManager.DataTypes[I]).Title, TDataType(DbManager.DataTypes[I]).Title);
     121    TDataType(DbManager.DataTypes[I]).Title := Translator1.TranslateText(TDataType(DbManager.DataTypes[I]).Title, TDataType(DbManager.DataTypes[I]).Title);
    119122  end;
    120123end;
     
    143146    Preferences.RememberDatabase := GetValue('RememberDatabase', True);
    144147    Preferences.LastDatabaseName := GetValue('LastDatabaseName', '');
    145     CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(
     148    Translator1.Language := Translator1.Languages.SearchByCode(
    146149      GetValue('Language', ''));
    147150  finally
     
    158161    SetValue('RememberDatabase', Preferences.RememberDatabase);
    159162    SetValue('LastDatabaseName', Preferences.LastDatabaseName);
    160     SetValue('Language', CoolTranslator1.Language.Code);
     163    SetValue('Language', Translator1.Language.Code);
    161164  finally
    162165    Free;
     
    170173begin
    171174  if not Initialized then begin
    172     {$IFDEF Linux}
     175    {$IFDEF UNIX}
    173176    // If installed in Linux system then use installation directory for po files
    174177    if Application.ExeName = '/usr/bin/MyData' then
    175       CoolTranslator1.POFilesFolder := '/usr/share/MyData/languages';
     178      Translator1.POFilesFolder := '/usr/share/MyData/languages';
    176179    {$ENDIF}
    177180    FormConnect.Init;
Note: See TracChangeset for help on using the changeset viewer.