|
@@ -939,49 +939,7 @@ class MachineManager(QObject):
|
|
|
container.nameChanged.connect(self._onQualityNameChanged)
|
|
|
|
|
|
def _askUserToKeepOrClearCurrentSettings(self):
|
|
|
- # Ask the user if the user profile should be cleared or not (discarding the current settings)
|
|
|
- # In Simple Mode we assume the user always wants to keep the (limited) current settings
|
|
|
- details_text = catalog.i18nc("@label", "You made changes to the following setting(s)/override(s):")
|
|
|
-
|
|
|
- # user changes in global stack
|
|
|
- details_list = [setting.definition.label for setting in self._global_container_stack.getTop().findInstances(**{})]
|
|
|
-
|
|
|
- # user changes in extruder stacks
|
|
|
- stacks = list(ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId()))
|
|
|
- for stack in stacks:
|
|
|
- details_list.extend([
|
|
|
- "%s (%s)" % (setting.definition.label, stack.getName())
|
|
|
- for setting in stack.getTop().findInstances(**{})])
|
|
|
-
|
|
|
- # Format to output string
|
|
|
- details = "\n ".join([details_text, ] + details_list)
|
|
|
-
|
|
|
- num_changed_settings = len(details_list)
|
|
|
Application.getInstance().discardOrKeepProfileChanges()
|
|
|
- '''Application.getInstance().messageBox(
|
|
|
- catalog.i18nc("@window:title", "Switched profiles"),
|
|
|
- catalog.i18nc(
|
|
|
- "@label",
|
|
|
- "Do you want to transfer your %d changed setting(s)/override(s) to this profile?") % num_changed_settings,
|
|
|
- catalog.i18nc(
|
|
|
- "@label",
|
|
|
- "If you transfer your settings they will override settings in the profile. If you don't transfer these settings, they will be lost."),
|
|
|
- details,
|
|
|
- buttons=QMessageBox.Yes + QMessageBox.No,
|
|
|
- icon=QMessageBox.Question,
|
|
|
- callback=self._keepUserSettingsDialogCallback)'''
|
|
|
-
|
|
|
- def _keepUserSettingsDialogCallback(self, button):
|
|
|
- if button == QMessageBox.Yes:
|
|
|
- # Yes, keep the settings in the user profile with this profile
|
|
|
- pass
|
|
|
- elif button == QMessageBox.No:
|
|
|
- # No, discard the settings in the user profile
|
|
|
- global_stack = Application.getInstance().getGlobalContainerStack()
|
|
|
- for extruder in ExtruderManager.getInstance().getMachineExtruders(global_stack.getId()):
|
|
|
- extruder.getTop().clear()
|
|
|
-
|
|
|
- global_stack.getTop().clear()
|
|
|
|
|
|
@pyqtProperty(str, notify = activeVariantChanged)
|
|
|
def activeVariantName(self):
|