Skip to content
Permalink
Browse files

new vector layer: limit attribute name length of shape files to 10 (f…

…ixes #9753)
  • Loading branch information
jef-n committed Jun 22, 2014
1 parent c8375f5 commit 88bbe384dc7f473c84fb55c97bfdff3e0cb83315
Showing with 11 additions and 0 deletions.
  1. +10 −0 src/gui/qgsnewvectorlayerdialog.cpp
  2. +1 −0 src/gui/qgsnewvectorlayerdialog.h
@@ -64,6 +64,8 @@ QgsNewVectorLayerDialog::QgsNewVectorLayerDialog( QWidget *parent, Qt::WindowFla
mFileFormatLabel->setVisible( false );
}

mFileFormatComboBox->setCurrentIndex( 0 );

mFileEncoding->addItems( QgsVectorDataProvider::availableEncodings() );

// Use default encoding if none supplied
@@ -104,6 +106,14 @@ QgsNewVectorLayerDialog::~QgsNewVectorLayerDialog()
settings.setValue( "/Windows/NewVectorLayer/geometry", saveGeometry() );
}

void QgsNewVectorLayerDialog::on_mFileFormatComboBox_currentIndexChanged( int index )
{
if ( mFileFormatComboBox->currentText() == tr( "ESRI Shapefile" ) )
mNameEdit->setMaxLength( 10 );
else
mNameEdit->setMaxLength( 32767 );
}

void QgsNewVectorLayerDialog::on_mTypeBox_currentIndexChanged( int index )
{
// FIXME: sync with providers/ogr/qgsogrprovider.cpp
@@ -49,6 +49,7 @@ class GUI_EXPORT QgsNewVectorLayerDialog: public QDialog, private Ui::QgsNewVect
protected slots:
void on_mAddAttributeButton_clicked();
void on_mRemoveAttributeButton_clicked();
void on_mFileFormatComboBox_currentIndexChanged( int index );
void on_mTypeBox_currentIndexChanged( int index );
void on_pbnChangeSpatialRefSys_clicked();
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }

0 comments on commit 88bbe38

Please sign in to comment.
You can’t perform that action at this time.