From b70a89d0e1c5f130d8538e05eb889e9fcc21ec8c Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 4 Sep 2017 14:08:03 +0200 Subject: [PATCH 1/4] Fix stdout and stderr redirecting file location --- cura_app.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cura_app.py b/cura_app.py index 1d8867f1f4..2e406f99d3 100755 --- a/cura_app.py +++ b/cura_app.py @@ -54,8 +54,17 @@ import Arcus #@UnusedImport import cura.CuraApplication import cura.Settings.CuraContainerRegistry +def get_cura_dir_path(): + if Platform.isWindows(): + return os.path.expanduser("~/AppData/Local/cura/") + elif Platform.isLinux(): + return os.path.expanduser("~/.local/share/cura") + elif Platform.isOSX(): + return os.path.expanduser("~/Library/Application Support/cura") + + if hasattr(sys, "frozen"): - dirpath = os.path.expanduser("~/AppData/Local/cura/") + dirpath = get_cura_dir_path() 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") From 8683275d4fae75753b69dd400fc5e8a0f7a5311d Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 4 Sep 2017 15:16:55 +0200 Subject: [PATCH 2/4] Added canAbort & canPause feature to PrinterOutputDevice --- cura/PrinterOutputDevice.py | 12 ++++++++++++ resources/qml/MonitorButton.qml | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/cura/PrinterOutputDevice.py b/cura/PrinterOutputDevice.py index 6643ce6e03..64544d3d3f 100644 --- a/cura/PrinterOutputDevice.py +++ b/cura/PrinterOutputDevice.py @@ -71,6 +71,8 @@ class PrinterOutputDevice(QObject, OutputDevice): self._control_item = None self._qml_context = None + self._can_pause = True + self._can_abort = True def requestWrite(self, nodes, file_name = None, filter_by_machine = False, file_handler = None): raise NotImplementedError("requestWrite needs to be implemented") @@ -126,6 +128,16 @@ class PrinterOutputDevice(QObject, OutputDevice): # Signal to be emitted when some drastic change occurs in the remaining time (not when the time just passes on normally). preheatBedRemainingTimeChanged = pyqtSignal() + # Does the printer support pause at all + @pyqtProperty(bool, constant=True) + def canPause(self): + return self._can_pause + + # Does the printer support abort at all + @pyqtProperty(bool, constant=True) + def canAbort(self): + return self._can_abort + @pyqtProperty(QObject, constant=True) def monitorItem(self): # Note that we specifically only check if the monitor component is created. diff --git a/resources/qml/MonitorButton.qml b/resources/qml/MonitorButton.qml index 5741749d4e..45c28847cd 100644 --- a/resources/qml/MonitorButton.qml +++ b/resources/qml/MonitorButton.qml @@ -220,7 +220,7 @@ Item property bool userClicked: false property string lastJobState: "" - visible: printerConnected + visible: printerConnected && Cura.MachineManager.printerOutputDevices[0].canPause enabled: (!userClicked) && printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands && (["paused", "printing"].indexOf(Cura.MachineManager.printerOutputDevices[0].jobState) >= 0) @@ -261,7 +261,7 @@ Item { id: abortButton - visible: printerConnected + visible: printerConnected && Cura.MachineManager.printerOutputDevices[0].canAbort enabled: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands && (["paused", "printing", "pre_print"].indexOf(Cura.MachineManager.printerOutputDevices[0].jobState) >= 0) From dd7ea80b6821ed4178e454512a7a26046729aab9 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 4 Sep 2017 15:33:04 +0200 Subject: [PATCH 3/4] Also added canPreheatBed option --- cura/PrinterOutputDevice.py | 6 ++++++ resources/qml/PrintMonitor.qml | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cura/PrinterOutputDevice.py b/cura/PrinterOutputDevice.py index 64544d3d3f..ea00122105 100644 --- a/cura/PrinterOutputDevice.py +++ b/cura/PrinterOutputDevice.py @@ -73,6 +73,7 @@ class PrinterOutputDevice(QObject, OutputDevice): self._qml_context = None self._can_pause = True self._can_abort = True + self._can_pre_heat_bed = True def requestWrite(self, nodes, file_name = None, filter_by_machine = False, file_handler = None): raise NotImplementedError("requestWrite needs to be implemented") @@ -128,6 +129,11 @@ class PrinterOutputDevice(QObject, OutputDevice): # Signal to be emitted when some drastic change occurs in the remaining time (not when the time just passes on normally). preheatBedRemainingTimeChanged = pyqtSignal() + # Does the printer support pre-heating the bed at all + @pyqtProperty(bool, constant=True) + def canPreHeatBed(self): + return self._can_pre_heat_bed + # Does the printer support pause at all @pyqtProperty(bool, constant=True) def canPause(self): diff --git a/resources/qml/PrintMonitor.qml b/resources/qml/PrintMonitor.qml index ac17681b33..0aecf839d2 100644 --- a/resources/qml/PrintMonitor.qml +++ b/resources/qml/PrintMonitor.qml @@ -388,7 +388,7 @@ Column anchors.bottomMargin: UM.Theme.getSize("default_margin").height width: UM.Theme.getSize("setting_control").width height: UM.Theme.getSize("setting_control").height - + visible: connectedPrinter != null ? connectedPrinter.canPreHeatBed: true Rectangle //Highlight of input field. { anchors.fill: parent @@ -511,6 +511,7 @@ Column { id: preheatButton height: UM.Theme.getSize("setting_control").height + visible: connectedPrinter != null ? connectedPrinter.canPreHeatBed: true enabled: { if (!preheatTemperatureControl.enabled) From e3f319a644b5d52967cd9eb708cb5677b60344b3 Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 4 Sep 2017 16:23:19 +0200 Subject: [PATCH 4/4] less margin when support extruder pops up CURA-4148 --- resources/qml/SidebarSimple.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 25564f1172..8d83dd1468 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -422,7 +422,7 @@ Item property alias _hovered: adhesionMouseArea.containsMouse anchors.top: supportExtruderCombobox.bottom - anchors.topMargin: UM.Theme.getSize("sidebar_margin").height * 2 + anchors.topMargin: UM.Theme.getSize("sidebar_margin").height anchors.left: infillCellRight.left //: Setting enable printing build-plate adhesion helper checkbox