mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 12:18:03 +02:00
Packager and IDE: don't ask twice when closing a package.
git-svn-id: trunk@32611 -
This commit is contained in:
parent
fb05dea232
commit
3a2de31121
@ -3646,7 +3646,7 @@ resourcestring
|
||||
lisPkgMangThereIsAlreadyAPackageLoadedFromFile = 'There is already a '
|
||||
+'package %s%s%s loaded%sfrom file %s%s%s.%sSee Components -> Package '
|
||||
+'Graph.%sReplace is impossible.';
|
||||
lisPkgMangSavePackage = 'Save Package?';
|
||||
lisPkgMangSavePackage = 'Save package?';
|
||||
lisPkgMangLoadingPackageWillReplacePackage = 'Loading package %s will '
|
||||
+'replace package %s%sfrom file %s.%sThe old package is modified.%s%sSave '
|
||||
+'old package %s?';
|
||||
@ -3675,7 +3675,6 @@ resourcestring
|
||||
lisPkgMangTheFilenameDoesNotCorrespondToThePackage = 'The filename %s%s%s '
|
||||
+'does not correspond to the package name %s%s%s in the file.%sChange '
|
||||
+'package name to %s%s%s?';
|
||||
lisPkgMangSavePackage2 = 'Save package?';
|
||||
lisPkgMangPackageFileMissing = 'Package file missing';
|
||||
lisPkgMangTheFileOfPackageIsMissing = 'The file %s%s%s%sof package %s is '
|
||||
+'missing.';
|
||||
@ -3988,8 +3987,7 @@ resourcestring
|
||||
lisPckEditViewPackageSource = 'View Package Source';
|
||||
lisPckEditGeneralOptions = 'General Options';
|
||||
lisPckEditSaveChanges = 'Save Changes?';
|
||||
lisPckEditPackageHasChangedSavePackage = 'Package %s%s%s has changed.%sSave '
|
||||
+'package?';
|
||||
lisPckEditPackageHasChangedSavePackage = 'Package %s%s%s has changed.%sSave package?';
|
||||
lisPckEditPage = '%s, Page: %s';
|
||||
lisPckEditRemoveFile2 = 'Remove file?';
|
||||
lisPckEditRemoveFileFromPackage = 'Remove file %s%s%s%sfrom package %s%s%s?';
|
||||
|
@ -1807,8 +1807,7 @@ begin
|
||||
FreeIDEWindows;
|
||||
end;
|
||||
|
||||
procedure TMainIDE.MainIDEFormCloseQuery(Sender: TObject;
|
||||
var CanClose: boolean);
|
||||
procedure TMainIDE.MainIDEFormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||
var
|
||||
MsgResult: integer;
|
||||
const IsClosing: Boolean = False;
|
||||
@ -1826,8 +1825,7 @@ begin
|
||||
if not CloseQueryIDEWindows then exit;
|
||||
|
||||
// check packages
|
||||
if (PkgBoss.DoSaveAllPackages([psfAskBeforeSaving])<>mrOk)
|
||||
or (PkgBoss.DoCloseAllPackageEditors<>mrOk) then exit;
|
||||
if PkgBoss.DoCloseAllPackageEditors<>mrOk then exit;
|
||||
|
||||
// check project
|
||||
if SomethingOfProjectIsModified then begin
|
||||
|
@ -903,14 +903,13 @@ begin
|
||||
or (LazPackage.ReadOnly) or (not LazPackage.Modified) then exit;
|
||||
|
||||
MsgResult:=MessageDlg(lisPckEditSaveChanges,
|
||||
Format(lisPckEditPackageHasChangedSavePackage, ['"', LazPackage.IDAsString,
|
||||
'"', #13]),
|
||||
Format(lisPckEditPackageHasChangedSavePackage,['"',LazPackage.IDAsString,'"',#13]),
|
||||
mtConfirmation,[mbYes,mbNo,mbAbort],0);
|
||||
case MsgResult of
|
||||
mrYes:
|
||||
MsgResult:=PackageEditors.SavePackage(LazPackage,false);
|
||||
mrNo:
|
||||
LazPackage.UserIgnoreChangeStamp:=LazPackage.UserIgnoreChangeStamp;
|
||||
LazPackage.UserIgnoreChangeStamp:=LazPackage.ChangeStamp;
|
||||
end;
|
||||
if MsgResult=mrAbort then CanClose:=false;
|
||||
end;
|
||||
|
@ -2282,19 +2282,18 @@ begin
|
||||
|
||||
if APackage.IsVirtual then Include(Flags,psfSaveAs);
|
||||
|
||||
// check if package needs saving
|
||||
if (not (psfSaveAs in Flags))
|
||||
and (not APackage.ReadOnly) and (not APackage.Modified)
|
||||
and FileExistsCached(APackage.Filename) then begin
|
||||
if not ( (psfSaveAs in Flags) or APackage.ReadOnly or APackage.Modified
|
||||
or FileExistsCached(APackage.Filename)
|
||||
or (APackage.UserIgnoreChangeStamp<>APackage.ChangeStamp )) then
|
||||
begin
|
||||
Result:=mrOk;
|
||||
exit;
|
||||
end;
|
||||
|
||||
// ask user if package should be saved
|
||||
if psfAskBeforeSaving in Flags then begin
|
||||
Result:=IDEMessageDialog(lisPkgMangSavePackage2,
|
||||
Format(lisPkgMangPackageChangedSave, ['"', APackage.IDAsString,
|
||||
'"']),
|
||||
Result:=IDEMessageDialog(lisPkgMangSavePackage,
|
||||
Format(lisPkgMangPackageChangedSave, ['"',APackage.IDAsString,'"']),
|
||||
mtConfirmation,[mbYes,mbNo,mbAbort]);
|
||||
if (Result=mrNo) then Result:=mrIgnore;
|
||||
if Result<>mrYes then exit;
|
||||
|
Loading…
Reference in New Issue
Block a user