4 changes: 4 additions & 0 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ SET (QGIS_APP_MOC_HDRS
qgsattributetabledialog.h
qgsbookmarks.h
qgsbrowserdockwidget.h
qgsclipboard.h
qgsconfigureshortcutsdialog.h
qgscustomization.h
qgscustomprojectiondialog.h
Expand Down Expand Up @@ -456,6 +457,9 @@ ELSE (ANDROID)
ADD_EXECUTABLE(${QGIS_APP_NAME} MACOSX_BUNDLE WIN32 ${QGIS_APP_SRCS} ${QGIS_APP_MOC_SRCS} ${IMAGE_RCC_SRCS} ${TEST_RCC_SRCS})
ENDIF (ANDROID)

# shared library used by tests - TODO: use it also for qgis executable?
ADD_LIBRARY(qgis_app SHARED ${QGIS_APP_SRCS} ${QGIS_APP_MOC_SRCS} ${QGIS_APP_HDRS} ${QGIS_APP_MOC_HDRS} ${IMAGE_RCC_SRCS})

TARGET_LINK_LIBRARIES(${QGIS_APP_NAME}
${QWT_LIBRARY}
${QT_QTSQL_LIBRARY}
Expand Down
24 changes: 22 additions & 2 deletions src/app/ogr/qgsvectorlayersaveasdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* (at your option) any later version. *
* *
***************************************************************************/
#include "qgslogger.h"
#include "qgsvectorlayersaveasdialog.h"
#include "qgsgenericprojectionselector.h"
#include "qgsvectordataprovider.h"
Expand All @@ -29,10 +30,29 @@ QgsVectorLayerSaveAsDialog::QgsVectorLayerSaveAsDialog( long srsid, QWidget* par
: QDialog( parent, fl )
, mCRS( srsid )
{
setupUi( this );
setup();
}

QgsVectorLayerSaveAsDialog::QgsVectorLayerSaveAsDialog( long srsid, int options, QWidget* parent, Qt::WFlags fl )
: QDialog( parent, fl )
, mCRS( srsid )
{
setup();
if ( !( options & Symbology ) )
{
mSymbologyExportLabel->hide();
mSymbologyExportComboBox->hide();
mScaleLabel->hide();
mScaleSpinBox->hide();
}
}

void QgsVectorLayerSaveAsDialog::setup()
{
setupUi( this );
QSettings settings;
restoreGeometry( settings.value( "/Windows/VectorLayerSaveAs/geometry" ).toByteArray() );

QMap<QString, QString> map = QgsVectorFileWriter::ogrDriverList();
mFormatComboBox->blockSignals( true );
for ( QMap< QString, QString>::const_iterator it = map.constBegin(); it != map.constEnd(); ++it )
Expand All @@ -57,7 +77,7 @@ QgsVectorLayerSaveAsDialog::QgsVectorLayerSaveAsDialog( long srsid, QWidget* par
mCRSSelection->clear();
mCRSSelection->addItems( QStringList() << tr( "Layer CRS" ) << tr( "Project CRS" ) << tr( "Selected CRS" ) );

QgsCoordinateReferenceSystem srs( srsid, QgsCoordinateReferenceSystem::InternalCrsId );
QgsCoordinateReferenceSystem srs( mCRS, QgsCoordinateReferenceSystem::InternalCrsId );
leCRS->setText( srs.description() );

mEncodingComboBox->setCurrentIndex( idx );
Expand Down
10 changes: 10 additions & 0 deletions src/app/ogr/qgsvectorlayersaveasdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ class QgsVectorLayerSaveAsDialog : public QDialog, private Ui::QgsVectorLayerSav
Q_OBJECT

public:
// bitmask of options to be shown
enum Options
{
Symbology = 1,
AllOptions = ~0
};

QgsVectorLayerSaveAsDialog( long srsid, QWidget* parent = 0, Qt::WFlags fl = 0 );
QgsVectorLayerSaveAsDialog( long srsid, int options = AllOptions, QWidget* parent = 0, Qt::WFlags fl = 0 );
~QgsVectorLayerSaveAsDialog();

QString format() const;
Expand Down Expand Up @@ -58,6 +66,8 @@ class QgsVectorLayerSaveAsDialog : public QDialog, private Ui::QgsVectorLayerSav
void accept();

private:
void setup();

long mCRS;
};

Expand Down
Loading