mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 10:39:20 +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
|
||||
PkgFile:=PackageGraph.FindFileInAllPackages(AnUnitInfo.Filename,true,
|
||||
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;
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
|
@ -3319,8 +3319,7 @@ begin
|
||||
// check if filename is absolute
|
||||
if ActiveUnitInfo.IsVirtual or (not FileExistsUTF8(Filename)) then begin
|
||||
Result:=IDEMessageDialog(lisPkgMangFileNotSaved,
|
||||
lisPkgMangPleaseSaveTheFileBeforeAddingItToAPackage,
|
||||
mtWarning,[mbCancel]);
|
||||
lisPkgMangPleaseSaveTheFileBeforeAddingItToAPackage, mtWarning,[mbCancel]);
|
||||
exit;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user