Skip to content

Commit

Permalink
new vector layer: limit attribute name length of shape files to 10 (f…
Browse files Browse the repository at this point in the history
…ixes #9753)
  • Loading branch information
jef-n committed Jun 22, 2014
1 parent c8375f5 commit 88bbe38
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/gui/qgsnewvectorlayerdialog.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsnewvectorlayerdialog.h
Expand Up @@ -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() ); }
Expand Down

0 comments on commit 88bbe38

Please sign in to comment.