mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 00:29:28 +02:00
IDE: fixed asking to save non project files
git-svn-id: trunk@35930 -
This commit is contained in:
parent
14360957b4
commit
5e13517a21
@ -5456,6 +5456,7 @@ resourcestring
|
|||||||
lisFileFiltersInsertRow = 'Insert Row';
|
lisFileFiltersInsertRow = 'Insert Row';
|
||||||
lisFileFiltersSetDefaults = 'Set defaults';
|
lisFileFiltersSetDefaults = 'Set defaults';
|
||||||
lisMenuPkgNewPackageComponent = 'New package component';
|
lisMenuPkgNewPackageComponent = 'New package component';
|
||||||
|
lisSaveChangedFiles = 'Save changed files?';
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
35
ide/main.pp
35
ide/main.pp
@ -8471,19 +8471,30 @@ begin
|
|||||||
if Result=mrNoToAll then exit(mrOk);
|
if Result=mrNoToAll then exit(mrOk);
|
||||||
if Result<>mrYes then exit(mrCancel);
|
if Result<>mrYes then exit(mrCancel);
|
||||||
end
|
end
|
||||||
else if Project1.SessionStorage=pssNone then
|
else if SourceEditorManager.SomethingModified(false) then
|
||||||
// only session data changed and session is not saved => skip
|
begin
|
||||||
exit(mrOk)
|
// some non project files were changes in the source editor
|
||||||
else if not SomethingOfProjectIsModified then
|
Result:=IDEQuestionDialog(lisSaveChangedFiles,lisSaveChangedFiles,
|
||||||
exit(mrOk)
|
mtConfirmation, [mrYes, mrNoToAll, lisNo, mbCancel], '');
|
||||||
|
if Result=mrNoToAll then exit(mrOk);
|
||||||
|
if Result<>mrYes then exit(mrCancel);
|
||||||
|
end
|
||||||
else begin
|
else begin
|
||||||
// only session data changed and session is saved separately
|
// only session data changed
|
||||||
if EnvironmentOptions.AskSaveSessionOnly then begin
|
if Project1.SessionStorage=pssNone then
|
||||||
Result:=IDEQuestionDialog(lisProjectSessionChanged,
|
// session is not saved => skip
|
||||||
Format(lisSaveSessionChangesToProject, [Project1.GetTitleOrName]),
|
exit(mrOk)
|
||||||
mtConfirmation, [mrYes, mrNoToAll, lisNo, mbCancel], '');
|
else if not SomethingOfProjectIsModified then
|
||||||
if Result=mrNoToAll then exit(mrOk);
|
exit(mrOk)
|
||||||
if Result<>mrYes then exit(mrCancel);
|
else begin
|
||||||
|
// session is saved separately
|
||||||
|
if EnvironmentOptions.AskSaveSessionOnly then begin
|
||||||
|
Result:=IDEQuestionDialog(lisProjectSessionChanged,
|
||||||
|
Format(lisSaveSessionChangesToProject, [Project1.GetTitleOrName]),
|
||||||
|
mtConfirmation, [mrYes, mrNoToAll, lisNo, mbCancel], '');
|
||||||
|
if Result=mrNoToAll then exit(mrOk);
|
||||||
|
if Result<>mrYes then exit(mrCancel);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
Result:=DoSaveProject([sfCanAbort]);
|
Result:=DoSaveProject([sfCanAbort]);
|
||||||
|
Loading…
Reference in New Issue
Block a user