Skip to content

Commit e3f141c

Browse files
authoredJun 14, 2019
Merge pull request #30213 from m-kuhn/no-projection
Allow setting the default for new projects to "no projection"
2 parents 5347eb7 + 7bcfb8e commit e3f141c

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed
 

‎src/app/qgsoptions.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,15 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
462462
leLayerGlobalCrs->setCrs( mLayerDefaultCrs );
463463

464464
const QString defaultProjectCrs = mSettings->value( QStringLiteral( "/projections/defaultProjectCrs" ), GEO_EPSG_CRS_AUTHID, QgsSettings::App ).toString();
465-
leProjectGlobalCrs->setCrs( QgsCoordinateReferenceSystem( defaultProjectCrs ) );
466465
leProjectGlobalCrs->setOptionVisible( QgsProjectionSelectionWidget::DefaultCrs, false );
466+
leProjectGlobalCrs->setOptionVisible( QgsProjectionSelectionWidget::CrsNotSet, true );
467+
leProjectGlobalCrs->setNotSetText( tr( "No projection (or unknown/non-Earth projection)" ) );
468+
leProjectGlobalCrs->setCrs( QgsCoordinateReferenceSystem( defaultProjectCrs ) );
469+
leProjectGlobalCrs->setMessage(
470+
tr( "<h1>Default projection for new projects</h1>"
471+
"Select a projection that should be used for new projects that are created in QGIS."
472+
) );
473+
467474
const QgsGui::ProjectCrsBehavior projectCrsBehavior = mSettings->enumValue( QStringLiteral( "/projections/newProjectCrsBehavior" ), QgsGui::UseCrsOfFirstLayerAdded, QgsSettings::App );
468475
switch ( projectCrsBehavior )
469476
{

‎src/gui/qgsprojectionselectionwidget.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,11 @@ void QgsProjectionSelectionWidget::selectCrs()
171171
//find out crs id of current proj4 string
172172
QgsProjectionSelectionDialog dlg( this );
173173
dlg.setMessage( mMessage );
174-
if ( mCrs.isValid() )
174+
dlg.setCrs( mCrs );
175+
176+
if ( optionVisible( QgsProjectionSelectionWidget::CrsOption::CrsNotSet ) )
175177
{
176-
dlg.setCrs( mCrs );
178+
dlg.setShowNoProjection( true );
177179
}
178180

179181
if ( dlg.exec() )

0 commit comments

Comments
 (0)
Please sign in to comment.