r17895 by fschmid - Fixed Bug #11176: scrapbook entry name & filesystem limitation

scribus-commit scribus-commit at lists.scribus.net
Wed Nov 21 22:47:33 UTC 2012


Author: fschmid
Date: Wed Nov 21 22:47:33 2012
New Revision: 17895

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17895
Log:
Fixed Bug #11176: scrapbook entry name & filesystem limitation

Modified:
    trunk/Scribus/scribus/ui/propertiespalette_utils.cpp
    trunk/Scribus/scribus/ui/query.cpp
    trunk/Scribus/scribus/ui/query.h
    trunk/Scribus/scribus/ui/scrapbookpalette.cpp

Modified: trunk/Scribus/scribus/ui/propertiespalette_utils.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17895&path=/trunk/Scribus/scribus/ui/propertiespalette_utils.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_utils.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_utils.cpp Wed Nov 21 22:47:33 2012
@@ -100,7 +100,7 @@
 NameWidget::NameWidget(QWidget* parent) : QLineEdit(parent)
 {
 	setObjectName("namewidget");
-	QRegExp rx( "\\w+" );
+	QRegExp rx( "[\\w()]+" );
 	QValidator* validator = new QRegExpValidator( rx, this );
 	setValidator( validator );
 }

Modified: trunk/Scribus/scribus/ui/query.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17895&path=/trunk/Scribus/scribus/ui/query.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/query.cpp (original)
+++ trunk/Scribus/scribus/ui/query.cpp Wed Nov 21 22:47:33 2012
@@ -10,6 +10,9 @@
 #include <QLineEdit>
 #include <QPushButton>
 #include <QMessageBox>
+#include <QRegExp>
+#include <QValidator>
+#include <QRegExpValidator>
 #include "commonstrings.h"
 #include "util_icon.h"
 
@@ -123,3 +126,9 @@
 {
 	checkMode = mode;
 }
+
+void Query::setValidator(QRegExp rx)
+{
+	QValidator* vaild = new QRegExpValidator( rx, this );
+	answerEdit->setValidator(vaild);
+}

Modified: trunk/Scribus/scribus/ui/query.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17895&path=/trunk/Scribus/scribus/ui/query.h
==============================================================================
--- trunk/Scribus/scribus/ui/query.h (original)
+++ trunk/Scribus/scribus/ui/query.h Wed Nov 21 22:47:33 2012
@@ -32,6 +32,7 @@
 	void setTestList(QStringList tList);
 	void setForbiddenList(QStringList tList);
 	void setCheckMode(bool mode);
+	void setValidator(QRegExp rx);
 
 public slots:
 	void Leave();

Modified: trunk/Scribus/scribus/ui/scrapbookpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17895&path=/trunk/Scribus/scribus/ui/scrapbookpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scrapbookpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/scrapbookpalette.cpp Wed Nov 21 22:47:33 2012
@@ -1077,6 +1077,7 @@
 	if (bv->objectMap.contains(nam))
 	{
 		Query dia(this, "tt", 1, 0, tr("&Name:"), tr("New Entry"));
+		dia.setValidator(QRegExp("[\\w()]+"));
 		dia.setEditText(nam, true);
 		dia.setTestList(activeBView->objectMap.keys());
 		if (dia.exec())
@@ -1265,6 +1266,7 @@
 	QListWidgetItem *ite = actItem;
 	QString OldName = ite->text();
 	Query dia(this, "tt", 1, 0, tr("&Name:"), tr("New Name"));
+	dia.setValidator(QRegExp("[\\w()]+"));
 	dia.setEditText(ite->text(), true);
 	dia.setTestList(activeBView->objectMap.keys());
 	if (dia.exec())
@@ -1394,6 +1396,7 @@
 		}
 		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 		Query dia(this, "tt", 1, 0, tr("&Name:"), tr("New Entry"));
+		dia.setValidator(QRegExp("[\\w()]+"));
 		dia.setEditText(nam, true);
 		dia.setTestList(activeBView->objectMap.keys());
 		if (dia.exec())
@@ -1521,6 +1524,7 @@
 	}
 	qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 	Query dia(this, "tt", 1, 0, tr("&Name:"), tr("New Entry"));
+	dia.setValidator(QRegExp("[\\w()]+"));
 	dia.setEditText(nam, true);
 	dia.setTestList(activeBView->objectMap.keys());
 	if (dia.exec())
@@ -1682,6 +1686,7 @@
 		nam += "("+ tmp.setNum(tempCount) + ")";
 	qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
 	Query dia(this, "tt", 1, 0, tr("&Name:"), tr("New Entry"));
+	dia.setValidator(QRegExp("[\\w()]+"));
 	dia.setEditText(nam, true);
 	dia.setTestList(activeBView->objectMap.keys());
 	if (dia.exec())




More information about the scribus-commit mailing list