mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 10:47:49 -06:00
Small cleanups for discard or keep behavior - CURA-4447
This commit is contained in:
parent
d735921d42
commit
e9336b9b9e
2 changed files with 5 additions and 6 deletions
|
@ -409,12 +409,10 @@ class CuraApplication(QtApplication):
|
||||||
|
|
||||||
@pyqtSlot(str)
|
@pyqtSlot(str)
|
||||||
def discardOrKeepProfileChangesClosed(self, option):
|
def discardOrKeepProfileChangesClosed(self, option):
|
||||||
self.getMachineManager().activeQualityChanged.emit()
|
|
||||||
if option == "discard":
|
if option == "discard":
|
||||||
global_stack = self.getGlobalContainerStack()
|
global_stack = self.getGlobalContainerStack()
|
||||||
for extruder in ExtruderManager.getInstance().getMachineExtruders(global_stack.getId()):
|
for extruder in ExtruderManager.getInstance().getMachineExtruders(global_stack.getId()):
|
||||||
extruder.getTop().clear()
|
extruder.getTop().clear()
|
||||||
|
|
||||||
global_stack.getTop().clear()
|
global_stack.getTop().clear()
|
||||||
|
|
||||||
# if the user decided to keep settings then the user settings should be re-calculated and validated for errors
|
# if the user decided to keep settings then the user settings should be re-calculated and validated for errors
|
||||||
|
@ -423,7 +421,6 @@ class CuraApplication(QtApplication):
|
||||||
global_stack = self.getGlobalContainerStack()
|
global_stack = self.getGlobalContainerStack()
|
||||||
for extruder in ExtruderManager.getInstance().getMachineExtruders(global_stack.getId()):
|
for extruder in ExtruderManager.getInstance().getMachineExtruders(global_stack.getId()):
|
||||||
user_extruder_container = extruder.getTop()
|
user_extruder_container = extruder.getTop()
|
||||||
|
|
||||||
if user_extruder_container:
|
if user_extruder_container:
|
||||||
user_extruder_container.update()
|
user_extruder_container.update()
|
||||||
|
|
||||||
|
@ -431,6 +428,9 @@ class CuraApplication(QtApplication):
|
||||||
if user_global_container:
|
if user_global_container:
|
||||||
user_global_container.update()
|
user_global_container.update()
|
||||||
|
|
||||||
|
# notify listeners that quality has changed (after user selected discard or keep)
|
||||||
|
self.getMachineManager().activeQualityChanged.emit()
|
||||||
|
|
||||||
@pyqtSlot(int)
|
@pyqtSlot(int)
|
||||||
def messageBoxClosed(self, button):
|
def messageBoxClosed(self, button):
|
||||||
if self._message_box_callback:
|
if self._message_box_callback:
|
||||||
|
|
|
@ -815,6 +815,7 @@ class MachineManager(QObject):
|
||||||
# \param quality_id The quality_id of either a quality or a quality_changes
|
# \param quality_id The quality_id of either a quality or a quality_changes
|
||||||
@pyqtSlot(str)
|
@pyqtSlot(str)
|
||||||
def setActiveQuality(self, quality_id: str):
|
def setActiveQuality(self, quality_id: str):
|
||||||
|
print("set active quality")
|
||||||
with postponeSignals(*self._getContainerChangedSignals(), compress = CompressTechnique.CompressPerParameterValue):
|
with postponeSignals(*self._getContainerChangedSignals(), compress = CompressTechnique.CompressPerParameterValue):
|
||||||
self.blurSettings.emit()
|
self.blurSettings.emit()
|
||||||
|
|
||||||
|
@ -858,10 +859,9 @@ class MachineManager(QObject):
|
||||||
for stack in name_changed_connect_stacks:
|
for stack in name_changed_connect_stacks:
|
||||||
stack.nameChanged.connect(self._onQualityNameChanged)
|
stack.nameChanged.connect(self._onQualityNameChanged)
|
||||||
|
|
||||||
has_user_interaction = False
|
|
||||||
if self.hasUserSettings and Preferences.getInstance().getValue("cura/active_mode") == 1:
|
if self.hasUserSettings and Preferences.getInstance().getValue("cura/active_mode") == 1:
|
||||||
# Show the keep/discard user settings dialog
|
# Show the keep/discard user settings dialog
|
||||||
has_user_interaction = Application.getInstance().discardOrKeepProfileChanges()
|
Application.getInstance().discardOrKeepProfileChanges()
|
||||||
else:
|
else:
|
||||||
# If the user doesn't have any of adjusted settings then slicing will be triggered by emit()
|
# If the user doesn't have any of adjusted settings then slicing will be triggered by emit()
|
||||||
# Send emits that are postponed in replaceContainer.
|
# Send emits that are postponed in replaceContainer.
|
||||||
|
@ -869,7 +869,6 @@ class MachineManager(QObject):
|
||||||
for setting_info in new_quality_settings_list:
|
for setting_info in new_quality_settings_list:
|
||||||
setting_info["stack"].sendPostponedEmits()
|
setting_info["stack"].sendPostponedEmits()
|
||||||
|
|
||||||
if not has_user_interaction:
|
|
||||||
self.activeQualityChanged.emit()
|
self.activeQualityChanged.emit()
|
||||||
|
|
||||||
## Determine the quality and quality changes settings for the current machine for a quality name.
|
## Determine the quality and quality changes settings for the current machine for a quality name.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue