mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Only show toolbox/marketplace welcome screen for Essentials builds
CURA-6569
This commit is contained in:
parent
3d352b3585
commit
7af5f132e0
1 changed files with 8 additions and 10 deletions
|
@ -125,13 +125,15 @@ class Toolbox(QObject, Extension):
|
||||||
showLicenseDialog = pyqtSignal()
|
showLicenseDialog = pyqtSignal()
|
||||||
uninstallVariablesChanged = pyqtSignal()
|
uninstallVariablesChanged = pyqtSignal()
|
||||||
|
|
||||||
def _loginStateChanged(self):
|
## Go back to the start state (welcome screen or loading if no login required)
|
||||||
|
def _restart(self):
|
||||||
self._updateRequestHeader()
|
self._updateRequestHeader()
|
||||||
if self._application.getCuraAPI().account.isLoggedIn:
|
# For an Essentials build, login is mandatory
|
||||||
|
if not self._application.getCuraAPI().account.isLoggedIn and ApplicationMetadata.CuraBuildType == "essentials":
|
||||||
|
self.setViewPage("welcome")
|
||||||
|
else:
|
||||||
self.setViewPage("loading")
|
self.setViewPage("loading")
|
||||||
self._fetchPackageData()
|
self._fetchPackageData()
|
||||||
else:
|
|
||||||
self.setViewPage("welcome")
|
|
||||||
|
|
||||||
def _updateRequestHeader(self):
|
def _updateRequestHeader(self):
|
||||||
self._request_headers = [
|
self._request_headers = [
|
||||||
|
@ -198,7 +200,7 @@ class Toolbox(QObject, Extension):
|
||||||
"packages": QUrl("{base_url}/packages".format(base_url = self._api_url))
|
"packages": QUrl("{base_url}/packages".format(base_url = self._api_url))
|
||||||
}
|
}
|
||||||
|
|
||||||
self._application.getCuraAPI().account.loginStateChanged.connect(self._loginStateChanged)
|
self._application.getCuraAPI().account.loginStateChanged.connect(self._restart)
|
||||||
|
|
||||||
if CuraApplication.getInstance().getPreferences().getValue("info/automatic_update_check"):
|
if CuraApplication.getInstance().getPreferences().getValue("info/automatic_update_check"):
|
||||||
# Request the latest and greatest!
|
# Request the latest and greatest!
|
||||||
|
@ -233,11 +235,7 @@ class Toolbox(QObject, Extension):
|
||||||
Logger.log("e", "Unexpected error trying to create the 'Marketplace' dialog.")
|
Logger.log("e", "Unexpected error trying to create the 'Marketplace' dialog.")
|
||||||
return
|
return
|
||||||
|
|
||||||
if self._application.getCuraAPI().account.isLoggedIn:
|
self._restart()
|
||||||
self.setViewPage("loading")
|
|
||||||
self._fetchPackageData()
|
|
||||||
else:
|
|
||||||
self.setViewPage("welcome")
|
|
||||||
|
|
||||||
self._dialog.show()
|
self._dialog.show()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue