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

scribus-commit scribus-commit at lists.scribus.net
Thu Nov 22 20:27:47 UTC 2012


Author: fschmid
Date: Thu Nov 22 20:27:47 2012
New Revision: 17897

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

Modified:
    branches/Version14x/Scribus/scribus/propertiespalette.cpp
    branches/Version14x/Scribus/scribus/query.cpp
    branches/Version14x/Scribus/scribus/query.h
    branches/Version14x/Scribus/scribus/scrapbookpalette.cpp

Modified: branches/Version14x/Scribus/scribus/propertiespalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17897&path=/branches/Version14x/Scribus/scribus/propertiespalette.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/propertiespalette.cpp (original)
+++ branches/Version14x/Scribus/scribus/propertiespalette.cpp Thu Nov 22 20:27:47 2012
@@ -133,7 +133,7 @@
 NameWidget::NameWidget(QWidget* parent) : QLineEdit(parent)
 {
 	setObjectName("namewidget");
-	QRegExp rx( "\\w+" );
+	QRegExp rx( "[\\w()]+" );
 	QValidator* validator = new QRegExpValidator( rx, this );
 	setValidator( validator );
 }

Modified: branches/Version14x/Scribus/scribus/query.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17897&path=/branches/Version14x/Scribus/scribus/query.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/query.cpp (original)
+++ branches/Version14x/Scribus/scribus/query.cpp Thu Nov 22 20:27:47 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: branches/Version14x/Scribus/scribus/query.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17897&path=/branches/Version14x/Scribus/scribus/query.h
==============================================================================
--- branches/Version14x/Scribus/scribus/query.h (original)
+++ branches/Version14x/Scribus/scribus/query.h Thu Nov 22 20:27:47 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: branches/Version14x/Scribus/scribus/scrapbookpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17897&path=/branches/Version14x/Scribus/scribus/scrapbookpalette.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scrapbookpalette.cpp (original)
+++ branches/Version14x/Scribus/scribus/scrapbookpalette.cpp Thu Nov 22 20:27:47 2012
@@ -926,6 +926,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())
@@ -1112,6 +1113,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())
@@ -1253,6 +1255,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())
@@ -1402,6 +1405,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