Skip to content

Commit

Permalink
Fix for #255 - choosing GISBASE more user friendly.
Browse files Browse the repository at this point in the history
User should now understand that no GISBASE equals no GRASS fun.


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6213 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Dec 8, 2006
1 parent 599456e commit b24e533
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions src/providers/grass/qgsgrass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,39 @@ void QgsGrass::init( void )
}

bool userGisbase = false;
while ( !isValidGrassBaseDir(gisBase) ) {
// Keep asking user for GISBASE until we get a valid one
//QMessageBox::warning( 0, "Warning", "QGIS can't find your GRASS installation,\nGRASS data "
// "cannot be used.\nPlease select your GISBASE.\nGISBASE is full path to the\n"
// "directory where GRASS is installed." );
bool valid = false;
while ( !(valid = isValidGrassBaseDir(gisBase)) ) {

// ask user if he wants to specify GISBASE
int res = QMessageBox::warning(0, QObject::tr("GRASS plugin"),
QObject::tr("QGIS couldn't find your GRASS installation.\n"
"Would you like to specify path (GISBASE) to your GRASS installation?"),
QMessageBox::Yes, QMessageBox::No);

if (res != QMessageBox::Yes)
{
userGisbase = false;
break;
}

// XXX Need to subclass this and add explantory message above to left side
userGisbase = true;
gisBase = QFileDialog::getExistingDirectory(
0, "Choose GISBASE ...", gisBase);
0, QObject::tr("Choose GRASS installation path (GISBASE)"), gisBase);
if (gisBase == QString::null)
{
// User pressed cancel. No GRASS for you!
userGisbase = false;
break;
}
}

if (!valid)
{
// warn user
QMessageBox::information(0, QObject::tr("GRASS plugin"),
QObject::tr("GRASS data won't be available if GISBASE is not specified."));
}

if ( userGisbase )
{
Expand Down

0 comments on commit b24e533

Please sign in to comment.