Changeset 93 for trunk/UCore.pas
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 6 6 compiled 7 7 heaptrclog.trc 8 LazFuck.dbg
-
- Property svn:ignore
-
trunk/UCore.pas
r91 r93 37 37 Optimizations: TOptimizations; 38 38 procedure Init; 39 procedure LoadFromRegistry( Root: HKEY; Key: string);40 procedure SaveToRegistry( Root: HKEY; Key: string);39 procedure LoadFromRegistry(Context: TRegistryContext); 40 procedure SaveToRegistry(Context: TRegistryContext); 41 41 property CurrentTarget: TTarget read FCurrentTarget write SetCurrentTarget; 42 42 end; … … 83 83 {$ENDIF} 84 84 85 LoadFromRegistry( HKEY(ApplicationInfo.RegistryRoot), ApplicationInfo.RegistryKey);85 LoadFromRegistry(Core.ApplicationInfo.GetRegistryContext); 86 86 end; 87 87 88 88 procedure TCore.DataModuleDestroy(Sender: TObject); 89 89 begin 90 SaveToRegistry( HKEY(ApplicationInfo.RegistryRoot), ApplicationInfo.RegistryKey);90 SaveToRegistry(Core.ApplicationInfo.GetRegistryContext); 91 91 FreeAndNil(Targets); 92 92 FreeAndNil(Project); … … 94 94 end; 95 95 96 procedure TCore.LoadFromRegistry( Root: HKEY; Key: string);96 procedure TCore.LoadFromRegistry(Context: TRegistryContext); 97 97 begin 98 98 with TRegistryEx.Create do 99 99 try 100 RootKey := Root; 101 OpenKey(Key, True); 100 CurrentContext := Context; 102 101 OpenProjectOnStart := ReadBoolWithDefault('OpenProjectOnStart', True); 103 102 if ValueExists('LanguageCode') then … … 113 112 Free; 114 113 end; 115 LastOpenedList.LoadFromRegistry( RegContext(Root,Key + '\' + RecentFilesRegKey));116 Targets.LoadFromRegistry( Root, Key);117 PersistentForm1.RegistryContext := RegContext(Root, Key);114 LastOpenedList.LoadFromRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\' + RecentFilesRegKey)); 115 Targets.LoadFromRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\Compiler')); 116 PersistentForm1.RegistryContext := Context; 118 117 end; 119 118 120 procedure TCore.SaveToRegistry( Root: HKEY; Key: string);119 procedure TCore.SaveToRegistry(Context: TRegistryContext); 121 120 begin 122 Targets.SaveToRegistry( Root, Key);123 LastOpenedList.SaveToRegistry( RegContext(Root,Key + '\' + RecentFilesRegKey));121 Targets.SaveToRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\Compiler')); 122 LastOpenedList.SaveToRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\' + RecentFilesRegKey)); 124 123 with TRegistryEx.Create do 125 124 try 126 RootKey := Root; 127 OpenKey(Key, True); 125 CurrentContext := Context; 128 126 WriteBool('OpenProjectOnStart', OpenProjectOnStart); 129 127 WriteBool('DPIAuto', ScaleDPI1.AutoDetect);
Note:
See TracChangeset
for help on using the changeset viewer.