Added num user settings to save project dialog

This commit is contained in:
Jaime van Kessel 2016-12-16 11:50:50 +01:00
parent 4431241a51
commit 0e09de195b
2 changed files with 26 additions and 1 deletions

View file

@ -412,6 +412,17 @@ class MachineManager(QObject):
return False
@pyqtProperty(int, notify = activeStackValueChanged)
def numUserSettings(self):
if not self._global_container_stack:
return 0
num_user_settings = 0
num_user_settings += len(self._global_container_stack.getTop().findInstances())
stacks = list(ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId()))
for stack in stacks:
num_user_settings += len(stack.getTop().findInstances())
return num_user_settings
## Delete a user setting from the global stack and all extruder stacks.
# \param key \type{str} the name of the key to delete
@pyqtSlot(str)