IDE: close project now asks to save

git-svn-id: trunk@10492 -
This commit is contained in:
mattias 2007-01-22 16:50:11 +00:00
parent 362c28cc65
commit 77c56b461f
2 changed files with 25 additions and 0 deletions

View File

@ -155,6 +155,7 @@ resourcestring
lisKMSaveAs = 'SaveAs';
lisKMSaveAll = 'SaveAll';
lisDiscardChanges = 'Discard changes';
lisDoNotCloseTheProject = 'Do not close the project';
lisDoNotCloseTheIDE = 'Do not close the IDE';
lisMenuSaveAs = 'Save As ...';
lisMenuSaveAll = 'Save All';

View File

@ -3091,7 +3091,31 @@ procedure TMainIDE.mnuCloseProjectClicked(Sender: TObject);
var
DlgResult: TModalResult;
begin
// stop debugging/compiling/...
if not DoResetToolStatus(true) then exit;
// check foreign windows
if not CloseQueryIDEWindows then exit;
// check project
if SomethingOfProjectIsModified then begin
DlgResult:=QuestionDlg(lisProjectChanged,
Format(lisSaveChangesToProject, [Project1.Title]), mtConfirmation,
[mrYes, lisMenuSave, mrNo, lisDiscardChanges,
mrAbort, lisDoNotCloseTheProject],
0);
case DlgResult of
mrYes:
if not (DoSaveProject([]) in [mrOk,mrIgnore]) then exit;
mrCancel, mrAbort:
Exit;
end;
end;
// close
DoCloseProject;
// ask what to do next
while Project1=nil do begin
DlgResult:=QuestionDlg(lisProjectClosed,
Format(lisTheProjectIsClosedThereAreNowThreePossibilitiesHin, [#13]),