Fix reset to default quality

This commit is contained in:
Lipu Fei 2018-03-15 17:08:44 +01:00
parent 5a55c1817d
commit f14ddb8711
3 changed files with 6 additions and 8 deletions

View file

@ -1270,13 +1270,11 @@ class MachineManager(QObject):
self._application.discardOrKeepProfileChanges() self._application.discardOrKeepProfileChanges()
@pyqtSlot() @pyqtSlot()
def clearQualityChangesGroup(self): def resetToUseDefaultQuality(self):
with postponeSignals(*self._getContainerChangedSignals(), compress = CompressTechnique.CompressPerParameterValue): with postponeSignals(*self._getContainerChangedSignals(), compress = CompressTechnique.CompressPerParameterValue):
self._setQualityGroup(self._current_quality_group) self._setQualityGroup(self._current_quality_group)
for stack in [self._global_container_stack] + list(self._global_container_stack.extruders.values()):
# See if we need to show the Discard or Keep changes screen stack.userChanges.clear()
if self.hasUserSettings and Preferences.getInstance().getValue("cura/active_mode") == 1:
self._application.discardOrKeepProfileChanges()
@pyqtProperty(QObject, fset = setQualityChangesGroup, notify = activeQualityChangesGroupChanged) @pyqtProperty(QObject, fset = setQualityChangesGroup, notify = activeQualityChangesGroupChanged)
def activeQualityChangesGroup(self): def activeQualityChangesGroup(self):

View file

@ -16,7 +16,8 @@ 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.activeQualityChanged.connect(self._updateIsProfileUserCreated) self._machine_manager.activeQualityGroupChanged.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()

View file

@ -111,7 +111,6 @@ Item
// Set selected value // Set selected value
if (Cura.MachineManager.activeQualityType == qualityItem.quality_type) { if (Cura.MachineManager.activeQualityType == qualityItem.quality_type) {
// set to -1 when switching to user created profile so all ticks are clickable // set to -1 when switching to user created profile so all ticks are clickable
if (Cura.SimpleModeSettingsManager.isProfileUserCreated) { if (Cura.SimpleModeSettingsManager.isProfileUserCreated) {
qualityModel.qualitySliderActiveIndex = -1 qualityModel.qualitySliderActiveIndex = -1
@ -474,7 +473,7 @@ Item
onClicked: onClicked:
{ {
// if the current profile is user-created, switch to a built-in quality // if the current profile is user-created, switch to a built-in quality
Cura.MachineManager.clearQualityChangesGroup() Cura.MachineManager.resetToUseDefaultQuality()
} }
onEntered: onEntered:
{ {