Skip to content

Commit

Permalink
Show datum ensemble warnings for selected dialogs only
Browse files Browse the repository at this point in the history
- align raster
- dxf export
- vector layer export
- processing crs widgets
- raster layer export
- dwg import
- new geopackage/shapefile/scratch layer dialog
- raster calculator
  • Loading branch information
nyalldawson committed May 11, 2021
1 parent 23f35f3 commit 24ee656
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app/dwg/qgsdwgimportdialog.cpp
Expand Up @@ -81,6 +81,7 @@ QgsDwgImportDialog::QgsDwgImportDialog( QWidget *parent, Qt::WindowFlags f )

int crsid = s.value( QStringLiteral( "/DwgImport/lastCrs" ), QString::number( QgsProject::instance()->crs().srsid() ) ).toInt();

mCrsSelector->setShowDatumEnsembleWarnings( true );
QgsCoordinateReferenceSystem crs;
crs.createFromSrsId( crsid );
mCrsSelector->setCrs( crs );
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgsalignrasterdialog.cpp
Expand Up @@ -84,6 +84,8 @@ QgsAlignRasterDialog::QgsAlignRasterDialog( QWidget *parent )
mAlign = new QgsAlignRaster;
mAlign->setProgressHandler( new QgsAlignRasterDialogProgress( mProgress ) );

mCrsSelector->setShowDatumEnsembleWarnings( true );

connect( mBtnAdd, &QAbstractButton::clicked, this, &QgsAlignRasterDialog::addLayer );
connect( mBtnRemove, &QAbstractButton::clicked, this, &QgsAlignRasterDialog::removeLayer );
connect( mBtnEdit, &QAbstractButton::clicked, this, &QgsAlignRasterDialog::editLayer );
Expand Down
1 change: 1 addition & 0 deletions src/app/qgsdxfexportdialog.cpp
Expand Up @@ -491,6 +491,7 @@ QgsDxfExportDialog::QgsDxfExportDialog( QWidget *parent, Qt::WindowFlags f )
mCRS = QgsCoordinateReferenceSystem::fromSrsId( crsid );
mCrsSelector->setCrs( mCRS );
mCrsSelector->setLayerCrs( mCRS );
mCrsSelector->setShowDatumEnsembleWarnings( true );
mCrsSelector->setMessage( tr( "Select the coordinate reference system for the dxf file. "
"The data points will be transformed from the layer coordinate reference system." ) );

Expand Down
1 change: 1 addition & 0 deletions src/app/qgsrastercalcdialog.cpp
Expand Up @@ -80,6 +80,7 @@ QgsRasterCalcDialog::QgsRasterCalcDialog( QgsRasterLayer *rasterLayer, QWidget *
setExtentSize( rasterLayer->width(), rasterLayer->height(), rasterLayer->extent() );
mCrsSelector->setCrs( rasterLayer->crs() );
}
mCrsSelector->setShowDatumEnsembleWarnings( true );

mButtonBox->button( QDialogButtonBox::Ok )->setEnabled( false );

Expand Down
2 changes: 2 additions & 0 deletions src/gui/ogr/qgsvectorlayersaveasdialog.cpp
Expand Up @@ -200,6 +200,8 @@ void QgsVectorLayerSaveAsDialog::setup()
}
mButtonBox->button( QDialogButtonBox::Ok )->setEnabled( !filePath.isEmpty() );
} );

mCrsSelector->setShowDatumEnsembleWarnings( true );
}

QList<QPair<QLabel *, QWidget *> > QgsVectorLayerSaveAsDialog::createControls( const QMap<QString, QgsVectorFileWriter::Option *> &options )
Expand Down
4 changes: 4 additions & 0 deletions src/gui/processing/qgsprocessingwidgetwrapperimpl.cpp
Expand Up @@ -252,6 +252,10 @@ QgsProcessingCrsParameterDefinitionWidget::QgsProcessingCrsParameterDefinitionWi
vlayout->addWidget( new QLabel( tr( "Default value" ) ) );

mCrsSelector = new QgsProjectionSelectionWidget();

// possibly we should expose this for parameter by parameter control
mCrsSelector->setShowDatumEnsembleWarnings( true );

if ( const QgsProcessingParameterCrs *crsParam = dynamic_cast<const QgsProcessingParameterCrs *>( definition ) )
mCrsSelector->setCrs( QgsProcessingParameters::parameterAsCrs( crsParam, crsParam->defaultValueForGui(), context ) );
else
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsnewgeopackagelayerdialog.cpp
Expand Up @@ -100,6 +100,7 @@ QgsNewGeoPackageLayerDialog::QgsNewGeoPackageLayerDialog( QWidget *parent, Qt::W
mFeatureIdColumnEdit->setPlaceholderText( QStringLiteral( DEFAULT_OGR_FID_COLUMN_TITLE ) );
mCheckBoxCreateSpatialIndex->setEnabled( false );
mCrsSelector->setEnabled( false );
mCrsSelector->setShowDatumEnsembleWarnings( true );

mFieldTypeBox->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconFieldText.svg" ) ), tr( "Text Data" ), "text" );
mFieldTypeBox->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconFieldInteger.svg" ) ), tr( "Whole Number (integer)" ), "integer" );
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsnewmemorylayerdialog.cpp
Expand Up @@ -80,6 +80,7 @@ QgsNewMemoryLayerDialog::QgsNewMemoryLayerDialog( QWidget *parent, Qt::WindowFla
mGeometryWithZCheckBox->setEnabled( false );
mGeometryWithMCheckBox->setEnabled( false );
mCrsSelector->setEnabled( false );
mCrsSelector->setShowDatumEnsembleWarnings( true );

mTypeBox->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconFieldText.svg" ) ), tr( "Text" ), "string" );
mTypeBox->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconFieldInteger.svg" ) ), tr( "Whole Number" ), "integer" );
Expand Down
2 changes: 2 additions & 0 deletions src/gui/qgsnewvectorlayerdialog.cpp
Expand Up @@ -87,6 +87,8 @@ QgsNewVectorLayerDialog::QgsNewVectorLayerDialog( QWidget *parent, Qt::WindowFla
mFileFormatLabel->setVisible( false );
}

mCrsSelector->setShowDatumEnsembleWarnings( true );

mFileFormatComboBox->setCurrentIndex( 0 );

mFileEncoding->addItems( QgsVectorDataProvider::availableEncodings() );
Expand Down
2 changes: 2 additions & 0 deletions src/gui/qgsrasterlayersaveasdialog.cpp
Expand Up @@ -140,6 +140,8 @@ QgsRasterLayerSaveAsDialog::QgsRasterLayerSaveAsDialog( QgsRasterLayer *rasterLa
// don't restore nodata, it needs user input
// pyramids are not necessarily built every time

mCrsSelector->setShowDatumEnsembleWarnings( true );

mCrsSelector->setLayerCrs( mLayerCrs );
//default to layer CRS - see https://github.com/qgis/QGIS/issues/22211 for discussion
mCrsSelector->setCrs( mLayerCrs );
Expand Down

0 comments on commit 24ee656

Please sign in to comment.