mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
QgsVectorLayerSaveAsDialog: use QgsVectorFileWriter::MetaData::compulsoryEncoding to initialize the encoding combobox
This commit is contained in:
parent
3ee7d59e18
commit
1ab29771b7
@ -228,8 +228,6 @@ void QgsVectorLayerSaveAsDialog::on_mFormatComboBox_currentIndexChanged( int idx
|
||||
|
||||
if ( format() == "KML" )
|
||||
{
|
||||
mEncodingComboBox->setCurrentIndex( mEncodingComboBox->findText( "UTF-8" ) );
|
||||
mEncodingComboBox->setDisabled( true );
|
||||
mAttributesSelection->setEnabled( true );
|
||||
selectAllFields = false;
|
||||
}
|
||||
@ -240,7 +238,6 @@ void QgsVectorLayerSaveAsDialog::on_mFormatComboBox_currentIndexChanged( int idx
|
||||
}
|
||||
else
|
||||
{
|
||||
mEncodingComboBox->setEnabled( true );
|
||||
mAttributesSelection->setEnabled( true );
|
||||
fieldsAsDisplayedValues = ( format() == "CSV" || format() == "XLS" || format() == "XLSX" || format() == "ODS" );
|
||||
}
|
||||
@ -372,6 +369,29 @@ void QgsVectorLayerSaveAsDialog::on_mFormatComboBox_currentIndexChanged( int idx
|
||||
{
|
||||
mLayerOptionsGroupBox->setVisible( false );
|
||||
}
|
||||
|
||||
if ( driverMetaData.compulsoryEncoding.isEmpty() )
|
||||
{
|
||||
mEncodingComboBox->setEnabled( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
int idx = mEncodingComboBox->findText( driverMetaData.compulsoryEncoding );
|
||||
if ( idx >= 0 )
|
||||
{
|
||||
mEncodingComboBox->setCurrentIndex( idx );
|
||||
mEncodingComboBox->setDisabled( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
mEncodingComboBox->setEnabled( true );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
mEncodingComboBox->setEnabled( true );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user