Ignore:
Timestamp:
Mar 19, 2013, 10:09:14 PM (11 years ago)
Author:
chronos
Message:
  • Přidáno: Možnost nastavit jazyk rozhraní v okně nastavení.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormSettings.pas

    r14 r18  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    9   StdCtrls;
     9  StdCtrls, ULanguages;
    1010
    1111type
     
    1717    ButtonCancel: TButton;
    1818    ButtonOk: TButton;
    19     ComboBox1: TComboBox;
     19    ComboBoxFormat: TComboBox;
     20    ComboBoxLang: TComboBox;
    2021    Label1: TLabel;
    2122    Label2: TLabel;
     23    Label3: TLabel;
    2224    LabeledEditFolder: TLabeledEdit;
    2325    LabeledEditFileNameFormat: TLabeledEdit;
     
    5052  I: TFioDataFormat;
    5153begin
    52   while ComboBox1.Items.Count < Length(DataFormatText) do
    53     ComboBox1.Items.Add('');
    54   while ComboBox1.Items.Count > Length(DataFormatText) do
    55     ComboBox1.Items.Delete(ComboBox1.Items.Count - 1);
     54  while ComboBoxFormat.Items.Count < Length(DataFormatText) do
     55    ComboBoxFormat.Items.Add('');
     56  while ComboBoxFormat.Items.Count > Length(DataFormatText) do
     57    ComboBoxFormat.Items.Delete(ComboBoxFormat.Items.Count - 1);
    5658  for I := Low(DataFormatText) to High(DataFormatText) do
    57     ComboBox1.Items.Strings[Integer(I)] := DataFormatText[I];
     59    ComboBoxFormat.Items.Strings[Integer(I)] := DataFormatText[I];
    5860end;
    5961
     
    6870procedure TFormSettings.Load;
    6971begin
     72  Core.CoolTranslator1.LanguageListToStrings(ComboBoxLang.Items);
     73  ComboBoxLang.ItemIndex := ComboBoxLang.Items.IndexOfObject(Core.CoolTranslator1.Language);
    7074  LabeledEditFileNameFormat.Text := Core.OutputFormat;
    71   ComboBox1.ItemIndex := Integer(Core.DataFormat);
     75  ComboBoxFormat.ItemIndex := Integer(Core.DataFormat);
    7276  LabeledEditFolder.Text := Core.TargetDirectory;
    7377end;
     
    7579procedure TFormSettings.Save;
    7680begin
     81  if ComboBoxLang.Items.Objects[ComboBoxLang.ItemIndex] <> Core.CoolTranslator1.Language then begin
     82    Core.CoolTranslator1.Language := TLanguage(ComboBoxLang.Items.Objects[ComboBoxLang.ItemIndex]);
     83
     84  end;
    7785  Core.OutputFormat := LabeledEditFileNameFormat.Text;
    78   Core.DataFormat := TFioDataFormat(ComboBox1.ItemIndex);
     86  Core.DataFormat := TFioDataFormat(ComboBoxFormat.ItemIndex);
    7987  Core.TargetDirectory := LabeledEditFolder.Text;
    8088end;
Note: See TracChangeset for help on using the changeset viewer.