mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 19:28:07 -06:00
WIP: Cleanup MachineManager
This commit is contained in:
parent
7a2c25226a
commit
25dd63dc21
2 changed files with 3 additions and 18 deletions
|
@ -496,7 +496,7 @@ class MachineManager(QObject):
|
||||||
#
|
#
|
||||||
# \return The layer height of the currently active quality profile. If
|
# \return The layer height of the currently active quality profile. If
|
||||||
# there is no quality profile, this returns 0.
|
# there is no quality profile, this returns 0.
|
||||||
@pyqtProperty(float, notify=activeQualityChanged)
|
@pyqtProperty(float, notify = activeQualityGroupChanged)
|
||||||
def activeQualityLayerHeight(self) -> float:
|
def activeQualityLayerHeight(self) -> float:
|
||||||
if not self._global_container_stack:
|
if not self._global_container_stack:
|
||||||
return 0
|
return 0
|
||||||
|
@ -516,22 +516,6 @@ class MachineManager(QObject):
|
||||||
|
|
||||||
return 0 # No quality profile.
|
return 0 # No quality profile.
|
||||||
|
|
||||||
@pyqtProperty(str, notify=activeQualityChanged)
|
|
||||||
def activeQualityId(self) -> str:
|
|
||||||
if self._active_container_stack:
|
|
||||||
quality = self._active_container_stack.quality
|
|
||||||
if isinstance(quality, type(self._empty_quality_container)):
|
|
||||||
return ""
|
|
||||||
quality_changes = self._active_container_stack.qualityChanges
|
|
||||||
if quality and quality_changes:
|
|
||||||
if isinstance(quality_changes, type(self._empty_quality_changes_container)):
|
|
||||||
# It's a built-in profile
|
|
||||||
return quality.getId()
|
|
||||||
else:
|
|
||||||
# Custom profile
|
|
||||||
return quality_changes.getId()
|
|
||||||
return ""
|
|
||||||
|
|
||||||
@pyqtProperty(str, notify = activeVariantChanged)
|
@pyqtProperty(str, notify = activeVariantChanged)
|
||||||
def globalVariantName(self) -> str:
|
def globalVariantName(self) -> str:
|
||||||
if self._global_container_stack:
|
if self._global_container_stack:
|
||||||
|
@ -939,6 +923,7 @@ class MachineManager(QObject):
|
||||||
extruder.qualityChanges = self._empty_quality_changes_container
|
extruder.qualityChanges = self._empty_quality_changes_container
|
||||||
|
|
||||||
self.activeQualityGroupChanged.emit()
|
self.activeQualityGroupChanged.emit()
|
||||||
|
self.activeQualityChangesGroupChanged.emit()
|
||||||
|
|
||||||
def _setQualityGroup(self, quality_group, empty_quality_changes = True):
|
def _setQualityGroup(self, quality_group, empty_quality_changes = True):
|
||||||
self._current_quality_group = quality_group
|
self._current_quality_group = quality_group
|
||||||
|
|
|
@ -173,7 +173,7 @@ Item
|
||||||
Action
|
Action
|
||||||
{
|
{
|
||||||
id: updateProfileAction;
|
id: updateProfileAction;
|
||||||
enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings && !Cura.MachineManager.isReadOnly(Cura.MachineManager.activeQualityId)
|
enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings && Cura.MachineManager.activeQualityChangesGroup != null
|
||||||
text: catalog.i18nc("@action:inmenu menubar:profile","&Update profile with current settings/overrides");
|
text: catalog.i18nc("@action:inmenu menubar:profile","&Update profile with current settings/overrides");
|
||||||
onTriggered: Cura.ContainerManager.updateQualityChanges();
|
onTriggered: Cura.ContainerManager.updateQualityChanges();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue