Merge pull request #4089 from Ultimaker/disable_extruder_swith_to_default

Switch to default extruder if disable the active one
This commit is contained in:
Lipu Fei 2018-07-17 10:28:16 +02:00 committed by GitHub
commit 636d145d08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -985,6 +985,11 @@ class MachineManager(QObject):
self.updateDefaultExtruder()
self.updateNumberExtrudersEnabled()
self.correctExtruderSettings()
# In case this extruder is being disabled and it's the currently selected one, switch to the default extruder
if not enabled and position == ExtruderManager.getInstance().activeExtruderIndex:
ExtruderManager.getInstance().setActiveExtruderIndex(int(self._default_extruder_position))
# ensure that the quality profile is compatible with current combination, or choose a compatible one if available
self._updateQualityWithMaterial()
self.extruderChanged.emit()

View File

@ -164,8 +164,12 @@ Column
onClicked: {
switch (mouse.button) {
case Qt.LeftButton:
forceActiveFocus(); // Changing focus applies the currently-being-typed values so it can change the displayed setting values.
Cura.ExtruderManager.setActiveExtruderIndex(index);
extruder_enabled = Cura.MachineManager.getExtruder(model.index).isEnabled
if (extruder_enabled)
{
forceActiveFocus(); // Changing focus applies the currently-being-typed values so it can change the displayed setting values.
Cura.ExtruderManager.setActiveExtruderIndex(index);
}
break;
case Qt.RightButton:
extruder_enabled = Cura.MachineManager.getExtruder(model.index).isEnabled