Skip to content

Commit

Permalink
Add coverage check on atlas exports
Browse files Browse the repository at this point in the history
Fixes #26144
  • Loading branch information
roya0045 authored and nyalldawson committed Mar 23, 2020
1 parent 4e043db commit 05ffd2d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/app/layout/qgslayoutdesignerdialog.cpp
Expand Up @@ -2651,6 +2651,15 @@ void QgsLayoutDesignerDialog::exportAtlasToRaster()
if ( !printAtlas || !printAtlas->enabled() )
return;

if ( printAtlas->coverageLayer() )
{
QMessageBox::warning( this, tr( "Export Atlas as Image" ),
tr( "Error: No coverage layer is set." ),
QMessageBox::Ok,
QMessageBox::Ok );
return;
}

// else, it has an atlas to render, so a directory must first be selected
if ( printAtlas->filenameExpression().isEmpty() )
{
Expand Down Expand Up @@ -2823,6 +2832,15 @@ void QgsLayoutDesignerDialog::exportAtlasToSvg()
if ( !printAtlas || !printAtlas->enabled() )
return;

if ( printAtlas->coverageLayer() )
{
QMessageBox::warning( this, tr( "Export Atlas as Image" ),
tr( "Error: No coverage layer is set." ),
QMessageBox::Ok,
QMessageBox::Ok );
return;
}

if ( containsWmsLayers() )
{
showWmsPrintingWarning();
Expand Down Expand Up @@ -2991,6 +3009,15 @@ void QgsLayoutDesignerDialog::exportAtlasToPdf()
if ( !printAtlas || !printAtlas->enabled() )
return;

if ( printAtlas->coverageLayer() )
{
QMessageBox::warning( this, tr( "Export Atlas as Image" ),
tr( "Error: No coverage layer is set." ),
QMessageBox::Ok,
QMessageBox::Ok );
return;
}

if ( containsWmsLayers() )
{
showWmsPrintingWarning();
Expand Down

0 comments on commit 05ffd2d

Please sign in to comment.