From fd015c03818a7345b682dbdfc7e0fa822e1d8fec Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 22 Mar 2019 11:30:22 +0100 Subject: [PATCH] Detach the data request and the showing of the dialog from eachother. This way we can fetch the data without having to show the marketplace. CURA-6151 --- plugins/Toolbox/src/Toolbox.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 7d8d359831..49b8775da3 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -190,8 +190,10 @@ class Toolbox(QObject, Extension): "packages": QUrl("{base_url}/packages".format(base_url = self._api_url)) } - @pyqtSlot() - def browsePackages(self) -> None: + # Request the latest and greatest! + self._fetchPackageData() + + def _fetchPackageData(self): # Create the network manager: # This was formerly its own function but really had no reason to be as # it was never called more than once ever. @@ -209,6 +211,10 @@ class Toolbox(QObject, Extension): # Gather installed packages: self._updateInstalledModels() + @pyqtSlot() + def browsePackages(self) -> None: + self._fetchPackageData() + if not self._dialog: self._dialog = self._createDialog("Toolbox.qml")