diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index cf4e85f850..1ded631def 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -117,7 +117,7 @@ from cura.ObjectsModel import ObjectsModel from cura.PrinterOutputDevice import PrinterOutputDevice from cura.PrinterOutput.NetworkMJPGImage import NetworkMJPGImage -from cura import ApplicationMetadata +from cura import ApplicationMetadata, UltimakerCloudAuthentication from UM.FlameProfiler import pyqtSlot from UM.Decorators import override @@ -132,16 +132,6 @@ if TYPE_CHECKING: numpy.seterr(all = "ignore") -try: - from cura.CuraVersion import CuraAppDisplayName, CuraVersion, CuraBuildType, CuraDebugMode, CuraSDKVersion # type: ignore -except ImportError: - CuraAppDisplayName = "Ultimaker Cura" - CuraVersion = "master" # [CodeStyle: Reflecting imported value] - CuraBuildType = "" - CuraDebugMode = False - CuraSDKVersion = "6.0.0" - - class CuraApplication(QtApplication): # SettingVersion represents the set of settings available in the machine/extruder definitions. # You need to make sure that this version number needs to be increased if there is any non-backwards-compatible @@ -266,6 +256,14 @@ class CuraApplication(QtApplication): from cura.CuraPackageManager import CuraPackageManager self._package_manager_class = CuraPackageManager + @pyqtProperty(str, constant=True) + def ultimakerCloudApiRootUrl(self) -> str: + return UltimakerCloudAuthentication.CuraCloudAPIRoot + + @pyqtProperty(str, constant = True) + def ultimakerCloudAccountRootUrl(self) -> str: + return UltimakerCloudAuthentication.CuraCloudAccountAPIRoot + # Adds command line options to the command line parser. This should be called after the application is created and # before the pre-start. def addCommandLineOptions(self): diff --git a/resources/qml/Account/GeneralOperations.qml b/resources/qml/Account/GeneralOperations.qml index b9f1025d5e..666a254cd1 100644 --- a/resources/qml/Account/GeneralOperations.qml +++ b/resources/qml/Account/GeneralOperations.qml @@ -16,7 +16,7 @@ Row width: UM.Theme.getSize("account_button").width height: UM.Theme.getSize("account_button").height text: catalog.i18nc("@button", "Create account") - onClicked: Qt.openUrlExternally("https://account.ultimaker.com/app/create") + onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl + "/app/create") fixedWidthMode: true } diff --git a/resources/qml/Account/UserOperations.qml b/resources/qml/Account/UserOperations.qml index b9ffa395d6..56c2dc416f 100644 --- a/resources/qml/Account/UserOperations.qml +++ b/resources/qml/Account/UserOperations.qml @@ -16,7 +16,7 @@ Row width: UM.Theme.getSize("account_button").width height: UM.Theme.getSize("account_button").height text: catalog.i18nc("@button", "Manage account") - onClicked: Qt.openUrlExternally("https://account.ultimaker.com") + onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl) fixedWidthMode: true }