added auto stop debugging on close

git-svn-id: trunk@4824 -
This commit is contained in:
mattias 2003-11-22 15:47:52 +00:00
parent aeaf1ae674
commit 07ce085aa7

View File

@ -387,6 +387,7 @@ type
protected protected
procedure SetToolStatus(const AValue: TIDEToolStatus); override; procedure SetToolStatus(const AValue: TIDEToolStatus); override;
function DoResetToolStatus(Interactive: boolean): boolean;
procedure ToolButtonClick(Sender: TObject); procedure ToolButtonClick(Sender: TObject);
procedure OnApplyWindowLayout(ALayout: TIDEWindowLayout); procedure OnApplyWindowLayout(ALayout: TIDEWindowLayout);
@ -1018,6 +1019,12 @@ procedure TMainIDE.MainIDEFormCloseQuery(Sender : TObject;
var var
MsgResult: integer; MsgResult: integer;
begin begin
// stop debugging/compiling/...
if not DoResetToolStatus(true) then begin
CanClose:=false;
exit;
end;
// check packages // check packages
if (PkgBoss.DoSaveAllPackages([psfAskBeforeSaving])<>mrOk) if (PkgBoss.DoSaveAllPackages([psfAskBeforeSaving])<>mrOk)
or (PkgBoss.DoCloseAllPackageEditors<>mrOk) then begin or (PkgBoss.DoCloseAllPackageEditors<>mrOk) then begin
@ -2187,6 +2194,24 @@ begin
inherited SetToolStatus(AValue); inherited SetToolStatus(AValue);
end; end;
function TMainIDE.DoResetToolStatus(Interactive: boolean): boolean;
begin
Result:=false;
case ToolStatus of
itDebugger:
begin
if Interactive
and (MessageDlg('Stop Debugging?',
'Stop the debugging?',mtConfirmation,[mbYes,mbCancel],0)<>mrYes)
then exit;
DebugBoss.DoStopProject;
end;
end;
Result:=true;
end;
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------}
@ -10140,6 +10165,9 @@ end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.673 2003/11/22 15:47:52 mattias
added auto stop debugging on close
Revision 1.672 2003/11/22 15:29:20 mattias Revision 1.672 2003/11/22 15:29:20 mattias
added short cmd line params added short cmd line params