- Timestamp:
- Apr 1, 2016, 12:04:16 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CoolDisk.lpi
r4 r8 64 64 </local> 65 65 </RunParams> 66 <RequiredPackages Count=" 4">66 <RequiredPackages Count="5"> 67 67 <Item1> 68 <PackageName Value="FCL"/> 69 </Item1> 70 <Item2> 68 71 <PackageName Value="TemplateGenerics"/> 69 72 <DefaultFilename Value="Packages/TemplateGenerics/TemplateGenerics.lpk" Prefer="True"/> 70 </Item 1>71 <Item 2>73 </Item2> 74 <Item3> 72 75 <PackageName Value="Common"/> 73 76 <DefaultFilename Value="Packages/Common/Common.lpk" Prefer="True"/> 74 </Item2>75 <Item3>76 <PackageName Value="tachartlazaruspkg"/>77 77 </Item3> 78 78 <Item4> 79 <PackageName Value="tachartlazaruspkg"/> 80 </Item4> 81 <Item5> 79 82 <PackageName Value="LCL"/> 80 </Item 4>83 </Item5> 81 84 </RequiredPackages> 82 85 <Units Count="8"> -
trunk/UDriveScan.pas
r7 r8 222 222 WriteInteger(Node, 'WritePattern', WritePattern); 223 223 WriteString(Node, 'DriveName', Drive); 224 WriteDateTime(Node, 'TimeStart', TimeStart); 225 WriteDateTime(Node, 'TimeEnd', TimeEnd); 224 226 225 227 NewNode := OwnerDocument.CreateElement('SectorMap'); … … 237 239 WritePattern := ReadInteger(Node, 'WritePattern', 0); 238 240 Drive := ReadString(Node, 'DriveName', ''); 241 TimeStart := ReadDateTime(Node, 'TimeStart', 0); 242 TimeEnd := ReadDateTime(Node, 'TimeEnd', 0); 239 243 240 244 NewNode := FindNode('SectorMap'); -
trunk/UFormMain.lfm
r7 r8 322 322 end 323 323 end 324 object XMLConfig1: TXMLConfig 325 StartEmpty = False 326 RootName = 'CONFIG' 327 ReadOnly = False 328 left = 672 329 top = 160 330 end 324 331 end -
trunk/UFormMain.pas
r7 r8 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 9 Menus, ComCtrls, ExtCtrls, ActnList, dateutils, syncobjs, UProject, 10 UDriveScan, UPrefixMultiplier ;10 UDriveScan, UPrefixMultiplier, XMLConf; 11 11 12 12 type … … 62 62 SaveDialog1: TSaveDialog; 63 63 Timer1: TTimer; 64 XMLConfig1: TXMLConfig; 64 65 procedure ABrowseDiskExecute(Sender: TObject); 65 66 procedure AExitExecute(Sender: TObject); … … 79 80 LastBlockPos: Integer; 80 81 RedrawPending: Boolean; 82 LastProjectFileName: string; 83 procedure ProjectOpen(FileName: string); 81 84 procedure DriveScanChange(Sender: TObject); 82 85 procedure DriveScanTerminate(Sender: TObject); … … 87 90 DriveScan: TDriveScan; 88 91 Project: TProject; 92 procedure SaveConfig; 93 procedure LoadConfig; 89 94 procedure Detect; 90 95 procedure ShowBuffer(Buffer: array of Byte); … … 105 110 procedure TFormMain.FormShow(Sender: TObject); 106 111 begin 112 LoadConfig; 113 if FileExists(LastProjectFileName) then 114 ProjectOpen(LastProjectFileName); 107 115 Redraw; 108 116 UpdateInterface; … … 123 131 DriveScan.OnTerminate := DriveScanTerminate; 124 132 EditDrive.Text := '/dev/sdb'; 133 XMLConfig1.Filename := 'config.xml'; 125 134 end; 126 135 … … 169 178 OpenDialog1.DefaultExt := '.cdp'; 170 179 if OpenDialog1.Execute then begin 171 Project .LoadFromFile(OpenDialog1.FileName);180 ProjectOpen(OpenDialog1.FileName); 172 181 end; 173 182 end; … … 184 193 procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction); 185 194 begin 195 SaveConfig; 186 196 end; 187 197 … … 252 262 end; 253 263 264 procedure TFormMain.SaveConfig; 265 begin 266 XMLConfig1.SetValue('DriveName', EditDrive.Text); 267 XMLConfig1.SetValue('LastProjectFileName', LastProjectFileName); 268 end; 269 270 procedure TFormMain.LoadConfig; 271 begin 272 EditDrive.Text := XMLConfig1.GetValue('DriveName', '/dev/sda'); 273 LastProjectFileName := XMLConfig1.GetValue('LastProjectFileName', ''); 274 end; 275 254 276 procedure TFormMain.Timer1Timer(Sender: TObject); 255 277 begin 256 278 Redraw; 279 end; 280 281 procedure TFormMain.ProjectOpen(FileName: string); 282 begin 283 Project.LoadFromFile(FileName); 284 LastProjectFileName := FileName; 257 285 end; 258 286
Note:
See TracChangeset
for help on using the changeset viewer.