diff --git a/cura/PrinterOutputDevice.py b/cura/PrinterOutputDevice.py index 6643ce6e03..ea00122105 100644 --- a/cura/PrinterOutputDevice.py +++ b/cura/PrinterOutputDevice.py @@ -71,6 +71,9 @@ class PrinterOutputDevice(QObject, OutputDevice): self._control_item = None 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") @@ -126,6 +129,21 @@ 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): + 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/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") 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) 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) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index da329f19b7..b8c476e24e 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -425,7 +425,7 @@ Item property alias _hovered: adhesionMouseArea.containsMouse anchors.top: enableSupportCheckBox.visible ? supportExtruderCombobox.bottom : infillCellRight.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