mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-30 04:05:25 +08:00
Simplify discardOrKeepProfileChangesClosed()
This commit is contained in:
parent
1cd26b790c
commit
9de114c73a
@ -451,27 +451,18 @@ class CuraApplication(QtApplication):
|
|||||||
|
|
||||||
@pyqtSlot(str)
|
@pyqtSlot(str)
|
||||||
def discardOrKeepProfileChangesClosed(self, option):
|
def discardOrKeepProfileChangesClosed(self, option):
|
||||||
|
global_stack = self.getGlobalContainerStack()
|
||||||
if option == "discard":
|
if option == "discard":
|
||||||
global_stack = self.getGlobalContainerStack()
|
for extruder in global_stack.extruders.values():
|
||||||
for extruder in self._extruder_manager.getMachineExtruders(global_stack.getId()):
|
extruder.userChanges.clear()
|
||||||
extruder.getTop().clear()
|
global_stack.userChanges.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
|
||||||
# before slicing. To ensure that slicer uses right settings values
|
# before slicing. To ensure that slicer uses right settings values
|
||||||
elif option == "keep":
|
elif option == "keep":
|
||||||
global_stack = self.getGlobalContainerStack()
|
for extruder in global_stack.extruders.values():
|
||||||
for extruder in self._extruder_manager.getMachineExtruders(global_stack.getId()):
|
extruder.userChanges.update()
|
||||||
user_extruder_container = extruder.getTop()
|
global_stack.userChanges.update()
|
||||||
if user_extruder_container:
|
|
||||||
user_extruder_container.update()
|
|
||||||
|
|
||||||
user_global_container = global_stack.getTop()
|
|
||||||
if user_global_container:
|
|
||||||
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):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user