Skip to content
Permalink
Browse files

[composer] Friendlier error messages when exports fail

Make it clear that this is likely because the destination
file is open in another application

(cherry-picked from b95eb07)
  • Loading branch information
nyalldawson committed Mar 4, 2017
1 parent 8984d59 commit d79bb3a0f32b7fdfef93626028d569bdaefce4ba
Showing with 7 additions and 7 deletions.
  1. +7 −7 src/app/composer/qgscomposer.cpp
@@ -1753,7 +1753,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 );
@@ -1799,7 +1799,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 );
@@ -1830,7 +1830,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 );
@@ -2146,7 +2146,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 );
@@ -2371,7 +2371,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 );
@@ -2721,7 +2721,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 );
@@ -2879,7 +2879,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 );

0 comments on commit d79bb3a

Please sign in to comment.
You can’t perform that action at this time.