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 fc51b82
Showing 1 changed file with 4 additions and 7 deletions.
@@ -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.