Skip to content

Commit

Permalink
[composer] Friendlier error messages when exports fail
Browse files Browse the repository at this point in the history
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 d79bb3a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/app/composer/qgscomposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit d79bb3a

Please sign in to comment.