QTfrontend/ui/page/pagescheme.cpp
changeset 14860 e239378a9400
parent 14857 b9437746bffb
child 15650 e63748a3aa52
--- a/QTfrontend/ui/page/pagescheme.cpp	Thu Apr 25 21:25:16 2019 +0200
+++ b/QTfrontend/ui/page/pagescheme.cpp	Thu Apr 25 23:01:05 2019 +0200
@@ -26,7 +26,10 @@
 #include <QMessageBox>
 #include <QDataWidgetMapper>
 #include <QSpinBox>
+#include <QRegExp>
+#include <QRegExpValidator>
 
+#include "hwconsts.h"
 #include "gameSchemeModel.h"
 #include "pagescheme.h"
 #include "FreqSpinBox.h"
@@ -517,6 +520,9 @@
     L_name->setText(QLabel::tr("Scheme Name:"));
 
     LE_name = new QLineEdit(this);
+    QRegExp rx(*cSafeFileNameRegExp);
+    QRegExpValidator * val = new QRegExpValidator(rx, LE_name);
+    LE_name->setValidator(val);
     LE_name->setWhatsThis(tr("Name of this scheme"));
 
     gl->addWidget(LE_name,15,1,1,5);