Changeset 93 for trunk/Forms
- Timestamp:
- Jul 20, 2018, 10:25:06 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 6 6 compiled 7 7 heaptrclog.trc 8 LazFuck.dbg
-
- Property svn:ignore
-
trunk/Forms/UFormMain.pas
r92 r93 152 152 procedure TargetLogExecute(Lines: TStrings); 153 153 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); 156 156 procedure UpdateInterface; 157 157 procedure UpdateStatusBar; … … 189 189 begin 190 190 Core.Init; 191 LoadFromRegistry( HKEY(Core.ApplicationInfo.RegistryRoot), Core.ApplicationInfo.RegistryKey);191 LoadFromRegistry(Core.ApplicationInfo.GetRegistryContext); 192 192 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; 201 205 end; 202 206 … … 293 297 end; 294 298 295 procedure TFormMain.LoadFromRegistry( Root: HKEY; Key: string);299 procedure TFormMain.LoadFromRegistry(Context: TRegistryContext); 296 300 var 297 301 TargetName: string; … … 299 303 with TRegistryEx.Create do 300 304 try 301 RootKey := Root; 302 OpenKey(Key, True); 305 CurrentContext := Context; 303 306 TargetName := ReadStringWithDefault('TargetName', 'Interpretter'); 304 307 Core.CurrentTarget := Core.Targets.FindByName(TargetName); … … 314 317 end; 315 318 316 procedure TFormMain.SaveToRegistry( Root: HKEY; Key: string);319 procedure TFormMain.SaveToRegistry(Context: TRegistryContext); 317 320 begin 318 321 with TRegistryEx.Create do 319 322 try 320 RootKey := Root; 321 OpenKey(Key, True); 323 CurrentContext := Context; 322 324 WriteString('TargetName', Core.CurrentTarget.Name); 323 325 WriteBool('OptimizationAddSubEnabled', Core.Optimizations.AddSub); … … 397 399 procedure TFormMain.FormDestroy(Sender: TObject); 398 400 begin 399 SaveToRegistry( HKEY(Core.ApplicationInfo.RegistryRoot), Core.ApplicationInfo.RegistryKey);401 SaveToRegistry(Core.ApplicationInfo.GetRegistryContext); 400 402 end; 401 403
Note:
See TracChangeset
for help on using the changeset viewer.