mirror of https://gitlab.com/basile.b/dexed.git
warning on exit, propose to save content
This commit is contained in:
parent
ace7888242
commit
60bbfad9f6
|
@ -1967,15 +1967,22 @@ begin
|
||||||
MainIcon := TTaskDialogIcon.tdiWarning;
|
MainIcon := TTaskDialogIcon.tdiWarning;
|
||||||
CommonButtons := [];
|
CommonButtons := [];
|
||||||
Text := format(s, [f, p, g]);
|
Text := format(s, [f, p, g]);
|
||||||
|
|
||||||
b := Buttons.Add;
|
b := Buttons.Add;
|
||||||
b.Caption := 'Quit and loose modifications';
|
b.Caption := 'Quit';
|
||||||
b.ModalResult := mrOK;
|
b.ModalResult := mrOK;
|
||||||
|
|
||||||
b := Buttons.Add;
|
b := Buttons.Add;
|
||||||
b.Caption := 'Do not quit for now';
|
b.Caption := 'Save and quit';
|
||||||
|
b.ModalResult := mrAll;
|
||||||
|
|
||||||
|
b := Buttons.Add;
|
||||||
|
b.Caption := 'Do no quit';
|
||||||
b.ModalResult := mrCancel;
|
b.ModalResult := mrCancel;
|
||||||
if Execute(self.WindowHandle) then
|
|
||||||
|
if Execute then
|
||||||
begin
|
begin
|
||||||
if ModalResult <> mrOk then
|
if ModalResult = mrCancel then
|
||||||
begin
|
begin
|
||||||
for i := 0 to fMultidoc.documentCount-1 do
|
for i := 0 to fMultidoc.documentCount-1 do
|
||||||
begin
|
begin
|
||||||
|
@ -1983,6 +1990,19 @@ begin
|
||||||
d.disableFileDateCheck := false;
|
d.disableFileDateCheck := false;
|
||||||
end;
|
end;
|
||||||
exit;
|
exit;
|
||||||
|
end
|
||||||
|
else if ModalResult = mrAll then
|
||||||
|
begin
|
||||||
|
for i := 0 to fMultidoc.documentCount-1 do
|
||||||
|
if fMultidoc.document[i].modified then
|
||||||
|
fMultidoc.document[i].save;
|
||||||
|
if assigned(fProject) and fProject.modified then
|
||||||
|
fProject.saveToFile(fProject.filename);
|
||||||
|
for i := 0 to fProjectGroup.projectCount-1 do
|
||||||
|
if fProjectGroup.projectModified(i) then
|
||||||
|
fProjectGroup.getProject(i).saveToFile(fProjectGroup.getProject(i).filename);
|
||||||
|
if fProjectGroup.groupModified then
|
||||||
|
fProjectGroup.saveGroup(fProjectGroup.groupFilename);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
|
|
Loading…
Reference in New Issue