mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-18 04:49:43 +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';
|
||||
lisFileFiltersSetDefaults = 'Set defaults';
|
||||
lisMenuPkgNewPackageComponent = 'New package component';
|
||||
lisSaveChangedFiles = 'Save changed files?';
|
||||
|
||||
implementation
|
||||
|
||||
|
35
ide/main.pp
35
ide/main.pp
@ -8471,19 +8471,30 @@ begin
|
||||
if Result=mrNoToAll then exit(mrOk);
|
||||
if Result<>mrYes then exit(mrCancel);
|
||||
end
|
||||
else if Project1.SessionStorage=pssNone then
|
||||
// only session data changed and session is not saved => skip
|
||||
exit(mrOk)
|
||||
else if not SomethingOfProjectIsModified then
|
||||
exit(mrOk)
|
||||
else if SourceEditorManager.SomethingModified(false) then
|
||||
begin
|
||||
// some non project files were changes in the source editor
|
||||
Result:=IDEQuestionDialog(lisSaveChangedFiles,lisSaveChangedFiles,
|
||||
mtConfirmation, [mrYes, mrNoToAll, lisNo, mbCancel], '');
|
||||
if Result=mrNoToAll then exit(mrOk);
|
||||
if Result<>mrYes then exit(mrCancel);
|
||||
end
|
||||
else begin
|
||||
// only session data changed and 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);
|
||||
// only session data changed
|
||||
if Project1.SessionStorage=pssNone then
|
||||
// session is not saved => skip
|
||||
exit(mrOk)
|
||||
else if not SomethingOfProjectIsModified then
|
||||
exit(mrOk)
|
||||
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;
|
||||
Result:=DoSaveProject([sfCanAbort]);
|
||||
|
Loading…
Reference in New Issue
Block a user