Skip to content

Commit

Permalink
Merge pull request #2745 from medspx/gdal_invalid_messagebar
Browse files Browse the repository at this point in the history
Replace QgsErrorDialog by messageBar for raster loading (fix #6967)
  • Loading branch information
nyalldawson committed Feb 24, 2016
2 parents d11e667 + 61bb01b commit 8abeb8d
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/app/qgisapp.cpp
Expand Up @@ -10369,7 +10369,8 @@ QgsRasterLayer* QgisApp::addRasterLayerPrivate(
// don't show the gui warning if we are loading from command line
if ( guiWarning )
{
QgsErrorDialog::show( error, title );
messageBar()->pushMessage( title, error.message( QgsErrorMessage::Text ),
QgsMessageBar::CRITICAL, messageTimeout() );
}

if ( layer )
Expand Down Expand Up @@ -10481,15 +10482,11 @@ bool QgisApp::addRasterLayers( QStringList const &theFileNameQStringList, bool g
// loaded afterwards (see main.cpp)
if ( guiWarning )
{
QgsError error;
QString msg;

msg = tr( "%1 is not a supported raster data source" ).arg( *myIterator );
QString msg = tr( "%1 is not a supported raster data source" ).arg( *myIterator );
if ( !errMsg.isEmpty() )
msg += '\n' + errMsg;
error.append( QGS_ERROR_MESSAGE( msg, tr( "Raster layer" ) ) );

QgsErrorDialog::show( error, tr( "Unsupported Data Source" ) );
messageBar()->pushMessage( tr( "Unsupported Data Source" ), msg, QgsMessageBar::CRITICAL, messageTimeout() );
}
}
if ( ! ok )
Expand Down

0 comments on commit 8abeb8d

Please sign in to comment.