From 23e36b51e6b0af7376f489bd3a5b997d7ca545a3 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 1 Oct 2015 16:43:29 +0200 Subject: [PATCH 01/11] Fix stdout/stderr output location so we do not output to UM but to cura Fixes #452 --- cura_app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cura_app.py b/cura_app.py index 913270e895..ee8211f818 100755 --- a/cura_app.py +++ b/cura_app.py @@ -14,9 +14,9 @@ sys.excepthook = exceptHook import cura.CuraApplication if sys.platform == "win32" and hasattr(sys, "frozen"): - from UM.Resources import Resources - sys.stdout = open(Resources.getStoragePath(Resources.Resources, "stdout.log"), "w") - sys.stderr = open(Resources.getStoragePath(Resources.Resources, "stderr.log"), "w") + import os.path + sys.stdout = open(os.path.expanduser("~/AppData/Local/cura/stdout.log"), "w") + sys.stderr = open(os.path.expanduser("~/AppData/Local/cura/stderr.log"), "w") app = cura.CuraApplication.CuraApplication.getInstance() app.run() From 5c5fb647c9fe339e706d614bc1142c437b7164b7 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 1 Oct 2015 17:51:19 +0200 Subject: [PATCH 02/11] Fix name of Low Quality profile --- resources/profiles/Low+Quality.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/profiles/Low+Quality.cfg b/resources/profiles/Low+Quality.cfg index f80ef55db0..159ac5144c 100644 --- a/resources/profiles/Low+Quality.cfg +++ b/resources/profiles/Low+Quality.cfg @@ -1,6 +1,6 @@ [general] version = 1 -name = High Quality +name = Low Quality [settings] layer_height = 0.15 From 34e37af8c9226518d8d80aff75515182bffc820b Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 1 Oct 2015 17:51:54 +0200 Subject: [PATCH 03/11] Also disable output device selection when main save button is disabled CURA-209 #done --- resources/qml/SaveButton.qml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/resources/qml/SaveButton.qml b/resources/qml/SaveButton.qml index a8861331e0..e104651ca4 100644 --- a/resources/qml/SaveButton.qml +++ b/resources/qml/SaveButton.qml @@ -245,12 +245,22 @@ Rectangle { anchors.rightMargin: UM.Theme.sizes.default_margin.width width: UM.Theme.sizes.save_button_save_to_button.height height: UM.Theme.sizes.save_button_save_to_button.height + enabled: base.progress > 0.99 && base.activity == true //iconSource: UM.Theme.icons[UM.OutputDeviceManager.activeDeviceIconName]; style: ButtonStyle { background: Rectangle { id: deviceSelectionIcon - color: control.hovered ? UM.Theme.colors.load_save_button_hover : UM.Theme.colors.load_save_button + color: { + if(!control.enabled){ + return UM.Theme.colors.button; + } + else if(control.enabled && control.hovered) { + return UM.Theme.colors.load_save_button_hover + } else { + return UM.Theme.colors.load_save_button + } + } Behavior on color { ColorAnimation { duration: 50; } } anchors.left: parent.left anchors.leftMargin: UM.Theme.sizes.save_button_text_margin.width / 2; From a9527920ae3699c0b892353925de0a0f875e5719 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Mon, 5 Oct 2015 13:14:42 +0200 Subject: [PATCH 04/11] Prevent crashes when centering an object Fixes #457 --- cura/CuraApplication.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index e64c8736d0..e41dee445c 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -252,16 +252,16 @@ class CuraApplication(QtApplication): ## Remove an object from the scene @pyqtSlot("quint64") def deleteObject(self, object_id): - object = self.getController().getScene().findObject(object_id) + node = self.getController().getScene().findObject(object_id) - if not object and object_id != 0: #Workaround for tool handles overlapping the selected object - object = Selection.getSelectedObject(0) - - if object: - if object.getParent(): - group_node = object.getParent() + if not node and object_id != 0: #Workaround for tool handles overlapping the selected object + node = Selection.getSelectedObject(0) + + if node: + if node.getParent(): + group_node = node.getParent() if not group_node.callDecoration("isGroup"): - op = RemoveSceneNodeOperation(object) + op = RemoveSceneNodeOperation(node) else: while group_node.getParent().callDecoration("isGroup"): group_node = group_node.getParent() @@ -295,10 +295,15 @@ class CuraApplication(QtApplication): @pyqtSlot("quint64") def centerObject(self, object_id): node = self.getController().getScene().findObject(object_id) - if node.getParent() and node.getParent().callDecoration("isGroup"): - node = node.getParent() if not node and object_id != 0: #Workaround for tool handles overlapping the selected object node = Selection.getSelectedObject(0) + + if not node: + return + + if node.getParent() and node.getParent().callDecoration("isGroup"): + node = node.getParent() + if node: op = SetTransformOperation(node, Vector()) op.push() From 03748ca19aeda1a9bd1ff6b6a6a63b3aedf00feb Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Mon, 5 Oct 2015 14:13:49 +0200 Subject: [PATCH 05/11] Disable crash handler if debug mode is not enabled --- cura/CrashHandler.py | 18 +++++++++++++----- cura/CuraApplication.py | 1 + 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/cura/CrashHandler.py b/cura/CrashHandler.py index 157aa39bbd..99220c2378 100644 --- a/cura/CrashHandler.py +++ b/cura/CrashHandler.py @@ -5,12 +5,20 @@ import webbrowser from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QCoreApplication from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTextEdit +from UM.Application import Application from UM.i18n import i18nCatalog catalog = i18nCatalog("cura") -def show(type, value, tb): - if not hasattr(sys, "frozen"): - traceback.print_exception(type, value, tb) +debug_mode = False + +def show(exception_type, value, tb): + if Application.getInstance().getCommandLineOption("debug-mode", False): + debug_mode = True + + traceback.print_exception(exception_type, value, tb) + + if not debug_mode: + return application = QCoreApplication.instance() if not application: @@ -34,7 +42,7 @@ def show(type, value, tb): except: version = "Unknown" - trace = "".join(traceback.format_exception(type, value, tb)) + trace = "".join(traceback.format_exception(exception_type, value, tb)) crash_info = "Version: {0}\nPlatform: {1}\nQt: {2}\nPyQt: {3}\n\nException:\n{4}" crash_info = crash_info.format(version, platform.platform(), QT_VERSION_STR, PYQT_VERSION_STR, trace) @@ -44,7 +52,7 @@ def show(type, value, tb): buttons = QDialogButtonBox(QDialogButtonBox.Close, dialog) layout.addWidget(buttons) buttons.addButton(catalog.i18nc("@action:button", "Open Web Page"), QDialogButtonBox.HelpRole) - buttons.rejected.connect(lambda: dialog.close()) + buttons.rejected.connect(dialog.close) buttons.helpRequested.connect(lambda: webbrowser.open("http://github.com/Ultimaker/Cura/issues")) dialog.exec_() diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index e41dee445c..52cef0e8c9 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -125,6 +125,7 @@ class CuraApplication(QtApplication): def addCommandLineOptions(self, parser): super().addCommandLineOptions(parser) parser.add_argument("file", nargs="*", help="Files to load after starting the application.") + parser.add_argument("--debug", dest="debug-mode", action="store_true", default=False, help="Enable detailed crash reports.") def run(self): self._i18n_catalog = i18nCatalog("cura"); From 03ad00546263a8d0337dcbd429501f0ca371bf0e Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Mon, 5 Oct 2015 14:40:02 +0200 Subject: [PATCH 06/11] Update preference dialog to the changed API --- resources/qml/Cura.qml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index e9b9571ccb..93bc311da1 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -465,14 +465,27 @@ UM.MainWindow { //; Remove & re-add the general page as we want to use our own instead of uranium standard. removePage(0); - insertPage(0, catalog.i18nc("@title:tab","General") , "" , Qt.resolvedUrl("./GeneralPage.qml")); + insertPage(0, catalog.i18nc("@title:tab","General"), generalPage); //: View preferences page title - insertPage(1, catalog.i18nc("@title:tab","View"), "view-preview", Qt.resolvedUrl("./ViewPage.qml")); + insertPage(1, catalog.i18nc("@title:tab","View"), viewPage); //Force refresh setPage(0) } + + Item { + visible: false + GeneralPage + { + id: generalPage + } + + ViewPage + { + id: viewPage + } + } } Actions From acfd2861f13fb4264acf8bad077ce8efaf143714 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Mon, 5 Oct 2015 16:47:18 +0200 Subject: [PATCH 07/11] Make the UMO upgrade selection page work properly --- resources/machines/ultimaker_original.json | 6 ++---- resources/qml/WizardPages/SelectUpgradedParts.qml | 6 +++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/resources/machines/ultimaker_original.json b/resources/machines/ultimaker_original.json index ca3ea7f3e3..6ea8d65cee 100644 --- a/resources/machines/ultimaker_original.json +++ b/resources/machines/ultimaker_original.json @@ -71,10 +71,8 @@ }, "machine_end_gcode": { "default": "M104 S0 ;extruder heater off\nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nM84 ;steppers off\nG90 ;absolute positioning" - } - }, + }, - "overrides": { - "material_bed_temperature": { "visible": false } + "machine_extruder_drive_upgrade": { "default": false } } } diff --git a/resources/qml/WizardPages/SelectUpgradedParts.qml b/resources/qml/WizardPages/SelectUpgradedParts.qml index 167c110a70..4275defdbf 100644 --- a/resources/qml/WizardPages/SelectUpgradedParts.qml +++ b/resources/qml/WizardPages/SelectUpgradedParts.qml @@ -46,21 +46,25 @@ Item id: checkBox text: catalog.i18nc("@option:check","Extruder driver ugrades") checked: true + onClicked: UM.MachineManager.setMachineSettingValue("machine_extruder_drive_upgrade", true); } CheckBox { text: catalog.i18nc("@option:check","Heated printer bed (standard kit)") y: checkBox.height * 1 + onClicked: UM.MachineManager.setMachineSettingValue("machine_heated_bed", true) } CheckBox { text: catalog.i18nc("@option:check","Heated printer bed (self built)") y: checkBox.height * 2 + onClicked: UM.MachineManager.setMachineSettingValue("machine_heated_bed", true) } CheckBox { text: catalog.i18nc("@option:check","Dual extrusion (experimental)") y: checkBox.height * 3 + enabled: false; } } @@ -74,4 +78,4 @@ Item } ExclusiveGroup { id: printerGroup; } -} \ No newline at end of file +} From 07d35a343906252585a2f2a2dadf6a1a00c85f4f Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Mon, 5 Oct 2015 16:35:02 +0200 Subject: [PATCH 08/11] Bump version --- cura/CuraApplication.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 52cef0e8c9..f1d92be9b6 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -61,7 +61,7 @@ class CuraApplication(QtApplication): if not hasattr(sys, "frozen"): Resources.addSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..")) - super().__init__(name = "cura", version = "15.09.85") + super().__init__(name = "cura", version = "15.09.90") self.setWindowIcon(QIcon(Resources.getPath(Resources.Images, "cura-icon.png"))) From ba863526425e1c6092a65f16e8ba4f3c8b5bdb8f Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Mon, 5 Oct 2015 18:32:44 +0200 Subject: [PATCH 09/11] Fix issues with crash handler and log file creation on Windows --- cura/CrashHandler.py | 3 +-- cura_app.py | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cura/CrashHandler.py b/cura/CrashHandler.py index 99220c2378..b369717f79 100644 --- a/cura/CrashHandler.py +++ b/cura/CrashHandler.py @@ -5,14 +5,13 @@ import webbrowser from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QCoreApplication from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTextEdit -from UM.Application import Application from UM.i18n import i18nCatalog catalog = i18nCatalog("cura") debug_mode = False def show(exception_type, value, tb): - if Application.getInstance().getCommandLineOption("debug-mode", False): + if QCoreApplication.instance() and QCoreApplication.instance().getCommandLineOption("debug-mode", False): debug_mode = True traceback.print_exception(exception_type, value, tb) diff --git a/cura_app.py b/cura_app.py index ee8211f818..e71fbd6515 100755 --- a/cura_app.py +++ b/cura_app.py @@ -14,9 +14,11 @@ sys.excepthook = exceptHook import cura.CuraApplication if sys.platform == "win32" and hasattr(sys, "frozen"): - import os.path - sys.stdout = open(os.path.expanduser("~/AppData/Local/cura/stdout.log"), "w") - sys.stderr = open(os.path.expanduser("~/AppData/Local/cura/stderr.log"), "w") + import os + dirpath = os.path.expanduser("~/AppData/Local/cura/") + os.makedirs(dirpath, exist_ok = True) + sys.stdout = open(os.path.join(dirpath, "stdout.log"), "w") + sys.stderr = open(os.path.join(dirpath, "stderr.log"), "w") app = cura.CuraApplication.CuraApplication.getInstance() app.run() From aac269f82a47de79c745c81c2aaeed891b42e5ca Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 6 Oct 2015 12:04:58 +0200 Subject: [PATCH 10/11] Render SupportInfillType so support is rendered correctly again. Fixes #445 --- plugins/CuraEngineBackend/LayerData.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/CuraEngineBackend/LayerData.py b/plugins/CuraEngineBackend/LayerData.py index 6634867da2..79c4477440 100644 --- a/plugins/CuraEngineBackend/LayerData.py +++ b/plugins/CuraEngineBackend/LayerData.py @@ -107,7 +107,7 @@ class Layer(): def build(self, offset, vertices, colors, indices): result = offset for polygon in self._polygons: - if polygon._type == Polygon.InfillType or polygon._type == Polygon.SupportInfillType: + if polygon._type == Polygon.InfillType: continue polygon.build(result, vertices, colors, indices) From 560662ac597c101df7fa42863b0010522140017f Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 6 Oct 2015 12:06:27 +0200 Subject: [PATCH 11/11] Properly clear stored layer data This fixes an issue where switching back and forth between layer view would trigger a reload of the layer data --- plugins/CuraEngineBackend/CuraEngineBackend.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 68d45d0b74..c612a6656c 100644 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -335,6 +335,7 @@ class CuraEngineBackend(Backend): if self._stored_layer_data: job = ProcessSlicedObjectListJob.ProcessSlicedObjectListJob(self._stored_layer_data) job.start() + self._stored_layer_data = None else: self._layer_view_active = False