Changeset 34 for trunk/Forms


Ignore:
Timestamp:
Dec 10, 2016, 10:00:19 PM (8 years ago)
Author:
chronos
Message:
  • Added: Interface localization support.
  • Added: Global settings dialog.
Location:
trunk/Forms
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r33 r34  
    1919    Top = 0
    2020    Width = 1703
    21     Caption = 'ToolBar1'
    2221    Images = Core.ImageList1
    2322    TabOrder = 0
     
    482481      OnExecute = AShowAboutExecute
    483482    end
     483    object AShowSettings: TAction
     484      Caption = 'Settings'
     485      OnExecute = AShowSettingsExecute
     486    end
    484487  end
    485488  object OpenDialog1: TOpenDialog
     
    549552      end
    550553    end
     554    object MenuItem22: TMenuItem
     555      Caption = 'Tools'
     556      object MenuItem23: TMenuItem
     557        Action = AShowSettings
     558      end
     559    end
    551560    object MenuItem20: TMenuItem
    552561      Caption = 'Help'
  • trunk/Forms/UFormMain.lrt

    r33 r34  
    11TFORMMAIN.CAPTION=CoolDisk
    2 TFORMMAIN.TOOLBAR1.CAPTION=ToolBar1
    32TFORMMAIN.LABEL1.CAPTION=Sector size:
    43TFORMMAIN.LABELSECTORSIZE.CAPTION= 
     
    4342TFORMMAIN.AOPERATIONADD.CAPTION=Add
    4443TFORMMAIN.ASHOWABOUT.CAPTION=About
     44TFORMMAIN.ASHOWSETTINGS.CAPTION=Settings
    4545TFORMMAIN.MENUITEM1.CAPTION=File
    4646TFORMMAIN.MENUITEMOPENRECENT.CAPTION=Open recent
     
    4949TFORMMAIN.MENUITEM14.CAPTION=-
    5050TFORMMAIN.MENUITEM16.CAPTION=View
     51TFORMMAIN.MENUITEM22.CAPTION=Tools
    5152TFORMMAIN.MENUITEM20.CAPTION=Help
  • trunk/Forms/UFormMain.pas

    r33 r34  
    1515
    1616  TFormMain = class(TForm)
     17    AShowSettings: TAction;
    1718    AShowAbout: TAction;
    1819    AOperationAdd: TAction;
     
    8081    MenuItem20: TMenuItem;
    8182    MenuItem21: TMenuItem;
     83    MenuItem22: TMenuItem;
     84    MenuItem23: TMenuItem;
    8285    MenuItemOpenRecent: TMenuItem;
    8386    MenuItem2: TMenuItem;
     
    119122    procedure AScanStopExecute(Sender: TObject);
    120123    procedure AShowAboutExecute(Sender: TObject);
     124    procedure AShowSettingsExecute(Sender: TObject);
    121125    procedure AViewToolbarExecute(Sender: TObject);
    122126    procedure ComboBoxDriveChange(Sender: TObject);
     
    162166
    163167uses
    164   UCore, UFormProject, UFormOperation, UFormAbout;
     168  UCore, UFormProject, UFormOperation, UFormAbout, UFormSettings;
    165169
    166170resourcestring
     
    180184  Detect;
    181185  LoadConfig;
     186  Core.LoadConfig;
    182187  Core.PersistentForm1.Load(Self);
    183188  if (LastOpenedList1.Items.Count > 0) and FileExists(LastOpenedList1.Items[0]) then
     
    234239
    235240procedure TFormMain.AShowAboutExecute(Sender: TObject);
    236 var
    237   FormAbout: TFormAbout;
    238241begin
    239242  FormAbout := TFormAbout.Create(nil);
     
    243246  finally
    244247    FreeAndNil(FormAbout);
     248  end;
     249end;
     250
     251procedure TFormMain.AShowSettingsExecute(Sender: TObject);
     252begin
     253  FormSettings := TFormSettings.Create(nil);
     254  try
     255    FormSettings.Load;
     256    if FormSettings.ShowModal = mrOK then
     257      FormSettings.Save;
     258  finally
     259    FreeAndNil(FormSettings);
    245260  end;
    246261end;
     
    417432  AFileClose.Execute;
    418433  SaveConfig;
     434  Core.SaveConfig;
    419435  Core.PersistentForm1.Save(Self);
    420436end;
Note: See TracChangeset for help on using the changeset viewer.