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)

View file

@ -119,7 +119,21 @@ UM.Dialog
text: catalog.i18nc("@action:label", "Profile settings")
font.bold: true
}
Row
{
width: parent.width
Label
{
text: catalog.i18nc("@action:label", "Not in profile")
width: parent.width / 3
}
Label
{
text: catalog.i18nc("@action:label", "%1 override(s)").arg(Cura.MachineManager.numUserSettings)
width: parent.width / 3
}
visible: Cura.MachineManager.numUserSettings
}
Row
{
width: parent.width