Add loading hint for replacing the global stack

Displayed as a splash message when the application is starting,
logged (not displayed to the user) otherwise

CURA-6823
This commit is contained in:
Nino van Hooff 2019-12-23 17:32:20 +01:00
parent 81976cfd1a
commit 6a0fba060e

View file

@ -637,6 +637,7 @@ class CuraApplication(QtApplication):
@override(Application)
def setGlobalContainerStack(self, stack: "GlobalStack") -> None:
self._setLoadingHint("Preparing Active Machine...")
super().setGlobalContainerStack(stack)
## A reusable dialogbox
@ -741,6 +742,14 @@ class CuraApplication(QtApplication):
self._plugins_loaded = True
## Set a short, user-friendly hint about current loading status.
# The way this message is displayed depends on application state
def _setLoadingHint(self, hint: str):
if self.started:
Logger.info(hint)
else:
self.showSplashMessage(hint)
def run(self):
super().run()