Merge branch 'master' into feature_extruder_per_feature

This commit is contained in:
Ghostkeeper 2017-05-22 16:22:32 +02:00
commit 884067d844
No known key found for this signature in database
GPG Key ID: C5F96EE2BC0F7E75
3 changed files with 17 additions and 14 deletions

View File

@ -70,7 +70,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
self._simple_names = False
self._active_machine_extruders = [] # type: Iterable[ExtruderStack]
self._use_optional_extruder = False
self._add_optional_extruder = False
#Listen to changes.
Application.getInstance().globalContainerStackChanged.connect(self._extrudersChanged) #When the machine is swapped we must update the active machine extruders.
@ -89,17 +89,17 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
def addGlobal(self):
return self._add_global
useOptionalExtruderChanged = pyqtSignal()
addOptionalExtruderChanged = pyqtSignal()
def setUseOptionalExtruder(self, use_optional_extruder):
if use_optional_extruder != self._use_optional_extruder:
self._use_optional_extruder = use_optional_extruder
self.useOptionalExtruderChanged.emit()
def setAddOptionalExtruder(self, add_optional_extruder):
if add_optional_extruder != self._add_optional_extruder:
self._add_optional_extruder = add_optional_extruder
self.addOptionalExtruderChanged.emit()
self._updateExtruders()
@pyqtProperty(bool, fset = setUseOptionalExtruder, notify = useOptionalExtruderChanged)
def useOptionalExtruder(self):
return self._use_optional_extruder
@pyqtProperty(bool, fset = setAddOptionalExtruder, notify = addOptionalExtruderChanged)
def addOptionalExtruder(self):
return self._add_optional_extruder
## Set the simpleNames property.
def setSimpleNames(self, simple_names):
@ -212,9 +212,9 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
items.sort(key = lambda i: i["index"])
# We need optional extruder to be last, so add it after we do sorting.
# This way we can simply intrepret the -1 of the index as the last item (which it now always is)
if self._use_optional_extruder:
if self._add_optional_extruder:
item = {
"id": "zomg",
"id": "",
"name": "Not overridden",
"color": "#ffffff",
"index": -1,

View File

@ -306,8 +306,11 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
def _stopCamera(self):
self._camera_timer.stop()
if self._image_reply:
self._image_reply.abort()
self._image_reply.downloadProgress.disconnect(self._onStreamDownloadProgress)
try:
self._image_reply.abort()
self._image_reply.downloadProgress.disconnect(self._onStreamDownloadProgress)
except RuntimeError:
pass # It can happen that the wrapped c++ object is already deleted.
self._image_reply = None
self._image_request = None

View File

@ -20,7 +20,7 @@ SettingItem
model: Cura.ExtrudersModel
{
onModelChanged: control.color = getItem(control.currentIndex).color
useOptionalExtruder: true
addOptionalExtruder: true
}
textRole: "name"