Updating profile now also works in profile page

CURA-1585
This commit is contained in:
Jaime van Kessel 2016-06-03 15:29:41 +02:00
parent d1d60e27cc
commit fdbd6d7c5f

View File

@ -29,14 +29,14 @@ UM.ManagementPage
onActivateObject: Cura.MachineManager.setActiveQuality(currentItem.id) onActivateObject: Cura.MachineManager.setActiveQuality(currentItem.id)
onAddObject: { onAddObject: {
var selectedProfile; var selectedContainer;
if (objectList.currentIndex == 0) { if (objectList.currentIndex == 0) {
// Current settings // Current settings
selectedProfile = UM.MachineManager.createProfile(); selectedContainer = Cura.MachineManager.convertUserContainerToQuality();
} else { } else {
selectedProfile = UM.MachineManager.duplicateProfile(currentItem.name); selectedContainer = Cura.MachineManager.duplicateContainer(currentItem.id);
} }
base.selectProfile(selectedProfile); base.selectContainer(selectedContainer);
renameDialog.removeWhenRejected = true; renameDialog.removeWhenRejected = true;
renameDialog.open(); renameDialog.open();
@ -50,11 +50,11 @@ UM.ManagementPage
removeEnabled: currentItem != null ? !currentItem.readOnly : false; removeEnabled: currentItem != null ? !currentItem.readOnly : false;
renameEnabled: currentItem != null ? !currentItem.readOnly : false; renameEnabled: currentItem != null ? !currentItem.readOnly : false;
scrollviewCaption: catalog.i18nc("@label %1 is printer name","Printer: %1").arg(UM.MachineManager.activeMachineInstance) scrollviewCaption: catalog.i18nc("@label %1 is printer name","Printer: %1").arg(Cura.MachineManager.activeMachineName)
signal selectProfile(string name) signal selectContainer(string id)
onSelectProfile: { onSelectContainer: {
objectList.currentIndex = objectList.model.find("name", name); objectList.currentIndex = objectList.model.find("id", id);
} }
Item { Item {
@ -86,12 +86,12 @@ UM.ManagementPage
Button Button
{ {
text: { text: {
var profileName = UM.MachineManager.activeProfile; var profileName = Cura.MachineManager.activeQualityName;
profileName = (profileName.length > 20) ? profileName.substring(0, 20) + '...' : profileName; profileName = (profileName.length > 20) ? profileName.substring(0, 20) + '...' : profileName;
return catalog.i18nc("@action:button", "Update \"%1\"".arg(profileName)); return catalog.i18nc("@action:button", "Update \"%1\"".arg(profileName));
} }
enabled: Cura.MachineManager.hasUserSettings && !Cura.MachineManager.isReadOnly(Cura.MachineManager.activeQualityId) enabled: Cura.MachineManager.hasUserSettings && !Cura.MachineManager.isReadOnly(Cura.MachineManager.activeQualityId)
onClicked: UM.ActiveProfile.updateProfile() onClicked: Cura.MachineManager.updateUserContainerToQuality()
} }
Button Button