Use "/<version>/<machineName>" as the material info URL suffix

CURA-3810
This commit is contained in:
Lipu Fei 2017-05-29 15:23:49 +02:00
parent 9b67fa94b4
commit 85e875257b
3 changed files with 14 additions and 1 deletions

View file

@ -1362,3 +1362,7 @@ class CuraApplication(QtApplication):
node = node.getParent()
Selection.add(node)
@pyqtSlot(result=str)
def getCuraVersion(self):
return CuraVersion

View file

@ -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:

View file

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