mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Fix ExtrudersModel to use the right location for ExtruderManager
Contributes to CURA-342
This commit is contained in:
parent
ce3a5f7e48
commit
6fbe354839
1 changed files with 5 additions and 4 deletions
|
@ -3,9 +3,10 @@
|
||||||
|
|
||||||
from PyQt5.QtCore import Qt, pyqtSignal, pyqtProperty
|
from PyQt5.QtCore import Qt, pyqtSignal, pyqtProperty
|
||||||
|
|
||||||
import cura.ExtruderManager
|
|
||||||
import UM.Qt.ListModel
|
import UM.Qt.ListModel
|
||||||
|
|
||||||
|
from . import ExtruderManager
|
||||||
|
|
||||||
## Model that holds extruders.
|
## Model that holds extruders.
|
||||||
#
|
#
|
||||||
# This model is designed for use by any list of extruders, but specifically
|
# This model is designed for use by any list of extruders, but specifically
|
||||||
|
@ -49,7 +50,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
||||||
self._active_extruder_stack = None
|
self._active_extruder_stack = None
|
||||||
|
|
||||||
#Listen to changes.
|
#Listen to changes.
|
||||||
manager = cura.ExtruderManager.ExtruderManager.getInstance()
|
manager = ExtruderManager.getInstance()
|
||||||
manager.extrudersChanged.connect(self._updateExtruders) #When the list of extruders changes in general.
|
manager.extrudersChanged.connect(self._updateExtruders) #When the list of extruders changes in general.
|
||||||
UM.Application.getInstance().globalContainerStackChanged.connect(self._updateExtruders) #When the current machine changes.
|
UM.Application.getInstance().globalContainerStackChanged.connect(self._updateExtruders) #When the current machine changes.
|
||||||
self._updateExtruders()
|
self._updateExtruders()
|
||||||
|
@ -69,7 +70,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
||||||
return self._add_global
|
return self._add_global
|
||||||
|
|
||||||
def _onActiveExtruderChanged(self):
|
def _onActiveExtruderChanged(self):
|
||||||
manager = cura.ExtruderManager.ExtruderManager.getInstance()
|
manager = ExtruderManager.getInstance()
|
||||||
active_extruder_stack = manager.getActiveExtruderStack()
|
active_extruder_stack = manager.getActiveExtruderStack()
|
||||||
if self._active_extruder_stack != active_extruder_stack:
|
if self._active_extruder_stack != active_extruder_stack:
|
||||||
if self._active_extruder_stack:
|
if self._active_extruder_stack:
|
||||||
|
@ -93,7 +94,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
||||||
# This should be called whenever the list of extruders changes.
|
# This should be called whenever the list of extruders changes.
|
||||||
def _updateExtruders(self):
|
def _updateExtruders(self):
|
||||||
self.clear()
|
self.clear()
|
||||||
manager = cura.ExtruderManager.ExtruderManager.getInstance()
|
manager = ExtruderManager.getInstance()
|
||||||
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
|
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||||
if not global_container_stack:
|
if not global_container_stack:
|
||||||
return #There is no machine to get the extruders of.
|
return #There is no machine to get the extruders of.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue