Ignore:
Timestamp:
Jul 20, 2018, 10:25:06 AM (6 years ago)
Author:
chronos
Message:
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        66compiled
        77heaptrclog.trc
         8LazFuck.dbg
  • trunk/Forms/UFormMain.pas

    r92 r93  
    152152    procedure TargetLogExecute(Lines: TStrings);
    153153    procedure TargetStateChanged(Sender: TObject);
    154     procedure LoadFromRegistry(Root: HKEY; Key: string);
    155     procedure SaveToRegistry(Root: HKEY; Key: string);
     154    procedure LoadFromRegistry(Context: TRegistryContext);
     155    procedure SaveToRegistry(Context: TRegistryContext);
    156156    procedure UpdateInterface;
    157157    procedure UpdateStatusBar;
     
    189189begin
    190190  Core.Init;
    191   LoadFromRegistry(HKEY(Core.ApplicationInfo.RegistryRoot), Core.ApplicationInfo.RegistryKey);
     191  LoadFromRegistry(Core.ApplicationInfo.GetRegistryContext);
    192192  PageControlMain.TabIndex := 0;
    193   if Core.OpenProjectOnStart and (Core.LastOpenedList.Items.Count > 0) then
    194     ProjectOpen(Core.LastOpenedList.Items[0])
    195     else AProjectNew.Execute;
    196   UpdateInterface;
    197   UpdateToolBarHints;
    198   UpdateTargetList;
    199   DockInit;
    200   Core.PersistentForm1.Load(Self, wsMaximized);
     193  try
     194    if Core.OpenProjectOnStart and (Core.LastOpenedList.Items.Count > 0) then
     195      ProjectOpen(Core.LastOpenedList.Items[0])
     196      else AProjectNew.Execute;
     197  finally
     198    LastOpenedListChange(nil);
     199    UpdateInterface;
     200    UpdateToolBarHints;
     201    UpdateTargetList;
     202    DockInit;
     203    Core.PersistentForm1.Load(Self, True);
     204  end;
    201205end;
    202206
     
    293297end;
    294298
    295 procedure TFormMain.LoadFromRegistry(Root: HKEY; Key: string);
     299procedure TFormMain.LoadFromRegistry(Context: TRegistryContext);
    296300var
    297301  TargetName: string;
     
    299303  with TRegistryEx.Create do
    300304  try
    301     RootKey := Root;
    302     OpenKey(Key, True);
     305    CurrentContext := Context;
    303306    TargetName := ReadStringWithDefault('TargetName', 'Interpretter');
    304307    Core.CurrentTarget := Core.Targets.FindByName(TargetName);
     
    314317end;
    315318
    316 procedure TFormMain.SaveToRegistry(Root: HKEY; Key: string);
     319procedure TFormMain.SaveToRegistry(Context: TRegistryContext);
    317320begin
    318321  with TRegistryEx.Create do
    319322  try
    320     RootKey := Root;
    321     OpenKey(Key, True);
     323    CurrentContext := Context;
    322324    WriteString('TargetName', Core.CurrentTarget.Name);
    323325    WriteBool('OptimizationAddSubEnabled', Core.Optimizations.AddSub);
     
    397399procedure TFormMain.FormDestroy(Sender: TObject);
    398400begin
    399   SaveToRegistry(HKEY(Core.ApplicationInfo.RegistryRoot), Core.ApplicationInfo.RegistryKey);
     401  SaveToRegistry(Core.ApplicationInfo.GetRegistryContext);
    400402end;
    401403
Note: See TracChangeset for help on using the changeset viewer.