Merge branch 'master' into fix_simple_mode_disabled_features

# Conflicts:
#	resources/qml/SidebarSimple.qml
This commit is contained in:
fieldOfView 2017-09-04 16:44:59 +02:00
commit 46b333bfc9
5 changed files with 33 additions and 5 deletions

View file

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

View file

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

View file

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

View file

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

View file

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