mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-05 13:20:35 +02:00
IDE: package editor: multi change add to pkg uses section
git-svn-id: trunk@45443 -
This commit is contained in:
parent
34c28b776a
commit
1d522141ff
@ -26,7 +26,6 @@
|
|||||||
ToDo:
|
ToDo:
|
||||||
- Multiselect
|
- Multiselect
|
||||||
CallRegisterProcCheckBox,
|
CallRegisterProcCheckBox,
|
||||||
AddToUsesPkgSectionCheckBox,
|
|
||||||
DisableI18NForLFMCheckBox
|
DisableI18NForLFMCheckBox
|
||||||
replace GetCurrentDependency
|
replace GetCurrentDependency
|
||||||
replace GetCurrentFile
|
replace GetCurrentFile
|
||||||
@ -1334,28 +1333,42 @@ end;
|
|||||||
procedure TPackageEditorForm.AddToUsesPkgSectionCheckBoxChange(Sender: TObject);
|
procedure TPackageEditorForm.AddToUsesPkgSectionCheckBoxChange(Sender: TObject);
|
||||||
var
|
var
|
||||||
CurFile: TPkgFile;
|
CurFile: TPkgFile;
|
||||||
Removed: boolean;
|
|
||||||
i: Integer;
|
i: Integer;
|
||||||
OtherFile: TPkgFile;
|
OtherFile: TPkgFile;
|
||||||
|
TVNode: TTreeNode;
|
||||||
|
NodeData: TPENodeData;
|
||||||
|
Item: TObject;
|
||||||
|
j: Integer;
|
||||||
begin
|
begin
|
||||||
if LazPackage=nil then exit;
|
if LazPackage=nil then exit;
|
||||||
CurFile:=GetCurrentFile(Removed);
|
BeginUdate;
|
||||||
if (CurFile=nil) then exit;
|
try
|
||||||
if CurFile.AddToUsesPkgSection=AddToUsesPkgSectionCheckBox.Checked then exit;
|
for i:=0 to ItemsTreeView.SelectionCount-1 do begin
|
||||||
CurFile.AddToUsesPkgSection:=AddToUsesPkgSectionCheckBox.Checked;
|
TVNode:=ItemsTreeView.Selections[i];
|
||||||
if not Removed then begin
|
if not GetNodeDataItem(TVNode,NodeData,Item) then continue;
|
||||||
if CurFile.AddToUsesPkgSection then begin
|
if Item is TPkgFile then begin
|
||||||
// mark all other units with the same name as unused
|
CurFile:=TPkgFile(Item);
|
||||||
for i:=0 to LazPackage.FileCount-1 do begin
|
if not (CurFile.FileType in PkgFileUnitTypes) then continue;
|
||||||
OtherFile:=LazPackage.Files[i];
|
if CurFile.AddToUsesPkgSection=AddToUsesPkgSectionCheckBox.Checked then
|
||||||
if (OtherFile<>CurFile)
|
continue;
|
||||||
and (SysUtils.CompareText(OtherFile.Unit_Name,CurFile.Unit_Name)=0) then
|
// change flag
|
||||||
OtherFile.AddToUsesPkgSection:=false;
|
CurFile.AddToUsesPkgSection:=AddToUsesPkgSectionCheckBox.Checked;
|
||||||
|
if (not NodeData.Removed) and CurFile.AddToUsesPkgSection then begin
|
||||||
|
// mark all other units with the same name as unused
|
||||||
|
for j:=0 to LazPackage.FileCount-1 do begin
|
||||||
|
OtherFile:=LazPackage.Files[j];
|
||||||
|
if (OtherFile<>CurFile)
|
||||||
|
and (SysUtils.CompareText(OtherFile.Unit_Name,CurFile.Unit_Name)=0) then
|
||||||
|
OtherFile.AddToUsesPkgSection:=false;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
LazPackage.Modified:=true;
|
||||||
|
UpdateFiles;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
LazPackage.Modified:=true;
|
finally
|
||||||
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
UpdateFiles;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPackageEditorForm.AddToProjectClick(Sender: TObject);
|
procedure TPackageEditorForm.AddToProjectClick(Sender: TObject);
|
||||||
|
Loading…
Reference in New Issue
Block a user