Skip to content

Commit 8abeb8d

Browse files
committedFeb 24, 2016
Merge pull request #2745 from medspx/gdal_invalid_messagebar
Replace QgsErrorDialog by messageBar for raster loading (fix #6967)
2 parents d11e667 + 61bb01b commit 8abeb8d

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10369,7 +10369,8 @@ QgsRasterLayer* QgisApp::addRasterLayerPrivate(
1036910369
// don't show the gui warning if we are loading from command line
1037010370
if ( guiWarning )
1037110371
{
10372-
QgsErrorDialog::show( error, title );
10372+
messageBar()->pushMessage( title, error.message( QgsErrorMessage::Text ),
10373+
QgsMessageBar::CRITICAL, messageTimeout() );
1037310374
}
1037410375

1037510376
if ( layer )
@@ -10481,15 +10482,11 @@ bool QgisApp::addRasterLayers( QStringList const &theFileNameQStringList, bool g
1048110482
// loaded afterwards (see main.cpp)
1048210483
if ( guiWarning )
1048310484
{
10484-
QgsError error;
10485-
QString msg;
10486-
10487-
msg = tr( "%1 is not a supported raster data source" ).arg( *myIterator );
10485+
QString msg = tr( "%1 is not a supported raster data source" ).arg( *myIterator );
1048810486
if ( !errMsg.isEmpty() )
1048910487
msg += '\n' + errMsg;
10490-
error.append( QGS_ERROR_MESSAGE( msg, tr( "Raster layer" ) ) );
1049110488

10492-
QgsErrorDialog::show( error, tr( "Unsupported Data Source" ) );
10489+
messageBar()->pushMessage( tr( "Unsupported Data Source" ), msg, QgsMessageBar::CRITICAL, messageTimeout() );
1049310490
}
1049410491
}
1049510492
if ( ! ok )

0 commit comments

Comments
 (0)
Please sign in to comment.