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
  • Loading branch information
nyalldawson committed Feb 23, 2017
1 parent b1158ff commit b95eb078828c38d1806c51e9b9bdcfa2a6e365b7
Showing with 7 additions and 7 deletions.
  1. +7 −7 src/app/composer/qgscomposer.cpp
@@ -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 );
@@ -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 );
@@ -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 );
@@ -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 );
@@ -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 );
@@ -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 );
@@ -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 );

0 comments on commit b95eb07

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