Skip to content
Permalink
Browse files

optionally add save vector file to canvas (fix #4598)

  • Loading branch information
jef-n committed Feb 2, 2012
1 parent 04a2824 commit 16d0d2f2d970c78d3877a9af96b8b8ff66095f8a
@@ -167,3 +167,8 @@ bool QgsVectorLayerSaveAsDialog::skipAttributeCreation() const
{
return mSkipAttributeCreation->isChecked();
}

bool QgsVectorLayerSaveAsDialog::addToCanvas() const
{
return mAddToCanvas->isChecked();
}
@@ -40,6 +40,7 @@ class QgsVectorLayerSaveAsDialog : public QDialog, private Ui::QgsVectorLayerSav
QStringList layerOptions() const;
long crs() const;
bool skipAttributeCreation() const;
bool addToCanvas() const;

private slots:
void on_mFormatComboBox_currentIndexChanged( int idx );
@@ -3471,6 +3471,10 @@ void QgisApp::saveAsVectorFileGeneral( bool saveOnlySelection )

if ( error == QgsVectorFileWriter::NoError )
{
if ( dialog->addToCanvas() )
{
addVectorLayers( QStringList( vectorFilename ), encoding, "file" );
}
QMessageBox::information( 0, tr( "Saving done" ), tr( "Export to vector file has been completed" ) );
}
else
@@ -143,6 +143,13 @@
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="mAddToCanvas">
<property name="text">
<string>Add save file to map</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

0 comments on commit 16d0d2f

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