|
@@ -245,6 +245,7 @@ class WelcomePagesModel(ListModel):
|
|
|
},
|
|
|
{"id": "cloud",
|
|
|
"page_url": self._getBuiltinWelcomePagePath("CloudContent.qml"),
|
|
|
+ "should_show_function": self.shouldShowCloudPage,
|
|
|
},
|
|
|
{"id": "add_network_or_local_printer",
|
|
|
"page_url": self._getBuiltinWelcomePagePath("AddNetworkOrLocalPrinterContent.qml"),
|
|
@@ -286,6 +287,17 @@ class WelcomePagesModel(ListModel):
|
|
|
first_start_actions = self._application.getMachineActionManager().getFirstStartActions(definition_id)
|
|
|
return len([action for action in first_start_actions if action.needsUserInteraction()]) > 0
|
|
|
|
|
|
+ def shouldShowCloudPage(self) -> bool:
|
|
|
+ """
|
|
|
+ The cloud page should be shown only if the user is not logged in
|
|
|
+
|
|
|
+ :return: True if the user is not logged in, False if he/she is
|
|
|
+ """
|
|
|
+ # Import CuraApplication locally or else it fails
|
|
|
+ from cura.CuraApplication import CuraApplication
|
|
|
+ api = CuraApplication.getInstance().getCuraAPI()
|
|
|
+ return not api.account.isLoggedIn
|
|
|
+
|
|
|
def addPage(self) -> None:
|
|
|
pass
|
|
|
|