Change settings to settings/overrides in selected messages. CURA-2898

This commit is contained in:
Jack Ha 2016-11-23 13:33:12 +01:00
parent 8aa5ea5864
commit c3320bb1a4
4 changed files with 19 additions and 14 deletions

View File

@ -871,7 +871,7 @@ class MachineManager(QObject):
def _askUserToKeepOrClearCurrentSettings(self): def _askUserToKeepOrClearCurrentSettings(self):
# Ask the user if the user profile should be cleared or not (discarding the current settings) # 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 # 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):") details_text = catalog.i18nc("@label", "You made changes to the following setting(s)/override(s):")
# user changes in global stack # user changes in global stack
details_list = [setting.definition.label for setting in self._global_container_stack.getTop().findInstances(**{})] details_list = [setting.definition.label for setting in self._global_container_stack.getTop().findInstances(**{})]
@ -886,14 +886,19 @@ class MachineManager(QObject):
# Format to output string # Format to output string
details = "\n ".join([details_text, ] + details_list) details = "\n ".join([details_text, ] + details_list)
Application.getInstance().messageBox(catalog.i18nc("@window:title", "Switched profiles"), num_changed_settings = len(details_list)
catalog.i18nc("@label", Application.getInstance().messageBox(
"Do you want to transfer your changed settings to this profile?"), catalog.i18nc("@window:title", "Switched profiles"),
catalog.i18nc("@label", catalog.i18nc(
"If you transfer your settings they will override settings in the profile."), "@label",
details, "Do you want to transfer your %d changed setting(s)/override(s) to this profile?") % num_changed_settings,
buttons=QMessageBox.Yes + QMessageBox.No, icon=QMessageBox.Question, catalog.i18nc(
callback=self._keepUserSettingsDialogCallback) "@label",
"If you transfer your settings they will override settings in the profile."),
details,
buttons=QMessageBox.Yes + QMessageBox.No,
icon=QMessageBox.Question,
callback=self._keepUserSettingsDialogCallback)
def _keepUserSettingsDialogCallback(self, button): def _keepUserSettingsDialogCallback(self, button):
if button == QMessageBox.Yes: if button == QMessageBox.Yes:

View File

@ -122,7 +122,7 @@ Item
{ {
id: updateProfileAction; id: updateProfileAction;
enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings && !Cura.MachineManager.isReadOnly(Cura.MachineManager.activeQualityId) enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings && !Cura.MachineManager.isReadOnly(Cura.MachineManager.activeQualityId)
text: catalog.i18nc("@action:inmenu menubar:profile","&Update profile with current settings"); text: catalog.i18nc("@action:inmenu menubar:profile","&Update profile with current settings/overrides");
onTriggered: Cura.ContainerManager.updateQualityChanges(); onTriggered: Cura.ContainerManager.updateQualityChanges();
} }
@ -142,7 +142,7 @@ Item
{ {
id: addProfileAction; id: addProfileAction;
enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings
text: catalog.i18nc("@action:inmenu menubar:profile","&Create profile from current settings..."); text: catalog.i18nc("@action:inmenu menubar:profile","&Create profile from current settings/overrides...");
} }
Action Action

View File

@ -162,7 +162,7 @@ UM.ManagementPage
Button Button
{ {
text: { text: {
return catalog.i18nc("@action:button", "Update profile with current settings"); return catalog.i18nc("@action:button", "Update profile with current settings/overrides");
} }
enabled: Cura.MachineManager.hasUserSettings && !Cura.MachineManager.isReadOnly(Cura.MachineManager.activeQualityId) enabled: Cura.MachineManager.hasUserSettings && !Cura.MachineManager.isReadOnly(Cura.MachineManager.activeQualityId)
onClicked: Cura.ContainerManager.updateQualityChanges() onClicked: Cura.ContainerManager.updateQualityChanges()
@ -187,7 +187,7 @@ UM.ManagementPage
Label { Label {
id: defaultsMessage id: defaultsMessage
visible: false visible: false
text: catalog.i18nc("@action:label", "This profile uses the defaults specified by the printer, so it has no settings in the list below.") text: catalog.i18nc("@action:label", "This profile uses the defaults specified by the printer, so it has no settings/overrides in the list below.")
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
width: parent.width width: parent.width
} }

View File

@ -329,7 +329,7 @@ Column
} }
onEntered: onEntered:
{ {
var content = catalog.i18nc("@tooltip","Some setting values are different from the values stored in the profile.\n\nClick to open the profile manager.") var content = catalog.i18nc("@tooltip","Some setting/override values are different from the values stored in the profile.\n\nClick to open the profile manager.")
base.showTooltip(globalProfileRow, Qt.point(0, globalProfileRow.height / 2), content) base.showTooltip(globalProfileRow, Qt.point(0, globalProfileRow.height / 2), content)
} }
onExited: base.hideTooltip() onExited: base.hideTooltip()