diff --git a/CMakeLists.txt b/CMakeLists.txt index 002662152e..ab08a4d624 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,7 @@ set(URANIUM_SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/../uranium/scripts" CACHE DIRECTORY add_custom_target(tests) add_custom_command(TARGET tests POST_BUILD COMMAND "PYTHONPATH=${CMAKE_SOURCE_DIR}/../Uranium/:${CMAKE_SOURCE_DIR}" ${PYTHON_EXECUTABLE} -m pytest -r a --junitxml=${CMAKE_BINARY_DIR}/junit.xml ${CMAKE_SOURCE_DIR} || exit 0) +option(CURA_DEBUGMODE "Enable debug dialog and other debug features" OFF) set(CURA_VERSION "master" CACHE STRING "Version name of Cura") set(CURA_BUILDTYPE "" CACHE STRING "Build type of Cura, eg. 'PPA'") diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index b6c5b7cf02..629f7ba6d8 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -285,6 +285,9 @@ class BuildVolume(SceneNode): color = Color(0.0, 0.0, 0.0, 0.15) for polygon in self._disallowed_areas: points = polygon.getPoints() + if len(points) == 0: + continue + first = Vector(self._clamp(points[0][0], min_w, max_w), disallowed_area_height, self._clamp(points[0][1], min_d, max_d)) previous_point = Vector(self._clamp(points[0][0], min_w, max_w), disallowed_area_height, self._clamp(points[0][1], min_d, max_d)) for point in points: @@ -827,4 +830,4 @@ class BuildVolume(SceneNode): _tower_settings = ["prime_tower_enable", "prime_tower_size", "prime_tower_position_x", "prime_tower_position_y"] _ooze_shield_settings = ["ooze_shield_enabled", "ooze_shield_dist"] _distance_settings = ["infill_wipe_dist", "travel_avoid_distance", "support_offset", "support_enable", "travel_avoid_other_parts"] - _extruder_settings = ["support_enable", "support_interface_enable", "support_infill_extruder_nr", "support_extruder_nr_layer_0", "support_interface_extruder_nr", "brim_line_count", "adhesion_extruder_nr", "adhesion_type"] #Settings that can affect which extruders are used. \ No newline at end of file + _extruder_settings = ["support_enable", "support_interface_enable", "support_infill_extruder_nr", "support_extruder_nr_layer_0", "support_interface_extruder_nr", "brim_line_count", "adhesion_extruder_nr", "adhesion_type"] #Settings that can affect which extruders are used. diff --git a/cura/CrashHandler.py b/cura/CrashHandler.py index 94b1971bdf..ba8499d4f2 100644 --- a/cura/CrashHandler.py +++ b/cura/CrashHandler.py @@ -12,6 +12,11 @@ from UM.Logger import Logger from UM.i18n import i18nCatalog catalog = i18nCatalog("cura") +try: + from cura.CuraVersion import CuraDebugMode +except ImportError: + CuraDebugMode = False # [CodeStyle: Reflecting imported value] + # List of exceptions that should be considered "fatal" and abort the program. # These are primarily some exception types that we simply cannot really recover from # (MemoryError and SystemError) and exceptions that indicate grave errors in the @@ -24,21 +29,18 @@ fatal_exception_types = [ ] def show(exception_type, value, tb): - debug_mode = True - Logger.log("c", "An uncaught exception has occurred!") for line in traceback.format_exception(exception_type, value, tb): for part in line.rstrip("\n").split("\n"): Logger.log("c", part) - if not debug_mode and exception_type not in fatal_exception_types: + if not CuraDebugMode and exception_type not in fatal_exception_types: return application = QCoreApplication.instance() if not application: sys.exit(1) - dialog = QDialog() dialog.setMinimumWidth(640) dialog.setMinimumHeight(640) diff --git a/cura/CuraVersion.py.in b/cura/CuraVersion.py.in index 5ad819b1fc..8a4d13e526 100644 --- a/cura/CuraVersion.py.in +++ b/cura/CuraVersion.py.in @@ -2,4 +2,5 @@ # Cura is released under the terms of the AGPLv3 or higher. CuraVersion = "@CURA_VERSION@" -CuraBuildType = "@CURA_BUILDTYPE@" \ No newline at end of file +CuraBuildType = "@CURA_BUILDTYPE@" +CuraDebugMode = True if "@CURA_DEBUGMODE@" == "ON" else False diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index c20da335e0..11a8087f37 100644 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -815,6 +815,8 @@ class MachineManager(QObject): for stack in stacks: material = stack.findContainer(type="material") quality = quality_manager.findQualityByQualityType(quality_type, global_machine_definition, [material]) + if not quality: #No quality profile is found for this quality type. + quality = self._empty_quality_container result.append({"stack": stack, "quality": quality, "quality_changes": empty_quality_changes}) if extruder_stacks: @@ -868,6 +870,8 @@ class MachineManager(QObject): material = stack.findContainer(type="material") quality = quality_manager.findQualityByQualityType(quality_type, global_machine_definition, [material]) + if not quality: #No quality profile found for this quality type. + quality = self._empty_quality_container result.append({"stack": stack, "quality": quality, "quality_changes": quality_changes}) diff --git a/cura/Settings/QualitySettingsModel.py b/cura/Settings/QualitySettingsModel.py index 46d829d06f..e6499ae8d0 100644 --- a/cura/Settings/QualitySettingsModel.py +++ b/cura/Settings/QualitySettingsModel.py @@ -193,6 +193,7 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel): profile_value_source = "" for container in containers: new_value = container.getProperty(definition.key, "value") + if new_value is not None: profile_value_source = container.getMetaDataEntry("type") profile_value = new_value @@ -200,7 +201,7 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel): # Global tab should use resolve (if there is one) if not self._extruder_id: resolve_value = global_container_stack.getProperty(definition.key, "resolve") - if resolve_value is not None and profile_value is not None: + if resolve_value is not None and profile_value is not None and profile_value_source != "quality_changes": profile_value = resolve_value user_value = None diff --git a/plugins/3MFReader/__init__.py b/plugins/3MFReader/__init__.py index 617bdd594c..3e05cb8dc7 100644 --- a/plugins/3MFReader/__init__.py +++ b/plugins/3MFReader/__init__.py @@ -4,10 +4,16 @@ from . import ThreeMFReader from . import ThreeMFWorkspaceReader from UM.i18n import i18nCatalog +import UM.Platform catalog = i18nCatalog("cura") def getMetaData(): + # Workarround for osx not supporting double file extensions correclty. + if UM.Platform.isOSX(): + workspace_extension = "3mf" + else: + workspace_extension = "curaproject.3mf" return { "plugin": { "name": catalog.i18nc("@label", "3MF Reader"), @@ -25,7 +31,7 @@ def getMetaData(): "workspace_reader": [ { - "extension": "curaproject.3mf", + "extension": workspace_extension, "description": catalog.i18nc("@item:inlistbox", "3MF File") } ] diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index e78786c7a3..314f3b7443 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -533,9 +533,9 @@ UM.MainWindow target: Cura.Actions.addProfile onTriggered: { - preferences.setPage(4); - preferences.show(); + preferences.show(); + preferences.setPage(4); // Create a new profile after a very short delay so the preference page has time to initiate createProfileTimer.start(); }