mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-31 02:25:57 +08:00
Merge branch 'master' into feature_extruder_per_feature
This commit is contained in:
commit
884067d844
@ -70,7 +70,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
|||||||
self._simple_names = False
|
self._simple_names = False
|
||||||
|
|
||||||
self._active_machine_extruders = [] # type: Iterable[ExtruderStack]
|
self._active_machine_extruders = [] # type: Iterable[ExtruderStack]
|
||||||
self._use_optional_extruder = False
|
self._add_optional_extruder = False
|
||||||
|
|
||||||
#Listen to changes.
|
#Listen to changes.
|
||||||
Application.getInstance().globalContainerStackChanged.connect(self._extrudersChanged) #When the machine is swapped we must update the active machine extruders.
|
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):
|
def addGlobal(self):
|
||||||
return self._add_global
|
return self._add_global
|
||||||
|
|
||||||
useOptionalExtruderChanged = pyqtSignal()
|
addOptionalExtruderChanged = pyqtSignal()
|
||||||
|
|
||||||
def setUseOptionalExtruder(self, use_optional_extruder):
|
def setAddOptionalExtruder(self, add_optional_extruder):
|
||||||
if use_optional_extruder != self._use_optional_extruder:
|
if add_optional_extruder != self._add_optional_extruder:
|
||||||
self._use_optional_extruder = use_optional_extruder
|
self._add_optional_extruder = add_optional_extruder
|
||||||
self.useOptionalExtruderChanged.emit()
|
self.addOptionalExtruderChanged.emit()
|
||||||
self._updateExtruders()
|
self._updateExtruders()
|
||||||
|
|
||||||
@pyqtProperty(bool, fset = setUseOptionalExtruder, notify = useOptionalExtruderChanged)
|
@pyqtProperty(bool, fset = setAddOptionalExtruder, notify = addOptionalExtruderChanged)
|
||||||
def useOptionalExtruder(self):
|
def addOptionalExtruder(self):
|
||||||
return self._use_optional_extruder
|
return self._add_optional_extruder
|
||||||
|
|
||||||
## Set the simpleNames property.
|
## Set the simpleNames property.
|
||||||
def setSimpleNames(self, simple_names):
|
def setSimpleNames(self, simple_names):
|
||||||
@ -212,9 +212,9 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
|||||||
items.sort(key = lambda i: i["index"])
|
items.sort(key = lambda i: i["index"])
|
||||||
# We need optional extruder to be last, so add it after we do sorting.
|
# 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)
|
# 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 = {
|
item = {
|
||||||
"id": "zomg",
|
"id": "",
|
||||||
"name": "Not overridden",
|
"name": "Not overridden",
|
||||||
"color": "#ffffff",
|
"color": "#ffffff",
|
||||||
"index": -1,
|
"index": -1,
|
||||||
|
@ -306,8 +306,11 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||||||
def _stopCamera(self):
|
def _stopCamera(self):
|
||||||
self._camera_timer.stop()
|
self._camera_timer.stop()
|
||||||
if self._image_reply:
|
if self._image_reply:
|
||||||
self._image_reply.abort()
|
try:
|
||||||
self._image_reply.downloadProgress.disconnect(self._onStreamDownloadProgress)
|
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_reply = None
|
||||||
self._image_request = None
|
self._image_request = None
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ SettingItem
|
|||||||
model: Cura.ExtrudersModel
|
model: Cura.ExtrudersModel
|
||||||
{
|
{
|
||||||
onModelChanged: control.color = getItem(control.currentIndex).color
|
onModelChanged: control.color = getItem(control.currentIndex).color
|
||||||
useOptionalExtruder: true
|
addOptionalExtruder: true
|
||||||
}
|
}
|
||||||
|
|
||||||
textRole: "name"
|
textRole: "name"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user