Merge branch 'master' of github.com:Ultimaker/Cura

This commit is contained in:
Diego Prado Gesto 2019-04-08 16:26:43 +02:00
commit bf47bfc4ea
6 changed files with 25 additions and 12 deletions

View File

@ -60,13 +60,11 @@ class ConvexHullDecorator(SceneNodeDecorator):
previous_node = self._node previous_node = self._node
# Disconnect from previous node signals # Disconnect from previous node signals
if previous_node is not None and node is not previous_node: if previous_node is not None and node is not previous_node:
previous_node.transformationChanged.disconnect(self._onChanged) previous_node.boundingBoxChanged.disconnect(self._onChanged)
previous_node.parentChanged.disconnect(self._onChanged)
super().setNode(node) super().setNode(node)
# Mypy doesn't understand that self._node is no longer optional, so just use the node.
node.transformationChanged.connect(self._onChanged) node.boundingBoxChanged.connect(self._onChanged)
node.parentChanged.connect(self._onChanged)
self._onChanged() self._onChanged()

View File

@ -362,7 +362,6 @@ class MachineManager(QObject):
# Mark global stack as invalid # Mark global stack as invalid
ConfigurationErrorMessage.getInstance().addFaultyContainers(global_stack.getId()) ConfigurationErrorMessage.getInstance().addFaultyContainers(global_stack.getId())
return # We're done here return # We're done here
ExtruderManager.getInstance().setActiveExtruderIndex(0) # Switch to first extruder
self._global_container_stack = global_stack self._global_container_stack = global_stack
self._application.setGlobalContainerStack(global_stack) self._application.setGlobalContainerStack(global_stack)
@ -370,6 +369,11 @@ class MachineManager(QObject):
self._initMachineState(global_stack) self._initMachineState(global_stack)
self._onGlobalContainerChanged() self._onGlobalContainerChanged()
# Switch to the first enabled extruder
self.updateDefaultExtruder()
default_extruder_position = int(self.defaultExtruderPosition)
ExtruderManager.getInstance().setActiveExtruderIndex(default_extruder_position)
self.__emitChangedSignals() self.__emitChangedSignals()
## Given a definition id, return the machine with this id. ## Given a definition id, return the machine with this id.

View File

@ -140,7 +140,7 @@ Item
{ {
id: printerConfiguration id: printerConfiguration
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
buildplate: printer ? "Glass" : null // 'Glass' as a default buildplate: printer ? catalog.i18nc("@label", "Glass") : null // 'Glass' as a default
configurations: configurations:
{ {
var configs = [] var configs = []

View File

@ -371,10 +371,17 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
self._sendCommand("N%d%s*%d" % (self._gcode_position, line, checksum)) self._sendCommand("N%d%s*%d" % (self._gcode_position, line, checksum))
progress = (self._gcode_position / len(self._gcode)) print_job = self._printers[0].activePrintJob
try:
progress = self._gcode_position / len(self._gcode)
except ZeroDivisionError:
# There is nothing to send!
if print_job is not None:
print_job.updateState("error")
return
elapsed_time = int(time() - self._print_start_time) elapsed_time = int(time() - self._print_start_time)
print_job = self._printers[0].activePrintJob
if print_job is None: if print_job is None:
controller = GenericOutputController(self) controller = GenericOutputController(self)
controller.setCanUpdateFirmware(True) controller.setCanUpdateFirmware(True)

View File

@ -25,12 +25,16 @@ Rectangle
Label Label
{ {
id: notificationLabel id: notificationLabel
anchors.centerIn: parent
anchors.fill: parent anchors.fill: parent
color: UM.Theme.getColor("primary_text") color: UM.Theme.getColor("primary_text")
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
font: UM.Theme.getFont("small") font: UM.Theme.getFont("default")
renderType: Text.NativeRendering renderType: Text.NativeRendering
// This is a bit of a hack, but we don't really have enough room for 2 characters (eg 9+). The default font
// does have a tad bit to much spacing. So instead of adding a whole new font, we just modify it a bit for this
// specific instance.
Component.onCompleted: font.letterSpacing = -1
} }
} }

View File

@ -604,7 +604,7 @@
"toolbox_action_button": [8.0, 2.5], "toolbox_action_button": [8.0, 2.5],
"toolbox_loader": [2.0, 2.0], "toolbox_loader": [2.0, 2.0],
"notification_icon": [1.4, 1.4], "notification_icon": [1.5, 1.5],
"avatar_image": [6.8, 6.8], "avatar_image": [6.8, 6.8],