mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 20:35:53 +08:00
Use "/<version>/<machineName>" as the material info URL suffix
CURA-3810
This commit is contained in:
parent
9b67fa94b4
commit
85e875257b
@ -1362,3 +1362,7 @@ class CuraApplication(QtApplication):
|
||||
node = node.getParent()
|
||||
|
||||
Selection.add(node)
|
||||
|
||||
@pyqtSlot(result=str)
|
||||
def getCuraVersion(self):
|
||||
return CuraVersion
|
||||
|
@ -474,6 +474,12 @@ class MachineManager(QObject):
|
||||
def activeMachine(self) -> "GlobalStack":
|
||||
return self._global_container_stack
|
||||
|
||||
@pyqtProperty(str, notify = globalContainerChanged)
|
||||
def activeMachineDefinitionId(self) -> str:
|
||||
if self._global_container_stack and self._global_container_stack.definition:
|
||||
return self._global_container_stack.definition.getId()
|
||||
return ""
|
||||
|
||||
@pyqtProperty(str, notify = activeStackChanged)
|
||||
def activeStackId(self) -> str:
|
||||
if self._active_container_stack:
|
||||
|
@ -220,7 +220,10 @@ Column
|
||||
onClicked:
|
||||
{
|
||||
// open the material URL with web browser
|
||||
var url = "https://ultimaker.com/en/resources/23121-materials";
|
||||
var version = CuraApplication.getCuraVersion();
|
||||
var machineName = Cura.MachineManager.activeMachineDefinitionId;
|
||||
|
||||
var url = "https://ultimaker.com/materialcompatibility/" + version + "/" + machineName;
|
||||
Qt.openUrlExternally(url);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user