Changeset 26 for trunk


Ignore:
Timestamp:
Apr 5, 2016, 11:01:24 PM (9 years ago)
Author:
chronos
Message:
  • Modified: Start button now always adds new scan operation.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Form/UFormMain.pas

    r25 r26  
    261261  LastBlockPos := 0;
    262262  with Core.Project do begin
     263    Core.Project.Scans.Add(TDriveScan.Create);
     264    Core.Project.CurrentScan := TDriveScan(Core.Project.Scans.Last);
    263265    CurrentScan.DriveName := DriveInfo.Path;
    264266    CurrentScan.SectorCount := DriveInfo.SectorCount;
     
    309311  Core.Project.FileName := SNewProject;
    310312  Core.Project.Modified := False;
    311   Core.Project.Scans.Add(TDriveScan.Create);
    312   Core.Project.CurrentScan := TDriveScan(Core.Project.Scans.Last);
    313313
    314314  ComboBoxDrive.ItemIndex := Core.DriveList.IndexOf(Core.DriveList.FindByModel(Core.Project.DriveInfo.Model));
     
    489489begin
    490490  with Core do begin
    491   if Assigned(Project) and Assigned(Project.CurrentScan) then begin
    492     AScanStart.Enabled := Project.CurrentScan.Terminated = True;
    493     AScanStop.Enabled := Project.CurrentScan.Terminated = False;
    494     AScanContinue.Enabled := (Project.CurrentScan.Terminated = True) and
     491  if Assigned(Project) then begin
     492    AScanStart.Enabled := (Assigned(Project.CurrentScan) and (Project.CurrentScan.Terminated = True)) or not Assigned(Project.CurrentScan);
     493    AScanStop.Enabled := Assigned(Project.CurrentScan) and (Project.CurrentScan.Terminated = False);
     494    AScanContinue.Enabled := Assigned(Project.CurrentScan) and (Project.CurrentScan.Terminated = True) and
    495495      (Project.CurrentScan.SectorCurrent > Project.CurrentScan.SectorStart) and
    496496      (Project.CurrentScan.SectorCurrent < Project.CurrentScan.SectorEnd);
Note: See TracChangeset for help on using the changeset viewer.