CURA-4606 reimplemented duplicate profile

This commit is contained in:
Jack Ha 2018-02-19 16:47:04 +01:00
parent 7a78f9821f
commit bd10f23311
3 changed files with 46 additions and 92 deletions

View file

@ -103,7 +103,9 @@ Item
visible: !base.canCreateProfile
onClicked: {
// TODO
newDuplicateNameDialog.object = Cura.ContainerManager.makeUniqueName(base.currentItem.name);
newDuplicateNameDialog.open();
newDuplicateNameDialog.selectText();
}
}
@ -154,8 +156,7 @@ Item
}
}
// Dialog to request a name when creating a new profile
// Dialog to request a name when creating a new profile
UM.RenameDialog
{
title: catalog.i18nc("@title:window", "Create Profile")
@ -168,6 +169,19 @@ Item
}
}
// Dialog to request a name when duplicating a new profile
UM.RenameDialog
{
title: catalog.i18nc("@title:window", "Duplicate Profile")
id: newDuplicateNameDialog;
object: "<new name>";
onAccepted:
{
Cura.ContainerManager.duplicateQualityChanges(newName, base.currentItem);
objectList.currentIndex = -1 //Reset selection.
}
}
Item {
id: contentsItem