Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[composer] Friendlier error messages when exports fail
Make it clear that this is likely because the destination
file is open in another application
  • Loading branch information
nyalldawson committed Feb 23, 2017
1 parent b1158ff commit b95eb07
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/app/composer/qgscomposer.cpp
Expand Up @@ -1772,7 +1772,7 @@ void QgsComposer::exportCompositionAsPDF( QgsComposer::OutputMode mode )
if ( !printReady )
{
QMessageBox::warning( this, tr( "Atlas processing error" ),
QString( tr( "Error creating %1." ) ).arg( outputFileName ),
QString( tr( "Cannot write to %1.\n\nThis file may be open in another application." ) ).arg( outputFileName ),
QMessageBox::Ok,
QMessageBox::Ok );
mView->setPaintingEnabled( true );
Expand Down Expand Up @@ -1818,7 +1818,7 @@ void QgsComposer::exportCompositionAsPDF( QgsComposer::OutputMode mode )
if ( !printReady )
{
QMessageBox::warning( this, tr( "Atlas processing error" ),
QString( tr( "Error creating %1." ) ).arg( outputFileName ),
QString( tr( "Cannot write to %1.\n\nThis file may be open in another application." ) ).arg( outputFileName ),
QMessageBox::Ok,
QMessageBox::Ok );
mView->setPaintingEnabled( true );
Expand Down Expand Up @@ -1849,7 +1849,7 @@ void QgsComposer::exportCompositionAsPDF( QgsComposer::OutputMode mode )
if ( !exportOk )
{
QMessageBox::warning( this, tr( "Atlas processing error" ),
QString( tr( "Error creating %1." ) ).arg( outputFileName ),
QString( tr( "Cannot write to %1.\n\nThis file may be open in another application." ) ).arg( outputFileName ),
QMessageBox::Ok,
QMessageBox::Ok );
mView->setPaintingEnabled( true );
Expand Down Expand Up @@ -2165,7 +2165,7 @@ void QgsComposer::exportCompositionAsImage( QgsComposer::OutputMode mode )
if ( !saveOk )
{
QMessageBox::warning( this, tr( "Image export error" ),
QString( tr( "Error creating %1." ) ).arg( fileNExt.first ),
QString( tr( "Cannot write to %1.\n\nThis file may be open in another application." ) ).arg( fileNExt.first ),
QMessageBox::Ok,
QMessageBox::Ok );
mView->setPaintingEnabled( true );
Expand Down Expand Up @@ -2390,7 +2390,7 @@ void QgsComposer::exportCompositionAsImage( QgsComposer::OutputMode mode )
if ( !saveOk )
{
QMessageBox::warning( this, tr( "Atlas processing error" ),
QString( tr( "Error creating %1." ) ).arg( imageFilename ),
QString( tr( "Cannot write to %1.\n\nThis file may be open in another application." ) ).arg( imageFilename ),
QMessageBox::Ok,
QMessageBox::Ok );
mView->setPaintingEnabled( true );
Expand Down Expand Up @@ -2740,7 +2740,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
if ( !createOk )
{
QMessageBox::warning( this, tr( "SVG export error" ),
QString( tr( "Error creating %1." ) ).arg( currentFileName ),
QString( tr( "Cannot write to %1.\n\nThis file may be open in another application." ) ).arg( currentFileName ),
QMessageBox::Ok,
QMessageBox::Ok );
mView->setPaintingEnabled( true );
Expand Down Expand Up @@ -2898,7 +2898,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
if ( !openOk )
{
QMessageBox::warning( this, tr( "SVG export error" ),
QString( tr( "Error creating %1." ) ).arg( currentFileName ),
QString( tr( "Cannot write to %1.\n\nThis file may be open in another application." ) ).arg( currentFileName ),
QMessageBox::Ok,
QMessageBox::Ok );
mView->setPaintingEnabled( true );
Expand Down

0 comments on commit b95eb07

Please sign in to comment.