Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
output name validator
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5076 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Mar 22, 2006
1 parent e771016 commit 2e252d2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/plugins/grass/qgsgrassmodule.cpp
Expand Up @@ -65,6 +65,7 @@
#include <QGridLayout>
#include <QIntValidator>
#include <QDoubleValidator>
#include <QRegExpValidator>
#include <QPushButton>
#include <QGroupBox>
#include <QFileDialog>
Expand Down Expand Up @@ -1151,6 +1152,19 @@ void QgsGrassModuleOption::addLineEdit()
} else {
mValidator = new QDoubleValidator( this );
}
lineEdit->setValidator ( mValidator );
} else if ( mIsOutput ) {
QRegExp rx;
if ( mOutputType == Vector )
{
rx.setPattern("[A-Za-z_][A-Za-z0-9_]+");
}
else
{
rx.setPattern("[A-Za-z0-9_.]+");
}
mValidator = new QRegExpValidator( rx, this );

lineEdit->setValidator ( mValidator );
}

Expand Down Expand Up @@ -2247,3 +2261,4 @@ QString QgsGrassModuleFile::ready()
QgsGrassModuleFile::~QgsGrassModuleFile()
{
}

0 comments on commit 2e252d2

Please sign in to comment.