|
@@ -20,14 +20,15 @@ |
|
|
#include "qgsgenericprojectionselector.h" |
|
|
#include "qgsvectordataprovider.h" |
|
|
#include "qgsvectorfilewriter.h" |
|
|
#include "qgscoordinatereferencesystem.h" |
|
|
|
|
|
#include <QSettings> |
|
|
#include <QFileDialog> |
|
|
#include <QTextCodec> |
|
|
|
|
|
QgsVectorLayerSaveAsDialog::QgsVectorLayerSaveAsDialog( QWidget* parent, Qt::WFlags fl ) |
|
|
QgsVectorLayerSaveAsDialog::QgsVectorLayerSaveAsDialog( long srsid, QWidget* parent, Qt::WFlags fl ) |
|
|
: QDialog( parent, fl ) |
|
|
, mCRS( -1 ) |
|
|
, mCRS( srsid ) |
|
|
{ |
|
|
setupUi( this ); |
|
|
|
|
@@ -53,9 +54,13 @@ QgsVectorLayerSaveAsDialog::QgsVectorLayerSaveAsDialog( QWidget* parent, Qt::WFl |
|
|
idx = 0; |
|
|
} |
|
|
|
|
|
mEncodingComboBox->setCurrentIndex( idx ); |
|
|
mCRSSelection->clear(); |
|
|
mCRSSelection->addItems( QStringList() << tr( "Layer CRS" ) << tr( "Project CRS" ) << tr( "Selected CRS" ) ); |
|
|
|
|
|
QgsCoordinateReferenceSystem srs( srsid, QgsCoordinateReferenceSystem::InternalCrsId ); |
|
|
leCRS->setText( srs.description() ); |
|
|
|
|
|
leCRS->setText( tr( "Original CRS" ) ); |
|
|
mEncodingComboBox->setCurrentIndex( idx ); |
|
|
on_mFormatComboBox_currentIndexChanged( mFormatComboBox->currentIndex() ); |
|
|
} |
|
|
|
|
@@ -72,6 +77,11 @@ void QgsVectorLayerSaveAsDialog::accept() |
|
|
QDialog::accept(); |
|
|
} |
|
|
|
|
|
void QgsVectorLayerSaveAsDialog::on_mCRSSelection_currentIndexChanged( int idx ) |
|
|
{ |
|
|
leCRS->setEnabled( idx == 2 ); |
|
|
} |
|
|
|
|
|
void QgsVectorLayerSaveAsDialog::on_mFormatComboBox_currentIndexChanged( int idx ) |
|
|
{ |
|
|
browseFilename->setEnabled( true ); |
|
@@ -120,6 +130,7 @@ void QgsVectorLayerSaveAsDialog::on_browseCRS_clicked() |
|
|
QgsCoordinateReferenceSystem srs( mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::InternalCrsId ); |
|
|
mCRS = srs.srsid(); |
|
|
leCRS->setText( srs.description() ); |
|
|
mCRSSelection->setCurrentIndex( 2 ); |
|
|
} |
|
|
|
|
|
delete mySelector; |
|
@@ -142,7 +153,18 @@ QString QgsVectorLayerSaveAsDialog::format() const |
|
|
|
|
|
long QgsVectorLayerSaveAsDialog::crs() const |
|
|
{ |
|
|
return mCRS; |
|
|
if ( mCRSSelection->currentIndex() == 0 ) |
|
|
{ |
|
|
return -1; // Layer CRS |
|
|
} |
|
|
else if ( mCRSSelection->currentIndex() == 1 ) |
|
|
{ |
|
|
return -2; // Project CRS |
|
|
} |
|
|
else |
|
|
{ |
|
|
return mCRS; |
|
|
} |
|
|
} |
|
|
|
|
|
QStringList QgsVectorLayerSaveAsDialog::datasourceOptions() const |
|
|