Browse Source

Use Cura.MachineNameValidator

CURA-6435
Lipu Fei 5 years ago
parent
commit
9b603d1f4b
1 changed files with 5 additions and 3 deletions
  1. 5 3
      resources/qml/WelcomePages/AddLocalPrinterScrollView.qml

+ 5 - 3
resources/qml/WelcomePages/AddLocalPrinterScrollView.qml

@@ -214,9 +214,11 @@ Item
             width: (parent.width / 2) | 0
             placeholderText: catalog.i18nc("@text", "Please give your printer a name")
             maximumLength: 40
-
-            // Make sure that the fill is not empty
-            validator: RegExpValidator { regExp: /.+/ }
+            validator: RegExpValidator
+            {
+                regExp: printerNameTextField.machineNameValidator.machineNameRegex
+            }
+            property var machineNameValidator: Cura.MachineNameValidator { }
         }
     }
 }