After resetting the custom settings the quality slider did not update selected value

CURA-6028
This commit is contained in:
Aleksei S 2018-12-14 16:17:05 +01:00
parent b70a4ae0a2
commit 9146a775a4
2 changed files with 17 additions and 6 deletions

View file

@ -1,7 +1,7 @@
# Copyright (c) 2017 Ultimaker B.V. # Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher. # Cura is released under the terms of the LGPLv3 or higher.
from PyQt5.QtCore import QObject, pyqtSignal, pyqtProperty from PyQt5.QtCore import QObject, pyqtSignal, pyqtProperty, pyqtSlot
from UM.Application import Application from UM.Application import Application
@ -16,12 +16,12 @@ class SimpleModeSettingsManager(QObject):
self._is_profile_user_created = False # True when profile was custom created by user self._is_profile_user_created = False # True when profile was custom created by user
self._machine_manager.activeStackValueChanged.connect(self._updateIsProfileCustomized) self._machine_manager.activeStackValueChanged.connect(self._updateIsProfileCustomized)
self._machine_manager.activeQualityGroupChanged.connect(self._updateIsProfileUserCreated) self._machine_manager.activeQualityGroupChanged.connect(self.updateIsProfileUserCreated)
self._machine_manager.activeQualityChangesGroupChanged.connect(self._updateIsProfileUserCreated) self._machine_manager.activeQualityChangesGroupChanged.connect(self.updateIsProfileUserCreated)
# update on create as the activeQualityChanged signal is emitted before this manager is created when Cura starts # update on create as the activeQualityChanged signal is emitted before this manager is created when Cura starts
self._updateIsProfileCustomized() self._updateIsProfileCustomized()
self._updateIsProfileUserCreated() self.updateIsProfileUserCreated()
isProfileCustomizedChanged = pyqtSignal() isProfileCustomizedChanged = pyqtSignal()
isProfileUserCreatedChanged = pyqtSignal() isProfileUserCreatedChanged = pyqtSignal()
@ -61,7 +61,8 @@ class SimpleModeSettingsManager(QObject):
def isProfileUserCreated(self): def isProfileUserCreated(self):
return self._is_profile_user_created return self._is_profile_user_created
def _updateIsProfileUserCreated(self): @pyqtSlot()
def updateIsProfileUserCreated(self) -> None:
quality_changes_keys = set() quality_changes_keys = set()
if not self._machine_manager.activeMachine: if not self._machine_manager.activeMachine:

View file

@ -39,7 +39,17 @@ Item
{ {
target: Cura.QualityProfilesDropDownMenuModel target: Cura.QualityProfilesDropDownMenuModel
onItemsChanged: qualityModel.update() onItemsChanged: qualityModel.update()
onDataChanged: qualityModel.update() onDataChanged:
{
// If a custom profile is selected and then a user decides to change any of setting the slider should show
// the reset button. After clicking the reset button the QualityProfilesDropDownMenuModel(ListModel) is
// updated before the property isProfileCustomized is called to update.
if (Cura.SimpleModeSettingsManager.isProfileCustomized)
{
Cura.SimpleModeSettingsManager.updateIsProfileUserCreated()
}
qualityModel.update()
}
} }
Connections { Connections {