Take into account the keep/discard interaction when emitting signals

CURA-4248

When user switches to a different profile, the keep/discard dialog can
show up. Don't emit signals immediately if this interaction takes place
because it will trigger an unnecessary slice.
This commit is contained in:
Lipu Fei 2017-10-19 08:32:26 +02:00
parent 85f2a7c385
commit d735921d42
2 changed files with 9 additions and 7 deletions

View file

@ -393,6 +393,7 @@ class CuraApplication(QtApplication):
showDiscardOrKeepProfileChanges = pyqtSignal()
def discardOrKeepProfileChanges(self):
has_user_interaction = False
choice = Preferences.getInstance().getValue("cura/choice_on_profile_override")
if choice == "always_discard":
# don't show dialog and DISCARD the profile
@ -403,11 +404,12 @@ class CuraApplication(QtApplication):
else:
# ALWAYS ask whether to keep or discard the profile
self.showDiscardOrKeepProfileChanges.emit()
#sidebarSimpleDiscardOrKeepProfileChanges = pyqtSignal()
has_user_interaction = True
return has_user_interaction
@pyqtSlot(str)
def discardOrKeepProfileChangesClosed(self, option):
self.getMachineManager().activeQualityChanged.emit()
if option == "discard":
global_stack = self.getGlobalContainerStack()
for extruder in ExtruderManager.getInstance().getMachineExtruders(global_stack.getId()):