diff --git a/cura/UI/PrintInformation.py b/cura/UI/PrintInformation.py index ae4aab0407..22710165b3 100644 --- a/cura/UI/PrintInformation.py +++ b/cura/UI/PrintInformation.py @@ -202,7 +202,11 @@ class PrintInformation(QObject): self._material_costs[build_plate_number] = [] self._material_names[build_plate_number] = [] - material_preference_values = json.loads(self._application.getInstance().getPreferences().getValue("cura/material_settings")) + try: + material_preference_values = json.loads(self._application.getInstance().getPreferences().getValue("cura/material_settings")) + except json.JSONDecodeError: + Logger.warning("Material preference values are corrupt. Will revert to defaults!") + material_preference_values = {} for index, extruder_stack in enumerate(global_stack.extruderList): if index >= len(self._material_amounts): diff --git a/resources/qml/Toolbar.qml b/resources/qml/Toolbar.qml index 0bf09b4d18..89d64b06ad 100644 --- a/resources/qml/Toolbar.qml +++ b/resources/qml/Toolbar.qml @@ -78,6 +78,10 @@ Item { base.activeY = y; } + //Clear focus when tools change. This prevents the tool grabbing focus when activated. + //Grabbing focus prevents items from being deleted. + //Apparently this was only a problem on MacOS. + forceActiveFocus(); } //Workaround since using ToolButton's onClicked would break the binding of the checked property, instead