From 56eb694745e019cf13766491b2c1c65bd338b3d6 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 11 Oct 2021 14:11:28 +0200 Subject: [PATCH] Hide refresh button if there are no offline printers It's not considered a big use case when the user has already added some printers but would want to add more while syncing materials to those printers. Contributes to issue CURA-8609. --- .../qml/Preferences/Materials/MaterialsSyncDialog.qml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml index 3b57f5c28d..3bbcf0fa94 100644 --- a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml +++ b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml @@ -266,7 +266,8 @@ Window footer: Item { width: printerListScrollView.width - height: UM.Theme.getSize("card").height + UM.Theme.getSize("default_margin").height + height: visible ? UM.Theme.getSize("card").height + UM.Theme.getSize("default_margin").height : 0 + visible: includeOfflinePrinterList.count - cloudPrinterList.count > 0 Rectangle { border.color: UM.Theme.getColor("lining") @@ -533,6 +534,13 @@ Window filterConnectionType: 3 //Only show cloud connections. filterOnlineOnly: true //Only show printers that are online. } + Cura.GlobalStacksModel + { + //In order to show a refresh button only when there are offline cloud printers, we need to know if there are any offline printers. + //A global stacks model without the filter for online-only printers allows this. + id: includeOfflinePrinterList + filterConnectionType: 3 //Still only show cloud connections. + } FileDialog {