From fb88dd6326ae91731bef2d4a75ca1f79c996c10a Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Fri, 27 Oct 2017 13:32:51 +0200 Subject: [PATCH] CURA-4492 Postponed signals are now emitted even if we need user interaction when changing quality profiles --- cura/Settings/MachineManager.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index bbeafc9a06..f85acc164d 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -897,16 +897,12 @@ class MachineManager(QObject): if self.hasUserSettings and Preferences.getInstance().getValue("cura/active_mode") == 1: # Show the keep/discard user settings dialog has_user_interaction = Application.getInstance().discardOrKeepProfileChanges() - else: - # If the user doesn't have any of adjusted settings then slicing will be triggered by emit() - # Send emits that are postponed in replaceContainer. - # Here the stacks are finished replacing and every value can be resolved based on the current state. - for setting_info in new_quality_settings_list: - setting_info["stack"].sendPostponedEmits() + # If there is no interaction with the user (it means the dialog showing "keep" or "discard" was not shown) + # because either there are not user changes or because the used already decided to always keep or discard, + # then the quality instance container is replaced, in which case, the activeQualityChanged signal is emitted. if not has_user_interaction: self._executeDelayedActiveContainerStackChanges() - self.activeQualityChanged.emit() ## Used to update material and variant in the active container stack with a delay. # This delay prevents the stack from triggering a lot of signals (eventually resulting in slicing) @@ -929,6 +925,7 @@ class MachineManager(QObject): for new_quality in self._new_quality_containers: new_quality["stack"].nameChanged.connect(self._onQualityNameChanged) + new_quality["stack"].sendPostponedEmits() # Send the signals that were postponed in _replaceQualityOrQualityChangesInStack self._new_quality_containers.clear()