From c3504fb223902156c98802abc587361874c22439 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 8 Aug 2018 20:47:22 +0200 Subject: [PATCH 01/22] Add setting for Support Infill Line Direction --- resources/definitions/fdmprinter.def.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 2ea87a890d..b5c6159271 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3873,6 +3873,19 @@ } } }, + "support_infill_angle": + { + "label": "Support Infill Line Direction", + "description": "The minimum angle of overhangs for which support is added. At a value of 0° all overhangs are supported, 90° will not provide any support.", + "unit": "°", + "type": "float", + "minimum_value": "-90", + "maximum_value": "90", + "default_value": 0, + "enabled": "support_enable", + "settable_per_mesh": false, + "settable_per_extruder": true + }, "support_z_distance": { "label": "Support Z Distance", From b9ac5671233532759c0a697c2c7e05ee5e35615a Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 9 Aug 2018 09:32:38 +0200 Subject: [PATCH 02/22] Fix description of the setting --- resources/definitions/fdmprinter.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index b5c6159271..be7eecc686 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3876,7 +3876,7 @@ "support_infill_angle": { "label": "Support Infill Line Direction", - "description": "The minimum angle of overhangs for which support is added. At a value of 0° all overhangs are supported, 90° will not provide any support.", + "description": "Orientation of the infill pattern for supports. The support infill pattern is rotated in the horizontal plane.", "unit": "°", "type": "float", "minimum_value": "-90", From 82570ee35ff027daa03ae7ed51bd748bac03079b Mon Sep 17 00:00:00 2001 From: Thomas Karl Pietrowski Date: Sat, 25 Aug 2018 14:46:21 +0200 Subject: [PATCH 03/22] bq Hephestos2: Getting a rid of custom g-code * Getting a rid of M800: This removes M800 completely. The problem is basically that M800 sets the temperature to 200deg. As a result we tell the firmware to heat up to e.g. 205deg, then M800 kicks in and sets the temperature to 200deg and then we heat up to 205deg again. Therefore I looked into the firmware and extracted all g-code lines except the one which tells to go to 200deg. * Getting independent of bq's fork and therefore adding compatibility to Marlin We use standard g-code, which is safe to be used with both firmware. Note: This change might be also interesting for other bq products, but can't test on them. Therefore it is up to bq and/or the owners of these products to contribute and correct this here, as I did. --- resources/definitions/bq_hephestos_2.def.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/definitions/bq_hephestos_2.def.json b/resources/definitions/bq_hephestos_2.def.json index ca0e66ada2..90a86433fb 100644 --- a/resources/definitions/bq_hephestos_2.def.json +++ b/resources/definitions/bq_hephestos_2.def.json @@ -17,8 +17,8 @@ "overrides": { "machine_name": { "default_value": "BQ Hephestos 2" }, - "machine_start_gcode": { "default_value": "; -- START GCODE --\nM104 S{material_print_temperature} ; Heat up extruder while leveling\nM800 ; Custom GCODE to fire start print procedure\nM109 S{material_print_temperature} ; Makes sure the temperature is correct before printing\n; -- end of START GCODE --" }, - "machine_end_gcode": { "default_value": "; -- END GCODE --\nM801 ; Custom GCODE to fire end print procedure\n; -- end of END GCODE --" }, + "machine_start_gcode": { "default_value": "; -- START GCODE --\nM104 S{material_print_temperature}\nG28 ; Zero-ing position\nG29 ; Auto bed-leveling\nG0 X4 Y297 Z15 F4000 ; Fast move to BQ's start position\nG90 ; Set to Absolute Positioning\nG92 E0 ; Reset extruder 0\nG1 F1800 ; Set default feedrate\nM109 S{material_print_temperature} ; Makes sure the temperature is correct before printing\n; -- end of START GCODE --" }, + "machine_end_gcode": { "default_value": "; -- END GCODE --\nM801 ; Marlin G-CODE to fire end print procedure\n; -- end of END GCODE --" }, "machine_width": { "default_value": 210 }, "machine_depth": { "default_value": 297 }, "machine_height": { "default_value": 220 }, From e0aea1817710a871c9695eb1707408772919d1d8 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 29 Aug 2018 11:42:45 +0200 Subject: [PATCH 04/22] Reset machines that use a removed quality changes CURA-5675 When a custom quality gets removed, Cura should reset all machines which use this custom quality to default. --- cura/Machines/QualityManager.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cura/Machines/QualityManager.py b/cura/Machines/QualityManager.py index cb2776429f..6869d99bc7 100644 --- a/cura/Machines/QualityManager.py +++ b/cura/Machines/QualityManager.py @@ -363,8 +363,19 @@ class QualityManager(QObject): @pyqtSlot(QObject) def removeQualityChangesGroup(self, quality_changes_group: "QualityChangesGroup"): Logger.log("i", "Removing quality changes group [%s]", quality_changes_group.name) + removed_quality_changes_ids = set() for node in quality_changes_group.getAllNodes(): - self._container_registry.removeContainer(node.getMetaDataEntry("id")) + container_id = node.getMetaDataEntry("id") + self._container_registry.removeContainer(container_id) + removed_quality_changes_ids.add(container_id) + + # Reset all machines that have activated this quality changes to empty. + for global_stack in self._container_registry.findContainerStacks(type = "machine"): + if global_stack.qualityChanges.getId() in removed_quality_changes_ids: + global_stack.qualityChanges = self._empty_quality_changes_container + for extruder_stack in self._container_registry.findContainerStacks(type = "extruder_train"): + if extruder_stack.qualityChanges.getId() in removed_quality_changes_ids: + extruder_stack.qualityChanges = self._empty_quality_changes_container # # Rename a set of quality changes containers. Returns the new name. From ac2125c3a5d8b4c16afd23922f0a3c8151696e6f Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 30 Aug 2018 14:36:54 +0200 Subject: [PATCH 05/22] Hide setting when support pattern is set to concentric... because it has no influence on the concentric pattern --- resources/definitions/fdmprinter.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index be7eecc686..57b7c93eed 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3882,7 +3882,7 @@ "minimum_value": "-90", "maximum_value": "90", "default_value": 0, - "enabled": "support_enable", + "enabled": "support_enable and support_pattern != 'concentric' and support_infill_rate > 0", "settable_per_mesh": false, "settable_per_extruder": true }, From 65f3605d9205bc7c551894b6b3d226d80c63b59e Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 30 Aug 2018 14:43:00 +0200 Subject: [PATCH 06/22] Allow the full range of orientations --- resources/definitions/fdmprinter.def.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 57b7c93eed..b3601b4405 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3879,8 +3879,8 @@ "description": "Orientation of the infill pattern for supports. The support infill pattern is rotated in the horizontal plane.", "unit": "°", "type": "float", - "minimum_value": "-90", - "maximum_value": "90", + "minimum_value": "-180", + "maximum_value": "180", "default_value": 0, "enabled": "support_enable and support_pattern != 'concentric' and support_infill_rate > 0", "settable_per_mesh": false, From 9258c9a7fc49b3bbe8b7c775c1b4377ca26fe4ef Mon Sep 17 00:00:00 2001 From: Aleksei S Date: Fri, 31 Aug 2018 11:03:30 +0200 Subject: [PATCH 07/22] Added links to toolbox CURA-5676 --- .../resources/qml/ToolboxAuthorPage.qml | 31 ++++++++++- .../qml/ToolboxCompatibilityChart.qml | 47 ++++++++++++++++ plugins/Toolbox/src/PackagesModel.py | 54 ++++++++++++------- 3 files changed, 111 insertions(+), 21 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml index 04b055ed66..9666e65613 100644 --- a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml @@ -82,9 +82,16 @@ Item } spacing: Math.floor(UM.Theme.getSize("narrow_margin").height) width: childrenRect.width + Label { - text: catalog.i18nc("@label", "Contact") + ":" + text: catalog.i18nc("@label", "Website") + ":" + font: UM.Theme.getFont("very_small") + color: UM.Theme.getColor("text_medium") + } + Label + { + text: catalog.i18nc("@label", "Email") + ":" font: UM.Theme.getFont("very_small") color: UM.Theme.getColor("text_medium") } @@ -100,6 +107,26 @@ Item topMargin: UM.Theme.getSize("default_margin").height } spacing: Math.floor(UM.Theme.getSize("narrow_margin").height) + + Label + { + text: + { + if (details.website) + { + return "Link" + } + else + { + return "" + } + } + font: UM.Theme.getFont("very_small") + color: UM.Theme.getColor("text") + linkColor: UM.Theme.getColor("text_link") + onLinkActivated: Qt.openUrlExternally(link) + } + Label { text: @@ -110,7 +137,7 @@ Item } else { - return ""+details.name+"" + return "" } } font: UM.Theme.getFont("very_small") diff --git a/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml b/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml index 1efcde2110..2ab8db007b 100644 --- a/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml +++ b/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml @@ -8,7 +8,31 @@ import UM 1.1 as UM Item { + id: base + property var packageData + property var technical_data_sheet_url + + function initiazeLinks() + { + var all_links = packageData.links + for(var index = 0; index < all_links.length; index++) + { + var temp_link = all_links[index] + var title = temp_link["title"] + + if(title === "Technical Data Sheet") + { + base.technical_data_sheet_url = temp_link["url"] + } + } + } + + Component.onCompleted: + { + initiazeLinks() + } + anchors.topMargin: UM.Theme.getSize("default_margin").height height: visible ? childrenRect.height : 0 visible: packageData.type == "material" && packageData.has_configs @@ -132,4 +156,27 @@ Item width: Math.floor(table.width * 0.1) } } + + + + Label + { + id: technical_data_sheet + anchors.top: table.bottom + anchors.topMargin: UM.Theme.getSize("default_margin").height / 2 + visible: base.technical_data_sheet_url !== undefined + text: + { + if (base.technical_data_sheet_url !== undefined) + { + return "%2".arg(base.technical_data_sheet_url).arg("Technical Data Sheet") + } + return "" + } + font: UM.Theme.getFont("very_small") + color: UM.Theme.getColor("text") + linkColor: UM.Theme.getColor("text_link") + onLinkActivated: Qt.openUrlExternally(link) + } + } diff --git a/plugins/Toolbox/src/PackagesModel.py b/plugins/Toolbox/src/PackagesModel.py index 8b9199b127..ddbd2d2665 100644 --- a/plugins/Toolbox/src/PackagesModel.py +++ b/plugins/Toolbox/src/PackagesModel.py @@ -7,6 +7,7 @@ from typing import Dict from PyQt5.QtCore import Qt, pyqtProperty from UM.Qt.ListModel import ListModel from .ConfigsModel import ConfigsModel +from UM.Logger import Logger ## Model that holds cura packages. By setting the filter property the instances held by this model can be changed. class PackagesModel(ListModel): @@ -34,6 +35,8 @@ class PackagesModel(ListModel): self.addRoleName(Qt.UserRole + 17, "supported_configs") self.addRoleName(Qt.UserRole + 18, "download_count") self.addRoleName(Qt.UserRole + 19, "tags") + self.addRoleName(Qt.UserRole + 20, "links") + self.addRoleName(Qt.UserRole + 21, "website") # List of filters for queries. The result is the union of the each list of results. self._filter = {} # type: Dict[str, str] @@ -45,10 +48,18 @@ class PackagesModel(ListModel): def _update(self): items = [] + #If a user has a slow internet connection then the metadata might be None + if self._metadata is None: + Logger.logException("w", "Failed to load packages for Toolbox") + self.setItems(items) + return + + for package in self._metadata: has_configs = False configs_model = None + data_links = [] if "data" in package: if "supported_configs" in package["data"]: if len(package["data"]["supported_configs"]) > 0: @@ -56,33 +67,38 @@ class PackagesModel(ListModel): configs_model = ConfigsModel() configs_model.setConfigs(package["data"]["supported_configs"]) + data_links = package['data']['links'] if 'links' in package['data'] else [] + if "author_id" not in package["author"] or "display_name" not in package["author"]: package["author"]["author_id"] = "" package["author"]["display_name"] = "" # raise Exception("Detected a package with malformed author data.") items.append({ - "id": package["package_id"], - "type": package["package_type"], - "name": package["display_name"], - "version": package["package_version"], - "author_id": package["author"]["author_id"], - "author_name": package["author"]["display_name"], - "author_email": package["author"]["email"] if "email" in package["author"] else None, - "description": package["description"] if "description" in package else None, - "icon_url": package["icon_url"] if "icon_url" in package else None, - "image_urls": package["image_urls"] if "image_urls" in package else None, - "download_url": package["download_url"] if "download_url" in package else None, - "last_updated": package["last_updated"] if "last_updated" in package else None, - "is_bundled": package["is_bundled"] if "is_bundled" in package else False, - "is_active": package["is_active"] if "is_active" in package else False, - "is_installed": package["is_installed"] if "is_installed" in package else False, - "has_configs": has_configs, - "supported_configs": configs_model, - "download_count": package["download_count"] if "download_count" in package else 0, - "tags": package["tags"] if "tags" in package else [] + "id": package["package_id"], + "type": package["package_type"], + "name": package["display_name"], + "version": package["package_version"], + "author_id": package["author"]["author_id"], + "author_name": package["author"]["display_name"], + "author_email": package["author"]["email"] if "email" in package["author"] else None, + "description": package["description"] if "description" in package else None, + "icon_url": package["icon_url"] if "icon_url" in package else None, + "image_urls": package["image_urls"] if "image_urls" in package else None, + "download_url": package["download_url"] if "download_url" in package else None, + "last_updated": package["last_updated"] if "last_updated" in package else None, + "is_bundled": package["is_bundled"] if "is_bundled" in package else False, + "is_active": package["is_active"] if "is_active" in package else False, + "is_installed": package["is_installed"] if "is_installed" in package else False, + "has_configs": has_configs, + "supported_configs": configs_model, + "download_count": package["download_count"] if "download_count" in package else 0, + "tags": package["tags"] if "tags" in package else [], + "links": data_links, + "website": package["website"] if "website" in package else None, }) + # Filter on all the key-word arguments. for key, value in self._filter.items(): if key is "tags": From b0b148f2d0d7ad880608880779f2b0d0fa3a7967 Mon Sep 17 00:00:00 2001 From: Aleksei S Date: Fri, 31 Aug 2018 11:06:25 +0200 Subject: [PATCH 08/22] Remove wrong setting CURA-5676 --- resources/definitions/fdmprinter.def.json | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 1b2d66810b..3eb7cb1c32 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3875,19 +3875,6 @@ } } }, - "support_infill_angle": - { - "label": "Support Infill Line Direction", - "description": "Orientation of the infill pattern for supports. The support infill pattern is rotated in the horizontal plane.", - "unit": "°", - "type": "float", - "minimum_value": "-90", - "maximum_value": "90", - "default_value": 0, - "enabled": "support_enable", - "settable_per_mesh": false, - "settable_per_extruder": true - }, "support_z_distance": { "label": "Support Z Distance", From e17cf3dfbffd8c8d2c19ec97c059d7629f22ebb5 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 31 Aug 2018 13:20:40 +0200 Subject: [PATCH 09/22] Show company website full link as text CURA-5676 --- plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml index 9666e65613..7195f6d276 100644 --- a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml @@ -114,7 +114,7 @@ Item { if (details.website) { - return "Link" + return ""+details.website+"" } else { From 9433cf7c45df38b599c3272aa02a7c04e406ae6d Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 31 Aug 2018 13:23:39 +0200 Subject: [PATCH 10/22] Change email field to show full email address CURA-5676 --- plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml index 7195f6d276..be6cd5e713 100644 --- a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml @@ -133,7 +133,7 @@ Item { if (details.email) { - return ""+details.name+"" + return ""+details.email+"" } else { From c4afbe7a673ceeac7bee277ef91c1e8efaa3bd41 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 31 Aug 2018 13:45:02 +0200 Subject: [PATCH 11/22] Convert links to a dict CURA-5676 Easier to process. --- .../qml/ToolboxCompatibilityChart.qml | 31 +++++-------------- plugins/Toolbox/src/PackagesModel.py | 27 +++++++++------- 2 files changed, 23 insertions(+), 35 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml b/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml index 2ab8db007b..4a008f2a83 100644 --- a/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml +++ b/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml @@ -11,26 +11,13 @@ Item id: base property var packageData - property var technical_data_sheet_url - - function initiazeLinks() - { - var all_links = packageData.links - for(var index = 0; index < all_links.length; index++) + property var technicalDataSheetUrl: { + var link = undefined + if ("Technical Data Sheet" in packageData.links) { - var temp_link = all_links[index] - var title = temp_link["title"] - - if(title === "Technical Data Sheet") - { - base.technical_data_sheet_url = temp_link["url"] - } + link = packageData.links["Technical Data Sheet"] } - } - - Component.onCompleted: - { - initiazeLinks() + return link } anchors.topMargin: UM.Theme.getSize("default_margin").height @@ -157,19 +144,17 @@ Item } } - - Label { id: technical_data_sheet anchors.top: table.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height / 2 - visible: base.technical_data_sheet_url !== undefined + visible: base.technicalDataSheetUrl !== undefined text: { - if (base.technical_data_sheet_url !== undefined) + if (base.technicalDataSheetUrl !== undefined) { - return "%2".arg(base.technical_data_sheet_url).arg("Technical Data Sheet") + return "%2".arg(base.technicalDataSheetUrl).arg("Technical Data Sheet") } return "" } diff --git a/plugins/Toolbox/src/PackagesModel.py b/plugins/Toolbox/src/PackagesModel.py index ddbd2d2665..7892044d00 100644 --- a/plugins/Toolbox/src/PackagesModel.py +++ b/plugins/Toolbox/src/PackagesModel.py @@ -5,9 +5,12 @@ import re from typing import Dict from PyQt5.QtCore import Qt, pyqtProperty -from UM.Qt.ListModel import ListModel -from .ConfigsModel import ConfigsModel + from UM.Logger import Logger +from UM.Qt.ListModel import ListModel + +from .ConfigsModel import ConfigsModel + ## Model that holds cura packages. By setting the filter property the instances held by this model can be changed. class PackagesModel(ListModel): @@ -48,18 +51,16 @@ class PackagesModel(ListModel): def _update(self): items = [] - #If a user has a slow internet connection then the metadata might be None if self._metadata is None: Logger.logException("w", "Failed to load packages for Toolbox") self.setItems(items) return - for package in self._metadata: - has_configs = False configs_model = None - data_links = [] + + links_dict = {} if "data" in package: if "supported_configs" in package["data"]: if len(package["data"]["supported_configs"]) > 0: @@ -67,7 +68,10 @@ class PackagesModel(ListModel): configs_model = ConfigsModel() configs_model.setConfigs(package["data"]["supported_configs"]) - data_links = package['data']['links'] if 'links' in package['data'] else [] + # Links is a list of dictionaries with "title" and "url". Convert this list into a dict so it's easier + # to process. + link_list = package['data']['links'] if 'links' in package['data'] else [] + links_dict = {d["title"]: d["url"] for d in link_list} if "author_id" not in package["author"] or "display_name" not in package["author"]: package["author"]["author_id"] = "" @@ -94,19 +98,18 @@ class PackagesModel(ListModel): "supported_configs": configs_model, "download_count": package["download_count"] if "download_count" in package else 0, "tags": package["tags"] if "tags" in package else [], - "links": data_links, + "links": links_dict, "website": package["website"] if "website" in package else None, }) - # Filter on all the key-word arguments. for key, value in self._filter.items(): if key is "tags": - key_filter = lambda item, value = value: value in item["tags"] + key_filter = lambda item, v = value: v in item["tags"] elif "*" in value: - key_filter = lambda candidate, key = key, value = value: self._matchRegExp(candidate, key, value) + key_filter = lambda candidate, k = key, v = value: self._matchRegExp(candidate, k, v) else: - key_filter = lambda candidate, key = key, value = value: self._matchString(candidate, key, value) + key_filter = lambda candidate, k = key, v = value: self._matchString(candidate, k, v) items = filter(key_filter, items) # Execute all filters. From 98d8a3f3e3c83ffd4443ac2a8afae84d071e80eb Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 31 Aug 2018 13:49:08 +0200 Subject: [PATCH 12/22] Fix code style and small cleanup CURA-5676 --- .../Toolbox/resources/qml/ToolboxAuthorPage.qml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml index be6cd5e713..90b92bd832 100644 --- a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml @@ -114,12 +114,9 @@ Item { if (details.website) { - return ""+details.website+"" - } - else - { - return "" + return "" + details.website + "" } + return "" } font: UM.Theme.getFont("very_small") color: UM.Theme.getColor("text") @@ -133,12 +130,9 @@ Item { if (details.email) { - return ""+details.email+"" - } - else - { - return "" + return "" + details.email + "" } + return "" } font: UM.Theme.getFont("very_small") color: UM.Theme.getColor("text") From 6cceebb117c963dcef71448be368ea2012a3a44d Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 31 Aug 2018 15:13:44 +0200 Subject: [PATCH 13/22] Revert "Remove double shortcut buttons" CURA-5642 This breaks translations and doesn't fix the shortcut key problem. --- resources/qml/Actions.qml | 18 +++++++++--------- resources/qml/Cura.qml | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index d5572298f7..21e6eebf58 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -110,35 +110,35 @@ Item Action { id: view3DCameraAction; - text: catalog.i18nc("@action:inmenu menubar:view","3D View"); + text: catalog.i18nc("@action:inmenu menubar:view","&3D View"); onTriggered: UM.Controller.rotateView("3d", 0); } Action { id: viewFrontCameraAction; - text: catalog.i18nc("@action:inmenu menubar:view","Front View"); + text: catalog.i18nc("@action:inmenu menubar:view","&Front View"); onTriggered: UM.Controller.rotateView("home", 0); } Action { id: viewTopCameraAction; - text: catalog.i18nc("@action:inmenu menubar:view","Top View"); + text: catalog.i18nc("@action:inmenu menubar:view","&Top View"); onTriggered: UM.Controller.rotateView("y", 90); } Action { id: viewLeftSideCameraAction; - text: catalog.i18nc("@action:inmenu menubar:view","Left Side View"); + text: catalog.i18nc("@action:inmenu menubar:view","&Left Side View"); onTriggered: UM.Controller.rotateView("x", 90); } Action { id: viewRightSideCameraAction; - text: catalog.i18nc("@action:inmenu menubar:view","Right Side View"); + text: catalog.i18nc("@action:inmenu menubar:view","&Right Side View"); onTriggered: UM.Controller.rotateView("x", -90); } @@ -229,7 +229,7 @@ Item Action { id: deleteSelectionAction; - text: catalog.i18ncp("@action:inmenu menubar:edit", "Delete Selected Model", "Delete Selected Models", UM.Selection.selectionCount); + text: catalog.i18ncp("@action:inmenu menubar:edit", "Delete &Selected Model", "Delete &Selected Models", UM.Selection.selectionCount); enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection; iconName: "edit-delete"; shortcut: StandardKey.Delete; @@ -239,7 +239,7 @@ Item Action //Also add backspace as the same function as delete because on Macintosh keyboards the button called "delete" is actually a backspace, and the user expects it to function as a delete. { id: backspaceSelectionAction - text: catalog.i18ncp("@action:inmenu menubar:edit", "Delete Selected Model", "Delete Selected Models", UM.Selection.selectionCount) + text: catalog.i18ncp("@action:inmenu menubar:edit", "Delete &Selected Model", "Delete &Selected Models", UM.Selection.selectionCount) enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection iconName: "edit-delete" shortcut: StandardKey.Backspace @@ -328,7 +328,7 @@ Item Action { id: selectAllAction; - text: catalog.i18nc("@action:inmenu menubar:edit","Select All Models"); + text: catalog.i18nc("@action:inmenu menubar:edit","&Select All Models"); enabled: UM.Controller.toolsEnabled; iconName: "edit-select-all"; shortcut: "Ctrl+A"; @@ -386,7 +386,7 @@ Item Action { id: resetAllAction; - text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Transformations"); + text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model &Transformations"); onTriggered: CuraApplication.resetAll(); } diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 616523fc45..97742de57a 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -117,7 +117,7 @@ UM.MainWindow MenuItem { id: saveWorkspaceMenu - text: catalog.i18nc("@title:menu menubar:file","Save...") + text: catalog.i18nc("@title:menu menubar:file","&Save...") onTriggered: { var args = { "filter_by_machine": false, "file_type": "workspace", "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml" }; From dec76a19ed2ee1bf5c9baaf3da8ad6110a875c92 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 31 Aug 2018 16:13:01 +0200 Subject: [PATCH 14/22] Build models using reserved tags Contributes to CURA-5670 --- .../resources/qml/ToolboxDownloadsPage.qml | 2 +- plugins/Toolbox/src/Toolbox.py | 84 +++++++++++++++---- 2 files changed, 70 insertions(+), 16 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml index 1089fcc51e..bcca02583d 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml @@ -30,7 +30,7 @@ ScrollView id: allPlugins width: parent.width heading: toolbox.viewCategory == "material" ? catalog.i18nc("@label", "Community Contributions") : catalog.i18nc("@label", "Community Plugins") - model: toolbox.viewCategory == "material" ? toolbox.authorsModel : toolbox.packagesModel + model: toolbox.viewCategory == "material" ? toolbox.materialsAvailableModel : toolbox.pluginsAvailableModel } ToolboxDownloadsGrid diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index c4205b8ed5..48219494bd 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -83,7 +83,7 @@ class Toolbox(QObject, Extension): "plugins_available": PackagesModel(self), "plugins_installed": PackagesModel(self), "materials_showcase": AuthorsModel(self), - "materials_available": PackagesModel(self), + "materials_available": AuthorsModel(self), "materials_installed": PackagesModel(self), "materials_generic": PackagesModel(self) } # type: Dict[str, ListModel] @@ -517,7 +517,7 @@ class Toolbox(QObject, Extension): @pyqtSlot(str, result = int) def getTotalNumberOfPackagesByAuthor(self, author_id: str) -> int: count = 0 - for package in self._metadata["materials_available"]: + for package in self._metadata["packages"]: if package["author"]["author_id"] == author_id: count += 1 return count @@ -624,24 +624,27 @@ class Toolbox(QObject, Extension): Logger.log("e", "Could not find the %s model.", type) break - # HACK: Eventually get rid of the code from here... - if type is "plugins_showcase" or type is "materials_showcase": - self._metadata["plugins_showcase"] = json_data["data"]["plugin"]["packages"] - self._models["plugins_showcase"].setMetadata(self._metadata["plugins_showcase"]) - self._metadata["materials_showcase"] = json_data["data"]["material"]["authors"] - self._models["materials_showcase"].setMetadata(self._metadata["materials_showcase"]) - else: - # ...until here. - # This hack arises for multiple reasons but the main - # one is because there are not separate API calls - # for different kinds of showcases. - self._metadata[type] = json_data["data"] - self._models[type].setMetadata(self._metadata[type]) + # HACK + do_not_handle = [ + "materials_available", + "materials_showcase", + "plugins_available", + "plugins_showcase", + ] + + # Do nothing because we'll handle these from the "packages" call + if type in do_not_handle: + return + + self._metadata[type] = json_data["data"] + self._models[type].setMetadata(self._metadata[type]) # Do some auto filtering # TODO: Make multiple API calls in the future to handle this if type is "packages": self._models[type].setFilter({"type": "plugin"}) + self.buildMaterialsModels() + self.buildPluginsModels() if type is "authors": self._models[type].setFilter({"package_types": "material"}) if type is "materials_generic": @@ -755,6 +758,10 @@ class Toolbox(QObject, Extension): def pluginsShowcaseModel(self) -> PackagesModel: return cast(PackagesModel, self._models["plugins_showcase"]) + @pyqtProperty(QObject, notify = metadataChanged) + def pluginsAvailableModel(self) -> PackagesModel: + return cast(PackagesModel, self._models["plugins_available"]) + @pyqtProperty(QObject, notify = metadataChanged) def pluginsInstalledModel(self) -> PackagesModel: return cast(PackagesModel, self._models["plugins_installed"]) @@ -763,6 +770,10 @@ class Toolbox(QObject, Extension): def materialsShowcaseModel(self) -> AuthorsModel: return cast(AuthorsModel, self._models["materials_showcase"]) + @pyqtProperty(QObject, notify = metadataChanged) + def materialsAvailableModel(self) -> AuthorsModel: + return cast(AuthorsModel, self._models["materials_available"]) + @pyqtProperty(QObject, notify = metadataChanged) def materialsInstalledModel(self) -> PackagesModel: return cast(PackagesModel, self._models["materials_installed"]) @@ -798,3 +809,46 @@ class Toolbox(QObject, Extension): return self._models[model_type].setFilter({}) self.filterChanged.emit() + + + # HACK(S): + # -------------------------------------------------------------------------- + def buildMaterialsModels(self) -> None: + + self._metadata["materials_showcase"] = [] + self._metadata["materials_available"] = [] + + processed_authors = [] + + for item in self._metadata["packages"]: + if item["package_type"] == "material": + + author = item["author"] + if author["author_id"] in processed_authors: + continue + + if "showcase" in item["tags"]: + self._metadata["materials_showcase"].append(author) + else: + self._metadata["materials_available"].append(author) + + processed_authors.append(author["author_id"]) + + self._models["materials_showcase"].setMetadata(self._metadata["materials_showcase"]) + self._models["materials_available"].setMetadata(self._metadata["materials_available"]) + + def buildPluginsModels(self) -> None: + + self._metadata["plugins_showcase"] = [] + self._metadata["plugins_available"] = [] + + for item in self._metadata["packages"]: + if item["package_type"] == "plugin": + + if "showcase" in item["tags"]: + self._metadata["plugins_showcase"].append(item) + else: + self._metadata["plugins_available"].append(item) + + self._models["plugins_showcase"].setMetadata(self._metadata["plugins_showcase"]) + self._models["plugins_available"].setMetadata(self._metadata["plugins_available"]) From 988b9059b9d7966cc1daae28561ea16cc24ff11b Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 31 Aug 2018 16:55:03 +0200 Subject: [PATCH 15/22] Fix code-style Contributes to CURA-5670 --- plugins/Toolbox/src/Toolbox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 48219494bd..52b00f5069 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -818,7 +818,7 @@ class Toolbox(QObject, Extension): self._metadata["materials_showcase"] = [] self._metadata["materials_available"] = [] - processed_authors = [] + processed_authors = [] # type: List[str] for item in self._metadata["packages"]: if item["package_type"] == "material": From 1136033f9799ed1249dfb4f988511a12853b1a12 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 3 Sep 2018 10:50:07 +0200 Subject: [PATCH 16/22] Remove superfluous check for 'ok T:' This check is never hit because if there is 'ok T:' in the bytes array then it will have hit the first check for 'ok ' and 'T:'. --- plugins/USBPrinting/USBPrinterOutputDevice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/USBPrinting/USBPrinterOutputDevice.py b/plugins/USBPrinting/USBPrinterOutputDevice.py index 45b566fcab..4ceda52875 100644 --- a/plugins/USBPrinting/USBPrinterOutputDevice.py +++ b/plugins/USBPrinting/USBPrinterOutputDevice.py @@ -326,7 +326,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice): if self._firmware_name is None: self.sendCommand("M115") - if (b"ok " in line and b"T:" in line) or b"ok T:" in line or line.startswith(b"T:") or b"ok B:" in line or line.startswith(b"B:"): # Temperature message. 'T:' for extruder and 'B:' for bed + if (b"ok " in line and b"T:" in line) or line.startswith(b"T:") or b"ok B:" in line or line.startswith(b"B:"): # Temperature message. 'T:' for extruder and 'B:' for bed extruder_temperature_matches = re.findall(b"T(\d*): ?([\d\.]+) ?\/?([\d\.]+)?", line) # Update all temperature values matched_extruder_nrs = [] From 6df029971d2f0dc4070959c892f2d79c3cf1cb04 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 3 Sep 2018 11:02:24 +0200 Subject: [PATCH 17/22] Don't crash if layer height is a formula We obtain the layer height here but that might be a formula so we should evaluate that formula here. Fixes #4005. --- cura/Machines/Models/QualityProfilesDropDownMenuModel.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cura/Machines/Models/QualityProfilesDropDownMenuModel.py b/cura/Machines/Models/QualityProfilesDropDownMenuModel.py index 59c4f4fa5b..dc2482ed45 100644 --- a/cura/Machines/Models/QualityProfilesDropDownMenuModel.py +++ b/cura/Machines/Models/QualityProfilesDropDownMenuModel.py @@ -6,10 +6,10 @@ from PyQt5.QtCore import Qt from UM.Application import Application from UM.Logger import Logger from UM.Qt.ListModel import ListModel +from UM.Settings.SettingFunction import SettingFunction from cura.Machines.QualityManager import QualityGroup - # # QML Model for all built-in quality profiles. This model is used for the drop-down quality menu. # @@ -106,4 +106,8 @@ class QualityProfilesDropDownMenuModel(ListModel): container = global_stack.definition if container and container.hasProperty("layer_height", "value"): layer_height = container.getProperty("layer_height", "value") + + if isinstance(layer_height, SettingFunction): + layer_height = layer_height() + return float(layer_height) From 149a47e5a779c0ae10fbccf82c7dccf4ce1dce53 Mon Sep 17 00:00:00 2001 From: Aleksei S Date: Mon, 3 Sep 2018 11:15:25 +0200 Subject: [PATCH 18/22] Remove double keys from right click menu, remove backspaceSelectionAction because not used CURA-5642 --- resources/qml/Actions.qml | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index 21e6eebf58..db230ebca7 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -110,28 +110,28 @@ Item Action { id: view3DCameraAction; - text: catalog.i18nc("@action:inmenu menubar:view","&3D View"); + text: catalog.i18nc("@action:inmenu menubar:view","3D View"); onTriggered: UM.Controller.rotateView("3d", 0); } Action { id: viewFrontCameraAction; - text: catalog.i18nc("@action:inmenu menubar:view","&Front View"); + text: catalog.i18nc("@action:inmenu menubar:view","Front View"); onTriggered: UM.Controller.rotateView("home", 0); } Action { id: viewTopCameraAction; - text: catalog.i18nc("@action:inmenu menubar:view","&Top View"); + text: catalog.i18nc("@action:inmenu menubar:view","Top View"); onTriggered: UM.Controller.rotateView("y", 90); } Action { id: viewLeftSideCameraAction; - text: catalog.i18nc("@action:inmenu menubar:view","&Left Side View"); + text: catalog.i18nc("@action:inmenu menubar:view","Left Side View"); onTriggered: UM.Controller.rotateView("x", 90); } @@ -229,23 +229,13 @@ Item Action { id: deleteSelectionAction; - text: catalog.i18ncp("@action:inmenu menubar:edit", "Delete &Selected Model", "Delete &Selected Models", UM.Selection.selectionCount); + text: catalog.i18ncp("@action:inmenu menubar:edit", "Delete Selected Model", "Delete Selected Models", UM.Selection.selectionCount); enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection; iconName: "edit-delete"; shortcut: StandardKey.Delete; onTriggered: CuraActions.deleteSelection(); } - Action //Also add backspace as the same function as delete because on Macintosh keyboards the button called "delete" is actually a backspace, and the user expects it to function as a delete. - { - id: backspaceSelectionAction - text: catalog.i18ncp("@action:inmenu menubar:edit", "Delete &Selected Model", "Delete &Selected Models", UM.Selection.selectionCount) - enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection - iconName: "edit-delete" - shortcut: StandardKey.Backspace - onTriggered: CuraActions.deleteSelection() - } - Action { id: centerSelectionAction; @@ -328,7 +318,7 @@ Item Action { id: selectAllAction; - text: catalog.i18nc("@action:inmenu menubar:edit","&Select All Models"); + text: catalog.i18nc("@action:inmenu menubar:edit","Select All Models"); enabled: UM.Controller.toolsEnabled; iconName: "edit-select-all"; shortcut: "Ctrl+A"; @@ -338,7 +328,7 @@ Item Action { id: deleteAllAction; - text: catalog.i18nc("@action:inmenu menubar:edit","&Clear Build Plate"); + text: catalog.i18nc("@action:inmenu menubar:edit","Clear Build Plate"); enabled: UM.Controller.toolsEnabled; iconName: "edit-delete"; shortcut: "Ctrl+D"; @@ -348,7 +338,7 @@ Item Action { id: reloadAllAction; - text: catalog.i18nc("@action:inmenu menubar:file","Re&load All Models"); + text: catalog.i18nc("@action:inmenu menubar:file","Reload All Models"); iconName: "document-revert"; shortcut: "F5" onTriggered: CuraApplication.reloadAll(); From ab572e9de24806963c9523bb4023011de3662a50 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 3 Sep 2018 14:03:44 +0200 Subject: [PATCH 19/22] SettingFunction evaluation needs a stack to provide values Note that this is still not correct. When the value gets evaluated, we need to evaluate it with that container in the stack(s), but this case, the stack may have other containers, so the evaluation can give incorrect values because its context is simply not correct. This change only prevents it from breaking because it's missing a provider. --- cura/Machines/Models/QualityProfilesDropDownMenuModel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Machines/Models/QualityProfilesDropDownMenuModel.py b/cura/Machines/Models/QualityProfilesDropDownMenuModel.py index dc2482ed45..a01cc1194f 100644 --- a/cura/Machines/Models/QualityProfilesDropDownMenuModel.py +++ b/cura/Machines/Models/QualityProfilesDropDownMenuModel.py @@ -108,6 +108,6 @@ class QualityProfilesDropDownMenuModel(ListModel): layer_height = container.getProperty("layer_height", "value") if isinstance(layer_height, SettingFunction): - layer_height = layer_height() + layer_height = layer_height(global_stack) return float(layer_height) From bf1d3b964f87ad587f5cb2cb2c02ea5a3d167b35 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 3 Sep 2018 14:30:05 +0200 Subject: [PATCH 20/22] Skip loading a reply if it's not later handled. Contributes to CURA-5670. --- .../qml/ToolboxDownloadsGridTile.qml | 2 +- .../qml/ToolboxDownloadsShowcaseTile.qml | 2 +- plugins/Toolbox/src/Toolbox.py | 30 ++++++++++--------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index ebd4c006f8..4366db041c 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -9,7 +9,7 @@ import UM 1.1 as UM Item { - property int packageCount: (toolbox.viewCategory == "material" && model.type === undefined) ? toolbox.getTotalNumberOfPackagesByAuthor(model.id) : 1 + property int packageCount: (toolbox.viewCategory == "material" && model.type === undefined) ? toolbox.getTotalNumberOfMaterialPackagesByAuthor(model.id) : 1 property int installedPackages: (toolbox.viewCategory == "material" && model.type === undefined) ? toolbox.getNumberOfInstalledPackagesByAuthor(model.id) : (toolbox.isInstalled(model.id) ? 1 : 0) height: childrenRect.height Layout.alignment: Qt.AlignTop | Qt.AlignLeft diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml index 15d1ae302c..845bbe8f91 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml @@ -9,7 +9,7 @@ import UM 1.1 as UM Rectangle { - property int packageCount: toolbox.viewCategory == "material" ? toolbox.getTotalNumberOfPackagesByAuthor(model.id) : 1 + property int packageCount: toolbox.viewCategory == "material" ? toolbox.getTotalNumberOfMaterialPackagesByAuthor(model.id) : 1 property int installedPackages: toolbox.viewCategory == "material" ? toolbox.getNumberOfInstalledPackagesByAuthor(model.id) : (toolbox.isInstalled(model.id) ? 1 : 0) id: tileBase width: UM.Theme.getSize("toolbox_thumbnail_large").width + (2 * UM.Theme.getSize("default_lining").width) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 52b00f5069..615fc06ebc 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -514,10 +514,11 @@ class Toolbox(QObject, Extension): count += 1 return count + # This slot is only used to get the number of material packages by author, not any other type of packages. @pyqtSlot(str, result = int) - def getTotalNumberOfPackagesByAuthor(self, author_id: str) -> int: + def getTotalNumberOfMaterialPackagesByAuthor(self, author_id: str) -> int: count = 0 - for package in self._metadata["packages"]: + for package in self._metadata["materials_available"]: if package["author"]["author_id"] == author_id: count += 1 return count @@ -606,8 +607,21 @@ class Toolbox(QObject, Extension): self.resetDownload() return + # HACK: These request are not handled independently at this moment, but together from the "packages" call + do_not_handle = [ + "materials_available", + "materials_showcase", + "plugins_available", + "plugins_showcase", + ] + if reply.operation() == QNetworkAccessManager.GetOperation: for type, url in self._request_urls.items(): + + # HACK: Do nothing because we'll handle these from the "packages" call + if type in do_not_handle: + return + if reply.url() == url: if reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) == 200: try: @@ -623,18 +637,6 @@ class Toolbox(QObject, Extension): if not self._models[type]: Logger.log("e", "Could not find the %s model.", type) break - - # HACK - do_not_handle = [ - "materials_available", - "materials_showcase", - "plugins_available", - "plugins_showcase", - ] - - # Do nothing because we'll handle these from the "packages" call - if type in do_not_handle: - return self._metadata[type] = json_data["data"] self._models[type].setMetadata(self._metadata[type]) From b638b2274a25070aad0450d0e1fe0c4103ee7d3c Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 3 Sep 2018 15:12:52 +0200 Subject: [PATCH 21/22] Count only the material packages by author, not all packages. Contributes to CURA-5670. --- plugins/Toolbox/src/Toolbox.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 615fc06ebc..00864c6b4e 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -518,9 +518,10 @@ class Toolbox(QObject, Extension): @pyqtSlot(str, result = int) def getTotalNumberOfMaterialPackagesByAuthor(self, author_id: str) -> int: count = 0 - for package in self._metadata["materials_available"]: - if package["author"]["author_id"] == author_id: - count += 1 + for package in self._metadata["packages"]: + if package["package_type"] == "material": + if package["author"]["author_id"] == author_id: + count += 1 return count @pyqtSlot(str, result = bool) From b02769912f97ff159ea191f0e7f5aa84625e5f48 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 5 Sep 2018 09:42:20 +0200 Subject: [PATCH 22/22] Don't print slower than 1mm/s If you set the wall printing speed to 10, it would through inheritance result in an outer wall printing speed of 0. No longer. --- resources/variants/ultimaker2_plus_0.4.inst.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/variants/ultimaker2_plus_0.4.inst.cfg b/resources/variants/ultimaker2_plus_0.4.inst.cfg index 544728f8a4..d9d982ef11 100644 --- a/resources/variants/ultimaker2_plus_0.4.inst.cfg +++ b/resources/variants/ultimaker2_plus_0.4.inst.cfg @@ -12,5 +12,5 @@ hardware_type = nozzle machine_nozzle_size = 0.4 machine_nozzle_tip_outer_diameter = 1.05 speed_wall = =round(speed_print / 1.25, 1) -speed_wall_0 = =1 if speed_wall < 10 else (speed_wall - 10) +speed_wall_0 = =min(speed_wall - 10, 1) speed_topbottom = =round(speed_print / 2.25, 1)