IDE 'Abort build' menu item should be disabled in the idle state
- Lazarus/FPC Version: Lazarus 2.3.0 (rev main-2_3-949-g02e74c7d81) FPC 3.2.3 x86_64-linux-gtk2
- Operating System: ubuntu
- CPU / Bitness: 64
What happens
Menuitem 'Run / Abort build' must be disabled until we start to compile. It's created here:
ide/mainbase.pas
CreateMenuItem(ParentMI,itmRunMenuAbortBuild,'itmRunMenuAbortBuild',lisMenuAbortBuild,'menu_abort_build');
I found this place where we disable items:
ide/debugmanager.pas
with MainIDEBar do begin
// For 'run' and 'step' bypass 'idle', so we can set the filename later
CanRun:=false;
if (Project1<>nil) and DebuggerIsValid then
CanRun:=( (AnUnitInfo<>nil) and (AnUnitInfo.RunFileIfActive) ) or
( ((Project1.CompilerOptions.ExecutableType=cetProgram) or
((Project1.RunParameterOptions.GetActiveMode<>nil) and (Project1.RunParameterOptions.GetActiveMode.HostApplicationFilename<>'')))
and (pfRunnable in Project1.Flags)
);
// Run
itmRunMenuRun.Enabled := CanRun and (dcRun in AvailCommands);
// Pause
itmRunMenuPause.Enabled := CanRun and ((dcPause in AvailCommands) or FAutoContinueTimer.Enabled);
Here we need to add
itmRunMenuAbortBuild.Enabled := ???
seems right side must be 'not CanRun'?