From 293f2ebda9d0bde887729f80f36b1f0351f96818 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Thu, 2 Nov 2023 16:52:34 +0100 Subject: [PATCH 1/6] Revert "Find python dependencies directly in python" This reverts commit e7188c2f9f92b6c9a695d850a987aab0bed5de08. --- CuraVersion.py.jinja | 4 +--- conanfile.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CuraVersion.py.jinja b/CuraVersion.py.jinja index 690a1386d3..515293b8af 100644 --- a/CuraVersion.py.jinja +++ b/CuraVersion.py.jinja @@ -1,8 +1,6 @@ # Copyright (c) 2023 UltiMaker # Cura is released under the terms of the LGPLv3 or higher. -from pkg_resources import working_set - CuraAppName = "{{ cura_app_name }}" CuraAppDisplayName = "{{ cura_app_display_name }}" CuraVersion = "{{ cura_version }}" @@ -16,4 +14,4 @@ CuraDigitalFactoryURL = "{{ cura_digital_factory_url }}" CuraLatestURL = "{{ cura_latest_url }}" ConanInstalls = {{ conan_installs }} -PythonInstalls = {package.key: {'version': package.version} for package in working_set} \ No newline at end of file +PythonInstalls = {{ python_installs }} diff --git a/conanfile.py b/conanfile.py index 3a53cbf529..9fd377b6b3 100644 --- a/conanfile.py +++ b/conanfile.py @@ -152,6 +152,25 @@ class CuraConan(ConanFile): } return conan_installs + def _python_installs(self): + python_installs = {} + + # list of python installs + outer = '"' if self.settings.os == "Windows" else "'" + inner = "'" if self.settings.os == "Windows" else '"' + python_ins_cmd = f"python -c {outer}import pkg_resources; print({inner};{inner}.join([(s.key+{inner},{inner}+ s.version) for s in pkg_resources.working_set])){outer}" + from six import StringIO + buffer = StringIO() + self.run(python_ins_cmd, run_environment= True, env = "conanrun", output=buffer) + + packages = str(buffer.getvalue()).split("-----------------\n") + packages = packages[1].strip('\r\n').split(";") + for package in packages: + name, version = package.split(",") + python_installs[name] = {"version": version} + + return python_installs + def _generate_cura_version(self, location): with open(os.path.join(self.recipe_folder, "CuraVersion.py.jinja"), "r") as f: cura_version_py = Template(f.read()) @@ -178,6 +197,7 @@ class CuraConan(ConanFile): cura_digital_factory_url = self.conan_data["urls"][self._urls]["digital_factory_url"], cura_latest_url=self.conan_data["urls"][self._urls]["cura_latest_url"], conan_installs=self._conan_installs(), + python_installs=self._python_installs(), )) def _generate_pyinstaller_spec(self, location, entrypoint_location, icon_path, entitlements_file): From 0fd8284a5c9558fd70d3808f8489cb472d6545a3 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Thu, 2 Nov 2023 16:53:03 +0100 Subject: [PATCH 2/6] Set source size on image CURA-11263 --- resources/qml/Dialogs/AboutDialog.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/qml/Dialogs/AboutDialog.qml b/resources/qml/Dialogs/AboutDialog.qml index d687f4a25d..abf04613a4 100644 --- a/resources/qml/Dialogs/AboutDialog.qml +++ b/resources/qml/Dialogs/AboutDialog.qml @@ -38,6 +38,8 @@ UM.Dialog width: Math.floor(base.width * 0.85) height: Math.floor(width * UM.Theme.getSize("logo").height / UM.Theme.getSize("logo").width) source: UM.Theme.getImage("logo") + sourceSize.width: width + sourceSize.height: height fillMode: Image.PreserveAspectFit anchors.centerIn: parent From cf2be72cd316bfda6c204908c06d0731579f26db Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Thu, 2 Nov 2023 17:15:18 +0100 Subject: [PATCH 3/6] Grey out menu if no items are present CURA-11266 --- resources/qml/Menus/MaterialMenu.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/Menus/MaterialMenu.qml b/resources/qml/Menus/MaterialMenu.qml index cee28cee6a..e4d4c37efe 100644 --- a/resources/qml/Menus/MaterialMenu.qml +++ b/resources/qml/Menus/MaterialMenu.qml @@ -76,6 +76,7 @@ Cura.Menu { id: genericMenu title: catalog.i18nc("@label:category menu label", "Generic") + enabled: genericMaterialsModel.items.length > 0 Instantiator { From a225ee56fd52f1e6052e6be76408bbb74ab84065 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Fri, 3 Nov 2023 11:45:25 +0100 Subject: [PATCH 4/6] Resolve QML warning CURA-11263 --- resources/qml/Dialogs/AboutDialog.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/Dialogs/AboutDialog.qml b/resources/qml/Dialogs/AboutDialog.qml index abf04613a4..8ea0c01888 100644 --- a/resources/qml/Dialogs/AboutDialog.qml +++ b/resources/qml/Dialogs/AboutDialog.qml @@ -109,9 +109,10 @@ UM.Dialog Flickable { + id: scroll anchors.fill: parent ScrollBar.vertical: UM.ScrollBar { - visible: contentHeight > height + visible: scroll.contentHeight > height } contentHeight: content.height clip: true From 51ab7409058fd38c4541064d93e87fd64902872f Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Fri, 3 Nov 2023 14:53:33 +0100 Subject: [PATCH 5/6] Simplify conan install CURA-11263 --- conanfile.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/conanfile.py b/conanfile.py index 9fd377b6b3..20ded4bc3c 100644 --- a/conanfile.py +++ b/conanfile.py @@ -156,9 +156,7 @@ class CuraConan(ConanFile): python_installs = {} # list of python installs - outer = '"' if self.settings.os == "Windows" else "'" - inner = "'" if self.settings.os == "Windows" else '"' - python_ins_cmd = f"python -c {outer}import pkg_resources; print({inner};{inner}.join([(s.key+{inner},{inner}+ s.version) for s in pkg_resources.working_set])){outer}" + python_ins_cmd = f"python -c \"import pkg_resources; print(';'.join([(s.key+','+ s.version) for s in pkg_resources.working_set]))\"" from six import StringIO buffer = StringIO() self.run(python_ins_cmd, run_environment= True, env = "conanrun", output=buffer) From 35d1ae3272dd0ea5204b446db5da05ca65884f5c Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Fri, 3 Nov 2023 17:04:26 +0100 Subject: [PATCH 6/6] Fix 'brand alignment' messing up actual print files. --- plugins/MakerbotWriter/MakerbotWriter.py | 6 +++--- resources/definitions/ultimaker_method_base.def.json | 2 +- resources/definitions/ultimaker_methodx.def.json | 2 +- resources/definitions/ultimaker_methodxl.def.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/MakerbotWriter/MakerbotWriter.py b/plugins/MakerbotWriter/MakerbotWriter.py index 7eeee9c290..a548c56853 100644 --- a/plugins/MakerbotWriter/MakerbotWriter.py +++ b/plugins/MakerbotWriter/MakerbotWriter.py @@ -51,9 +51,9 @@ class MakerbotWriter(MeshWriter): ] _META_VERSION = "3.0.0" _PRINT_NAME_MAP = { - "Makerbot Method": "fire_e", - "Makerbot Method X": "lava_f", - "Makerbot Method XL": "magma_10", + "UltiMaker Method": "fire_e", + "UltiMaker Method X": "lava_f", + "UltiMaker Method XL": "magma_10", } _EXTRUDER_NAME_MAP = { "1XA": "mk14_hot", diff --git a/resources/definitions/ultimaker_method_base.def.json b/resources/definitions/ultimaker_method_base.def.json index f574969069..77d0cb37fc 100644 --- a/resources/definitions/ultimaker_method_base.def.json +++ b/resources/definitions/ultimaker_method_base.def.json @@ -329,7 +329,7 @@ "machine_heated_build_volume": { "default_value": true }, "machine_height": { "default_value": 196 }, "machine_min_cool_heat_time_window": { "value": 15 }, - "machine_name": { "default_value": "Makerbot Method" }, + "machine_name": { "default_value": "UltiMaker Method" }, "machine_nozzle_cool_down_speed": { "value": 0.8 }, "machine_nozzle_heat_up_speed": { "value": 3.5 }, "machine_start_gcode": { "default_value": "" }, diff --git a/resources/definitions/ultimaker_methodx.def.json b/resources/definitions/ultimaker_methodx.def.json index 5e63ddea79..8d8e4bd4bd 100644 --- a/resources/definitions/ultimaker_methodx.def.json +++ b/resources/definitions/ultimaker_methodx.def.json @@ -83,6 +83,6 @@ }, "overrides": { - "machine_name": { "default_value": "Makerbot Method X" } + "machine_name": { "default_value": "UltiMaker Method X" } } } \ No newline at end of file diff --git a/resources/definitions/ultimaker_methodxl.def.json b/resources/definitions/ultimaker_methodxl.def.json index ac64e3a95d..837432f029 100644 --- a/resources/definitions/ultimaker_methodxl.def.json +++ b/resources/definitions/ultimaker_methodxl.def.json @@ -35,7 +35,7 @@ "machine_depth": { "default_value": 305 }, "machine_heated_bed": { "default_value": true }, "machine_height": { "default_value": 317 }, - "machine_name": { "default_value": "Makerbot Method XL" }, + "machine_name": { "default_value": "UltiMaker Method XL" }, "machine_width": { "default_value": 305 }, "material_shrinkage_percentage_z": { "resolve": "sum(extruderValues(\"material_shrinkage_percentage_z\")) / len(extruderValues(\"material_shrinkage_percentage_z\"))" }, "speed_travel": { "value": 500 }