mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 10:40:20 +02:00
IDE: close project now asks to save
git-svn-id: trunk@10492 -
This commit is contained in:
parent
362c28cc65
commit
77c56b461f
@ -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';
|
||||
|
24
ide/main.pp
24
ide/main.pp
@ -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]),
|
||||
|
Loading…
Reference in New Issue
Block a user