Merge branch '2.4'

This commit is contained in:
Ghostkeeper 2016-12-16 09:54:10 +01:00
commit e870dec276
8 changed files with 28 additions and 10 deletions

View File

@ -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'")

View File

@ -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.
_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.

View File

@ -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)

View File

@ -2,4 +2,5 @@
# Cura is released under the terms of the AGPLv3 or higher.
CuraVersion = "@CURA_VERSION@"
CuraBuildType = "@CURA_BUILDTYPE@"
CuraBuildType = "@CURA_BUILDTYPE@"
CuraDebugMode = True if "@CURA_DEBUGMODE@" == "ON" else False

View File

@ -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})

View File

@ -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

View File

@ -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")
}
]

View File

@ -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();
}