mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Disable the settings in the global tab
CURA-1758
This commit is contained in:
parent
6602177102
commit
121cd19e83
3 changed files with 18 additions and 9 deletions
|
@ -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.
|
||||
|
|
|
@ -34,14 +34,7 @@ ScrollView
|
|||
expanded: Printer.expandedCategories
|
||||
onExpandedChanged: Printer.setExpandedCategories(expanded)
|
||||
|
||||
filter:
|
||||
{
|
||||
if(ExtruderManager.activeExtruderStackId)
|
||||
{
|
||||
return { "settable_per_extruder": true }
|
||||
}
|
||||
return { }
|
||||
}
|
||||
filter: {}
|
||||
}
|
||||
|
||||
delegate: Loader
|
||||
|
@ -53,7 +46,15 @@ ScrollView
|
|||
Behavior on height { NumberAnimation { duration: 100 } }
|
||||
opacity: provider.properties.enabled == "True" ? 1 : 0
|
||||
Behavior on opacity { NumberAnimation { duration: 100 } }
|
||||
enabled: provider.properties.enabled == "True"
|
||||
enabled:
|
||||
{
|
||||
if(!ExtruderManager.activeExtruderStackId && ExtruderManager.extruderCount > 0)
|
||||
{
|
||||
// disable all controls on the global tab, except categories
|
||||
return model.type == "category"
|
||||
}
|
||||
return provider.properties.enabled == "True"
|
||||
}
|
||||
|
||||
property var definition: model
|
||||
property var settingDefinitionsModel: definitionsModel
|
||||
|
|
|
@ -258,6 +258,8 @@ Column
|
|||
{
|
||||
id: globalProfileSelection
|
||||
text: Cura.MachineManager.activeQualityName
|
||||
enabled: !extrudersList.visible || base.currentExtruderIndex > -1
|
||||
|
||||
width: parent.width * 0.55 + UM.Theme.getSize("default_margin").width
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
tooltip: Cura.MachineManager.activeQualityName
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue