Skip to content

Commit

Permalink
Show symbology export options only when compatible (fixes #11098)
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ committed Oct 27, 2017
1 parent 99b1c74 commit 591150d
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/gui/ogr/qgsvectorlayersaveasdialog.cpp
Expand Up @@ -57,6 +57,7 @@ QgsVectorLayerSaveAsDialog::QgsVectorLayerSaveAsDialog( QgsVectorLayer *layer, i
mLayerExtent = layer->extent();
}
setup();

if ( !( options & Symbology ) )
{
mSymbologyExportLabel->hide();
Expand Down Expand Up @@ -360,15 +361,31 @@ void QgsVectorLayerSaveAsDialog::mFormatComboBox_currentIndexChanged( int idx )
const QString sFormat( format() );
if ( sFormat == QLatin1String( "DXF" ) || sFormat == QLatin1String( "DGN" ) )
{
mAttributesSelection->setEnabled( false );
mAttributesSelection->setVisible( false );
selectAllFields = false;
}
else
{
mAttributesSelection->setEnabled( true );
mAttributesSelection->setVisible( true );
fieldsAsDisplayedValues = ( sFormat == QLatin1String( "CSV" ) || sFormat == QLatin1String( "XLS" ) || sFormat == QLatin1String( "XLSX" ) || sFormat == QLatin1String( "ODS" ) );
}

// Show symbology options only for some formats
if ( sFormat == QLatin1String( "DXF" ) || sFormat == QLatin1String( "KML" ) || sFormat == QLatin1String( "MapInfo File" ) || sFormat == QLatin1String( "MapInfo MIF" ) )
{
mSymbologyExportLabel->setVisible( true );
mSymbologyExportComboBox->setVisible( true );
mScaleLabel->setVisible( true );
mScaleWidget->setVisible( true );
}
else
{
mSymbologyExportLabel->hide();
mSymbologyExportComboBox->hide();
mScaleLabel->hide();
mScaleWidget->hide();
}

leLayername->setEnabled( sFormat == QLatin1String( "KML" ) ||
sFormat == QLatin1String( "GPKG" ) ||
sFormat == QLatin1String( "XLSX" ) ||
Expand Down

0 comments on commit 591150d

Please sign in to comment.