From 906074d6ceab2f53ade716c64e407eb2ff7b122e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars-S=C3=B6ren=20Steck?= Date: Mon, 8 Apr 2019 01:15:49 +0200 Subject: [PATCH 01/17] Fix anycubic 4max gcode comments --- resources/definitions/anycubic_4max.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/anycubic_4max.def.json b/resources/definitions/anycubic_4max.def.json index c14ce1ac31..58cbaa3b22 100644 --- a/resources/definitions/anycubic_4max.def.json +++ b/resources/definitions/anycubic_4max.def.json @@ -83,6 +83,6 @@ "machine_gcode_flavor":{"default_value": "RepRap (Marlin/Sprinter)"}, "machine_start_gcode":{"default_value": "G21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nG1 Z15.0 F{speed_travel} ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E3 ;extrude 3mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F{speed_travel}\nM117 Printing...\nG5"}, - "machine_end_gcode":{"default_value": "M104 S0 ; turn off extruder\nM140 S0 ; turn off bed\nM84 ; disable motors\nM107\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle\nto release some of the pressure\nG1 Z+0.5 E-5 ;X-20 Y-20 F{speed_travel} ;move Z up a bit and retract filament even more\nG28 X0 ;Y0 ;move X/Y to min endstops\nso the head is out of the way\nG1 Y180 F2000\nM84 ;steppers off\nG90\nM300 P300 S4000"} + "machine_end_gcode":{"default_value": "M104 S0 ; turn off extruder\nM140 S0 ; turn off bed\nM84 ; disable motors\nM107\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 ;X-20 Y-20 F{speed_travel} ;move Z up a bit and retract filament even more\nG28 X0 ;Y0 ;move X/Y to min endstops, so the head is out of the way\nG1 Y180 F2000\nM84 ;steppers off\nG90\nM300 P300 S4000"} } } From b47489eb3053476d236994abc5ad83e78c595755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars-S=C3=B6ren=20Steck?= Date: Mon, 8 Apr 2019 01:16:26 +0200 Subject: [PATCH 02/17] Fix anycubic i3 mega gcode comments --- resources/definitions/anycubic_i3_mega.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/anycubic_i3_mega.def.json b/resources/definitions/anycubic_i3_mega.def.json index 8a96d98023..6e81085fdd 100644 --- a/resources/definitions/anycubic_i3_mega.def.json +++ b/resources/definitions/anycubic_i3_mega.def.json @@ -58,7 +58,7 @@ }, "machine_end_gcode": { - "default_value": "M104 S0 ; turn off extruder\nM140 S0 ; turn off bed\nM84 ; disable motors\nM107\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle\nto release some of the pressure\nG1 Z+0.5 E-5 ;X-20 Y-20 F{speed_travel} ;move Z up a bit and retract filament even more\nG28 X0 ;Y0 ;move X/Y to min endstops\nso the head is out of the way\nG1 Y180 F2000\nM84 ;steppers off\nG90\nM300 P300 S4000" + "default_value": "M104 S0 ; turn off extruder\nM140 S0 ; turn off bed\nM84 ; disable motors\nM107\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 ;X-20 Y-20 F{speed_travel} ;move Z up a bit and retract filament even more\nG28 X0 ;Y0 ;move X/Y to min endstops, so the head is out of the way\nG1 Y180 F2000\nM84 ;steppers off\nG90\nM300 P300 S4000" } } } From 61c38c5ec05bb58271e046e53366e9f735fb86a1 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Wed, 10 Apr 2019 15:43:44 +0200 Subject: [PATCH 03/17] Pass output device (or not) to cloud check method Contributes to CL-1325 --- plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py b/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py index 8d923d3827..7cff6b6aca 100644 --- a/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py +++ b/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py @@ -181,7 +181,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin): um_network_key = CuraApplication.getInstance().getGlobalContainerStack().getMetaDataEntry("um_network_key") if key == um_network_key: self.getOutputDeviceManager().addOutputDevice(self._discovered_devices[key]) - self.checkCloudFlowIsPossible() + self.checkCloudFlowIsPossible(None) else: self.getOutputDeviceManager().removeOutputDevice(key) if key.startswith("manual:"): @@ -488,7 +488,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin): return True ## Check if the prerequsites are in place to start the cloud flow - def checkCloudFlowIsPossible(self) -> None: + def checkCloudFlowIsPossible(self, cluster: Optional["CloudOutputDevice"]) -> None: Logger.log("d", "Checking if cloud connection is possible...") # Pre-Check: Skip if active machine already has been cloud connected or you said don't ask again @@ -595,7 +595,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin): self._cloud_flow_complete_message.hide() # Check for cloud flow again with newly selected machine - self.checkCloudFlowIsPossible() + self.checkCloudFlowIsPossible(None) def _createCloudFlowStartMessage(self): self._start_cloud_flow_message = Message( From 17a5816b884c63807d1a2a7f3b2cd1eabcd21473 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Thu, 11 Apr 2019 10:12:27 +0200 Subject: [PATCH 04/17] Fix typing Contributes to CL-1325 --- plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py b/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py index 7cff6b6aca..0c205b7b3c 100644 --- a/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py +++ b/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py @@ -27,6 +27,7 @@ from UM.Version import Version from . import ClusterUM3OutputDevice, LegacyUM3OutputDevice from .Cloud.CloudOutputDeviceManager import CloudOutputDeviceManager +from .Cloud.CloudOutputDevice import CloudOutputDevice # typing if TYPE_CHECKING: from PyQt5.QtNetwork import QNetworkReply @@ -488,7 +489,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin): return True ## Check if the prerequsites are in place to start the cloud flow - def checkCloudFlowIsPossible(self, cluster: Optional["CloudOutputDevice"]) -> None: + def checkCloudFlowIsPossible(self, cluster: Optional[CloudOutputDevice]) -> None: Logger.log("d", "Checking if cloud connection is possible...") # Pre-Check: Skip if active machine already has been cloud connected or you said don't ask again From c9a4f0c8b14b69ca4b61bde0416a1a72c817333a Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 11 Apr 2019 10:51:57 +0200 Subject: [PATCH 05/17] Fixed some minor qml issues with userOperations popup --- resources/qml/Account/UserOperations.qml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/resources/qml/Account/UserOperations.qml b/resources/qml/Account/UserOperations.qml index b6ae1efff6..10a4119dfc 100644 --- a/resources/qml/Account/UserOperations.qml +++ b/resources/qml/Account/UserOperations.qml @@ -9,10 +9,9 @@ import Cura 1.1 as Cura Column { - width: Math.max(title.width, - accountButton.width) * 1.5 + width: Math.max(title.width, accountButton.width) + 2 * UM.Theme.getSize("default_margin").width - spacing: UM.Theme.getSize("default_margin").width + spacing: UM.Theme.getSize("default_margin").height Label { @@ -20,17 +19,11 @@ Column anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: Text.AlignHCenter renderType: Text.NativeRendering - text: catalog.i18nc("@label The argument is a username.", "Hi %1").format(profile.username) + text: catalog.i18nc("@label The argument is a username.", "Hi %1").arg(profile.username) font: UM.Theme.getFont("large_bold") color: UM.Theme.getColor("text") } - // placeholder - Label - { - text: " " - } - Cura.SecondaryButton { id: accountButton From 89a74e8ae209f53e3b0876c3bef79bc19dc7c985 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Thu, 11 Apr 2019 13:59:43 +0200 Subject: [PATCH 06/17] JSON: new setting infill_randomize_start_location --- resources/definitions/fdmprinter.def.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 8ce0246a93..4eeac55183 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1723,6 +1723,17 @@ "limit_to_extruder": "infill_extruder_nr", "settable_per_mesh": true }, + "infill_randomize_start_location": + { + "label": "Randomize Infill Start", + "description": "Randomize which infill line is printed first. This prevents one segment becoming the strongest, but it does so at the cost of an additional travel move.", + "type": "bool", + "default_value": true, + "value": "infill_pattern == 'grid' or infill_pattern == 'triangles' or infill_pattern == 'trihexagon' or infill_pattern == 'triangles' or infill_pattern == 'cubic' or infill_pattern == 'cubicsubdiv' or infill_pattern == 'tetrahedral' or infill_pattern == 'quarter_cubic'", + "enabled": "not ((infill_pattern == 'cross' and connect_infill_polygons) or infill_pattern == 'concentric')", + "limit_to_extruder": "infill_extruder_nr", + "settable_per_mesh": true + }, "infill_multiplier": { "label": "Infill Line Multiplier", From cc9aa1129a7795a9bcc13bf4916d38a2c4b11375 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Thu, 11 Apr 2019 14:07:52 +0200 Subject: [PATCH 07/17] Revert "JSON: new setting infill_randomize_start_location" This reverts commit 89a74e8ae209f53e3b0876c3bef79bc19dc7c985. Accidentally committed to master. --- resources/definitions/fdmprinter.def.json | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 4eeac55183..8ce0246a93 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1723,17 +1723,6 @@ "limit_to_extruder": "infill_extruder_nr", "settable_per_mesh": true }, - "infill_randomize_start_location": - { - "label": "Randomize Infill Start", - "description": "Randomize which infill line is printed first. This prevents one segment becoming the strongest, but it does so at the cost of an additional travel move.", - "type": "bool", - "default_value": true, - "value": "infill_pattern == 'grid' or infill_pattern == 'triangles' or infill_pattern == 'trihexagon' or infill_pattern == 'triangles' or infill_pattern == 'cubic' or infill_pattern == 'cubicsubdiv' or infill_pattern == 'tetrahedral' or infill_pattern == 'quarter_cubic'", - "enabled": "not ((infill_pattern == 'cross' and connect_infill_polygons) or infill_pattern == 'concentric')", - "limit_to_extruder": "infill_extruder_nr", - "settable_per_mesh": true - }, "infill_multiplier": { "label": "Infill Line Multiplier", From a428bf49f4c4f4b744e8be64decd31abd03560de Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Thu, 11 Apr 2019 14:17:10 +0200 Subject: [PATCH 08/17] Use the 'busy' property of the ActionButton Instead of creating a new BusyIndicator, use the existing one. Contributes to CURA-6435. --- resources/qml/WelcomePages/AddPrinterByIpContent.qml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/resources/qml/WelcomePages/AddPrinterByIpContent.qml b/resources/qml/WelcomePages/AddPrinterByIpContent.qml index 9376909070..4bc815d334 100644 --- a/resources/qml/WelcomePages/AddPrinterByIpContent.qml +++ b/resources/qml/WelcomePages/AddPrinterByIpContent.qml @@ -106,17 +106,7 @@ Item UM.OutputDeviceManager.addManualDevice(hostnameField.text, hostnameField.text); } } - - BusyIndicator - { - anchors.fill: parent - running: - { - ! parent.enabled && - ! addPrinterByIpScreen.hasSentRequest && - ! addPrinterByIpScreen.haveConnection - } - } + busy: !enabled && !addPrinterByIpScreen.hasSentRequest && !addPrinterByIpScreen.haveConnection Connections { From 13be1eb9aa974dce26ff7fc3a06092a1d5738b95 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Thu, 11 Apr 2019 12:08:18 +0200 Subject: [PATCH 09/17] Add renderType to labels Otherwise it becomes unreadable on macOS. Contributes to CURA-6435. --- .../qml/WelcomePages/AddPrinterByIpContent.qml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/resources/qml/WelcomePages/AddPrinterByIpContent.qml b/resources/qml/WelcomePages/AddPrinterByIpContent.qml index 4bc815d334..293b8c4e81 100644 --- a/resources/qml/WelcomePages/AddPrinterByIpContent.qml +++ b/resources/qml/WelcomePages/AddPrinterByIpContent.qml @@ -61,6 +61,7 @@ Item anchors.top: parent.top font: UM.Theme.getFont("default") + renderType: Text.NativeRendering text: catalog.i18nc("@label", "Enter the IP address or hostname of your printer on the network.") } @@ -128,6 +129,7 @@ Item anchors.top: parent.top anchors.margins: UM.Theme.getSize("default_margin").width font: UM.Theme.getFont("default") + renderType: Text.NativeRendering visible: { @@ -160,6 +162,7 @@ Item id: printerNameLabel anchors.top: parent.top font: UM.Theme.getFont("large") + renderType: Text.NativeRendering text: "???" } @@ -172,14 +175,14 @@ Item columns: 2 columnSpacing: UM.Theme.getSize("default_margin").width - Label { font: UM.Theme.getFont("default"); text: catalog.i18nc("@label", "Type") } - Label { id: typeText; font: UM.Theme.getFont("default"); text: "?" } + Label { font: UM.Theme.getFont("default"); text: catalog.i18nc("@label", "Type"); renderType: Text.NativeRendering } + Label { id: typeText; font: UM.Theme.getFont("default"); text: "?"; renderType: Text.NativeRendering } - Label { font: UM.Theme.getFont("default"); text: catalog.i18nc("@label", "Firmware version") } - Label { id: firmwareText; font: UM.Theme.getFont("default"); text: "0.0.0.0" } + Label { font: UM.Theme.getFont("default"); text: catalog.i18nc("@label", "Firmware version"); renderType: Text.NativeRendering } + Label { id: firmwareText; font: UM.Theme.getFont("default"); text: "0.0.0.0"; renderType: Text.NativeRendering } - Label { font: UM.Theme.getFont("default"); text: catalog.i18nc("@label", "Address") } - Label { id: addressText; font: UM.Theme.getFont("default"); text: "0.0.0.0" } + Label { font: UM.Theme.getFont("default"); text: catalog.i18nc("@label", "Address"); renderType: Text.NativeRendering } + Label { id: addressText; font: UM.Theme.getFont("default"); text: "0.0.0.0"; renderType: Text.NativeRendering } Connections { From 852e7bc8f6e45d04d35db91540618e953fd33d3c Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 11 Apr 2019 14:46:27 +0200 Subject: [PATCH 10/17] Fit missing font in material-vendor text. --- plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml index b653f1a73b..42ece4043d 100644 --- a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml @@ -65,6 +65,7 @@ Item { id: description text: details.description || "" + font: UM.Theme.getFont("default") anchors { top: title.bottom From db71a40acc19eeedb3a9de62c4ba24a93fa1af54 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 11 Apr 2019 16:23:36 +0200 Subject: [PATCH 11/17] Handle undefined extruder-color on start in RecommendedSupportSelector. --- .../Recommended/RecommendedSupportSelector.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml index 7e115667c3..ed075c6b90 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml @@ -133,7 +133,14 @@ Item supportExtruderCombobox.color = supportExtruderCombobox.model.getItem(supportExtruderCombobox.currentIndex).color } } - onCurrentIndexChanged: supportExtruderCombobox.color = supportExtruderCombobox.model.getItem(supportExtruderCombobox.currentIndex).color + onCurrentIndexChanged: + { + var maybeColor = supportExtruderCombobox.model.getItem(supportExtruderCombobox.currentIndex).color + if(maybeColor) + { + supportExtruderCombobox.color = maybeColor + } + } Binding { From 55dcf31e3c10d60b13c44630c5a36055ef92ef94 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 11 Apr 2019 16:24:51 +0200 Subject: [PATCH 12/17] Fix QML binding loop warnings for CustomConfiguration. --- .../Menus/ConfigurationMenu/CustomConfiguration.qml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 708606f483..c60d4d48f0 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -205,7 +205,7 @@ Item Row { - height: visible ? childrenRect.height : 0 + height: visible ? UM.Theme.getSize("setting_control").height : 0 visible: extrudersModel.count > 1 // If there is only one extruder, there is no point to enable/disable that. Label @@ -223,7 +223,7 @@ Item { checked: Cura.MachineManager.activeStack != null ? Cura.MachineManager.activeStack.isEnabled : false enabled: !checked || Cura.MachineManager.numberExtrudersEnabled > 1 //Disable if it's the last enabled extruder. - height: UM.Theme.getSize("setting_control").height + height: parent.height style: UM.Theme.styles.checkbox /* Use a MouseArea to process the click on this checkbox. @@ -242,7 +242,7 @@ Item Row { - height: visible ? childrenRect.height: 0 + height: visible ? UM.Theme.getSize("print_setup_big_item").height : 0 visible: Cura.MachineManager.hasMaterials Label @@ -267,7 +267,7 @@ Item tooltip: text width: selectors.controlWidth - height: UM.Theme.getSize("print_setup_big_item").height + height: parent.height style: UM.Theme.styles.print_setup_header_button activeFocusOnPress: true @@ -302,7 +302,7 @@ Item Row { - height: visible ? childrenRect.height: 0 + height: visible ? UM.Theme.getSize("print_setup_big_item").height : 0 visible: Cura.MachineManager.hasVariants Label @@ -321,7 +321,7 @@ Item id: variantSelection text: Cura.MachineManager.activeVariantName tooltip: Cura.MachineManager.activeVariantName - height: UM.Theme.getSize("print_setup_big_item").height + height: parent.height width: selectors.controlWidth style: UM.Theme.styles.print_setup_header_button activeFocusOnPress: true; From 32fcc79dd8730aea85e0b3212cea16d6a8d82b44 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 11 Apr 2019 16:32:56 +0200 Subject: [PATCH 13/17] Fix _shouldResolve() CURA-6456 --- cura/Settings/GlobalStack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Settings/GlobalStack.py b/cura/Settings/GlobalStack.py index 5c05d28739..df881b4714 100755 --- a/cura/Settings/GlobalStack.py +++ b/cura/Settings/GlobalStack.py @@ -212,7 +212,7 @@ class GlobalStack(CuraContainerStack): # Determine whether or not we should try to get the "resolve" property instead of the # requested property. def _shouldResolve(self, key: str, property_name: str, context: Optional[PropertyEvaluationContext] = None) -> bool: - if property_name is not "value": + if property_name != "value": # Do not try to resolve anything but the "value" property return False From 4065a1204a40f7cac72951c268c09bfcf301f9fd Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 12 Apr 2019 08:52:35 +0200 Subject: [PATCH 14/17] Fix string comparisons --- plugins/Toolbox/src/AuthorsModel.py | 2 +- plugins/Toolbox/src/PackagesModel.py | 2 +- plugins/Toolbox/src/Toolbox.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/Toolbox/src/AuthorsModel.py b/plugins/Toolbox/src/AuthorsModel.py index 877f8256ee..7bfc58df04 100644 --- a/plugins/Toolbox/src/AuthorsModel.py +++ b/plugins/Toolbox/src/AuthorsModel.py @@ -53,7 +53,7 @@ class AuthorsModel(ListModel): # Filter on all the key-word arguments. for key, value in self._filter.items(): - if key is "package_types": + if key == "package_types": key_filter = lambda item, value = value: value in item["package_types"] # type: ignore elif "*" in value: key_filter = lambda item, key = key, value = value: self._matchRegExp(item, key, value) # type: ignore diff --git a/plugins/Toolbox/src/PackagesModel.py b/plugins/Toolbox/src/PackagesModel.py index d94fdf6bb7..1cf87790bc 100644 --- a/plugins/Toolbox/src/PackagesModel.py +++ b/plugins/Toolbox/src/PackagesModel.py @@ -112,7 +112,7 @@ class PackagesModel(ListModel): # Filter on all the key-word arguments. for key, value in self._filter.items(): - if key is "tags": + if key == "tags": key_filter = lambda item, v = value: v in item["tags"] elif "*" in value: key_filter = lambda candidate, k = key, v = value: self._matchRegExp(candidate, k, v) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 085c5d1bde..6d21b8e6f0 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -613,12 +613,12 @@ class Toolbox(QObject, Extension): self._server_response_data[response_type] = json_data["data"] self._models[response_type].setMetadata(self._server_response_data[response_type]) - if response_type is "packages": + if response_type == "packages": self._models[response_type].setFilter({"type": "plugin"}) self.reBuildMaterialsModels() self.reBuildPluginsModels() self._notifyPackageManager() - elif response_type is "authors": + elif response_type == "authors": self._models[response_type].setFilter({"package_types": "material"}) self._models[response_type].setFilter({"tags": "generic"}) From c5f4b302649aa66ef39fc4ce74759c654069a450 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Fri, 12 Apr 2019 13:01:39 +0200 Subject: [PATCH 15/17] Don't show 'discovered' machines that are placeholders. [CURA-6057] --- cura/Machines/Models/DiscoveredPrintersModel.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cura/Machines/Models/DiscoveredPrintersModel.py b/cura/Machines/Models/DiscoveredPrintersModel.py index aa372a49e8..7468b7cd8e 100644 --- a/cura/Machines/Models/DiscoveredPrintersModel.py +++ b/cura/Machines/Models/DiscoveredPrintersModel.py @@ -89,7 +89,8 @@ class DiscoveredPrintersModel(QObject): @pyqtProperty(list, notify = discoveredPrintersChanged) def discoveredPrinters(self) -> List["DiscoveredPrinter"]: - item_list = list(x for x in self._discovered_printer_by_ip_dict.values()) + item_list = list( + x for x in self._discovered_printer_by_ip_dict.values() if x.device.getProperty("temporary") != "true") item_list.sort(key = lambda x: x.device.name) return item_list From 367a12557f8c38edce3cd8fd450a56e309259eac Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Fri, 12 Apr 2019 13:14:35 +0200 Subject: [PATCH 16/17] Filter placeholders-devices: but use parseBool instead. [CURA-6057] --- cura/Machines/Models/DiscoveredPrintersModel.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cura/Machines/Models/DiscoveredPrintersModel.py b/cura/Machines/Models/DiscoveredPrintersModel.py index 7468b7cd8e..7b4fe48221 100644 --- a/cura/Machines/Models/DiscoveredPrintersModel.py +++ b/cura/Machines/Models/DiscoveredPrintersModel.py @@ -7,6 +7,7 @@ from PyQt5.QtCore import pyqtSlot, pyqtProperty, pyqtSignal, QObject from UM.i18n import i18nCatalog from UM.Logger import Logger +from UM.Util import parseBool if TYPE_CHECKING: from PyQt5.QtCore import QObject @@ -90,7 +91,7 @@ class DiscoveredPrintersModel(QObject): @pyqtProperty(list, notify = discoveredPrintersChanged) def discoveredPrinters(self) -> List["DiscoveredPrinter"]: item_list = list( - x for x in self._discovered_printer_by_ip_dict.values() if x.device.getProperty("temporary") != "true") + x for x in self._discovered_printer_by_ip_dict.values() if not parseBool(x.device.getProperty("temporary"))) item_list.sort(key = lambda x: x.device.name) return item_list From 3bfe7df04471d07784afa9b24ea1df7c01dde1b9 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Fri, 12 Apr 2019 15:45:10 +0200 Subject: [PATCH 17/17] Fix the alignment of the MachineSelectorButton Sometimes it was creating a button with width zero. Now it expands to the width of the container. Also fixing a small issue with the buttons and the link not being correctly aligned to the vertical center. Contributes to CURA-6057. --- .../AddNetworkPrinterScrollView.qml | 32 ++++++++----------- resources/qml/qmldir | 1 + 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml b/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml index 924eeb930d..dc59ea05dd 100644 --- a/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml +++ b/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml @@ -7,9 +7,6 @@ import QtQuick.Controls 2.3 import UM 1.3 as UM import Cura 1.1 as Cura -import "../PrinterSelector" - - // // This is the widget for adding a network printer. There are 2 parts in this widget. One is a scroll view of a list // of discovered network printers. Beneath the scroll view is a container with 3 buttons: "Refresh", "Add by IP", and @@ -84,13 +81,11 @@ Item } } - delegate: MachineSelectorButton + delegate: Cura.MachineSelectorButton { text: modelData.device.name - anchors.left: parent.left - anchors.right: parent.right - anchors.rightMargin: UM.Theme.getSize("default_margin").width + width: networkPrinterListView.width outputDevice: modelData.device enabled: !modelData.isUnknownMachineType @@ -119,22 +114,23 @@ Item } } + // Horizontal line separating the buttons (below) and the discovered network printers (above) + Rectangle + { + id: separator + anchors.left: parent.left + anchors.top: networkPrinterInfo.bottom + anchors.right: parent.right + height: UM.Theme.getSize("default_lining").height + color: UM.Theme.getColor("lining") + } + Item { id: controlsRectangle anchors.left: parent.left anchors.right: parent.right - anchors.top: networkPrinterInfo.bottom - - // Horizontal line separating the buttons (below) and the discovered network printers (above) - Rectangle - { - anchors.left: parent.left - anchors.top: parent.top - anchors.right: parent.right - height: UM.Theme.getSize("default_lining").width - color: UM.Theme.getColor("lining") - } + anchors.top: separator.bottom height: UM.Theme.getSize("message_action_button").height + UM.Theme.getSize("default_margin").height diff --git a/resources/qml/qmldir b/resources/qml/qmldir index 68c4fa82bc..b4881bde77 100644 --- a/resources/qml/qmldir +++ b/resources/qml/qmldir @@ -1,6 +1,7 @@ module Cura MachineSelector 1.0 MachineSelector.qml +MachineSelectorButton 1.0 MachineSelectorButton.qml CustomConfigurationSelector 1.0 CustomConfigurationSelector.qml PrintSetupSelector 1.0 PrintSetupSelector.qml ActionButton 1.0 ActionButton.qml