mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 18:59:43 +02:00
parent
33eb66c116
commit
728880b814
@ -66,6 +66,7 @@ type
|
|||||||
|
|
||||||
TDebugManager = class(TBaseDebugManager)
|
TDebugManager = class(TBaseDebugManager)
|
||||||
procedure DebuggerIdle(Sender: TObject);
|
procedure DebuggerIdle(Sender: TObject);
|
||||||
|
function DoProjectClose(Sender: TObject; AProject: TLazProject): TModalResult;
|
||||||
procedure DoProjectModified(Sender: TObject);
|
procedure DoProjectModified(Sender: TObject);
|
||||||
private
|
private
|
||||||
procedure BreakAutoContinueTimer(Sender: TObject);
|
procedure BreakAutoContinueTimer(Sender: TObject);
|
||||||
@ -708,6 +709,12 @@ begin
|
|||||||
FSnapshots.DoDebuggerIdle;
|
FSnapshots.DoDebuggerIdle;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TDebugManager.DoProjectClose(Sender: TObject; AProject: TLazProject): TModalResult;
|
||||||
|
begin
|
||||||
|
ResetDebugger;
|
||||||
|
Result := mrOK;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TDebugManager.DoProjectModified(Sender: TObject);
|
procedure TDebugManager.DoProjectModified(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if Project1 <> nil then
|
if Project1 <> nil then
|
||||||
@ -1597,6 +1604,8 @@ begin
|
|||||||
FIsInitializingDebugger:= False;
|
FIsInitializingDebugger:= False;
|
||||||
|
|
||||||
inherited Create(TheOwner);
|
inherited Create(TheOwner);
|
||||||
|
|
||||||
|
LazarusIDE.AddHandlerOnProjectClose(@DoProjectClose);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TDebugManager.Destroy;
|
destructor TDebugManager.Destroy;
|
||||||
@ -1605,6 +1614,7 @@ var
|
|||||||
begin
|
begin
|
||||||
FDestroying := true;
|
FDestroying := true;
|
||||||
|
|
||||||
|
LazarusIDE.RemoveHandlerOnProjectClose(@DoProjectClose);
|
||||||
FreeAndNil(FAutoContinueTimer);
|
FreeAndNil(FAutoContinueTimer);
|
||||||
|
|
||||||
for DialogType := Low(TDebugDialogType) to High(TDebugDialogType) do
|
for DialogType := Low(TDebugDialogType) to High(TDebugDialogType) do
|
||||||
|
11
ide/main.pp
11
ide/main.pp
@ -3782,6 +3782,8 @@ begin
|
|||||||
then exit;
|
then exit;
|
||||||
if (DebugBoss.DoStopProject = mrOK) and (ToolStatus = itDebugger) and (rfCloseOnDone in AFlags) then
|
if (DebugBoss.DoStopProject = mrOK) and (ToolStatus = itDebugger) and (rfCloseOnDone in AFlags) then
|
||||||
FWaitForClose := True;
|
FWaitForClose := True;
|
||||||
|
if rfSuccessOnTrigger in AFlags then
|
||||||
|
exit(true);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
Result := ToolStatus = itNone;
|
Result := ToolStatus = itNone;
|
||||||
@ -4143,7 +4145,7 @@ var
|
|||||||
ARecentProject: String;
|
ARecentProject: String;
|
||||||
begin
|
begin
|
||||||
// stop debugging/compiling/...
|
// stop debugging/compiling/...
|
||||||
if not DoResetToolStatus([rfInteractive]) then exit;
|
if not DoResetToolStatus([rfInteractive, rfSuccessOnTrigger]) then exit;
|
||||||
|
|
||||||
// check foreign windows
|
// check foreign windows
|
||||||
if not CloseQueryIDEWindows then exit;
|
if not CloseQueryIDEWindows then exit;
|
||||||
@ -10706,6 +10708,8 @@ begin
|
|||||||
|
|
||||||
// close current project first
|
// close current project first
|
||||||
if Project1<>nil then begin
|
if Project1<>nil then begin
|
||||||
|
if not DoResetToolStatus([rfInteractive, rfSuccessOnTrigger]) then exit;
|
||||||
|
|
||||||
if AskSaveProject(lisDoYouStillWantToCreateTheNewProject,
|
if AskSaveProject(lisDoYouStillWantToCreateTheNewProject,
|
||||||
lisDiscardChangesCreateNewProject)<>mrOK then exit;
|
lisDiscardChangesCreateNewProject)<>mrOK then exit;
|
||||||
|
|
||||||
@ -11000,6 +11004,8 @@ begin
|
|||||||
if ofAddToRecent in Flags then
|
if ofAddToRecent in Flags then
|
||||||
AddRecentProjectFileToEnvironment(AFileName);
|
AddRecentProjectFileToEnvironment(AFileName);
|
||||||
|
|
||||||
|
if not DoResetToolStatus([rfInteractive, rfSuccessOnTrigger]) then exit;
|
||||||
|
|
||||||
// save old project
|
// save old project
|
||||||
if AskSaveProject(lisDoYouStillWantToOpenAnotherProject,
|
if AskSaveProject(lisDoYouStillWantToOpenAnotherProject,
|
||||||
lisDiscardChangesAndOpenProject)<>mrOk then exit;
|
lisDiscardChangesAndOpenProject)<>mrOk then exit;
|
||||||
@ -11241,6 +11247,9 @@ begin
|
|||||||
{$IFDEF IDE_VERBOSE}
|
{$IFDEF IDE_VERBOSE}
|
||||||
writeln('[TMainIDE.DoCreateProjectForProgram] A ',ProgramBuf.Filename);
|
writeln('[TMainIDE.DoCreateProjectForProgram] A ',ProgramBuf.Filename);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
if (Project1 <> nil) and (not DoResetToolStatus([rfInteractive, rfSuccessOnTrigger])) then exit;
|
||||||
|
|
||||||
Result:=DoSaveProjectIfChanged;
|
Result:=DoSaveProjectIfChanged;
|
||||||
if Result=mrAbort then exit;
|
if Result=mrAbort then exit;
|
||||||
|
|
||||||
|
@ -73,7 +73,8 @@ uses
|
|||||||
type
|
type
|
||||||
TResetToolFlag = (
|
TResetToolFlag = (
|
||||||
rfInteractive,
|
rfInteractive,
|
||||||
rfCloseOnDone
|
rfCloseOnDone,
|
||||||
|
rfSuccessOnTrigger
|
||||||
);
|
);
|
||||||
TResetToolFlags = set of TResetToolFlag;
|
TResetToolFlags = set of TResetToolFlag;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user