mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 10:17:52 -06:00
Added read-only property to profiles
CURA-1585
This commit is contained in:
parent
113da81db5
commit
4fc565711d
11 changed files with 19 additions and 1 deletions
|
@ -246,6 +246,15 @@ class MachineManagerModel(QObject):
|
|||
return quality.getId()
|
||||
return ""
|
||||
|
||||
## Check if a container is read_only
|
||||
@pyqtSlot(str, result = bool)
|
||||
def isReadOnly(self, container_id):
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id=container_id)
|
||||
if not containers or not self._global_container_stack:
|
||||
return True
|
||||
return containers[0].getMetaDataEntry("read_only", False) == "True"
|
||||
|
||||
|
||||
@pyqtSlot(str)
|
||||
def setActiveMaterial(self, material_id):
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id=material_id)
|
||||
|
|
|
@ -110,7 +110,7 @@ Item
|
|||
Action
|
||||
{
|
||||
id: updateProfileAction;
|
||||
enabled: Cura.MachineManager.isGlobalStackValid && !UM.ActiveProfile.readOnly && Cura.MachineManager.hasUserSettings
|
||||
enabled: Cura.MachineManager.isGlobalStackValid && Cura.MachineManager.hasUserSettings && !Cura.MachineManager.isReadOnly(Cura.MachineManager.activeQualityId)
|
||||
text: catalog.i18nc("@action:inmenu menubar:profile","&Update Current Profile");
|
||||
onTriggered: UM.ActiveProfile.updateProfile();
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ definition = fdmprinter
|
|||
|
||||
[metadata]
|
||||
type = quality
|
||||
read_only = True
|
||||
|
||||
[values]
|
||||
layer_height = 0.06
|
||||
|
|
|
@ -5,6 +5,7 @@ definition = fdmprinter
|
|||
|
||||
[metadata]
|
||||
type = quality
|
||||
read_only = True
|
||||
|
||||
[values]
|
||||
layer_height = 0.15
|
||||
|
|
|
@ -5,5 +5,6 @@ definition = fdmprinter
|
|||
|
||||
[metadata]
|
||||
type = quality
|
||||
read_only = True
|
||||
|
||||
[values]
|
||||
|
|
|
@ -7,6 +7,7 @@ definition = ultimaker2_plus
|
|||
type = quality
|
||||
material = generic_pla_ultimaker2_plus_0.25_mm
|
||||
weight = -2
|
||||
read_only = True
|
||||
|
||||
[values]
|
||||
layer_height = 0.06
|
||||
|
|
|
@ -7,6 +7,7 @@ definition = ultimaker2_plus
|
|||
type = quality
|
||||
material = generic_pla_ultimaker2_plus_0.4_mm
|
||||
weight = -1
|
||||
read_only = True
|
||||
|
||||
[values]
|
||||
layer_height = 0.15
|
||||
|
|
|
@ -7,6 +7,7 @@ definition = ultimaker2_plus
|
|||
type = quality
|
||||
material = generic_pla_ultimaker2_plus_0.4_mm
|
||||
weight = -3
|
||||
read_only = True
|
||||
|
||||
[values]
|
||||
layer_height = 0.06
|
||||
|
|
|
@ -7,6 +7,7 @@ definition = ultimaker2_plus
|
|||
type = quality
|
||||
material = generic_pla_ultimaker2_plus_0.4_mm
|
||||
weight = -2
|
||||
read_only = True
|
||||
|
||||
[values]
|
||||
layer_height = 0.1
|
||||
|
|
|
@ -7,6 +7,7 @@ definition = ultimaker2_plus
|
|||
material = generic_pla_ultimaker2_plus_0.6_mm
|
||||
type = quality
|
||||
weight = -2
|
||||
read_only = True
|
||||
|
||||
[values]
|
||||
layer_height = 0.15
|
||||
|
|
|
@ -7,6 +7,7 @@ definition = ultimaker2_plus
|
|||
material = generic_pla_ultimaker2_plus_0.8_mm
|
||||
type = quality
|
||||
weight = -2
|
||||
read_only = True
|
||||
|
||||
[values]
|
||||
layer_height = 0.2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue