diff --git a/components/onlinepackagemanager/opkman_mainfrm.pas b/components/onlinepackagemanager/opkman_mainfrm.pas index 0b0216c6d9..f9133f5239 100644 --- a/components/onlinepackagemanager/opkman_mainfrm.pas +++ b/components/onlinepackagemanager/opkman_mainfrm.pas @@ -226,6 +226,7 @@ begin PackageDownloader.OnJSONProgress := nil; PackageDownloader.OnJSONDownloadCompleted := nil; StopUpdates; + Application.RemoveOnDeactivateHandler(@DoDeactivate); VisualTree.Free; Application.HintHidePause := FHintTimeOut; end; diff --git a/components/onlinepackagemanager/opkman_packagelistfrm.pas b/components/onlinepackagemanager/opkman_packagelistfrm.pas index 034d8b61cf..1d0e49eccd 100644 --- a/components/onlinepackagemanager/opkman_packagelistfrm.pas +++ b/components/onlinepackagemanager/opkman_packagelistfrm.pas @@ -30,7 +30,7 @@ uses // LCL Forms, Controls, Graphics, ExtCtrls, StdCtrls, VirtualTrees, // OpkMan - opkman_const, opkman_serializablepackages, opkman_options; + opkman_const, opkman_serializablepackages, opkman_options, opkman_visualtree; type @@ -63,6 +63,7 @@ type procedure VSTCompareNodes(Sender: TBaseVirtualTree; Node1, Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer); procedure VSTFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode); + function IsNodeVisible(const APackageName: String): Boolean; public procedure PopulateList(const ATyp: Integer; const AExtra: String = ''); property Count: Integer read GetCount; @@ -138,6 +139,8 @@ begin InvCnt := 0; for I := 0 to SerializablePackages.Count - 1 do begin + if not IsNodeVisible(SerializablePackages.Items[I].DisplayName) then + Continue; if ATyp = 0 then begin for J := 0 to SerializablePackages.Items[I].LazarusPackages.Count - 1 do @@ -296,5 +299,24 @@ begin Finalize(Data^); end; +function TPackageListFrm.IsNodeVisible(const APackageName: String): Boolean; +var + Node: PVirtualNode; + Data: opkman_visualtree.PData; +begin + Result := False; + Node := VisualTree.VST.GetFirst; + while Assigned(Node) do + begin + Data := VisualTree.VST.GetNodeData(Node); + if (Data^.DataType = 1) and (Data^.PackageDisplayName = APackageName) then + begin + Result := VisualTree.VST.IsVisible[Node]; + Break; + end; + Node := VisualTree.VST.GetNext(Node); + end; +end; + end.