From e098816f2ba8fbca1d6e4667f3fd02dc6f4f2d2e Mon Sep 17 00:00:00 2001 From: Ale Martinez Date: Thu, 17 Dec 2020 15:48:36 -0300 Subject: [PATCH] Don't allow "_" in user metric name since it is alread used to replace blanks and breaks some functionality, for example names with "_" don't appear on column chooser. --- src/Gui/EditUserMetricDialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Gui/EditUserMetricDialog.cpp b/src/Gui/EditUserMetricDialog.cpp index 4b7bea2c3..f1aab38a0 100644 --- a/src/Gui/EditUserMetricDialog.cpp +++ b/src/Gui/EditUserMetricDialog.cpp @@ -281,7 +281,8 @@ EditUserMetricDialog::setErrors(QStringList &list) void EditUserMetricDialog::enableOk() { - okButton->setEnabled(!symbol->text().isEmpty() && !name->text().isEmpty()); + // Check symbol and name are non-empty, and "_" is not used in name. + okButton->setEnabled(!symbol->text().isEmpty() && !name->text().isEmpty() && !name->text().contains("_")); } bool