diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 9609a93a9f..ed14a15629 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -2076,3 +2076,7 @@ class CuraApplication(QtApplication): @classmethod def getInstance(cls, *args, **kwargs) -> "CuraApplication": return cast(CuraApplication, super().getInstance(**kwargs)) + + @pyqtProperty(bool, constant=True) + def isEnterprise(self) -> bool: + return ApplicationMetadata.IsEnterpriseVersion diff --git a/plugins/Marketplace/resources/qml/Marketplace.qml b/plugins/Marketplace/resources/qml/Marketplace.qml index 2a3c5f69ce..97ba2303e9 100644 --- a/plugins/Marketplace/resources/qml/Marketplace.qml +++ b/plugins/Marketplace/resources/qml/Marketplace.qml @@ -285,4 +285,33 @@ Window } } } + + Rectangle + { + color: UM.Theme.getColor("main_background") + anchors.fill: parent + visible: !Cura.API.account.isLoggedIn && CuraApplication.isEnterprise + + UM.Label + { + id: signInLabel + anchors.centerIn: parent + width: Math.round(UM.Theme.getSize("modal_window_minimum").width / 2.5) + text: catalog.i18nc("@description","Please sign in to get verified plugins and materials for UltiMaker Cura Enterprise") + horizontalAlignment: Text.AlignHCenter + } + + Cura.PrimaryButton + { + id: loginButton + width: UM.Theme.getSize("account_button").width + height: UM.Theme.getSize("account_button").height + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: signInLabel.bottom + anchors.topMargin: UM.Theme.getSize("default_margin").height * 2 + text: catalog.i18nc("@button", "Sign in") + fixedWidthMode: true + onClicked: Cura.API.account.login() + } + } }