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
This commit is contained in:
Jaime van Kessel 2019-03-22 11:30:22 +01:00
parent 9a5b7e7925
commit fd015c0381

View File

@ -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")