From 614b1000fd8642d77ea38b1f6de21e0d24d1adbe Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 10 Jan 2019 15:36:36 +0100 Subject: [PATCH 1/6] Added missing material compatibility chart link CURA-6090 --- .../ConfigurationMenu/ConfigurationMenu.qml | 42 +++++++++++++++++++ .../themes/cura-light/icons/external_link.svg | 8 ++++ 2 files changed, 50 insertions(+) create mode 100644 resources/themes/cura-light/icons/external_link.svg diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 3001efac54..491a2f069f 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -173,6 +173,48 @@ Cura.ExpandablePopup } } + Item + { + height: visible ? childrenRect.height: 0 + anchors.right: parent.right + anchors.rightMargin: UM.Theme.getSize("default_margin").width + width: childrenRect.width + UM.Theme.getSize("default_margin").width + visible: popupItem.configuration_method == ConfigurationMenu.ConfigurationMethod.Custom + UM.RecolorImage + { + id: externalLinkIcon + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_margin").width + height: materialInfoLabel.height + width: height + sourceSize.height: width + color: UM.Theme.getColor("text_link") + source: UM.Theme.getIcon("external_link") + } + + Label + { + id: materialInfoLabel + wrapMode: Text.WordWrap + text: catalog.i18nc("@label", "See the material compatibility chart") + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text_link") + anchors.left: externalLinkIcon.right + anchors.leftMargin: UM.Theme.getSize("narrow_margin").width + + MouseArea + { + anchors.fill: parent + onClicked: + { + // open the material URL with web browser + var url = "https://ultimaker.com/incoming-links/cura/material-compatibilty" + Qt.openUrlExternally(url) + } + } + } + } + Rectangle { id: separator diff --git a/resources/themes/cura-light/icons/external_link.svg b/resources/themes/cura-light/icons/external_link.svg new file mode 100644 index 0000000000..a2130fb97b --- /dev/null +++ b/resources/themes/cura-light/icons/external_link.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file From ff79e91686c070c1df206c2dc7f93555f04758fd Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 10 Jan 2019 16:32:43 +0100 Subject: [PATCH 2/6] Move the additional components for the save button out of the action panel CURA-6097 --- .../PostProcessingPlugin.qml | 2 +- .../qml/ActionPanel/OutputProcessWidget.qml | 50 +++---------------- .../qml/ActionPanel/SliceProcessWidget.qml | 38 +------------- resources/qml/Cura.qml | 34 +++++++++++++ 4 files changed, 44 insertions(+), 80 deletions(-) diff --git a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml index d5fe618b2d..cd8303d1d3 100644 --- a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml +++ b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml @@ -488,7 +488,7 @@ UM.Dialog { objectName: "postProcessingSaveAreaButton" visible: activeScriptsList.count > 0 - height: UM.Theme.getSize("save_button_save_to_button").height + height: UM.Theme.getSize("action_button").height width: height tooltip: catalog.i18nc("@info:tooltip", "Change active post-processing scripts") onClicked: dialog.show() diff --git a/resources/qml/ActionPanel/OutputProcessWidget.qml b/resources/qml/ActionPanel/OutputProcessWidget.qml index 15214f212c..e3b623b675 100644 --- a/resources/qml/ActionPanel/OutputProcessWidget.qml +++ b/resources/qml/ActionPanel/OutputProcessWidget.qml @@ -31,6 +31,13 @@ Column id: information width: parent.width height: childrenRect.height + + PrintInformationWidget + { + id: printInformationPanel + visible: !preSlicedData + anchors.right: parent.right + } Column { @@ -51,14 +58,6 @@ Column text: preSlicedData ? catalog.i18nc("@label", "No time estimation available") : PrintInformation.currentPrintTime.getDisplayString(UM.DurationFormat.Long) source: UM.Theme.getIcon("clock") font: UM.Theme.getFont("large_bold") - - PrintInformationWidget - { - id: printInformationPanel - visible: !preSlicedData - anchors.left: parent.left - anchors.leftMargin: parent.contentWidth + UM.Theme.getSize("default_margin").width - } } Cura.IconWithText @@ -91,43 +90,8 @@ Column return totalWeights + "g ยท " + totalLengths.toFixed(2) + "m" } source: UM.Theme.getIcon("spool") - - Item - { - id: additionalComponents - width: childrenRect.width - anchors.right: parent.right - height: parent.height - Row - { - id: additionalComponentsRow - anchors.right: parent.right - anchors.bottom: parent.bottom - spacing: UM.Theme.getSize("default_margin").width - } - } - Component.onCompleted: addAdditionalComponents("saveButton") - - Connections - { - target: CuraApplication - onAdditionalComponentsChanged: addAdditionalComponents("saveButton") - } - - function addAdditionalComponents (areaId) - { - if(areaId == "saveButton") - { - for (var component in CuraApplication.additionalComponents["saveButton"]) - { - CuraApplication.additionalComponents["saveButton"][component].parent = additionalComponentsRow - } - } - } } } - - } Item diff --git a/resources/qml/ActionPanel/SliceProcessWidget.qml b/resources/qml/ActionPanel/SliceProcessWidget.qml index 0f415a6a2d..08966ce82c 100644 --- a/resources/qml/ActionPanel/SliceProcessWidget.qml +++ b/resources/qml/ActionPanel/SliceProcessWidget.qml @@ -110,8 +110,7 @@ Column height: parent.height - anchors.right: additionalComponents.left - anchors.rightMargin: additionalComponents.width != 0 ? UM.Theme.getSize("default_margin").width : 0 + anchors.right: parent.right anchors.left: parent.left text: catalog.i18nc("@button", "Slice") @@ -128,45 +127,12 @@ Column height: parent.height anchors.left: parent.left - anchors.right: additionalComponents.left - anchors.rightMargin: additionalComponents.width != 0 ? UM.Theme.getSize("default_margin").width : 0 + anchors.right: parent.right text: catalog.i18nc("@button", "Cancel") enabled: sliceButton.enabled visible: !sliceButton.visible onClicked: sliceOrStopSlicing() } - - Item - { - id: additionalComponents - width: childrenRect.width - anchors.right: parent.right - height: parent.height - Row - { - id: additionalComponentsRow - anchors.verticalCenter: parent.verticalCenter - spacing: UM.Theme.getSize("default_margin").width - } - } - Component.onCompleted: prepareButtons.addAdditionalComponents("saveButton") - - Connections - { - target: CuraApplication - onAdditionalComponentsChanged: prepareButtons.addAdditionalComponents("saveButton") - } - - function addAdditionalComponents (areaId) - { - if(areaId == "saveButton") - { - for (var component in CuraApplication.additionalComponents["saveButton"]) - { - CuraApplication.additionalComponents["saveButton"][component].parent = additionalComponentsRow - } - } - } } diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 4a031e33fa..f3d2e7295a 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -248,6 +248,7 @@ UM.MainWindow Cura.ActionPanelWidget { + id: actionPanelWidget anchors.right: parent.right anchors.bottom: parent.bottom anchors.rightMargin: UM.Theme.getSize("thick_margin").width @@ -269,6 +270,39 @@ UM.MainWindow visible: CuraApplication.platformActivity && (main.item == null || !qmlTypeOf(main.item, "QQuickRectangle")) } + Item + { + id: additionalComponents + width: childrenRect.width + anchors.right: actionPanelWidget.left + anchors.rightMargin: UM.Theme.getSize("default_margin").width + anchors.bottom: actionPanelWidget.bottom + anchors.bottomMargin: UM.Theme.getSize("thick_margin").height * 2 + visible: actionPanelWidget.visible + Row + { + id: additionalComponentsRow + anchors.verticalCenter: parent.verticalCenter + spacing: UM.Theme.getSize("default_margin").width + } + } + + Component.onCompleted: contentItem.addAdditionalComponents() + + Connections + { + target: CuraApplication + onAdditionalComponentsChanged: contentItem.addAdditionalComponents("saveButton") + } + + function addAdditionalComponents() + { + for (var component in CuraApplication.additionalComponents["saveButton"]) + { + CuraApplication.additionalComponents["saveButton"][component].parent = additionalComponentsRow + } + } + Loader { // A stage can control this area. If nothing is set, it will therefore show the 3D view. From d4621ec5043f2be107abfee6e5779cbdaaebccad Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 11 Jan 2019 13:20:14 +0100 Subject: [PATCH 3/6] Ensure that if no CuraCloudApiRoot is set that the default is used CURA-6005 --- cura/UltimakerCloudAuthentication.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cura/UltimakerCloudAuthentication.py b/cura/UltimakerCloudAuthentication.py index ac752231b9..5f69329dbb 100644 --- a/cura/UltimakerCloudAuthentication.py +++ b/cura/UltimakerCloudAuthentication.py @@ -10,6 +10,8 @@ DEFAULT_CLOUD_ACCOUNT_API_ROOT = "https://account.ultimaker.com" # type: str try: from cura.CuraVersion import CuraCloudAPIRoot # type: ignore + if CuraCloudAPIRoot == "": + CuraCloudAPIRoot = DEFAULT_CLOUD_API_ROOT except ImportError: CuraCloudAPIRoot = DEFAULT_CLOUD_API_ROOT @@ -20,5 +22,7 @@ except ImportError: try: from cura.CuraVersion import CuraCloudAccountAPIRoot # type: ignore + if CuraCloudAccountAPIRoot == "": + CuraCloudAccountAPIRoot = DEFAULT_CLOUD_ACCOUNT_API_ROOT except ImportError: CuraCloudAccountAPIRoot = DEFAULT_CLOUD_ACCOUNT_API_ROOT From 2dead8759329767f2348c07a4b8df6516dbe519c Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 11 Jan 2019 14:43:20 +0100 Subject: [PATCH 4/6] Ensure that the installed & canUpdate properties get set correctly CURA-6053 --- plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml index 7160dafa2d..87fc5d6955 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml @@ -91,5 +91,10 @@ Column target: toolbox onInstallChanged: installed = toolbox.isInstalled(model.id) onMetadataChanged: canUpdate = toolbox.canUpdate(model.id) + onFilterChanged: + { + installed = toolbox.isInstalled(model.id) + canUpdate = toolbox.canUpdate(model.id) + } } } From e7060206396f7cc4a30e82e3d4b8c7036e152d4b Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Fri, 11 Jan 2019 14:44:49 +0100 Subject: [PATCH 5/6] Improve the text when there is no configuration available It can happen that the list is empty because the data is still coming or because the connection has been lost. There are also some improvements in the link to the compatibility chart. Now the two external links in Cura have the same behaviour. Contributes to CURA-6011. --- .../UM3NetworkPrinting/resources/qml/MonitorQueue.qml | 9 +++++---- .../resources/svg/icons/external_link.svg | 8 -------- .../Menus/ConfigurationMenu/ConfigurationListView.qml | 8 ++++++-- .../qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 11 +++++++++++ 4 files changed, 22 insertions(+), 14 deletions(-) delete mode 100644 plugins/UM3NetworkPrinting/resources/svg/icons/external_link.svg diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml index 124b268300..f2dc09de95 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml @@ -42,8 +42,8 @@ Item { id: externalLinkIcon anchors.verticalCenter: manageQueueLabel.verticalCenter - color: UM.Theme.getColor("primary") - source: "../svg/icons/external_link.svg" + color: UM.Theme.getColor("text_link") + source: UM.Theme.getIcon("external_link") width: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!) height: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!) } @@ -56,10 +56,11 @@ Item leftMargin: 6 * screenScaleFactor // TODO: Theme! verticalCenter: externalLinkIcon.verticalCenter } - color: UM.Theme.getColor("primary") + color: UM.Theme.getColor("text_link") font: UM.Theme.getFont("default") // 12pt, regular - linkColor: UM.Theme.getColor("primary") + linkColor: UM.Theme.getColor("text_link") text: catalog.i18nc("@label link to connect manager", "Manage queue in Cura Connect") + renderType: Text.NativeRendering } } diff --git a/plugins/UM3NetworkPrinting/resources/svg/icons/external_link.svg b/plugins/UM3NetworkPrinting/resources/svg/icons/external_link.svg deleted file mode 100644 index a2130fb97b..0000000000 --- a/plugins/UM3NetworkPrinting/resources/svg/icons/external_link.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index e57b21cb78..15d882fdf5 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -23,7 +23,7 @@ Item } } - // This component will appear when there is no configurations (e.g. when losing connection) + // This component will appear when there are no configurations (e.g. when losing connection or when they are being loaded) Item { width: parent.width @@ -51,7 +51,11 @@ Item anchors.left: icon.right anchors.right: parent.right anchors.leftMargin: UM.Theme.getSize("default_margin").width - text: catalog.i18nc("@label", "Downloading the configurations from the remote printer") + // There are two cases that we want to diferenciate, one is when Cura is loading the configurations and the + // other when the connection was lost + text: Cura.MachineManager.printerConnected ? + catalog.i18nc("@label", "Loading available configurations from the printer...") : + catalog.i18nc("@label", "The configurations are not available because the printer is disconnected.") color: UM.Theme.getColor("text") font: UM.Theme.getFont("default") renderType: Text.NativeRendering diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 491a2f069f..7d09f4be38 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -199,18 +199,29 @@ Cura.ExpandablePopup text: catalog.i18nc("@label", "See the material compatibility chart") font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_link") + linkColor: UM.Theme.getColor("text_link") anchors.left: externalLinkIcon.right anchors.leftMargin: UM.Theme.getSize("narrow_margin").width + renderType: Text.NativeRendering MouseArea { anchors.fill: parent + hoverEnabled: true onClicked: { // open the material URL with web browser var url = "https://ultimaker.com/incoming-links/cura/material-compatibilty" Qt.openUrlExternally(url) } + onEntered: + { + materialInfoLabel.font.underline = true + } + onExited: + { + materialInfoLabel.font.underline = false + } } } } From cbeadb234314a3dc18372cced43dacee7f859aa1 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 11 Jan 2019 14:47:59 +0100 Subject: [PATCH 6/6] Set the font of the time estimation to medium bold This way it will also fit when a very long time is used in german. If we don't do this, 14 Tages 12 Stunden 33 Minuten didn't fit. CURA-6097 --- resources/qml/ActionPanel/OutputProcessWidget.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/ActionPanel/OutputProcessWidget.qml b/resources/qml/ActionPanel/OutputProcessWidget.qml index e3b623b675..63974d7f34 100644 --- a/resources/qml/ActionPanel/OutputProcessWidget.qml +++ b/resources/qml/ActionPanel/OutputProcessWidget.qml @@ -57,7 +57,7 @@ Column text: preSlicedData ? catalog.i18nc("@label", "No time estimation available") : PrintInformation.currentPrintTime.getDisplayString(UM.DurationFormat.Long) source: UM.Theme.getIcon("clock") - font: UM.Theme.getFont("large_bold") + font: UM.Theme.getFont("medium_bold") } Cura.IconWithText