mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 17:45:56 +08:00
Remove hard-coded account URLs in QMLs
CURA-6117
This commit is contained in:
parent
c28aefac4e
commit
3b3baeac03
@ -117,7 +117,7 @@ from cura.ObjectsModel import ObjectsModel
|
|||||||
from cura.PrinterOutputDevice import PrinterOutputDevice
|
from cura.PrinterOutputDevice import PrinterOutputDevice
|
||||||
from cura.PrinterOutput.NetworkMJPGImage import NetworkMJPGImage
|
from cura.PrinterOutput.NetworkMJPGImage import NetworkMJPGImage
|
||||||
|
|
||||||
from cura import ApplicationMetadata
|
from cura import ApplicationMetadata, UltimakerCloudAuthentication
|
||||||
|
|
||||||
from UM.FlameProfiler import pyqtSlot
|
from UM.FlameProfiler import pyqtSlot
|
||||||
from UM.Decorators import override
|
from UM.Decorators import override
|
||||||
@ -132,16 +132,6 @@ if TYPE_CHECKING:
|
|||||||
numpy.seterr(all = "ignore")
|
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):
|
class CuraApplication(QtApplication):
|
||||||
# SettingVersion represents the set of settings available in the machine/extruder definitions.
|
# 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
|
# 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
|
from cura.CuraPackageManager import CuraPackageManager
|
||||||
self._package_manager_class = 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
|
# Adds command line options to the command line parser. This should be called after the application is created and
|
||||||
# before the pre-start.
|
# before the pre-start.
|
||||||
def addCommandLineOptions(self):
|
def addCommandLineOptions(self):
|
||||||
|
@ -16,7 +16,7 @@ Row
|
|||||||
width: UM.Theme.getSize("account_button").width
|
width: UM.Theme.getSize("account_button").width
|
||||||
height: UM.Theme.getSize("account_button").height
|
height: UM.Theme.getSize("account_button").height
|
||||||
text: catalog.i18nc("@button", "Create account")
|
text: catalog.i18nc("@button", "Create account")
|
||||||
onClicked: Qt.openUrlExternally("https://account.ultimaker.com/app/create")
|
onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl + "/app/create")
|
||||||
fixedWidthMode: true
|
fixedWidthMode: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ Row
|
|||||||
width: UM.Theme.getSize("account_button").width
|
width: UM.Theme.getSize("account_button").width
|
||||||
height: UM.Theme.getSize("account_button").height
|
height: UM.Theme.getSize("account_button").height
|
||||||
text: catalog.i18nc("@button", "Manage account")
|
text: catalog.i18nc("@button", "Manage account")
|
||||||
onClicked: Qt.openUrlExternally("https://account.ultimaker.com")
|
onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl)
|
||||||
fixedWidthMode: true
|
fixedWidthMode: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user