- Timestamp:
- Dec 10, 2016, 10:00:19 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CoolDisk.lpi
r33 r34 89 89 </Item6> 90 90 </RequiredPackages> 91 <Units Count="1 3">91 <Units Count="14"> 92 92 <Unit0> 93 93 <Filename Value="CoolDisk.lpr"/> … … 135 135 <Filename Value="Forms/UFormBenchmark.pas"/> 136 136 <IsPartOfProject Value="True"/> 137 <HasResources Value="True"/> 137 <ComponentName Value="FormBenchmark"/> 138 <HasResources Value="True"/> 139 <ResourceBaseClass Value="Form"/> 138 140 </Unit9> 139 141 <Unit10> … … 147 149 <Filename Value="Forms/UFormOperation.pas"/> 148 150 <IsPartOfProject Value="True"/> 149 <HasResources Value="True"/> 151 <ComponentName Value="FormOperation"/> 152 <HasResources Value="True"/> 153 <ResourceBaseClass Value="Form"/> 150 154 </Unit11> 151 155 <Unit12> 152 156 <Filename Value="Forms/UFormProject.pas"/> 153 157 <IsPartOfProject Value="True"/> 154 <HasResources Value="True"/> 158 <ComponentName Value="FormProject"/> 159 <HasResources Value="True"/> 160 <ResourceBaseClass Value="Form"/> 155 161 </Unit12> 162 <Unit13> 163 <Filename Value="Forms/UFormSettings.pas"/> 164 <IsPartOfProject Value="True"/> 165 <ComponentName Value="FormSettings"/> 166 <HasResources Value="True"/> 167 <ResourceBaseClass Value="Form"/> 168 </Unit13> 156 169 </Units> 157 170 </ProjectOptions> … … 182 195 <StackChecks Value="True"/> 183 196 </Checks> 184 <VerifyObjMethodCallValidity Value="True"/>185 197 </CodeGeneration> 186 198 <Linking> -
trunk/CoolDisk.lpr
r33 r34 9 9 Interfaces, // this includes the LCL widgetset 10 10 Forms, tachartlazaruspkg, UProject, 11 UConfig, UBlockMap, UDriveScan, Common, TemplateGenerics, 12 UPhysDrive, UCore, UFileStreamEx, CoolTranslator, UFormMain; 11 UConfig, UBlockMap, UDriveScan, Common, TemplateGenerics, UFormProject, 12 UPhysDrive, UCore, UFileStreamEx, CoolTranslator, UFormMain, UFormBenchmark, 13 UFormOperation; 13 14 14 15 {$R *.res} … … 19 20 Application.CreateForm(TCore, Core); 20 21 Application.CreateForm(TFormMain, FormMain); 22 Application.CreateForm(TFormProject, FormProject); 23 Application.CreateForm(TFormOperation, FormOperation); 24 Application.CreateForm(TFormBenchmark, FormBenchmark); 21 25 Application.Run; 22 26 end. -
trunk/Forms/UFormMain.lfm
r33 r34 19 19 Top = 0 20 20 Width = 1703 21 Caption = 'ToolBar1'22 21 Images = Core.ImageList1 23 22 TabOrder = 0 … … 482 481 OnExecute = AShowAboutExecute 483 482 end 483 object AShowSettings: TAction 484 Caption = 'Settings' 485 OnExecute = AShowSettingsExecute 486 end 484 487 end 485 488 object OpenDialog1: TOpenDialog … … 549 552 end 550 553 end 554 object MenuItem22: TMenuItem 555 Caption = 'Tools' 556 object MenuItem23: TMenuItem 557 Action = AShowSettings 558 end 559 end 551 560 object MenuItem20: TMenuItem 552 561 Caption = 'Help' -
trunk/Forms/UFormMain.lrt
r33 r34 1 1 TFORMMAIN.CAPTION=CoolDisk 2 TFORMMAIN.TOOLBAR1.CAPTION=ToolBar13 2 TFORMMAIN.LABEL1.CAPTION=Sector size: 4 3 TFORMMAIN.LABELSECTORSIZE.CAPTION= … … 43 42 TFORMMAIN.AOPERATIONADD.CAPTION=Add 44 43 TFORMMAIN.ASHOWABOUT.CAPTION=About 44 TFORMMAIN.ASHOWSETTINGS.CAPTION=Settings 45 45 TFORMMAIN.MENUITEM1.CAPTION=File 46 46 TFORMMAIN.MENUITEMOPENRECENT.CAPTION=Open recent … … 49 49 TFORMMAIN.MENUITEM14.CAPTION=- 50 50 TFORMMAIN.MENUITEM16.CAPTION=View 51 TFORMMAIN.MENUITEM22.CAPTION=Tools 51 52 TFORMMAIN.MENUITEM20.CAPTION=Help -
trunk/Forms/UFormMain.pas
r33 r34 15 15 16 16 TFormMain = class(TForm) 17 AShowSettings: TAction; 17 18 AShowAbout: TAction; 18 19 AOperationAdd: TAction; … … 80 81 MenuItem20: TMenuItem; 81 82 MenuItem21: TMenuItem; 83 MenuItem22: TMenuItem; 84 MenuItem23: TMenuItem; 82 85 MenuItemOpenRecent: TMenuItem; 83 86 MenuItem2: TMenuItem; … … 119 122 procedure AScanStopExecute(Sender: TObject); 120 123 procedure AShowAboutExecute(Sender: TObject); 124 procedure AShowSettingsExecute(Sender: TObject); 121 125 procedure AViewToolbarExecute(Sender: TObject); 122 126 procedure ComboBoxDriveChange(Sender: TObject); … … 162 166 163 167 uses 164 UCore, UFormProject, UFormOperation, UFormAbout ;168 UCore, UFormProject, UFormOperation, UFormAbout, UFormSettings; 165 169 166 170 resourcestring … … 180 184 Detect; 181 185 LoadConfig; 186 Core.LoadConfig; 182 187 Core.PersistentForm1.Load(Self); 183 188 if (LastOpenedList1.Items.Count > 0) and FileExists(LastOpenedList1.Items[0]) then … … 234 239 235 240 procedure TFormMain.AShowAboutExecute(Sender: TObject); 236 var237 FormAbout: TFormAbout;238 241 begin 239 242 FormAbout := TFormAbout.Create(nil); … … 243 246 finally 244 247 FreeAndNil(FormAbout); 248 end; 249 end; 250 251 procedure TFormMain.AShowSettingsExecute(Sender: TObject); 252 begin 253 FormSettings := TFormSettings.Create(nil); 254 try 255 FormSettings.Load; 256 if FormSettings.ShowModal = mrOK then 257 FormSettings.Save; 258 finally 259 FreeAndNil(FormSettings); 245 260 end; 246 261 end; … … 417 432 AFileClose.Execute; 418 433 SaveConfig; 434 Core.SaveConfig; 419 435 Core.PersistentForm1.Save(Self); 420 436 end; -
trunk/UCore.lfm
r33 r34 47 47 top = 56 48 48 end 49 object ScaleDPI1: TScaleDPI 50 AutoDetect = False 51 left = 88 52 top = 200 53 end 49 54 end -
trunk/UCore.pas
r33 r34 7 7 uses 8 8 Classes, SysUtils, XMLConf, FileUtil, Controls, UProject, UPhysDrive, 9 UCoolTranslator, UPersistentForm, UApplicationInfo ;9 UCoolTranslator, UPersistentForm, UApplicationInfo, URegistry, UScaleDPI; 10 10 11 11 type … … 18 18 ImageList1: TImageList; 19 19 PersistentForm1: TPersistentForm; 20 ScaleDPI1: TScaleDPI; 20 21 XMLConfig1: TXMLConfig; 21 22 procedure DataModuleCreate(Sender: TObject); 22 23 procedure DataModuleDestroy(Sender: TObject); 23 24 private 24 { private declarations }25 RegistryContext: TRegistryContext; 25 26 public 27 DevelMode: Boolean; 26 28 DriveList: TDriveList; 27 29 Project: TProject; 30 procedure LoadConfig; 31 procedure SaveConfig; 28 32 end; 29 33 … … 51 55 end; 52 56 57 procedure TCore.LoadConfig; 58 begin 59 RegistryContext := RegContext(Integer(ApplicationInfo1.RegistryRoot), ApplicationInfo1.RegistryKey); 60 PersistentForm1.RegistryContext := RegistryContext; 61 XMLConfig1.Filename := GetAppConfigDir(False) + 'Config.xml'; 62 63 CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(XMLConfig1.GetValue('Language', '')); 64 end; 65 66 procedure TCore.SaveConfig; 67 begin 68 XMLConfig1.SetValue('Language', CoolTranslator1.Language.Code); 69 end; 70 53 71 end. 54 72
Note:
See TracChangeset
for help on using the changeset viewer.