mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-14 21:59:18 +02:00
IDE: disable "Add Active Unit to Package" menu item for virtual files
git-svn-id: trunk@30383 -
This commit is contained in:
parent
6fdeb037a4
commit
3f96385d5a
@ -3972,7 +3972,11 @@ begin
|
|||||||
if Assigned(ASrcEdit) then
|
if Assigned(ASrcEdit) then
|
||||||
PkgFile:=PackageGraph.FindFileInAllPackages(AnUnitInfo.Filename,true,
|
PkgFile:=PackageGraph.FindFileInAllPackages(AnUnitInfo.Filename,true,
|
||||||
not AnUnitInfo.IsPartOfProject);
|
not AnUnitInfo.IsPartOfProject);
|
||||||
MainIDEBar.itmPkgOpenPackageOfCurUnit.Enabled:=Assigned(PkgFile);
|
with MainIDEBar do begin
|
||||||
|
itmPkgOpenPackageOfCurUnit.Enabled:=Assigned(PkgFile);
|
||||||
|
itmPkgAddCurUnitToPkg.Enabled:=
|
||||||
|
(not AnUnitInfo.IsVirtual) and FileExistsUTF8(AnUnitInfo.Filename);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
|
@ -3319,8 +3319,7 @@ begin
|
|||||||
// check if filename is absolute
|
// check if filename is absolute
|
||||||
if ActiveUnitInfo.IsVirtual or (not FileExistsUTF8(Filename)) then begin
|
if ActiveUnitInfo.IsVirtual or (not FileExistsUTF8(Filename)) then begin
|
||||||
Result:=IDEMessageDialog(lisPkgMangFileNotSaved,
|
Result:=IDEMessageDialog(lisPkgMangFileNotSaved,
|
||||||
lisPkgMangPleaseSaveTheFileBeforeAddingItToAPackage,
|
lisPkgMangPleaseSaveTheFileBeforeAddingItToAPackage, mtWarning,[mbCancel]);
|
||||||
mtWarning,[mbCancel]);
|
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user