Add sign in wall

CURA-10183
This commit is contained in:
Joey de l'Arago 2023-02-09 17:41:08 +01:00
parent 8d6ab7aa30
commit 1133e76e66
2 changed files with 33 additions and 0 deletions

View file

@ -2076,3 +2076,7 @@ class CuraApplication(QtApplication):
@classmethod @classmethod
def getInstance(cls, *args, **kwargs) -> "CuraApplication": def getInstance(cls, *args, **kwargs) -> "CuraApplication":
return cast(CuraApplication, super().getInstance(**kwargs)) return cast(CuraApplication, super().getInstance(**kwargs))
@pyqtProperty(bool, constant=True)
def isEnterprise(self) -> bool:
return ApplicationMetadata.IsEnterpriseVersion

View file

@ -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()
}
}
} }