Skip to content

Commit

Permalink
fixed: #2965
Browse files Browse the repository at this point in the history
  • Loading branch information
eranif committed Mar 9, 2022
1 parent 86ce147 commit 903a1ab
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions LiteEditor/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2749,20 +2749,22 @@ void clMainFrame::OnExecuteNoDebug(wxCommandEvent& event)

// Prepare the commands to execute
QueueCommand commandExecute(QueueCommand::kExecuteNoDebug);
wxStandardID res =
::PromptForYesNoDialogWithCheckbox(_("Would you like to build the active project\nbefore executing it?"),
"PromptForBuildBeforeExecute", _("Build and Execute"), _("Execute"));
// Don't do anything if "X" is pressed
if(res != wxID_CANCEL) {
if(res == wxID_YES) {
QueueCommand buildCommand(QueueCommand::kBuild);
ManagerST::Get()->PushQueueCommand(buildCommand);
commandExecute.SetCheckBuildSuccess(true); // execute only if build was successfull
}
wxStandardID res = ::PromptForYesNoCancelDialogWithCheckbox(
_("Would you like to build the active project\nbefore executing it?"), "PromptForBuildBeforeExecute",
_("Build and Execute"), _("Execute"), _("Cancel"));
if(res == wxID_CANCEL) {
return;
}

ManagerST::Get()->PushQueueCommand(commandExecute);
ManagerST::Get()->ProcessCommandQueue();
// If "YES" is selected, push a build request to the queue
if(res == wxID_YES) {
QueueCommand buildCommand(QueueCommand::kBuild);
ManagerST::Get()->PushQueueCommand(buildCommand);
commandExecute.SetCheckBuildSuccess(true); // execute only if build was successfull
}

ManagerST::Get()->PushQueueCommand(commandExecute);
ManagerST::Get()->ProcessCommandQueue();
}

void clMainFrame::OnExecuteNoDebugUI(wxUpdateUIEvent& event)
Expand Down

0 comments on commit 903a1ab

Please sign in to comment.