mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 11:19:23 +02:00
IDE: added dialog to explore the current package links
git-svn-id: trunk@12811 -
This commit is contained in:
parent
5b8a949fe8
commit
12a7912211
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -3225,6 +3225,9 @@ packager/pkgfileslcl.inc svneol=native#text/plain
|
|||||||
packager/pkggraphexplorer.lfm svneol=native#text/plain
|
packager/pkggraphexplorer.lfm svneol=native#text/plain
|
||||||
packager/pkggraphexplorer.lrs svneol=native#text/plain
|
packager/pkggraphexplorer.lrs svneol=native#text/plain
|
||||||
packager/pkggraphexplorer.pas svneol=native#text/pascal
|
packager/pkggraphexplorer.pas svneol=native#text/pascal
|
||||||
|
packager/pkglinksdlg.lfm svneol=native#text/plain
|
||||||
|
packager/pkglinksdlg.lrs svneol=native#text/plain
|
||||||
|
packager/pkglinksdlg.pas svneol=native#text/plain
|
||||||
packager/pkgmanager.pas svneol=native#text/pascal
|
packager/pkgmanager.pas svneol=native#text/pascal
|
||||||
packager/pkgoptionsdlg.lfm svneol=native#text/plain
|
packager/pkgoptionsdlg.lfm svneol=native#text/plain
|
||||||
packager/pkgoptionsdlg.lrs svneol=native#text/plain
|
packager/pkgoptionsdlg.lrs svneol=native#text/plain
|
||||||
|
@ -779,7 +779,6 @@ begin
|
|||||||
repeat
|
repeat
|
||||||
if (FileInfo.Name='.') or (FileInfo.Name='..') or (FileInfo.Name='')
|
if (FileInfo.Name='.') or (FileInfo.Name='..') or (FileInfo.Name='')
|
||||||
or ((FileInfo.Attr and faDirectory)<>0) then continue;
|
or ((FileInfo.Attr and faDirectory)<>0) then continue;
|
||||||
DebugLn(['TBuildManager.CheckUnitPathForAmbiguousPascalFiles AAA1 ',CurDir+FileInfo.Name]);
|
|
||||||
if FilenameIsPascalUnit(FileInfo.Name) then
|
if FilenameIsPascalUnit(FileInfo.Name) then
|
||||||
CurUnitTree:=SourceUnitTree
|
CurUnitTree:=SourceUnitTree
|
||||||
else if (CompareFileExt(FileInfo.Name,CompiledExt,false)=0) then
|
else if (CompareFileExt(FileInfo.Name,CompiledExt,false)=0) then
|
||||||
@ -790,7 +789,7 @@ begin
|
|||||||
if (CurUnitName='') or (not IsValidIdent(CurUnitName)) then
|
if (CurUnitName='') or (not IsValidIdent(CurUnitName)) then
|
||||||
continue;
|
continue;
|
||||||
CurFilename:=CurDir+FileInfo.Name;
|
CurFilename:=CurDir+FileInfo.Name;
|
||||||
DebugLn(['TBuildManager.CheckUnitPathForAmbiguousPascalFiles ',CurUnitName,' ',CurFilename]);
|
//DebugLn(['TBuildManager.CheckUnitPathForAmbiguousPascalFiles ',CurUnitName,' ',CurFilename]);
|
||||||
// check if unit already found
|
// check if unit already found
|
||||||
ANode:=CurUnitTree.FindKey(PChar(CurUnitName),
|
ANode:=CurUnitTree.FindKey(PChar(CurUnitName),
|
||||||
TListSortCompare(@CompareUnitNameAndUnitFile));
|
TListSortCompare(@CompareUnitNameAndUnitFile));
|
||||||
|
@ -161,6 +161,9 @@ resourcestring
|
|||||||
lisMenuSaveAs = 'Save As ...';
|
lisMenuSaveAs = 'Save As ...';
|
||||||
lisMenuSaveAll = 'Save All';
|
lisMenuSaveAll = 'Save All';
|
||||||
lisMenuClose = 'Close';
|
lisMenuClose = 'Close';
|
||||||
|
lisPLDOnlyExistingFiles = 'Only existing files';
|
||||||
|
lisPLDShowGlobalLinks = 'Show global links';
|
||||||
|
lisPLDShowUserLinks = 'Show user links';
|
||||||
lisKMCloseAll = 'Close All';
|
lisKMCloseAll = 'Close All';
|
||||||
lisCTDefDefineTemplates = 'Define templates';
|
lisCTDefDefineTemplates = 'Define templates';
|
||||||
lisMenuCloseAll = 'Close all editor files';
|
lisMenuCloseAll = 'Close all editor files';
|
||||||
@ -274,6 +277,8 @@ resourcestring
|
|||||||
lisMenuViewLocalVariables = 'Local Variables';
|
lisMenuViewLocalVariables = 'Local Variables';
|
||||||
lisMenuViewCallStack = 'Call Stack';
|
lisMenuViewCallStack = 'Call Stack';
|
||||||
lisMenuViewDebugOutput = 'Debug output';
|
lisMenuViewDebugOutput = 'Debug output';
|
||||||
|
lisMenuIDEInternals = 'IDE internals';
|
||||||
|
lisMenuPackageLinks = 'Package links ...';
|
||||||
|
|
||||||
lisMenuNewProject = 'New Project ...';
|
lisMenuNewProject = 'New Project ...';
|
||||||
lisMenuNewProjectFromFile = 'New Project from file ...';
|
lisMenuNewProjectFromFile = 'New Project from file ...';
|
||||||
@ -1379,6 +1384,7 @@ resourcestring
|
|||||||
dlgPromptOnReplace = 'Prompt On Replace';
|
dlgPromptOnReplace = 'Prompt On Replace';
|
||||||
lisAskBeforeReplacingEachFoundText = 'Ask before replacing each found text';
|
lisAskBeforeReplacingEachFoundText = 'Ask before replacing each found text';
|
||||||
dlgSROrigin = 'Origin';
|
dlgSROrigin = 'Origin';
|
||||||
|
lisPLDExists = 'Exists';
|
||||||
dlgFromCursor = 'From Cursor';
|
dlgFromCursor = 'From Cursor';
|
||||||
dlgEntireScope = 'Entire Scope';
|
dlgEntireScope = 'Entire Scope';
|
||||||
dlgScope = 'Scope';
|
dlgScope = 'Scope';
|
||||||
@ -1412,6 +1418,7 @@ resourcestring
|
|||||||
lisFRIinAllOpenPackagesAndProjects = 'in all open packages and projects';
|
lisFRIinAllOpenPackagesAndProjects = 'in all open packages and projects';
|
||||||
lisFRIRenameAllReferences = 'Rename all References';
|
lisFRIRenameAllReferences = 'Rename all References';
|
||||||
dlgGlobal = 'Global';
|
dlgGlobal = 'Global';
|
||||||
|
lisPLDUser = 'User';
|
||||||
dlgSelectedText = 'Selected Text';
|
dlgSelectedText = 'Selected Text';
|
||||||
dlgDirection = 'Direction';
|
dlgDirection = 'Direction';
|
||||||
lisFRForwardSearch = 'Forward search';
|
lisFRForwardSearch = 'Forward search';
|
||||||
@ -3447,6 +3454,7 @@ resourcestring
|
|||||||
lisAutomaticallyOnAddSymbol = 'symbol';
|
lisAutomaticallyOnAddSymbol = 'symbol';
|
||||||
lisPckOptsThisPackageProvidesTheSameAsTheFollowingPackages = 'This package '
|
lisPckOptsThisPackageProvidesTheSameAsTheFollowingPackages = 'This package '
|
||||||
+'provides the same as the following packages:';
|
+'provides the same as the following packages:';
|
||||||
|
lisPLDPackageLinks = 'Package Links';
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
@ -198,6 +198,8 @@ type
|
|||||||
itmViewLocals: TIDEMenuCommand;
|
itmViewLocals: TIDEMenuCommand;
|
||||||
itmViewCallStack: TIDEMenuCommand;
|
itmViewCallStack: TIDEMenuCommand;
|
||||||
itmViewDebugOutput: TIDEMenuCommand;
|
itmViewDebugOutput: TIDEMenuCommand;
|
||||||
|
//itmViewIDEInternalsWindows: TIDEMenuSection;
|
||||||
|
itmViewPackageLinks: TIDEMenuCommand;
|
||||||
|
|
||||||
// project menu
|
// project menu
|
||||||
//mnuProject: TIDEMenuSection;
|
//mnuProject: TIDEMenuSection;
|
||||||
|
@ -535,6 +535,10 @@ begin
|
|||||||
CreateMenuItem(itmViewDebugWindows,itmViewCallStack,'itmViewCallStack',lisMenuViewCallStack,'debugger_call_stack');
|
CreateMenuItem(itmViewDebugWindows,itmViewCallStack,'itmViewCallStack',lisMenuViewCallStack,'debugger_call_stack');
|
||||||
CreateMenuItem(itmViewDebugWindows,itmViewDebugOutput,'itmViewDebugOutput',lisMenuViewDebugOutput,'debugger_output');
|
CreateMenuItem(itmViewDebugWindows,itmViewDebugOutput,'itmViewDebugOutput',lisMenuViewDebugOutput,'debugger_output');
|
||||||
end;
|
end;
|
||||||
|
CreateMenuSubSection(ParentMI, itmViewIDEInternalsWindows, 'itmViewIDEInternalsWindows', lisMenuIDEInternals, '');
|
||||||
|
begin
|
||||||
|
CreateMenuItem(itmViewIDEInternalsWindows, itmViewPackageLinks, 'itmViewPackageLinks', lisMenuPackageLinks, '');
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -865,6 +869,7 @@ begin
|
|||||||
itmViewAnchorEditor.Command:=GetCommand(ecViewAnchorEditor);
|
itmViewAnchorEditor.Command:=GetCommand(ecViewAnchorEditor);
|
||||||
itmViewComponentPalette.Command:=GetCommand(ecToggleCompPalette);
|
itmViewComponentPalette.Command:=GetCommand(ecToggleCompPalette);
|
||||||
itmViewIDESpeedButtons.Command:=GetCommand(ecToggleIDESpeedBtns);
|
itmViewIDESpeedButtons.Command:=GetCommand(ecToggleIDESpeedBtns);
|
||||||
|
//itmViewPackageLinks.Command:=GetCommand(ec?);
|
||||||
|
|
||||||
// project menu
|
// project menu
|
||||||
itmProjectNew.Command:=GetCommand(ecNewProject);
|
itmProjectNew.Command:=GetCommand(ecNewProject);
|
||||||
|
@ -309,6 +309,7 @@ var
|
|||||||
itmViewUnitWindows: TIDEMenuSection;
|
itmViewUnitWindows: TIDEMenuSection;
|
||||||
itmViewSecondaryWindows: TIDEMenuSection;
|
itmViewSecondaryWindows: TIDEMenuSection;
|
||||||
itmViewDebugWindows: TIDEMenuSection;
|
itmViewDebugWindows: TIDEMenuSection;
|
||||||
|
itmViewIDEInternalsWindows: TIDEMenuSection;
|
||||||
|
|
||||||
// project menu
|
// project menu
|
||||||
mnuProject: TIDEMenuSection;
|
mnuProject: TIDEMenuSection;
|
||||||
|
@ -66,7 +66,11 @@ type
|
|||||||
ploUser
|
ploUser
|
||||||
);
|
);
|
||||||
TPkgLinkOrigins = set of TPkgLinkOrigin;
|
TPkgLinkOrigins = set of TPkgLinkOrigin;
|
||||||
|
|
||||||
|
const
|
||||||
|
AllPkgLinkOrigins = [low(TPkgLinkOrigin)..high(TPkgLinkOrigin)];
|
||||||
|
|
||||||
|
type
|
||||||
TPackageLink = class(TLazPackageID)
|
TPackageLink = class(TLazPackageID)
|
||||||
private
|
private
|
||||||
FAutoCheckExists: boolean;
|
FAutoCheckExists: boolean;
|
||||||
@ -147,7 +151,8 @@ type
|
|||||||
function FindLinkWithPkgName(const PkgName: string): TPackageLink;
|
function FindLinkWithPkgName(const PkgName: string): TPackageLink;
|
||||||
function FindLinkWithDependency(Dependency: TPkgDependency): TPackageLink;
|
function FindLinkWithDependency(Dependency: TPkgDependency): TPackageLink;
|
||||||
function FindLinkWithPackageID(APackageID: TLazPackageID): TPackageLink;
|
function FindLinkWithPackageID(APackageID: TLazPackageID): TPackageLink;
|
||||||
procedure IteratePackages(MustExist: boolean; Event: TIteratePackagesEvent);
|
procedure IteratePackages(MustExist: boolean; Event: TIteratePackagesEvent;
|
||||||
|
Origins: TPkgLinkOrigins = AllPkgLinkOrigins);
|
||||||
function AddUserLink(APackage: TLazPackage): TPackageLink;
|
function AddUserLink(APackage: TLazPackage): TPackageLink;
|
||||||
function AddUserLink(const PkgFilename, PkgName: string): TPackageLink;
|
function AddUserLink(const PkgFilename, PkgName: string): TPackageLink;
|
||||||
procedure RemoveLink(APackageID: TLazPackageID; FreeID: boolean);
|
procedure RemoveLink(APackageID: TLazPackageID; FreeID: boolean);
|
||||||
@ -159,7 +164,9 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
PkgLinks: TPackageLinks; // set by the PkgBoss
|
PkgLinks: TPackageLinks = nil; // set by the PkgBoss
|
||||||
|
|
||||||
|
function ComparePackageLinks(Data1, Data2: Pointer): integer;
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -735,10 +742,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPackageLinks.IteratePackages(MustExist: boolean;
|
procedure TPackageLinks.IteratePackages(MustExist: boolean;
|
||||||
Event: TIteratePackagesEvent);
|
Event: TIteratePackagesEvent; Origins: TPkgLinkOrigins);
|
||||||
begin
|
begin
|
||||||
IteratePackagesInTree(MustExist,FUserLinksSortID,Event);
|
if ploUser in Origins then
|
||||||
IteratePackagesInTree(MustExist,FGlobalLinks,Event);
|
IteratePackagesInTree(MustExist,FUserLinksSortID,Event);
|
||||||
|
if ploGlobal in Origins then
|
||||||
|
IteratePackagesInTree(MustExist,FGlobalLinks,Event);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPackageLinks.AddUserLink(APackage: TLazPackage): TPackageLink;
|
function TPackageLinks.AddUserLink(APackage: TLazPackage): TPackageLink;
|
||||||
|
93
packager/pkglinksdlg.lfm
Normal file
93
packager/pkglinksdlg.lfm
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
object PackageLinksDialog: TPackageLinksDialog
|
||||||
|
Left = 290
|
||||||
|
Height = 451
|
||||||
|
Top = 189
|
||||||
|
Width = 659
|
||||||
|
HorzScrollBar.Page = 658
|
||||||
|
VertScrollBar.Page = 450
|
||||||
|
Caption = 'PackageLinksDialog'
|
||||||
|
ClientHeight = 451
|
||||||
|
ClientWidth = 659
|
||||||
|
OnCreate = FormCreate
|
||||||
|
object CloseBitBtn: TBitBtn
|
||||||
|
AnchorSideRight.Control = Owner
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
AnchorSideBottom.Control = Owner
|
||||||
|
AnchorSideBottom.Side = asrBottom
|
||||||
|
Left = 579
|
||||||
|
Height = 36
|
||||||
|
Top = 409
|
||||||
|
Width = 74
|
||||||
|
Anchors = [akRight, akBottom]
|
||||||
|
AutoSize = True
|
||||||
|
BorderSpacing.Around = 6
|
||||||
|
Caption = '&Close'
|
||||||
|
Kind = bkClose
|
||||||
|
ModalResult = 1
|
||||||
|
NumGlyphs = 0
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object ScopeGroupBox: TGroupBox
|
||||||
|
Height = 53
|
||||||
|
Width = 659
|
||||||
|
Align = alTop
|
||||||
|
AutoSize = True
|
||||||
|
Caption = 'ScopeGroupBox'
|
||||||
|
ChildSizing.LeftRightSpacing = 6
|
||||||
|
ChildSizing.TopBottomSpacing = 6
|
||||||
|
ChildSizing.HorizontalSpacing = 6
|
||||||
|
ChildSizing.VerticalSpacing = 6
|
||||||
|
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||||
|
ChildSizing.ControlsPerLine = 3
|
||||||
|
ClientHeight = 34
|
||||||
|
ClientWidth = 655
|
||||||
|
TabOrder = 1
|
||||||
|
object FileMustExistCheckBox: TCheckBox
|
||||||
|
Left = 6
|
||||||
|
Height = 22
|
||||||
|
Top = 6
|
||||||
|
Width = 168
|
||||||
|
Caption = 'FileMustExistCheckBox'
|
||||||
|
OnChange = FileMustExistCheckBoxChange
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object ShowGlobalLinksCheckBox: TCheckBox
|
||||||
|
Left = 180
|
||||||
|
Height = 22
|
||||||
|
Top = 6
|
||||||
|
Width = 193
|
||||||
|
Caption = 'ShowGlobalLinksCheckBox'
|
||||||
|
Checked = True
|
||||||
|
OnChange = ShowGlobalLinksCheckBoxChange
|
||||||
|
State = cbChecked
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object ShowUserLinksCheckBox: TCheckBox
|
||||||
|
Left = 379
|
||||||
|
Height = 22
|
||||||
|
Top = 6
|
||||||
|
Width = 183
|
||||||
|
Caption = 'ShowUserLinksCheckBox'
|
||||||
|
Checked = True
|
||||||
|
OnChange = ShowUserLinksCheckBoxChange
|
||||||
|
State = cbChecked
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object PkgStringGrid: TStringGrid
|
||||||
|
AnchorSideBottom.Control = CloseBitBtn
|
||||||
|
Height = 350
|
||||||
|
Top = 53
|
||||||
|
Width = 659
|
||||||
|
Align = alTop
|
||||||
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
|
ColCount = 4
|
||||||
|
FixedColor = clBtnFace
|
||||||
|
FixedCols = 0
|
||||||
|
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goColSizing, goTabs, goColSpanning, goDblClickAutoSize, goSmoothScroll]
|
||||||
|
RowCount = 5
|
||||||
|
ScrollBars = ssAutoBoth
|
||||||
|
TabOrder = 2
|
||||||
|
TabStop = True
|
||||||
|
end
|
||||||
|
end
|
36
packager/pkglinksdlg.lrs
Normal file
36
packager/pkglinksdlg.lrs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{ This is an automatically generated lazarus resource file }
|
||||||
|
|
||||||
|
LazarusResources.Add('TPackageLinksDialog','FORMDATA',[
|
||||||
|
'TPF0'#19'TPackageLinksDialog'#18'PackageLinksDialog'#4'Left'#3'"'#1#6'Height'
|
||||||
|
+#3#195#1#3'Top'#3#189#0#5'Width'#3#147#2#18'HorzScrollBar.Page'#3#146#2#18'V'
|
||||||
|
+'ertScrollBar.Page'#3#194#1#7'Caption'#6#18'PackageLinksDialog'#12'ClientHei'
|
||||||
|
+'ght'#3#195#1#11'ClientWidth'#3#147#2#8'OnCreate'#7#10'FormCreate'#0#7'TBitB'
|
||||||
|
+'tn'#11'CloseBitBtn'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRig'
|
||||||
|
+'ht.Side'#7#9'asrBottom'#24'AnchorSideBottom.Control'#7#5'Owner'#21'AnchorSi'
|
||||||
|
+'deBottom.Side'#7#9'asrBottom'#4'Left'#3'C'#2#6'Height'#2'$'#3'Top'#3#153#1#5
|
||||||
|
+'Width'#2'J'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderS'
|
||||||
|
+'pacing.Around'#2#6#7'Caption'#6#6'&Close'#4'Kind'#7#7'bkClose'#11'ModalResu'
|
||||||
|
+'lt'#2#1#9'NumGlyphs'#2#0#8'TabOrder'#2#0#0#0#9'TGroupBox'#13'ScopeGroupBox'
|
||||||
|
+#6'Height'#2'5'#5'Width'#3#147#2#5'Align'#7#5'alTop'#8'AutoSize'#9#7'Caption'
|
||||||
|
+#6#13'ScopeGroupBox'#28'ChildSizing.LeftRightSpacing'#2#6#28'ChildSizing.Top'
|
||||||
|
+'BottomSpacing'#2#6#29'ChildSizing.HorizontalSpacing'#2#6#27'ChildSizing.Ver'
|
||||||
|
+'ticalSpacing'#2#6#18'ChildSizing.Layout'#7#29'cclLeftToRightThenTopToBottom'
|
||||||
|
+#27'ChildSizing.ControlsPerLine'#2#3#12'ClientHeight'#2'"'#11'ClientWidth'#3
|
||||||
|
+#143#2#8'TabOrder'#2#1#0#9'TCheckBox'#21'FileMustExistCheckBox'#4'Left'#2#6#6
|
||||||
|
+'Height'#2#22#3'Top'#2#6#5'Width'#3#168#0#7'Caption'#6#21'FileMustExistCheck'
|
||||||
|
+'Box'#8'OnChange'#7#27'FileMustExistCheckBoxChange'#8'TabOrder'#2#0#0#0#9'TC'
|
||||||
|
+'heckBox'#23'ShowGlobalLinksCheckBox'#4'Left'#3#180#0#6'Height'#2#22#3'Top'#2
|
||||||
|
+#6#5'Width'#3#193#0#7'Caption'#6#23'ShowGlobalLinksCheckBox'#7'Checked'#9#8
|
||||||
|
+'OnChange'#7#29'ShowGlobalLinksCheckBoxChange'#5'State'#7#9'cbChecked'#8'Tab'
|
||||||
|
+'Order'#2#1#0#0#9'TCheckBox'#21'ShowUserLinksCheckBox'#4'Left'#3'{'#1#6'Heig'
|
||||||
|
+'ht'#2#22#3'Top'#2#6#5'Width'#3#183#0#7'Caption'#6#21'ShowUserLinksCheckBox'
|
||||||
|
+#7'Checked'#9#8'OnChange'#7#27'ShowUserLinksCheckBoxChange'#5'State'#7#9'cbC'
|
||||||
|
+'hecked'#8'TabOrder'#2#2#0#0#0#11'TStringGrid'#13'PkgStringGrid'#24'AnchorSi'
|
||||||
|
+'deBottom.Control'#7#11'CloseBitBtn'#6'Height'#3'^'#1#3'Top'#2'5'#5'Width'#3
|
||||||
|
+#147#2#5'Align'#7#5'alTop'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akB'
|
||||||
|
+'ottom'#0#8'ColCount'#2#4#10'FixedColor'#7#9'clBtnFace'#9'FixedCols'#2#0#7'O'
|
||||||
|
+'ptions'#11#15'goFixedVertLine'#15'goFixedHorzLine'#10'goVertLine'#10'goHorz'
|
||||||
|
+'Line'#13'goRangeSelect'#11'goColSizing'#6'goTabs'#13'goColSpanning'#18'goDb'
|
||||||
|
+'lClickAutoSize'#14'goSmoothScroll'#0#8'RowCount'#2#5#10'ScrollBars'#7#10'ss'
|
||||||
|
+'AutoBoth'#8'TabOrder'#2#2#7'TabStop'#9#0#0#0
|
||||||
|
]);
|
217
packager/pkglinksdlg.pas
Normal file
217
packager/pkglinksdlg.pas
Normal file
@ -0,0 +1,217 @@
|
|||||||
|
{ $Id: pkgmanager.pas 12718 2007-11-03 16:56:23Z mattias $ }
|
||||||
|
{
|
||||||
|
/***************************************************************************
|
||||||
|
pkgmanager.pas
|
||||||
|
--------------
|
||||||
|
|
||||||
|
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
***************************************************************************
|
||||||
|
* *
|
||||||
|
* This source is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This code is distributed in the hope that it will be useful, but *
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||||
|
* General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* A copy of the GNU General Public License is available on the World *
|
||||||
|
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
|
||||||
|
* obtain it by writing to the Free Software Foundation, *
|
||||||
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
|
* *
|
||||||
|
***************************************************************************
|
||||||
|
|
||||||
|
Author: Mattias Gaertner
|
||||||
|
|
||||||
|
Abstract:
|
||||||
|
Dialog showing the package links of the IDE package systems.
|
||||||
|
}
|
||||||
|
unit PkgLinksDlg;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||||
|
Buttons, Grids, AVL_Tree,
|
||||||
|
FileProcs,
|
||||||
|
LazarusIDEStrConsts, PackageDefs, PackageLinks;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TPkgLinkInfo }
|
||||||
|
|
||||||
|
TPkgLinkInfo = class(TPackageLink)
|
||||||
|
public
|
||||||
|
procedure Assign(Source: TLazPackageID);
|
||||||
|
property Origin: TPkgLinkOrigin read FOrigin write FOrigin;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TPackageLinksDialog }
|
||||||
|
|
||||||
|
TPackageLinksDialog = class(TForm)
|
||||||
|
CloseBitBtn: TBitBtn;
|
||||||
|
ShowUserLinksCheckBox: TCheckBox;
|
||||||
|
ShowGlobalLinksCheckBox: TCheckBox;
|
||||||
|
FileMustExistCheckBox: TCheckBox;
|
||||||
|
ScopeGroupBox: TGroupBox;
|
||||||
|
PkgStringGrid: TStringGrid;
|
||||||
|
procedure FileMustExistCheckBoxChange(Sender: TObject);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure ShowGlobalLinksCheckBoxChange(Sender: TObject);
|
||||||
|
procedure ShowUserLinksCheckBoxChange(Sender: TObject);
|
||||||
|
private
|
||||||
|
FLinks: TAVLTree;// tree of TPkgLinkInfo sorted for names
|
||||||
|
FCollectingOrigin: TPkgLinkOrigin;
|
||||||
|
procedure UpdateAll;
|
||||||
|
procedure UpdatePackageList;
|
||||||
|
procedure ClearLinks;
|
||||||
|
procedure IteratePackages(APackage: TLazPackageID);
|
||||||
|
public
|
||||||
|
{ public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
function ShowPackageLinks: TModalResult;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
function ShowPackageLinks: TModalResult;
|
||||||
|
var
|
||||||
|
PackageLinksDialog: TPackageLinksDialog;
|
||||||
|
begin
|
||||||
|
PackageLinksDialog:=TPackageLinksDialog.Create(nil);
|
||||||
|
try
|
||||||
|
Result:=PackageLinksDialog.ShowModal;
|
||||||
|
finally
|
||||||
|
PackageLinksDialog.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TPackageLinksDialog }
|
||||||
|
|
||||||
|
procedure TPackageLinksDialog.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Caption:=lisPLDPackageLinks;
|
||||||
|
CloseBitBtn.Caption:=lisMenuClose;
|
||||||
|
FileMustExistCheckBox.Caption:=lisPLDOnlyExistingFiles;
|
||||||
|
ShowGlobalLinksCheckBox.Caption:=lisPLDShowGlobalLinks;
|
||||||
|
ShowUserLinksCheckBox.Caption:=lisPLDShowUserLinks;
|
||||||
|
UpdateAll;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPackageLinksDialog.ShowGlobalLinksCheckBoxChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
UpdatePackageList;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPackageLinksDialog.ShowUserLinksCheckBoxChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
UpdatePackageList;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPackageLinksDialog.FileMustExistCheckBoxChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
UpdatePackageList;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPackageLinksDialog.UpdateAll;
|
||||||
|
begin
|
||||||
|
UpdatePackageList;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPackageLinksDialog.UpdatePackageList;
|
||||||
|
var
|
||||||
|
Node: TAVLTreeNode;
|
||||||
|
Link: TPkgLinkInfo;
|
||||||
|
i: Integer;
|
||||||
|
OriginStr: String;
|
||||||
|
begin
|
||||||
|
ClearLinks;
|
||||||
|
|
||||||
|
FLinks:=TAVLTree.Create(@ComparePackageLinks);
|
||||||
|
if ShowGlobalLinksCheckBox.Checked then begin
|
||||||
|
FCollectingOrigin:=ploGlobal;
|
||||||
|
PkgLinks.IteratePackages(FileMustExistCheckBox.Checked,@IteratePackages,[ploGlobal]);
|
||||||
|
end;
|
||||||
|
if ShowUserLinksCheckBox.Checked then begin
|
||||||
|
FCollectingOrigin:=ploUser;
|
||||||
|
PkgLinks.IteratePackages(FileMustExistCheckBox.Checked,@IteratePackages,[ploUser]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
PkgStringGrid.ColCount:=5;
|
||||||
|
PkgStringGrid.RowCount:=FLinks.Count+1;
|
||||||
|
PkgStringGrid.Cells[0, 0]:=lisDebugOptionsFrmName;
|
||||||
|
PkgStringGrid.Cells[1, 0]:=lisVersion;
|
||||||
|
PkgStringGrid.Cells[2, 0]:=dlgSROrigin;
|
||||||
|
PkgStringGrid.Cells[3, 0]:=lisPLDExists;
|
||||||
|
PkgStringGrid.Cells[4, 0]:=lisA2PFilename2;
|
||||||
|
|
||||||
|
i:=1;
|
||||||
|
Node:=FLinks.FindLowest;
|
||||||
|
while Node<>nil do begin
|
||||||
|
Link:=TPkgLinkInfo(Node.Data);
|
||||||
|
PkgStringGrid.Cells[0,i]:=Link.Name;
|
||||||
|
PkgStringGrid.Cells[1,i]:=Link.Version.AsString;
|
||||||
|
if Link.Origin=ploGlobal then
|
||||||
|
OriginStr:=dlgGlobal
|
||||||
|
else
|
||||||
|
OriginStr:=lisPLDUser;
|
||||||
|
PkgStringGrid.Cells[2,i]:=OriginStr;
|
||||||
|
PkgStringGrid.Cells[3,i]:=dbgs(FileExistsCached(Link.Filename));
|
||||||
|
PkgStringGrid.Cells[4,i]:=Link.Filename;
|
||||||
|
inc(i);
|
||||||
|
Node:=FLinks.FindSuccessor(Node);
|
||||||
|
end;
|
||||||
|
|
||||||
|
PkgStringGrid.AutoAdjustColumns;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPackageLinksDialog.ClearLinks;
|
||||||
|
begin
|
||||||
|
if FLinks<>nil then begin
|
||||||
|
FLinks.FreeAndClear;
|
||||||
|
FreeAndNil(FLinks);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPackageLinksDialog.IteratePackages(APackage: TLazPackageID);
|
||||||
|
var
|
||||||
|
NewLink: TPkgLinkInfo;
|
||||||
|
begin
|
||||||
|
NewLink:=TPkgLinkInfo.Create;
|
||||||
|
NewLink.Assign(APackage);
|
||||||
|
NewLink.Origin:=FCollectingOrigin;
|
||||||
|
FLinks.Add(NewLink);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TPkgLinkInfo }
|
||||||
|
|
||||||
|
procedure TPkgLinkInfo.Assign(Source: TLazPackageID);
|
||||||
|
var
|
||||||
|
Link: TPackageLink;
|
||||||
|
begin
|
||||||
|
AssignID(Source);
|
||||||
|
if Source is TPackageLink then begin
|
||||||
|
Link:=TPackageLink(Source);
|
||||||
|
Origin:=Link.Origin;
|
||||||
|
Filename:=Link.Filename;
|
||||||
|
AutoCheckExists:=Link.AutoCheckExists;
|
||||||
|
NotFoundCount:=Link.NotFoundCount;
|
||||||
|
LastCheckValid:=Link.LastCheckValid;
|
||||||
|
LastCheck:=Link.LastCheck;
|
||||||
|
FileDateValid:=Link.FileDateValid;
|
||||||
|
FileDate:=Link.FileDate;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$I pkglinksdlg.lrs}
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
@ -61,7 +61,7 @@ uses
|
|||||||
BrokenDependenciesDlg, CompilerOptions, ExtToolEditDlg, IDETranslations,
|
BrokenDependenciesDlg, CompilerOptions, ExtToolEditDlg, IDETranslations,
|
||||||
TransferMacros, MsgView, BuildLazDialog, NewDialog, IDEDialogs,
|
TransferMacros, MsgView, BuildLazDialog, NewDialog, IDEDialogs,
|
||||||
ProjectInspector, ComponentPalette, UnitEditor, AddFileToAPackageDlg,
|
ProjectInspector, ComponentPalette, UnitEditor, AddFileToAPackageDlg,
|
||||||
LazarusPackageIntf, PublishProjectDlg, InstallPkgSetDlg,
|
LazarusPackageIntf, PublishProjectDlg, PkgLinksDlg, InstallPkgSetDlg,
|
||||||
// bosses
|
// bosses
|
||||||
BaseBuildManager, BasePkgManager,
|
BaseBuildManager, BasePkgManager,
|
||||||
MainBar, MainIntf, MainBase;
|
MainBar, MainIntf, MainBase;
|
||||||
@ -130,6 +130,7 @@ type
|
|||||||
procedure MainIDEitmConfigCustomCompsClicked(Sender: TObject);
|
procedure MainIDEitmConfigCustomCompsClicked(Sender: TObject);
|
||||||
procedure MainIDEitmOpenRecentPackageClicked(Sender: TObject);
|
procedure MainIDEitmOpenRecentPackageClicked(Sender: TObject);
|
||||||
procedure MainIDEitmPkgOpenPackageClicked(Sender: TObject);
|
procedure MainIDEitmPkgOpenPackageClicked(Sender: TObject);
|
||||||
|
procedure MainIDEViewPackageLinksClicked(Sender: TObject);
|
||||||
|
|
||||||
// component palette
|
// component palette
|
||||||
procedure IDEComponentPaletteEndUpdate(Sender: TObject;
|
procedure IDEComponentPaletteEndUpdate(Sender: TObject;
|
||||||
@ -954,6 +955,11 @@ begin
|
|||||||
DoShowOpenInstalledPckDlg;
|
DoShowOpenInstalledPckDlg;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TPkgManager.MainIDEViewPackageLinksClicked(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ShowPackageLinks;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TPkgManager.MainIDEitmOpenRecentPackageClicked(Sender: TObject);
|
procedure TPkgManager.MainIDEitmOpenRecentPackageClicked(Sender: TObject);
|
||||||
|
|
||||||
procedure UpdateEnvironment;
|
procedure UpdateEnvironment;
|
||||||
@ -1813,6 +1819,8 @@ begin
|
|||||||
{$IFDEF CustomIDEComps}
|
{$IFDEF CustomIDEComps}
|
||||||
itmCompsConfigCustomComps.OnClick :=@MainIDEitmConfigCustomCompsClicked;
|
itmCompsConfigCustomComps.OnClick :=@MainIDEitmConfigCustomCompsClicked;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
itmViewPackageLinks.OnClick := @MainIDEViewPackageLinksClicked;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
SetRecentPackagesMenu;
|
SetRecentPackagesMenu;
|
||||||
|
Loading…
Reference in New Issue
Block a user