From c81689d23361af8d8a86bba129e0336112baf819 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Fri, 11 Jan 2019 17:40:36 +0100 Subject: [PATCH 1/6] Prevent a recurring qml warning Note that the connect_group metadata is also queried for non-connected printers; the model is not filtered, but non-connected printers are set to be invisible. --- resources/qml/Menus/NetworkPrinterMenu.qml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/resources/qml/Menus/NetworkPrinterMenu.qml b/resources/qml/Menus/NetworkPrinterMenu.qml index 3cb0aae016..41f3054e92 100644 --- a/resources/qml/Menus/NetworkPrinterMenu.qml +++ b/resources/qml/Menus/NetworkPrinterMenu.qml @@ -12,10 +12,18 @@ Instantiator model: Cura.GlobalStacksModel {} MenuItem { - text: model.metadata["connect_group_name"] + property string connectGroupName: + { + if("connect_group_name" in model.metadata) + { + return model.metadata["connect_group_name"] + } + return "" + } + text: connectGroupName checkable: true visible: model.hasRemoteConnection - checked: Cura.MachineManager.activeMachineNetworkGroupName == model.metadata["connect_group_name"] + checked: Cura.MachineManager.activeMachineNetworkGroupName == connectGroupName exclusiveGroup: group onTriggered: Cura.MachineManager.setActiveMachine(model.id) } From c6fa47e584a38998809916d6d5ff694afe21f75a Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Fri, 11 Jan 2019 17:52:28 +0100 Subject: [PATCH 2/6] Mark PrinterOutputDevice without printer type as invalid Since self._printer_type was defined as an empty string and the setter only accepts strings, it could never be None --- cura/PrinterOutput/ConfigurationModel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/PrinterOutput/ConfigurationModel.py b/cura/PrinterOutput/ConfigurationModel.py index 89e609c913..f9d0c7e36b 100644 --- a/cura/PrinterOutput/ConfigurationModel.py +++ b/cura/PrinterOutput/ConfigurationModel.py @@ -54,7 +54,7 @@ class ConfigurationModel(QObject): for configuration in self._extruder_configurations: if configuration is None: return False - return self._printer_type is not None + return self._printer_type != "" def __str__(self): message_chunks = [] From d03ec22dee514c305edc8e4482b9e43584f2c7b0 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Fri, 11 Jan 2019 17:55:06 +0100 Subject: [PATCH 3/6] Hide empty abbreviated machinename Connected printers that are not Cura Connect printers may not have a connect_group_name. --- resources/qml/PrinterSelector/MachineSelector.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/qml/PrinterSelector/MachineSelector.qml b/resources/qml/PrinterSelector/MachineSelector.qml index 9f0d3b4ac6..0a2e304efc 100644 --- a/resources/qml/PrinterSelector/MachineSelector.qml +++ b/resources/qml/PrinterSelector/MachineSelector.qml @@ -26,7 +26,14 @@ Cura.ExpandablePopup headerItem: Cura.IconWithText { - text: isNetworkPrinter ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName + text: + { + if (isNetworkPrinter && Cura.MachineManager.activeMachineNetworkGroupName != "") + { + Cura.MachineManager.activeMachineNetworkGroupName + } + return Cura.MachineManager.activeMachineName + } source: { if (isNetworkPrinter) From f8bfca6079569835550a80f4eba2095d97cc53a3 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Fri, 11 Jan 2019 18:27:44 +0100 Subject: [PATCH 4/6] Don't show auto configuration selection when there are no configurations --- resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 7d09f4be38..86cb7f9acf 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -136,9 +136,9 @@ Cura.ExpandablePopup onVisibleChanged: { - is_connected = Cura.MachineManager.activeMachineHasRemoteConnection && Cura.MachineManager.printerConnected //Re-evaluate. + is_connected = Cura.MachineManager.activeMachineHasRemoteConnection && Cura.MachineManager.printerConnected && Cura.MachineManager.printerOutputDevices[0].uniqueConfigurations.length > 0 //Re-evaluate. - // If the printer is not connected, we switch always to the custom mode. If is connected instead, the auto mode + // If the printer is not connected or does not have configurations, we switch always to the custom mode. If is connected instead, the auto mode // or the previous state is selected configuration_method = is_connected ? (manual_selected_method == -1 ? ConfigurationMenu.ConfigurationMethod.Auto : manual_selected_method) : ConfigurationMenu.ConfigurationMethod.Custom } From 71036abd870ce0b517b5c8636a6444505cd9cff1 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 14 Jan 2019 12:11:41 +0100 Subject: [PATCH 5/6] Add troubleshooting link for recommended CURA-6114 --- .../Recommended/RecommendedPrintSetup.qml | 5 +++ .../RecommendedTroubleshootingGuides.qml | 36 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 resources/qml/PrintSetupSelector/Recommended/RecommendedTroubleshootingGuides.qml diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml index 6885f8c041..44b3abf7cd 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml @@ -68,6 +68,11 @@ Item // TODO Create a reusable component with these properties to not define them separately for each component labelColumnWidth: parent.firstColumnWidth } + + RecommendedTroubleshootingGuides + { + width: parent.width + } } UM.SettingPropertyProvider diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedTroubleshootingGuides.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedTroubleshootingGuides.qml new file mode 100644 index 0000000000..846e343028 --- /dev/null +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedTroubleshootingGuides.qml @@ -0,0 +1,36 @@ +// Copyright (c) 2019 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 1.4 +import QtQuick.Controls.Styles 1.4 + +import UM 1.2 as UM +import Cura 1.0 as Cura + + +Item +{ + id: tipsCell + anchors.top: adhesionCheckBox.visible ? adhesionCheckBox.bottom : (enableSupportCheckBox.visible ? supportExtruderCombobox.bottom : infillCellRight.bottom) + anchors.topMargin: Math.round(UM.Theme.getSize("sidebar_margin").height * 2) + anchors.left: parent.left + width: parent.width + height: tipsText.contentHeight * tipsText.lineCount + + Label + { + id: tipsText + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width + anchors.right: parent.right + anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width + anchors.top: parent.top + wrapMode: Text.WordWrap + text: catalog.i18nc("@label", "Need help improving your prints?
Read the Ultimaker Troubleshooting Guides").arg("https://ultimaker.com/en/troubleshooting") + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + linkColor: UM.Theme.getColor("text_link") + onLinkActivated: Qt.openUrlExternally(link) + } +} \ No newline at end of file From b1b61fa466eafa51121ce7a276dc2046d5f38ea7 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 14 Jan 2019 14:14:47 +0100 Subject: [PATCH 6/6] Add missing return --- resources/qml/PrinterSelector/MachineSelector.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/PrinterSelector/MachineSelector.qml b/resources/qml/PrinterSelector/MachineSelector.qml index 0a2e304efc..4bee917751 100644 --- a/resources/qml/PrinterSelector/MachineSelector.qml +++ b/resources/qml/PrinterSelector/MachineSelector.qml @@ -30,7 +30,7 @@ Cura.ExpandablePopup { if (isNetworkPrinter && Cura.MachineManager.activeMachineNetworkGroupName != "") { - Cura.MachineManager.activeMachineNetworkGroupName + return Cura.MachineManager.activeMachineNetworkGroupName } return Cura.MachineManager.activeMachineName }