Disable the settings in the global tab

CURA-1758
This commit is contained in:
fieldOfView 2016-07-16 13:10:50 +02:00
parent 6602177102
commit 121cd19e83
3 changed files with 18 additions and 9 deletions

View file

@ -41,6 +41,12 @@ class ExtruderManager(QObject):
except KeyError: # Extruder index could be -1 if the global tab is selected, or the entry doesn't exist if the machine definition is wrong.
return None
@pyqtProperty(int, notify = extrudersChanged)
def extruderCount(self):
if not UM.Application.getInstance().getGlobalContainerStack():
return 0 # No active machine, so no extruders.
return len(self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()])
## The instance of the singleton pattern.
#
# It's None if the extruder manager hasn't been created yet.