Also validate machine name in rename dialogue

Otherwise you could still circumvent the length limitation.

Contributes to issue CURA-2692.
This commit is contained in:
Ghostkeeper 2016-10-28 13:33:26 +02:00
parent d33f6d2e44
commit 9f43a740a6
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -251,6 +251,8 @@ UM.ManagementPage
{
id: renameDialog;
object: base.currentItem && base.currentItem.name ? base.currentItem.name : "";
property var machine_name_validator: Cura.MachineNameValidator { }
validName: renameDialog.newName.match(renameDialog.machine_name_validator.machineNameRegex) != null;
onAccepted:
{
Cura.MachineManager.renameMachine(base.currentItem.id, newName.trim());