Skip to content
GitLab Next
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Lazarus Lazarus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 2,095
    • Issues 2,095
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 8
    • Merge requests 8
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • FPC
  • Lazarus
  • LazarusLazarus
  • Issues
  • #39585
Closed
Open
Created Jan 22, 2022 by Alexey Torgashin@Alexey-T1Contributor

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'?

Edited Jan 22, 2022 by Alexey Torgashin
Assignee
Assign to
Time tracking