mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 18:27:51 -06:00
Use "/<version>/<machineName>" as the material info URL suffix
CURA-3810
This commit is contained in:
parent
9b67fa94b4
commit
85e875257b
3 changed files with 14 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue