mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
[GRASS] disabled wrong GISBASE warning on startup
This commit is contained in:
parent
ddb80ebd8a
commit
0be74e5fd9
@ -413,7 +413,9 @@ bool QgsGrass::init( void )
|
||||
}
|
||||
|
||||
bool userGisbase = false;
|
||||
bool valid = false;
|
||||
bool valid = isValidGrassBaseDir( gisBase );
|
||||
// TODO add GISBASE selection to options dialog
|
||||
#if 0
|
||||
while ( !( valid = isValidGrassBaseDir( gisBase ) ) )
|
||||
{
|
||||
|
||||
@ -446,14 +448,21 @@ bool QgsGrass::init( void )
|
||||
gisBase = shortPath( gisBase );
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( !valid )
|
||||
{
|
||||
// warn user
|
||||
QMessageBox::information( 0, QObject::tr( "GRASS plugin" ),
|
||||
QObject::tr( "GRASS data won't be available if GISBASE is not specified." ) );
|
||||
nonInitializable = true;
|
||||
error_message = tr( "GRASS was not found in '%1'(GISBASE), provider and plugin will not work." ).arg( gisBase );
|
||||
QgsDebugMsg( error_message );
|
||||
#if 0
|
||||
// TODO: how to emit message from provider (which does not know about QgisApp)
|
||||
QgisApp::instance()->messageBar()->pushMessage( tr( "GRASS error" ),
|
||||
error_message, QgsMessageBar: WARNING );
|
||||
#endif
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if ( userGisbase )
|
||||
{
|
||||
settings.setValue( "/GRASS/gisbase", gisBase );
|
||||
@ -539,10 +548,11 @@ bool QgsGrass::init( void )
|
||||
putEnv( "GRASS_PAGER", pager );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
initialized = 1;
|
||||
unlock();
|
||||
return true;
|
||||
return valid;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -94,6 +94,7 @@ QgsGrassProvider::QgsGrassProvider( QString uri )
|
||||
mValid = false;
|
||||
if ( !QgsGrass::init() )
|
||||
{
|
||||
appendError( QgsGrass::errorMessage() );
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user