Skip to content

Commit b95eb07

Browse files
committedFeb 23, 2017
[composer] Friendlier error messages when exports fail
Make it clear that this is likely because the destination file is open in another application
1 parent b1158ff commit b95eb07

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed
 

‎src/app/composer/qgscomposer.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1772,7 +1772,7 @@ void QgsComposer::exportCompositionAsPDF( QgsComposer::OutputMode mode )
17721772
if ( !printReady )
17731773
{
17741774
QMessageBox::warning( this, tr( "Atlas processing error" ),
1775-
QString( tr( "Error creating %1." ) ).arg( outputFileName ),
1775+
QString( tr( "Cannot write to %1.\n\nThis file may be open in another application." ) ).arg( outputFileName ),
17761776
QMessageBox::Ok,
17771777
QMessageBox::Ok );
17781778
mView->setPaintingEnabled( true );
@@ -1818,7 +1818,7 @@ void QgsComposer::exportCompositionAsPDF( QgsComposer::OutputMode mode )
18181818
if ( !printReady )
18191819
{
18201820
QMessageBox::warning( this, tr( "Atlas processing error" ),
1821-
QString( tr( "Error creating %1." ) ).arg( outputFileName ),
1821+
QString( tr( "Cannot write to %1.\n\nThis file may be open in another application." ) ).arg( outputFileName ),
18221822
QMessageBox::Ok,
18231823
QMessageBox::Ok );
18241824
mView->setPaintingEnabled( true );
@@ -1849,7 +1849,7 @@ void QgsComposer::exportCompositionAsPDF( QgsComposer::OutputMode mode )
18491849
if ( !exportOk )
18501850
{
18511851
QMessageBox::warning( this, tr( "Atlas processing error" ),
1852-
QString( tr( "Error creating %1." ) ).arg( outputFileName ),
1852+
QString( tr( "Cannot write to %1.\n\nThis file may be open in another application." ) ).arg( outputFileName ),
18531853
QMessageBox::Ok,
18541854
QMessageBox::Ok );
18551855
mView->setPaintingEnabled( true );
@@ -2165,7 +2165,7 @@ void QgsComposer::exportCompositionAsImage( QgsComposer::OutputMode mode )
21652165
if ( !saveOk )
21662166
{
21672167
QMessageBox::warning( this, tr( "Image export error" ),
2168-
QString( tr( "Error creating %1." ) ).arg( fileNExt.first ),
2168+
QString( tr( "Cannot write to %1.\n\nThis file may be open in another application." ) ).arg( fileNExt.first ),
21692169
QMessageBox::Ok,
21702170
QMessageBox::Ok );
21712171
mView->setPaintingEnabled( true );
@@ -2390,7 +2390,7 @@ void QgsComposer::exportCompositionAsImage( QgsComposer::OutputMode mode )
23902390
if ( !saveOk )
23912391
{
23922392
QMessageBox::warning( this, tr( "Atlas processing error" ),
2393-
QString( tr( "Error creating %1." ) ).arg( imageFilename ),
2393+
QString( tr( "Cannot write to %1.\n\nThis file may be open in another application." ) ).arg( imageFilename ),
23942394
QMessageBox::Ok,
23952395
QMessageBox::Ok );
23962396
mView->setPaintingEnabled( true );
@@ -2740,7 +2740,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
27402740
if ( !createOk )
27412741
{
27422742
QMessageBox::warning( this, tr( "SVG export error" ),
2743-
QString( tr( "Error creating %1." ) ).arg( currentFileName ),
2743+
QString( tr( "Cannot write to %1.\n\nThis file may be open in another application." ) ).arg( currentFileName ),
27442744
QMessageBox::Ok,
27452745
QMessageBox::Ok );
27462746
mView->setPaintingEnabled( true );
@@ -2898,7 +2898,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
28982898
if ( !openOk )
28992899
{
29002900
QMessageBox::warning( this, tr( "SVG export error" ),
2901-
QString( tr( "Error creating %1." ) ).arg( currentFileName ),
2901+
QString( tr( "Cannot write to %1.\n\nThis file may be open in another application." ) ).arg( currentFileName ),
29022902
QMessageBox::Ok,
29032903
QMessageBox::Ok );
29042904
mView->setPaintingEnabled( true );

0 commit comments

Comments
 (0)
Please sign in to comment.