Skip to content
Permalink
Browse files

[save as vector] use the save/restore geomtry API

  • Loading branch information
DelazJ authored and nirvn committed Feb 13, 2018
1 parent ea40f1e commit fc51b82f5cf24d41d6e3671747b1ce7578d8ec83
Showing with 4 additions and 7 deletions.
  1. +4 −7 src/gui/ogr/qgsvectorlayersaveasdialog.cpp
@@ -73,6 +73,8 @@ QgsVectorLayerSaveAsDialog::QgsVectorLayerSaveAsDialog( QgsVectorLayer *layer, i
void QgsVectorLayerSaveAsDialog::setup()
{
setupUi( this );
QgsGui::instance()->enableAutoGeometryRestore( this );

connect( mFormatComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsVectorLayerSaveAsDialog::mFormatComboBox_currentIndexChanged );
connect( mCrsSelector, &QgsProjectionSelectionWidget::crsChanged, this, &QgsVectorLayerSaveAsDialog::mCrsSelector_crsChanged );
connect( mSymbologyExportComboBox, static_cast<void ( QComboBox::* )( const QString & )>( &QComboBox::currentIndexChanged ), this, &QgsVectorLayerSaveAsDialog::mSymbologyExportComboBox_currentIndexChanged );
@@ -83,16 +85,14 @@ void QgsVectorLayerSaveAsDialog::setup()
connect( mAttributeTable, &QTableWidget::itemChanged, this, &QgsVectorLayerSaveAsDialog::mAttributeTable_itemChanged );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsVectorLayerSaveAsDialog::showHelp );

QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/VectorLayerSaveAs/geometry" ) ).toByteArray() );

const QList< QgsVectorFileWriter::DriverDetails > drivers = QgsVectorFileWriter::ogrDriverList();
mFormatComboBox->blockSignals( true );
for ( const QgsVectorFileWriter::DriverDetails &driver : drivers )
{
mFormatComboBox->addItem( driver.longName, driver.driverName );
}

QgsSettings settings;
QString format = settings.value( QStringLiteral( "UI/lastVectorFormat" ), "GPKG" ).toString();
mFormatComboBox->setCurrentIndex( mFormatComboBox->findData( format ) );
mFormatComboBox->blockSignals( false );
@@ -153,8 +153,7 @@ void QgsVectorLayerSaveAsDialog::setup()
QFileInfo fileInfo( filePath );
leLayername->setText( fileInfo.baseName() );
}
buttonBox->button( QDialogButtonBox::Ok )->setEnabled(
!filePath.isEmpty() && QFileInfo( filePath ).absoluteDir().exists() );
buttonBox->button( QDialogButtonBox::Ok )->setEnabled( !filePath.isEmpty() );
} );
}

@@ -237,8 +236,6 @@ QList<QPair<QLabel *, QWidget *> > QgsVectorLayerSaveAsDialog::createControls( c

QgsVectorLayerSaveAsDialog::~QgsVectorLayerSaveAsDialog()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "Windows/VectorLayerSaveAs/geometry" ), saveGeometry() );
}

void QgsVectorLayerSaveAsDialog::accept()

0 comments on commit fc51b82

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