mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
fix #5251
This commit is contained in:
parent
e2f7adf2fb
commit
ce6aab704f
@ -139,6 +139,10 @@ class Dialog( QDialog, Ui_Dialog ):
|
|||||||
baseDir = self.leInputDir.text()
|
baseDir = self.leInputDir.text()
|
||||||
# look for shapes with specified geometry type
|
# look for shapes with specified geometry type
|
||||||
self.inputFiles = ftools_utils.getShapesByGeometryType( baseDir, self.inputFiles, self.cmbGeometry.currentIndex() )
|
self.inputFiles = ftools_utils.getShapesByGeometryType( baseDir, self.inputFiles, self.cmbGeometry.currentIndex() )
|
||||||
|
if self.inputFiles is None:
|
||||||
|
QMessageBox.warning( self, self.tr( "No shapefiles found" ),
|
||||||
|
self.tr( "There are no shapefiles with the given geometry type. Please select an available geometry type." ) )
|
||||||
|
return
|
||||||
self.progressFiles.setRange( 0, self.inputFiles.count() )
|
self.progressFiles.setRange( 0, self.inputFiles.count() )
|
||||||
|
|
||||||
outFile = QFile( self.outFileName )
|
outFile = QFile( self.outFileName )
|
||||||
|
@ -344,12 +344,12 @@ static QgsMessageOutput *messageOutputViewer_()
|
|||||||
return new QgsMessageOutputConsole();
|
return new QgsMessageOutputConsole();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void customSrsValidation_( QgsCoordinateReferenceSystem* srs )
|
static void customSrsValidation_( QgsCoordinateReferenceSystem &srs )
|
||||||
{
|
{
|
||||||
QgisApp::instance()->emitCustomSrsValidation( srs );
|
QgisApp::instance()->emitCustomSrsValidation( srs );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgisApp::emitCustomSrsValidation( QgsCoordinateReferenceSystem* srs )
|
void QgisApp::emitCustomSrsValidation( QgsCoordinateReferenceSystem &srs )
|
||||||
{
|
{
|
||||||
emit customSrsValidation( srs );
|
emit customSrsValidation( srs );
|
||||||
}
|
}
|
||||||
@ -361,7 +361,7 @@ void QgisApp::emitCustomSrsValidation( QgsCoordinateReferenceSystem* srs )
|
|||||||
* - use project's CRS
|
* - use project's CRS
|
||||||
* - use predefined global CRS
|
* - use predefined global CRS
|
||||||
*/
|
*/
|
||||||
void QgisApp::validateSrs( QgsCoordinateReferenceSystem* srs )
|
void QgisApp::validateSrs( QgsCoordinateReferenceSystem &srs )
|
||||||
{
|
{
|
||||||
static QString authid = QString::null;
|
static QString authid = QString::null;
|
||||||
QSettings mySettings;
|
QSettings mySettings;
|
||||||
@ -372,9 +372,10 @@ void QgisApp::validateSrs( QgsCoordinateReferenceSystem* srs )
|
|||||||
//it in the ctor of the layer projection selector
|
//it in the ctor of the layer projection selector
|
||||||
|
|
||||||
QgsGenericProjectionSelector *mySelector = new QgsGenericProjectionSelector();
|
QgsGenericProjectionSelector *mySelector = new QgsGenericProjectionSelector();
|
||||||
mySelector->setMessage( srs->validationHint() ); //shows a generic message, if not specified
|
mySelector->setMessage( srs.validationHint() ); //shows a generic message, if not specified
|
||||||
if ( authid.isNull() )
|
if ( authid.isNull() )
|
||||||
authid = QgisApp::instance()->mapCanvas()->mapRenderer()->destinationCrs().authid();
|
authid = QgisApp::instance()->mapCanvas()->mapRenderer()->destinationCrs().authid();
|
||||||
|
|
||||||
QgsCoordinateReferenceSystem defaultCrs;
|
QgsCoordinateReferenceSystem defaultCrs;
|
||||||
if ( defaultCrs.createFromOgcWmsCrs( authid ) )
|
if ( defaultCrs.createFromOgcWmsCrs( authid ) )
|
||||||
{
|
{
|
||||||
@ -389,7 +390,7 @@ void QgisApp::validateSrs( QgsCoordinateReferenceSystem* srs )
|
|||||||
{
|
{
|
||||||
QgsDebugMsg( "Layer srs set from dialog: " + QString::number( mySelector->selectedCrsId() ) );
|
QgsDebugMsg( "Layer srs set from dialog: " + QString::number( mySelector->selectedCrsId() ) );
|
||||||
authid = mySelector->selectedAuthId();
|
authid = mySelector->selectedAuthId();
|
||||||
srs->createFromOgcWmsCrs( mySelector->selectedAuthId() );
|
srs.createFromOgcWmsCrs( mySelector->selectedAuthId() );
|
||||||
}
|
}
|
||||||
|
|
||||||
//QApplication::restoreOverrideCursor();
|
//QApplication::restoreOverrideCursor();
|
||||||
@ -402,12 +403,12 @@ void QgisApp::validateSrs( QgsCoordinateReferenceSystem* srs )
|
|||||||
authid = QgisApp::instance()->mapCanvas()->mapRenderer()->destinationCrs().authid();
|
authid = QgisApp::instance()->mapCanvas()->mapRenderer()->destinationCrs().authid();
|
||||||
QgsDebugMsg( "Layer srs set from project: " + authid );
|
QgsDebugMsg( "Layer srs set from project: " + authid );
|
||||||
QgisApp::instance()->statusBar()->showMessage( QObject::tr( "CRS undefined - defaulting to project CRS" ) );
|
QgisApp::instance()->statusBar()->showMessage( QObject::tr( "CRS undefined - defaulting to project CRS" ) );
|
||||||
srs->createFromOgcWmsCrs( authid );
|
srs.createFromOgcWmsCrs( authid );
|
||||||
}
|
}
|
||||||
else ///Projections/defaultBehaviour==useGlobal
|
else ///Projections/defaultBehaviour==useGlobal
|
||||||
{
|
{
|
||||||
authid = mySettings.value( "/Projections/layerDefaultCrs", GEO_EPSG_CRS_AUTHID ).toString();
|
authid = mySettings.value( "/Projections/layerDefaultCrs", GEO_EPSG_CRS_AUTHID ).toString();
|
||||||
srs->createFromOgcWmsCrs( authid );
|
srs.createFromOgcWmsCrs( authid );
|
||||||
QgisApp::instance()->statusBar()->showMessage( QObject::tr( "CRS undefined - defaulting to default CRS: %1" ).arg( authid ) );
|
QgisApp::instance()->statusBar()->showMessage( QObject::tr( "CRS undefined - defaulting to default CRS: %1" ).arg( authid ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -566,8 +567,8 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
|
|||||||
QgsMessageLog::logMessage( tr( "QGIS starting..." ) );
|
QgsMessageLog::logMessage( tr( "QGIS starting..." ) );
|
||||||
|
|
||||||
// set QGIS specific srs validation
|
// set QGIS specific srs validation
|
||||||
connect( this, SIGNAL( customSrsValidation( QgsCoordinateReferenceSystem * ) ),
|
connect( this, SIGNAL( customSrsValidation( QgsCoordinateReferenceSystem& ) ),
|
||||||
this, SLOT( validateSrs( QgsCoordinateReferenceSystem * ) ) );
|
this, SLOT( validateSrs( QgsCoordinateReferenceSystem& ) ) );
|
||||||
QgsCoordinateReferenceSystem::setCustomSrsValidation( customSrsValidation_ );
|
QgsCoordinateReferenceSystem::setCustomSrsValidation( customSrsValidation_ );
|
||||||
|
|
||||||
// set graphical message output
|
// set graphical message output
|
||||||
@ -7020,6 +7021,7 @@ void QgisApp::markDirty()
|
|||||||
// notify the project that there was a change
|
// notify the project that there was a change
|
||||||
QgsProject::instance()->dirty( true );
|
QgsProject::instance()->dirty( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
//changed from layerWasAdded to layersWereAdded in 1.8
|
//changed from layerWasAdded to layersWereAdded in 1.8
|
||||||
void QgisApp::layersWereAdded( QList<QgsMapLayer *> theLayers )
|
void QgisApp::layersWereAdded( QList<QgsMapLayer *> theLayers )
|
||||||
{
|
{
|
||||||
|
@ -404,7 +404,7 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
|
|||||||
//! @note added in 1.6
|
//! @note added in 1.6
|
||||||
void completeInitialization();
|
void completeInitialization();
|
||||||
|
|
||||||
void emitCustomSrsValidation( QgsCoordinateReferenceSystem *crs );
|
void emitCustomSrsValidation( QgsCoordinateReferenceSystem &crs );
|
||||||
|
|
||||||
QList<QgsDecorationItem*> decorationItems() { return mDecorationItems; }
|
QList<QgsDecorationItem*> decorationItems() { return mDecorationItems; }
|
||||||
void addDecorationItem( QgsDecorationItem* item ) { mDecorationItems.append( item ); }
|
void addDecorationItem( QgsDecorationItem* item ) { mDecorationItems.append( item ); }
|
||||||
@ -533,7 +533,7 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
//! validate a SRS
|
//! validate a SRS
|
||||||
void validateSrs( QgsCoordinateReferenceSystem *crs );
|
void validateSrs( QgsCoordinateReferenceSystem &crs );
|
||||||
|
|
||||||
//! QGis Sponsors
|
//! QGis Sponsors
|
||||||
void sponsors();
|
void sponsors();
|
||||||
@ -1008,7 +1008,7 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
|
|||||||
@note added in version 1.6*/
|
@note added in version 1.6*/
|
||||||
void initializationCompleted();
|
void initializationCompleted();
|
||||||
|
|
||||||
void customSrsValidation( QgsCoordinateReferenceSystem *crs );
|
void customSrsValidation( QgsCoordinateReferenceSystem &crs );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** This method will open a dialog so the user can select GDAL sublayers to load
|
/** This method will open a dialog so the user can select GDAL sublayers to load
|
||||||
|
@ -283,7 +283,7 @@ void QgsCoordinateReferenceSystem::validate()
|
|||||||
|
|
||||||
// try to validate using custom validation routines
|
// try to validate using custom validation routines
|
||||||
if ( mCustomSrsValidation )
|
if ( mCustomSrsValidation )
|
||||||
mCustomSrsValidation( this );
|
mCustomSrsValidation( *this );
|
||||||
|
|
||||||
if ( !mIsValidFlag )
|
if ( !mIsValidFlag )
|
||||||
{
|
{
|
||||||
|
@ -42,7 +42,7 @@ typedef void *OGRSpatialReferenceH;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
class QgsCoordinateReferenceSystem;
|
class QgsCoordinateReferenceSystem;
|
||||||
typedef void ( *CUSTOM_CRS_VALIDATION )( QgsCoordinateReferenceSystem* );
|
typedef void ( *CUSTOM_CRS_VALIDATION )( QgsCoordinateReferenceSystem& );
|
||||||
|
|
||||||
/** \ingroup core
|
/** \ingroup core
|
||||||
* Class for storing a coordinate reference system (CRS)
|
* Class for storing a coordinate reference system (CRS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user