From c69987b8240ba82464bb04a4e5c7057f664a5c22 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 14 Mar 2018 11:26:22 +0100 Subject: [PATCH] CURA-4870 Reintroduce the "Check compatibility" link in the sidebar --- resources/qml/SidebarHeader.qml | 68 +++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index 74e189789d..5591f49797 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -468,6 +468,74 @@ Column } } + // Material info row + Item + { + id: materialInfoRow + height: Math.round(UM.Theme.getSize("sidebar_setup").height / 2) + visible: (Cura.MachineManager.hasVariants || Cura.MachineManager.hasMaterials) && !sidebar.monitoringPrint && !sidebar.hideSettings + + anchors + { + left: parent.left + leftMargin: UM.Theme.getSize("sidebar_margin").width + right: parent.right + rightMargin: UM.Theme.getSize("sidebar_margin").width + } + + Item { + height: UM.Theme.getSize("sidebar_setup").height + anchors.right: parent.right + width: Math.round(parent.width * 0.7 + UM.Theme.getSize("sidebar_margin").width) + + UM.RecolorImage { + id: warningImage + anchors.right: materialInfoLabel.left + anchors.rightMargin: UM.Theme.getSize("default_margin").width + anchors.verticalCenter: parent.Bottom + source: UM.Theme.getIcon("warning") + width: UM.Theme.getSize("section_icon").width + height: UM.Theme.getSize("section_icon").height + color: UM.Theme.getColor("material_compatibility_warning") + visible: !Cura.MachineManager.isCurrentSetupSupported + } + + Label { + id: materialInfoLabel + wrapMode: Text.WordWrap + text: "" + catalog.i18nc("@label", "Check compatibility") + "" + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + linkColor: UM.Theme.getColor("text_link") + verticalAlignment: Text.AlignTop + anchors.top: parent.top + anchors.right: parent.right + anchors.bottom: parent.bottom + + MouseArea { + anchors.fill: parent + hoverEnabled: true + onClicked: { + // open the material URL with web browser + var version = UM.Application.version; + var machineName = Cura.MachineManager.activeMachine.definition.id; + var url = "https://ultimaker.com/materialcompatibility/" + version + "/" + machineName + "?utm_source=cura&utm_medium=software&utm_campaign=resources"; + Qt.openUrlExternally(url); + } + onEntered: { + var content = catalog.i18nc("@tooltip", "Click to check the material compatibility on Ultimaker.com."); + base.showTooltip( + materialInfoRow, + Qt.point(-UM.Theme.getSize("sidebar_margin").width, 0), + catalog.i18nc("@tooltip", content) + ); + } + onExited: base.hideTooltip(); + } + } + } + } + UM.SettingPropertyProvider { id: machineExtruderCount