Skip to content

Commit 9ec2e42

Browse files
author
jef
committedMar 27, 2010
[FEATURE] allow saving vector layers as ogr vector files
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13169 c8812cc2-4d05-0410-92ff-de0c093fc19c

19 files changed

+538
-578
lines changed
 

‎python/core/qgsvectordataprovider.sip

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,4 +296,7 @@ class QgsVectorDataProvider : QgsDataProvider
296296
(e.g. no multipolygon in a polygon layer)
297297
@note: added in version 1.4*/
298298
bool doesStrictFeatureTypeCheck() const;
299+
300+
/** Returns a list of available encodings */
301+
static const QStringList &availableEncodings();
299302
};

‎src/app/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ SET(QGIS_APP_SRCS
105105
ogr/qgsopenvectorlayerdialog.cpp
106106
ogr/qgsnewogrconnection.cpp
107107
ogr/qgsogrsublayersdialog.cpp
108+
ogr/qgsvectorlayersaveasdialog.cpp
108109

109110
attributetable/qgsattributetabledialog.cpp
110111
attributetable/qgsattributetablemodel.cpp
@@ -199,6 +200,7 @@ SET (QGIS_APP_MOC_HDRS
199200
ogr/qgsopenvectorlayerdialog.h
200201
ogr/qgsnewogrconnection.h
201202
ogr/qgsogrsublayersdialog.h
203+
ogr/qgsvectorlayersaveasdialog.h
202204

203205
attributetable/qgsattributetableview.h
204206
attributetable/qgsattributetablemodel.h

‎src/app/legend/qgslegendlayer.cpp

Lines changed: 54 additions & 167 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include "qgsvectorfilewriter.h"
3737
#include "qgsgenericprojectionselector.h"
3838
#include "qgsattributetabledialog.h"
39-
#include "qgsencodingfiledialog.h"
39+
#include "ogr/qgsvectorlayersaveasdialog.h"
4040

4141
#include "qgsrendererv2.h"
4242
#include "qgssymbolv2.h"
@@ -53,6 +53,7 @@
5353
#include <QMessageBox>
5454
#include <QPainter>
5555
#include <QSettings>
56+
#include <QFileDialog>
5657

5758

5859
QgsLegendLayer::QgsLegendLayer( QgsMapLayer* layer )
@@ -450,16 +451,6 @@ void QgsLegendLayer::table()
450451
// the dialog will be deleted by itself on close
451452
}
452453

453-
void QgsLegendLayer::saveAsShapefile()
454-
{
455-
saveAsShapefileGeneral( FALSE );
456-
}
457-
458-
void QgsLegendLayer::saveSelectionAsShapefile()
459-
{
460-
saveAsShapefileGeneral( TRUE );
461-
}
462-
463454
void QgsLegendLayer::saveAsVectorFile()
464455
{
465456
saveAsVectorFileGeneral( false );
@@ -504,177 +495,73 @@ void QgsLegendLayer::showInOverview()
504495

505496
void QgsLegendLayer::saveAsVectorFileGeneral( bool saveOnlySelection )
506497
{
498+
QgsCoordinateReferenceSystem destCRS;
499+
507500
if ( mLyr.layer()->type() != QgsMapLayer::VectorLayer )
508501
return;
509502

510503
QgsVectorLayer* vlayer = qobject_cast<QgsVectorLayer *>( mLyr.layer() );
511504

512-
//get output name and format
513-
QSettings settings;
514-
QString filter = QString( "Shapefiles (*.shp)" );
515-
QString dirName = settings.value( "/UI/lastVectorfileDir", "." ).toString();
516-
QString filterString = QgsVectorFileWriter::fileFilterString();
517-
QString selectedFilter = settings.value( "/UI/lastVectorFilter", "[OGR] ESRI Shapefiles (*.shp *.SHP)" ).toString();
518-
QString outputFile = QFileDialog::getSaveFileName( 0, tr( "Save layer as..." ), dirName, filterString, &selectedFilter );
519-
if ( outputFile.isNull() )
520-
{
521-
return; //cancelled
522-
}
523-
524-
settings.setValue( "/UI/lastVectorfileDir", QFileInfo( outputFile ).absolutePath() );
525-
settings.setValue( "/UI/lastVectorFilter", selectedFilter );
505+
QgsVectorLayerSaveAsDialog *dialog = new QgsVectorLayerSaveAsDialog( QgisApp::instance() );
526506

527-
QMap< QString, QString> filterDriverMap = QgsVectorFileWriter::supportedFiltersAndFormats();
528-
QMap< QString, QString>::const_iterator it = filterDriverMap.find( selectedFilter + ";;" );
529-
if ( it == filterDriverMap.constEnd() )
530-
{
531-
return; //unknown format
532-
}
533-
534-
QString driverKey = *it;
535-
536-
//output CRS
537-
QgsCoordinateReferenceSystem destCRS = vlayer->srs();
538-
// Find out if we have projections enabled or not
539-
if ( QgisApp::instance()->mapCanvas()->mapRenderer()->hasCrsTransformEnabled() )
540-
{
541-
destCRS = QgisApp::instance()->mapCanvas()->mapRenderer()->destinationSrs();
542-
}
543-
544-
QgsGenericProjectionSelector * mySelector = new QgsGenericProjectionSelector();
545-
mySelector->setSelectedCrsId( destCRS.srsid() );
546-
mySelector->setMessage( tr( "Select the coordinate reference system for the saved shapefile. "
547-
"The data points will be transformed from the layer coordinate reference system." ) );
548-
549-
if ( mySelector->exec() )
550-
{
551-
QgsCoordinateReferenceSystem srs( mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::InternalCrsId );
552-
destCRS = srs;
553-
// destCRS->createFromId(mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::InternalCrsId)
554-
}
555-
else
507+
if( dialog->exec() == QDialog::Accepted )
556508
{
557-
// Aborted CS selection, don't save.
558-
delete mySelector;
559-
return;
560-
}
561-
delete mySelector;
509+
QString encoding = dialog->encoding();
510+
QString vectorFilename = dialog->filename();
511+
QString format = dialog->format();
512+
513+
if( dialog->crs() < 0 )
514+
{
515+
// Find out if we have projections enabled or not
516+
if ( QgisApp::instance()->mapCanvas()->mapRenderer()->hasCrsTransformEnabled() )
517+
{
518+
destCRS = QgisApp::instance()->mapCanvas()->mapRenderer()->destinationSrs();
519+
}
520+
else
521+
{
522+
destCRS = vlayer->srs();
523+
}
524+
}
525+
else
526+
{
527+
destCRS = QgsCoordinateReferenceSystem( dialog->crs(), QgsCoordinateReferenceSystem::InternalCrsId );
528+
}
562529

563-
// overwrite the file - user will already have been prompted
564-
// to verify they want to overwrite by the file dialog above
565-
// might not even exists in the given case.
566-
if ( driverKey == "ESRI Shapefile" )
567-
{
530+
// overwrite the file - user will already have been prompted
531+
// to verify they want to overwrite by the file dialog above
532+
// might not even exists in the given case.
568533
// add the extension if not present
569-
if ( !outputFile.endsWith( ".shp", Qt::CaseInsensitive ) )
534+
if( format == "ESRI Shapefile" )
570535
{
571-
outputFile += ".shp";
536+
if ( !vectorFilename.endsWith( ".shp", Qt::CaseInsensitive ) )
537+
{
538+
vectorFilename += ".shp";
539+
}
540+
QgsVectorFileWriter::deleteShapeFile( vectorFilename );
541+
}
542+
543+
// ok if the file existed it should be deleted now so we can continue...
544+
QApplication::setOverrideCursor( Qt::WaitCursor );
545+
546+
QgsVectorFileWriter::WriterError error;
547+
QString errorMessage;
548+
error = QgsVectorFileWriter::writeAsVectorFormat( vlayer, vectorFilename, encoding, &destCRS, format, saveOnlySelection, &errorMessage );
549+
550+
QApplication::restoreOverrideCursor();
551+
552+
if ( error == QgsVectorFileWriter::NoError )
553+
{
554+
QMessageBox::information( 0, tr( "Saving done" ), tr( "Export to vector file has been completed" ) );
555+
}
556+
else
557+
{
558+
QMessageBox::warning( 0, tr( "Save error" ), tr( "Export to vector file failed.\nError: %1").arg( errorMessage ) );
572559
}
573-
QgsVectorFileWriter::deleteShapeFile( outputFile );
574-
}
575-
576-
QString errorMessage;
577-
QgsVectorFileWriter::WriterError error;
578-
error = QgsVectorFileWriter::writeAsVectorFormat( vlayer, outputFile, "utf-8", &destCRS, driverKey, saveOnlySelection, &errorMessage );
579-
}
580-
581-
582-
void QgsLegendLayer::saveAsShapefileGeneral( bool saveOnlySelection )
583-
{
584-
QgsCoordinateReferenceSystem destCRS;
585-
586-
if ( mLyr.layer()->type() != QgsMapLayer::VectorLayer )
587-
return;
588-
589-
QgsVectorLayer* vlayer = qobject_cast<QgsVectorLayer *>( mLyr.layer() );
590-
591-
// get a name for the shapefile
592-
// Get a file to process, starting at the current directory
593-
QSettings settings;
594-
QString filter = QString( "Shapefiles (*.shp)" );
595-
QString dirName = settings.value( "/UI/lastShapefileDir", "." ).toString();
596-
597-
QgsEncodingFileDialog* openFileDialog = new QgsEncodingFileDialog( 0,
598-
tr( "Save layer as..." ),
599-
dirName,
600-
filter,
601-
QString( "" ) );
602-
openFileDialog->setAcceptMode( QFileDialog::AcceptSave );
603-
604-
// allow for selection of more than one file
605-
//openFileDialog->setMode(QFileDialog::AnyFile);
606-
607-
if ( openFileDialog->exec() != QDialog::Accepted )
608-
return;
609-
610-
611-
QString encoding = openFileDialog->encoding();
612-
QString shapefileName = openFileDialog->selectedFiles().first();
613-
settings.setValue( "/UI/lastShapefileDir", QFileInfo( shapefileName ).absolutePath() );
614-
615-
616-
if ( shapefileName.isNull() )
617-
return;
618-
619-
// add the extension if not present
620-
if ( !shapefileName.endsWith( ".shp", Qt::CaseInsensitive ) )
621-
{
622-
shapefileName += ".shp";
623-
}
624-
625-
destCRS = vlayer->srs();
626-
// Find out if we have projections enabled or not
627-
if ( QgisApp::instance()->mapCanvas()->mapRenderer()->hasCrsTransformEnabled() )
628-
{
629-
destCRS = QgisApp::instance()->mapCanvas()->mapRenderer()->destinationSrs();
630-
}
631-
632-
QgsGenericProjectionSelector * mySelector = new QgsGenericProjectionSelector();
633-
mySelector->setSelectedCrsId( destCRS.srsid() );
634-
mySelector->setMessage( tr( "Select the coordinate reference system for the saved shapefile. "
635-
"The data points will be transformed from the layer coordinate reference system." ) );
636-
637-
if ( mySelector->exec() )
638-
{
639-
QgsCoordinateReferenceSystem srs( mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::InternalCrsId );
640-
destCRS = srs;
641-
// destCRS->createFromId(mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::InternalCrsId)
642-
}
643-
else
644-
{
645-
// Aborted CS selection, don't save.
646-
delete mySelector;
647-
return;
648560
}
649561

650-
delete mySelector;
651-
652-
// overwrite the file - user will already have been prompted
653-
// to verify they want to overwrite by the file dialog above
654-
// might not even exists in the given case.
655-
QgsVectorFileWriter::deleteShapeFile( shapefileName );
656-
657-
// ok if the file existed it should be deleted now so we can continue...
658-
QApplication::setOverrideCursor( Qt::WaitCursor );
659-
660-
QgsVectorFileWriter::WriterError error;
661-
QString errorMessage;
662-
error = QgsVectorFileWriter::writeAsShapefile( vlayer, shapefileName, encoding, &destCRS, saveOnlySelection, &errorMessage );
663-
664-
QApplication::restoreOverrideCursor();
665-
666-
if ( error == QgsVectorFileWriter::NoError )
667-
{
668-
QMessageBox::information( 0, tr( "Saving done" ), tr( "Export to Shapefile has been completed" ) );
669-
}
670-
else
671-
{
672-
QMessageBox::warning( 0, tr( "Save error" ), errorMessage );
673-
}
562+
delete dialog;
674563
}
675564

676-
677-
678565
QString QgsLegendLayer::nameFromLayer( QgsMapLayer* layer )
679566
{
680567
QString sourcename = layer->publicSource(); //todo: move this duplicated code into a new function

‎src/app/legend/qgslegendlayer.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***************************************************************************
2-
* Copyright (C) 2005 by Tim Sutton *
3-
* aps02ts@macbuntu *
2+
* Copyright (C) 2005 by Tim Sutton *
3+
* aps02ts@macbuntu *
44
* *
55
* This program is free software; you can redistribute it and/or modify *
66
* it under the terms of the GNU General Public License as published by *
@@ -84,9 +84,6 @@ class QgsLegendLayer : public QgsLegendItem
8484
/**Show layer attribute table*/
8585
void table();
8686

87-
void saveAsShapefile();
88-
void saveSelectionAsShapefile();
89-
9087
void saveAsVectorFile();
9188
void saveSelectionAsVectorFile();
9289

@@ -111,9 +108,6 @@ class QgsLegendLayer : public QgsLegendItem
111108

112109
QPixmap getOriginalPixmap();
113110

114-
/**Save as shapefile (called from saveAsShapefile and saveSelectionAsShapefile)*/
115-
void saveAsShapefileGeneral( bool saveOnlySelection );
116-
117111
void saveAsVectorFileGeneral( bool saveOnlySelection );
118112

119113
private:

‎src/app/ogr/qgsopenvectorlayerdialog.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@
2222
#include <QMessageBox>
2323
#include <QInputDialog>
2424
#include <QTextCodec>
25+
2526
#include "qgslogger.h"
26-
#include "qgsencodingfiledialog.h"
2727
#include "qgsopenvectorlayerdialog.h"
28+
#include "qgsvectordataprovider.h"
29+
2830
#include <ogr_api.h>
2931
#include "qgsproviderregistry.h"
3032
#include "qgsnewogrconnection.h"
@@ -40,8 +42,10 @@ QgsOpenVectorLayerDialog::QgsOpenVectorLayerDialog( QWidget* parent, Qt::WFlags
4042
cmbConnections->blockSignals( true );
4143
radioSrcFile->setChecked( true );
4244
mDataSourceType = "file";
45+
4346
//set encoding
44-
// cmbEncodings->setItemText( cmbEncodings->currentIndex(), QString( QTextCodec::codecForLocale()->name() ) );
47+
cmbEncodings->addItems( QgsVectorDataProvider::availableEncodings() );
48+
4549
QSettings settings;
4650
QString enc = settings.value( "/UI/encoding", QString( "System" ) ).toString();
4751

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
/***************************************************************************
2+
qgsvectorlayersaveasdialog.h
3+
Dialog to select destination, type and crs for ogr layers
4+
-------------------
5+
begin : Mon Mar 22 2010
6+
copyright : (C) 2010 by Juergen E. Fischer
7+
email : jef at norbit dot de
8+
***************************************************************************/
9+
10+
/***************************************************************************
11+
* *
12+
* This program is free software; you can redistribute it and/or modify *
13+
* it under the terms of the GNU General Public License as published by *
14+
* the Free Software Foundation; either version 2 of the License, or *
15+
* (at your option) any later version. *
16+
* *
17+
***************************************************************************/
18+
/* $Id:$ */
19+
#include "qgsvectorlayersaveasdialog.h"
20+
#include "qgsgenericprojectionselector.h"
21+
#include "qgsvectordataprovider.h"
22+
#include "qgsvectorfilewriter.h"
23+
24+
#include <QSettings>
25+
#include <QFileDialog>
26+
#include <QTextCodec>
27+
28+
QgsVectorLayerSaveAsDialog::QgsVectorLayerSaveAsDialog( QWidget* parent, Qt::WFlags fl )
29+
: QDialog( parent, fl )
30+
, mCRS( -1 )
31+
{
32+
setupUi( this );
33+
34+
QSettings settings;
35+
QMap<QString, QString> map = QgsVectorFileWriter::ogrDriverList();
36+
for ( QMap< QString, QString>::const_iterator it = map.constBegin(); it != map.constEnd(); ++it )
37+
{
38+
mFormatComboBox->addItem( it.key(), it.value() );
39+
}
40+
41+
QString format = settings.value( "/UI/lastVectorFormat", "ESRI Shapefile" ).toString();
42+
mFormatComboBox->setCurrentIndex( mFormatComboBox->findData( format ) );
43+
44+
45+
mEncodingComboBox->addItems( QgsVectorDataProvider::availableEncodings() );
46+
47+
QString enc = settings.value( "/UI/encoding", QString( "System" ) ).toString();
48+
int idx = mEncodingComboBox->findText( enc );
49+
if ( idx < 0 )
50+
{
51+
mEncodingComboBox->insertItem( 0, enc );
52+
idx = 0;
53+
}
54+
55+
mEncodingComboBox->setCurrentIndex( idx );
56+
57+
leCRS->setText( tr("Original CRS") );
58+
}
59+
60+
QgsVectorLayerSaveAsDialog::~QgsVectorLayerSaveAsDialog()
61+
{
62+
}
63+
64+
void QgsVectorLayerSaveAsDialog::accept()
65+
{
66+
QSettings settings;
67+
settings.setValue( "/UI/lastVectorFileFilterDir", QFileInfo( filename() ).absolutePath() );
68+
settings.setValue( "/UI/lastVectorFormat", format() );
69+
settings.setValue( "/UI/encoding", encoding() );
70+
QDialog::accept();
71+
}
72+
73+
void QgsVectorLayerSaveAsDialog::on_mFormatComboBox_currentIndexChanged( int idx )
74+
{
75+
browseFilename->setEnabled( true );
76+
leFilename->setEnabled( true );
77+
}
78+
79+
void QgsVectorLayerSaveAsDialog::on_browseFilename_clicked()
80+
{
81+
QSettings settings;
82+
QString dirName = leFilename->text().isEmpty() ? settings.value( "/UI/lastVectorfileDir", "." ).toString() : leFilename->text();
83+
QString filterString = QgsVectorFileWriter::filterForDriver( format() );
84+
QString outputFile = QFileDialog::getSaveFileName( 0, tr( "Save layer as..." ), dirName, filterString );
85+
if ( !outputFile.isNull() )
86+
{
87+
leFilename->setText( outputFile );
88+
}
89+
}
90+
91+
void QgsVectorLayerSaveAsDialog::on_browseCRS_clicked()
92+
{
93+
QgsGenericProjectionSelector * mySelector = new QgsGenericProjectionSelector();
94+
if( mCRS >= 0 )
95+
mySelector->setSelectedCrsId( mCRS );
96+
mySelector->setMessage( tr( "Select the coordinate reference system for the vector file. "
97+
"The data points will be transformed from the layer coordinate reference system." ) );
98+
99+
if ( mySelector->exec() )
100+
{
101+
QgsCoordinateReferenceSystem srs( mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::InternalCrsId );
102+
mCRS = srs.srsid();
103+
leCRS->setText( srs.description() );
104+
}
105+
106+
delete mySelector;
107+
}
108+
109+
QString QgsVectorLayerSaveAsDialog::filename() const
110+
{
111+
return leFilename->text();
112+
}
113+
114+
QString QgsVectorLayerSaveAsDialog::encoding() const
115+
{
116+
return mEncodingComboBox->currentText();
117+
}
118+
119+
QString QgsVectorLayerSaveAsDialog::format() const
120+
{
121+
return mFormatComboBox->itemData( mFormatComboBox->currentIndex() ).toString();
122+
}
123+
124+
long QgsVectorLayerSaveAsDialog::crs() const
125+
{
126+
return mCRS;
127+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/***************************************************************************
2+
qgsvectorlayersaveasdialog.h
3+
Dialog to select destination, type and crs to save as ogr layers
4+
-------------------
5+
begin : Mon Mar 22 2010
6+
copyright : (C) 2010 by Juergen E. Fischer
7+
email : jef at norbit dot de
8+
***************************************************************************/
9+
10+
/***************************************************************************
11+
* *
12+
* This program is free software; you can redistribute it and/or modify *
13+
* it under the terms of the GNU General Public License as published by *
14+
* the Free Software Foundation; either version 2 of the License, or *
15+
* (at your option) any later version. *
16+
* *
17+
***************************************************************************/
18+
/* $Id:$ */
19+
#ifndef QGSVECTORLAYERSAVEASDIALOG_H
20+
#define QGSVECTORLAYERSAVEASDIALOG_H
21+
22+
#include <ui_qgsvectorlayersaveasdialogbase.h>
23+
#include <QDialog>
24+
#include "qgscontexthelp.h"
25+
26+
/**
27+
* Class to select destination file, type and CRS for ogr layrs
28+
*/
29+
class QgsVectorLayerSaveAsDialog : public QDialog, private Ui::QgsVectorLayerSaveAsDialogBase
30+
{
31+
Q_OBJECT
32+
33+
public:
34+
QgsVectorLayerSaveAsDialog( QWidget* parent = 0, Qt::WFlags fl = 0 );
35+
~QgsVectorLayerSaveAsDialog();
36+
37+
QString format() const;
38+
QString encoding() const;
39+
QString filename() const;
40+
long crs() const;
41+
42+
private slots:
43+
void on_mFormatComboBox_currentIndexChanged( int idx );
44+
void on_browseFilename_clicked();
45+
void on_browseCRS_clicked();
46+
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
47+
void accept();
48+
49+
private:
50+
long mCRS;
51+
};
52+
53+
#endif // QGSVECTORLAYERSAVEASDIALOG_H

‎src/app/qgisapp.cpp

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -965,16 +965,16 @@ void QgisApp::createActions()
965965
connect( mActionToggleEditing, SIGNAL( triggered() ), this, SLOT( toggleEditing() ) );
966966
mActionToggleEditing->setEnabled( false );
967967

968-
mActionLayerSaveAs = new QAction( tr( "Save as Shapefile..." ), this );
968+
mActionLayerSaveAs = new QAction( tr( "Save as..." ), this );
969969
shortcuts->registerAction( mActionLayerSaveAs );
970-
mActionLayerSaveAs->setStatusTip( tr( "Save the current layer as a shapefile" ) );
971-
connect( mActionLayerSaveAs, SIGNAL( triggered() ), this, SLOT( saveAsShapefile() ) );
970+
mActionLayerSaveAs->setStatusTip( tr( "Save the current layer as a vector file" ) );
971+
connect( mActionLayerSaveAs, SIGNAL( triggered() ), this, SLOT( saveAsVectorFile() ) );
972972
mActionLayerSaveAs->setEnabled( false );
973973

974-
mActionLayerSelectionSaveAs = new QAction( tr( "Save Selection as Shapefile..." ), this );
974+
mActionLayerSelectionSaveAs = new QAction( tr( "Save Selection as vector file..." ), this );
975975
shortcuts->registerAction( mActionLayerSelectionSaveAs );
976-
mActionLayerSelectionSaveAs->setStatusTip( tr( "Save the selection as a shapefile" ) );
977-
connect( mActionLayerSelectionSaveAs, SIGNAL( triggered() ), this, SLOT( saveSelectionAsShapefile() ) );
976+
mActionLayerSelectionSaveAs->setStatusTip( tr( "Save the selection as a vector file" ) );
977+
connect( mActionLayerSelectionSaveAs, SIGNAL( triggered() ), this, SLOT( saveSelectionAsVectorFile() ) );
978978
mActionLayerSelectionSaveAs->setEnabled( false );
979979

980980
mActionRemoveLayer = new QAction( getThemeIcon( "mActionRemoveLayer.png" ), tr( "Remove Layer" ), this );
@@ -3657,14 +3657,14 @@ void QgisApp::attributeTable()
36573657
// the dialog will be deleted by itself on close
36583658
}
36593659

3660-
void QgisApp::saveAsShapefile()
3660+
void QgisApp::saveAsVectorFile()
36613661
{
3662-
mMapLegend->currentLegendLayer()->saveAsShapefile();
3662+
mMapLegend->currentLegendLayer()->saveAsVectorFile();
36633663
}
36643664

3665-
void QgisApp::saveSelectionAsShapefile()
3665+
void QgisApp::saveSelectionAsVectorFile()
36663666
{
3667-
mMapLegend->currentLegendLayer()->saveSelectionAsShapefile();
3667+
mMapLegend->currentLegendLayer()->saveSelectionAsVectorFile();
36683668
}
36693669

36703670
void QgisApp::layerProperties()
@@ -5669,9 +5669,9 @@ void QgisApp::addRasterLayer()
56695669
// This is the method that does the actual work of adding a raster layer - the others
56705670
// here simply create a raster layer object and delegate here. It is the responsibility
56715671
// of the calling method to manage things such as the frozen state of the mapcanvas and
5672-
// using waitcursors etc. - this method wont and SHOULDNT do it
5672+
// using waitcursors etc. - this method won't and SHOULDN'T do it
56735673
//
5674-
bool QgisApp::addRasterLayer( QgsRasterLayer * theRasterLayer )
5674+
bool QgisApp::addRasterLayer( QgsRasterLayer *theRasterLayer )
56755675
{
56765676
if ( mMapCanvas && mMapCanvas->isDrawing() )
56775677
{
@@ -5697,16 +5697,12 @@ bool QgisApp::addRasterLayer( QgsRasterLayer * theRasterLayer )
56975697
QgsMapLayerRegistry::instance()->addMapLayer( theRasterLayer );
56985698

56995699
// connect up any request the raster may make to update the app progress
5700-
QObject::connect( theRasterLayer,
5701-
SIGNAL( drawingProgress( int, int ) ),
5702-
this,
5703-
SLOT( showProgress( int, int ) ) );
5700+
QObject::connect( theRasterLayer, SIGNAL( drawingProgress( int, int ) ),
5701+
this, SLOT( showProgress( int, int ) ) );
57045702

57055703
// connect up any request the raster may make to update the statusbar message
5706-
QObject::connect( theRasterLayer,
5707-
SIGNAL( statusChanged( QString ) ),
5708-
this,
5709-
SLOT( showStatusMessage( QString ) ) );
5704+
QObject::connect( theRasterLayer, SIGNAL( statusChanged( QString ) ),
5705+
this, SLOT( showStatusMessage( QString ) ) );
57105706

57115707
return true;
57125708
}

‎src/app/qgisapp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,8 @@ class QgisApp : public QMainWindow
625625
void toggleEditing( QgsMapLayer *layer );
626626

627627
//! save current vector layer
628-
void saveAsShapefile();
629-
void saveSelectionAsShapefile();
628+
void saveAsVectorFile();
629+
void saveSelectionAsVectorFile();
630630

631631
//! open the properties dialog for the currently selected layer
632632
void layerProperties();

‎src/core/qgsproviderregistry.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ class CORE_EXPORT QgsProviderRegistry
9999
*/
100100
virtual QString protocolDrivers() const;
101101

102-
103102
/** open the given vector data source
104103
105104
Similar to open(QString const &), except that the user specifies a data provider
@@ -127,7 +126,6 @@ class CORE_EXPORT QgsProviderRegistry
127126
/** type for data provider metadata associative container */
128127
typedef std::map<QString, QgsProviderMetadata*> Providers;
129128

130-
131129
private:
132130

133131
/** ctor private since instance() creates it */

‎src/core/qgsvectordataprovider.cpp

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,3 +417,59 @@ QVariant QgsVectorDataProvider::convertValue( QVariant::Type type, QString value
417417

418418
return v;
419419
}
420+
421+
const QStringList &QgsVectorDataProvider::availableEncodings()
422+
{
423+
if( smEncodings.isEmpty() )
424+
{
425+
smEncodings << "BIG5";
426+
smEncodings << "BIG5-HKSCS";
427+
smEncodings << "EUCJP";
428+
smEncodings << "EUCKR";
429+
smEncodings << "GB2312";
430+
smEncodings << "GBK";
431+
smEncodings << "GB18030";
432+
smEncodings << "JIS7";
433+
smEncodings << "SHIFT-JIS";
434+
smEncodings << "TSCII";
435+
smEncodings << "UTF-8";
436+
smEncodings << "UTF-16";
437+
smEncodings << "KOI8-R";
438+
smEncodings << "KOI8-U";
439+
smEncodings << "ISO8859-1";
440+
smEncodings << "ISO8859-2";
441+
smEncodings << "ISO8859-3";
442+
smEncodings << "ISO8859-4";
443+
smEncodings << "ISO8859-5";
444+
smEncodings << "ISO8859-6";
445+
smEncodings << "ISO8859-7";
446+
smEncodings << "ISO8859-8";
447+
smEncodings << "ISO8859-8-I";
448+
smEncodings << "ISO8859-9";
449+
smEncodings << "ISO8859-10";
450+
smEncodings << "ISO8859-11";
451+
smEncodings << "ISO8859-12";
452+
smEncodings << "ISO8859-13";
453+
smEncodings << "ISO8859-14";
454+
smEncodings << "ISO8859-15";
455+
smEncodings << "IBM 850";
456+
smEncodings << "IBM 866";
457+
smEncodings << "CP874";
458+
smEncodings << "CP1250";
459+
smEncodings << "CP1251";
460+
smEncodings << "CP1252";
461+
smEncodings << "CP1253";
462+
smEncodings << "CP1254";
463+
smEncodings << "CP1255";
464+
smEncodings << "CP1256";
465+
smEncodings << "CP1257";
466+
smEncodings << "CP1258";
467+
smEncodings << "Apple Roman";
468+
smEncodings << "TIS-620";
469+
smEncodings << "System";
470+
}
471+
472+
return smEncodings;
473+
}
474+
475+
QStringList QgsVectorDataProvider::smEncodings;

‎src/core/qgsvectordataprovider.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider
348348
@note: added in version 1.4*/
349349
virtual bool doesStrictFeatureTypeCheck() const { return true;}
350350

351+
352+
static const QStringList &availableEncodings();
353+
351354
protected:
352355
QVariant convertValue( QVariant::Type type, QString value );
353356

@@ -374,6 +377,8 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider
374377
private:
375378
/** old notation **/
376379
QMap<QString, QVariant::Type> mOldTypeList;
380+
381+
static QStringList smEncodings;
377382
};
378383

379384
#endif

‎src/core/qgsvectorfilewriter.cpp

Lines changed: 60 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -387,92 +387,6 @@ QgsVectorFileWriter::writeAsShapefile( QgsVectorLayer* layer,
387387
QString *errorMessage )
388388
{
389389
return writeAsVectorFormat( layer, shapefileName, fileEncoding, destCRS, "ESRI Shapefile", onlySelected, errorMessage );
390-
#if 0
391-
const QgsCoordinateReferenceSystem* outputCRS;
392-
QgsCoordinateTransform* ct = 0;
393-
int shallTransform = false;
394-
395-
if ( destCRS && destCRS->isValid() )
396-
{
397-
// This means we should transform
398-
outputCRS = destCRS;
399-
shallTransform = true;
400-
}
401-
else
402-
{
403-
// This means we shouldn't transform, use source CRS as output (if defined)
404-
outputCRS = &layer->srs();
405-
}
406-
QgsVectorFileWriter* writer =
407-
new QgsVectorFileWriter( shapefileName, fileEncoding, layer->pendingFields(), layer->wkbType(), outputCRS );
408-
409-
// check whether file creation was successful
410-
WriterError err = writer->hasError();
411-
if ( err != NoError )
412-
{
413-
if ( errorMessage )
414-
*errorMessage = writer->errorMessage();
415-
delete writer;
416-
return err;
417-
}
418-
419-
QgsAttributeList allAttr = layer->pendingAllAttributesList();
420-
QgsFeature fet;
421-
422-
layer->select( allAttr, QgsRectangle(), true );
423-
424-
const QgsFeatureIds& ids = layer->selectedFeaturesIds();
425-
426-
// Create our transform
427-
if ( destCRS )
428-
{
429-
ct = new QgsCoordinateTransform( layer->srs(), *destCRS );
430-
}
431-
432-
// Check for failure
433-
if ( ct == NULL )
434-
{
435-
shallTransform = false;
436-
}
437-
438-
// write all features
439-
while ( layer->nextFeature( fet ) )
440-
{
441-
if ( onlySelected && !ids.contains( fet.id() ) )
442-
continue;
443-
444-
if ( shallTransform )
445-
{
446-
try
447-
{
448-
fet.geometry()->transform( *ct );
449-
}
450-
catch ( QgsCsException &e )
451-
{
452-
delete ct;
453-
delete writer;
454-
455-
QString msg = QObject::tr( "Failed to transform a point while drawing a feature of type '%1'. Writing stopped. (Exception: %2)" )
456-
.arg( fet.typeName() ).arg( e.what() );
457-
QgsLogger::warning( msg );
458-
if ( errorMessage )
459-
*errorMessage = msg;
460-
461-
return ErrProjection;
462-
}
463-
}
464-
writer->addFeature( fet );
465-
}
466-
467-
delete writer;
468-
469-
if ( shallTransform )
470-
{
471-
delete ct;
472-
}
473-
474-
return NoError;
475-
#endif //0
476390
}
477391

478392
QgsVectorFileWriter::WriterError
@@ -603,22 +517,46 @@ QMap< QString, QString> QgsVectorFileWriter::supportedFiltersAndFormats()
603517
QgsApplication::registerOgrDrivers();
604518
int const drvCount = OGRGetDriverCount();
605519

606-
QString drvName;
607-
QString filterString;
608520
for ( int i = 0; i < drvCount; ++i )
609521
{
610522
OGRSFDriverH drv = OGRGetDriver( i );
611523
if ( drv )
612524
{
613-
drvName = OGR_Dr_GetName( drv );
614-
if ( OGR_Dr_TestCapability( drv, ODrCCreateDataSource ) != 0 )
525+
QString drvName = OGR_Dr_GetName( drv );
526+
if ( OGR_Dr_TestCapability( drv, "CreateDataSource" ) != 0 )
615527
{
616-
//add driver name and filter to map
617-
filterString = QgsVectorFileWriter::filterForDriver( drvName );
618-
if ( !filterString.isEmpty() )
619-
{
620-
resultMap.insert( filterString, drvName );
621-
}
528+
QString filterString = filterForDriver( drvName );
529+
if( filterString.isEmpty() )
530+
continue;
531+
532+
resultMap.insert( filterString, drvName );
533+
}
534+
}
535+
}
536+
537+
return resultMap;
538+
}
539+
540+
QMap<QString, QString> QgsVectorFileWriter::ogrDriverList()
541+
{
542+
QMap<QString, QString> resultMap;
543+
544+
QgsApplication::registerOgrDrivers();
545+
int const drvCount = OGRGetDriverCount();
546+
547+
for ( int i = 0; i < drvCount; ++i )
548+
{
549+
OGRSFDriverH drv = OGRGetDriver( i );
550+
if ( drv )
551+
{
552+
QString drvName = OGR_Dr_GetName( drv );
553+
if ( OGR_Dr_TestCapability( drv, "CreateDataSource" ) != 0 )
554+
{
555+
QPair<QString, QString> p = nameAndGlob( drvName );
556+
if( p.first.isEmpty() )
557+
continue;
558+
559+
resultMap.insert( p.first, drvName );
622560
}
623561
}
624562
}
@@ -629,16 +567,29 @@ QMap< QString, QString> QgsVectorFileWriter::supportedFiltersAndFormats()
629567
QString QgsVectorFileWriter::fileFilterString()
630568
{
631569
QString filterString;
632-
QMap< QString, QString> driverFormatMap = QgsVectorFileWriter::supportedFiltersAndFormats();
570+
QMap< QString, QString> driverFormatMap = supportedFiltersAndFormats();
633571
QMap< QString, QString>::const_iterator it = driverFormatMap.constBegin();
634572
for ( ; it != driverFormatMap.constEnd(); ++it )
635573
{
574+
if( filterString.isEmpty() )
575+
filterString += ";;";
576+
636577
filterString += it.key();
637578
}
638579
return filterString;
639580
}
640581

641582
QString QgsVectorFileWriter::filterForDriver( const QString& driverName )
583+
{
584+
QPair<QString, QString> p = nameAndGlob( driverName );
585+
586+
if( p.first.isEmpty() || p.second.isEmpty() )
587+
return "";
588+
589+
return "[OGR] " + p.first + " (" + p.second.toLower() + " " + p.second.toUpper() + ")";
590+
}
591+
592+
QPair<QString, QString> QgsVectorFileWriter::nameAndGlob( QString driverName )
642593
{
643594
QString longName;
644595
QString glob;
@@ -660,7 +611,7 @@ QString QgsVectorFileWriter::filterForDriver( const QString& driverName )
660611
}
661612
else if ( driverName.startsWith( "ESRI" ) )
662613
{
663-
longName = "ESRI Shapefiles";
614+
longName = "ESRI Shapefile";
664615
glob = "*.shp";
665616
}
666617
else if ( driverName.startsWith( "FMEObjects Gateway" ) )
@@ -685,12 +636,12 @@ QString QgsVectorFileWriter::filterForDriver( const QString& driverName )
685636
}
686637
else if ( driverName.startsWith( "GMT" ) )
687638
{
688-
longName = "GMT";
639+
longName = "Generic Mapping Tools";
689640
glob = "*.gmt";
690641
}
691642
else if ( driverName.startsWith( "GPX" ) )
692643
{
693-
longName = "GPX";
644+
longName = "GPS eXchange Format";
694645
glob = "*.gpx";
695646
}
696647
else if ( driverName.startsWith( "Interlis 1" ) )
@@ -705,7 +656,7 @@ QString QgsVectorFileWriter::filterForDriver( const QString& driverName )
705656
}
706657
else if ( driverName.startsWith( "KML" ) )
707658
{
708-
longName = "KML";
659+
longName = "Keyhole Markup Language";
709660
glob = "*.kml" ;
710661
}
711662
else if ( driverName.startsWith( "MapInfo File" ) )
@@ -733,19 +684,16 @@ QString QgsVectorFileWriter::filterForDriver( const QString& driverName )
733684
longName = "SQLite";
734685
glob = "*.sqlite";
735686
}
736-
else if ( driverName.startsWith( "VRT" ) )
687+
else if ( driverName.startsWith( "DXF" ) )
737688
{
738-
longName = "VRT - Virtual Datasource ";
739-
glob = "*.vrt";
689+
longName = "AutoCAD DXF";
690+
glob = "*.dxf";
740691
}
741-
else if ( driverName.startsWith( "XPlane" ) )
692+
else if ( driverName.startsWith( "Geoconcept" ) )
742693
{
743-
longName = "X-Plane/Flighgear";
744-
glob = "apt.dat nav.dat fix.dat awy.dat";
694+
longName = "Geoconcept";
695+
glob = "*.gxt *.txt";
745696
}
746-
else
747-
{
748-
return QString();
749-
}
750-
return "[OGR] " + longName + " (" + glob.toLower() + " " + glob.toUpper() + ");;";
697+
698+
return QPair<QString, QString>( longName, glob );
751699
}

‎src/core/qgsvectorfilewriter.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include "qgsvectorlayer.h"
2424
#include "qgsfield.h"
2525

26+
#include <QPair>
27+
2628
typedef void *OGRDataSourceH;
2729
typedef void *OGRLayerH;
2830
typedef void *OGRGeometryH;
@@ -83,6 +85,9 @@ class CORE_EXPORT QgsVectorFileWriter
8385
/**Returns map with format filter string as key and OGR format key as value*/
8486
static QMap< QString, QString> supportedFiltersAndFormats();
8587

88+
/**Returns driver list that can be used for dialogs*/
89+
static QMap< QString, QString> ogrDriverList();
90+
8691
/**Returns filter string that can be used for dialogs*/
8792
static QString fileFilterString();
8893

@@ -108,6 +113,7 @@ class CORE_EXPORT QgsVectorFileWriter
108113
* @return bool true if the file was deleted successfully
109114
*/
110115
static bool deleteShapeFile( QString theFileName );
116+
111117
protected:
112118

113119
OGRGeometryH createEmptyGeometry( QGis::WkbType wkbType );
@@ -129,6 +135,9 @@ class CORE_EXPORT QgsVectorFileWriter
129135

130136
/** map attribute indizes to OGR field indexes */
131137
QMap<int, int> mAttrIdxToOgrIdx;
138+
139+
private:
140+
static QPair<QString, QString> nameAndGlob( QString driverName );
132141
};
133142

134143
#endif

‎src/gui/qgsencodingfiledialog.cpp

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
#include "qgsencodingfiledialog.h"
1717
#include "qgsproject.h"
1818
#include "qgslogger.h"
19+
#include "qgsvectordataprovider.h"
20+
1921
#include <QSettings>
2022
#include <QComboBox>
2123
#include <QPushButton>
2224
#include <QLabel>
2325
#include <QLayout>
2426
#include <QTextCodec>
2527

26-
2728
QgsEncodingFileDialog::QgsEncodingFileDialog( QWidget * parent,
2829
const QString & caption, const QString & directory,
2930
const QString & filter, const QString & encoding )
@@ -35,48 +36,8 @@ QgsEncodingFileDialog::QgsEncodingFileDialog( QWidget * parent,
3536
QLabel* l = new QLabel( tr( "Encoding:" ), this );
3637
layout()->addWidget( l );
3738
layout()->addWidget( mEncodingComboBox );
38-
mEncodingComboBox->addItem( "BIG5" );
39-
mEncodingComboBox->addItem( "BIG5-HKSCS" );
40-
mEncodingComboBox->addItem( "EUCJP" );
41-
mEncodingComboBox->addItem( "EUCKR" );
42-
mEncodingComboBox->addItem( "GB2312" );
43-
mEncodingComboBox->addItem( "GBK" );
44-
mEncodingComboBox->addItem( "GB18030" );
45-
mEncodingComboBox->addItem( "JIS7" );
46-
mEncodingComboBox->addItem( "SHIFT-JIS" );
47-
mEncodingComboBox->addItem( "TSCII" );
48-
mEncodingComboBox->addItem( "UTF-8" );
49-
mEncodingComboBox->addItem( "UTF-16" );
50-
mEncodingComboBox->addItem( "KOI8-R" );
51-
mEncodingComboBox->addItem( "KOI8-U" );
52-
mEncodingComboBox->addItem( "ISO8859-1" );
53-
mEncodingComboBox->addItem( "ISO8859-2" );
54-
mEncodingComboBox->addItem( "ISO8859-3" );
55-
mEncodingComboBox->addItem( "ISO8859-4" );
56-
mEncodingComboBox->addItem( "ISO8859-5" );
57-
mEncodingComboBox->addItem( "ISO8859-6" );
58-
mEncodingComboBox->addItem( "ISO8859-7" );
59-
mEncodingComboBox->addItem( "ISO8859-8" );
60-
mEncodingComboBox->addItem( "ISO8859-8-I" );
61-
mEncodingComboBox->addItem( "ISO8859-9" );
62-
mEncodingComboBox->addItem( "ISO8859-10" );
63-
mEncodingComboBox->addItem( "ISO8859-13" );
64-
mEncodingComboBox->addItem( "ISO8859-14" );
65-
mEncodingComboBox->addItem( "ISO8859-15" );
66-
mEncodingComboBox->addItem( "IBM 850" );
67-
mEncodingComboBox->addItem( "IBM 866" );
68-
mEncodingComboBox->addItem( "CP874" );
69-
mEncodingComboBox->addItem( "CP1250" );
70-
mEncodingComboBox->addItem( "CP1251" );
71-
mEncodingComboBox->addItem( "CP1252" );
72-
mEncodingComboBox->addItem( "CP1253" );
73-
mEncodingComboBox->addItem( "CP1254" );
74-
mEncodingComboBox->addItem( "CP1255" );
75-
mEncodingComboBox->addItem( "CP1256" );
76-
mEncodingComboBox->addItem( "CP1257" );
77-
mEncodingComboBox->addItem( "CP1258" );
78-
mEncodingComboBox->addItem( "Apple Roman" );
79-
mEncodingComboBox->addItem( "TIS-620" );
39+
40+
mEncodingComboBox->addItems( QgsVectorDataProvider::availableEncodings() );
8041

8142
// Use default encoding if none supplied
8243
QString enc = encoding;

‎src/plugins/ogr_converter/format.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,5 @@ void FormatsRegistry::init()
108108
add( Format( "UK.NTF", "UK National Transfer Format", Format::eFile ) );
109109
add( Format( "TIGER", "U.S. Census TIGER/Line", Format::eFile ) );
110110
add( Format( "VRT", "Virtual Datasource", Format::eFile ) );
111-
add( Format( "XPLANE", "X-Plane/Flighgear Aeronautical Data", Format::eFile ) );
111+
add( Format( "XPLANE", "X-Plane/Flightgear Aeronautical Data", Format::eFile ) );
112112
}

‎src/providers/ogr/qgsogrprovider.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,9 +1321,17 @@ QString createFilters( QString type )
13211321
}
13221322
else if ( driverName.startsWith( "XPlane" ) )
13231323
{
1324-
myFileFilters += createFileFilter_( "X-Plane/Flighgear",
1324+
myFileFilters += createFileFilter_( "X-Plane/Flightgear",
13251325
"apt.dat nav.dat fix.dat awy.dat" );
13261326
}
1327+
else if ( driverName.startsWith( "Geoconcept" ) )
1328+
{
1329+
myFileFilters += createFileFilter_( "Geoconcept", "*.gxt *.txt" );
1330+
}
1331+
else if ( driverName.startsWith( "DXF" ) )
1332+
{
1333+
myFileFilters += createFileFilter_( "AutoCAD DXF", "*.dxf" );
1334+
}
13271335
else
13281336
{
13291337
// NOP, we don't know anything about the current driver

‎src/ui/qgsopenvectorlayerdialogbase.ui

Lines changed: 0 additions & 220 deletions
Original file line numberDiff line numberDiff line change
@@ -89,226 +89,6 @@
8989
<height>0</height>
9090
</size>
9191
</property>
92-
<item>
93-
<property name="text">
94-
<string>BIG5</string>
95-
</property>
96-
</item>
97-
<item>
98-
<property name="text">
99-
<string>BIG5-HKSCS</string>
100-
</property>
101-
</item>
102-
<item>
103-
<property name="text">
104-
<string>EUCJP</string>
105-
</property>
106-
</item>
107-
<item>
108-
<property name="text">
109-
<string>EUCKR</string>
110-
</property>
111-
</item>
112-
<item>
113-
<property name="text">
114-
<string>GB2312</string>
115-
</property>
116-
</item>
117-
<item>
118-
<property name="text">
119-
<string>GBK</string>
120-
</property>
121-
</item>
122-
<item>
123-
<property name="text">
124-
<string>GB18030</string>
125-
</property>
126-
</item>
127-
<item>
128-
<property name="text">
129-
<string>JIS7</string>
130-
</property>
131-
</item>
132-
<item>
133-
<property name="text">
134-
<string>SHIFT-JIS</string>
135-
</property>
136-
</item>
137-
<item>
138-
<property name="text">
139-
<string>TSCII</string>
140-
</property>
141-
</item>
142-
<item>
143-
<property name="text">
144-
<string>UTF-8</string>
145-
</property>
146-
</item>
147-
<item>
148-
<property name="text">
149-
<string>UTF-16</string>
150-
</property>
151-
</item>
152-
<item>
153-
<property name="text">
154-
<string>KOI8-R</string>
155-
</property>
156-
</item>
157-
<item>
158-
<property name="text">
159-
<string>KOI8-U</string>
160-
</property>
161-
</item>
162-
<item>
163-
<property name="text">
164-
<string>ISO8859-1</string>
165-
</property>
166-
</item>
167-
<item>
168-
<property name="text">
169-
<string>ISO8859-2</string>
170-
</property>
171-
</item>
172-
<item>
173-
<property name="text">
174-
<string>ISO8859-3</string>
175-
</property>
176-
</item>
177-
<item>
178-
<property name="text">
179-
<string>ISO8859-4</string>
180-
</property>
181-
</item>
182-
<item>
183-
<property name="text">
184-
<string>ISO8859-5</string>
185-
</property>
186-
</item>
187-
<item>
188-
<property name="text">
189-
<string>ISO8859-6</string>
190-
</property>
191-
</item>
192-
<item>
193-
<property name="text">
194-
<string>ISO8859-7</string>
195-
</property>
196-
</item>
197-
<item>
198-
<property name="text">
199-
<string>ISO8859-8</string>
200-
</property>
201-
</item>
202-
<item>
203-
<property name="text">
204-
<string>ISO8859-8-I</string>
205-
</property>
206-
</item>
207-
<item>
208-
<property name="text">
209-
<string>ISO8859-9</string>
210-
</property>
211-
</item>
212-
<item>
213-
<property name="text">
214-
<string>ISO8859-10</string>
215-
</property>
216-
</item>
217-
<item>
218-
<property name="text">
219-
<string>ISO8859-11</string>
220-
</property>
221-
</item>
222-
<item>
223-
<property name="text">
224-
<string>ISO8859-12</string>
225-
</property>
226-
</item>
227-
<item>
228-
<property name="text">
229-
<string>ISO8859-13</string>
230-
</property>
231-
</item>
232-
<item>
233-
<property name="text">
234-
<string>ISO8859-14</string>
235-
</property>
236-
</item>
237-
<item>
238-
<property name="text">
239-
<string>ISO8859-15</string>
240-
</property>
241-
</item>
242-
<item>
243-
<property name="text">
244-
<string>IBM 850</string>
245-
</property>
246-
</item>
247-
<item>
248-
<property name="text">
249-
<string>IBM 866</string>
250-
</property>
251-
</item>
252-
<item>
253-
<property name="text">
254-
<string>CP874</string>
255-
</property>
256-
</item>
257-
<item>
258-
<property name="text">
259-
<string>CP1250</string>
260-
</property>
261-
</item>
262-
<item>
263-
<property name="text">
264-
<string>CP1251</string>
265-
</property>
266-
</item>
267-
<item>
268-
<property name="text">
269-
<string>CP1252</string>
270-
</property>
271-
</item>
272-
<item>
273-
<property name="text">
274-
<string>CP1253</string>
275-
</property>
276-
</item>
277-
<item>
278-
<property name="text">
279-
<string>CP1254</string>
280-
</property>
281-
</item>
282-
<item>
283-
<property name="text">
284-
<string>CP1255</string>
285-
</property>
286-
</item>
287-
<item>
288-
<property name="text">
289-
<string>CP1256</string>
290-
</property>
291-
</item>
292-
<item>
293-
<property name="text">
294-
<string>CP1257</string>
295-
</property>
296-
</item>
297-
<item>
298-
<property name="text">
299-
<string>CP1258</string>
300-
</property>
301-
</item>
302-
<item>
303-
<property name="text">
304-
<string>Apple Roman</string>
305-
</property>
306-
</item>
307-
<item>
308-
<property name="text">
309-
<string>TIS-620</string>
310-
</property>
311-
</item>
31292
</widget>
31393
</item>
31494
</layout>
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>QgsVectorLayerSaveAsDialogBase</class>
4+
<widget class="QDialog" name="QgsVectorLayerSaveAsDialogBase">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>400</width>
10+
<height>203</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>Save vector layer as...</string>
15+
</property>
16+
<layout class="QGridLayout" name="gridLayout">
17+
<item row="1" column="1">
18+
<widget class="QLineEdit" name="leFilename">
19+
<property name="enabled">
20+
<bool>false</bool>
21+
</property>
22+
</widget>
23+
</item>
24+
<item row="5" column="0">
25+
<widget class="QLabel" name="label_3">
26+
<property name="text">
27+
<string>CRS</string>
28+
</property>
29+
</widget>
30+
</item>
31+
<item row="5" column="1">
32+
<widget class="QLineEdit" name="leCRS">
33+
<property name="readOnly">
34+
<bool>true</bool>
35+
</property>
36+
</widget>
37+
</item>
38+
<item row="6" column="0" colspan="3">
39+
<widget class="QDialogButtonBox" name="buttonBox">
40+
<property name="orientation">
41+
<enum>Qt::Horizontal</enum>
42+
</property>
43+
<property name="standardButtons">
44+
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
45+
</property>
46+
</widget>
47+
</item>
48+
<item row="1" column="0">
49+
<widget class="QLabel" name="label">
50+
<property name="text">
51+
<string>Save as</string>
52+
</property>
53+
</widget>
54+
</item>
55+
<item row="1" column="2">
56+
<widget class="QPushButton" name="browseFilename">
57+
<property name="enabled">
58+
<bool>false</bool>
59+
</property>
60+
<property name="text">
61+
<string>Browse</string>
62+
</property>
63+
</widget>
64+
</item>
65+
<item row="5" column="2">
66+
<widget class="QPushButton" name="browseCRS">
67+
<property name="text">
68+
<string>Browse</string>
69+
</property>
70+
</widget>
71+
</item>
72+
<item row="4" column="1" colspan="2">
73+
<widget class="QComboBox" name="mEncodingComboBox"/>
74+
</item>
75+
<item row="4" column="0">
76+
<widget class="QLabel" name="label_4">
77+
<property name="text">
78+
<string>Encoding</string>
79+
</property>
80+
</widget>
81+
</item>
82+
<item row="0" column="0">
83+
<widget class="QLabel" name="label_2">
84+
<property name="text">
85+
<string>Format</string>
86+
</property>
87+
</widget>
88+
</item>
89+
<item row="0" column="1" colspan="2">
90+
<widget class="QComboBox" name="mFormatComboBox"/>
91+
</item>
92+
</layout>
93+
</widget>
94+
<resources/>
95+
<connections>
96+
<connection>
97+
<sender>buttonBox</sender>
98+
<signal>accepted()</signal>
99+
<receiver>QgsVectorLayerSaveAsDialogBase</receiver>
100+
<slot>accept()</slot>
101+
<hints>
102+
<hint type="sourcelabel">
103+
<x>248</x>
104+
<y>254</y>
105+
</hint>
106+
<hint type="destinationlabel">
107+
<x>157</x>
108+
<y>274</y>
109+
</hint>
110+
</hints>
111+
</connection>
112+
<connection>
113+
<sender>buttonBox</sender>
114+
<signal>rejected()</signal>
115+
<receiver>QgsVectorLayerSaveAsDialogBase</receiver>
116+
<slot>reject()</slot>
117+
<hints>
118+
<hint type="sourcelabel">
119+
<x>316</x>
120+
<y>260</y>
121+
</hint>
122+
<hint type="destinationlabel">
123+
<x>286</x>
124+
<y>274</y>
125+
</hint>
126+
</hints>
127+
</connection>
128+
</connections>
129+
</ui>

0 commit comments

Comments
 (0)
Please sign in to comment.