Skip to content

Commit b24e533

Browse files
author
wonder
committedDec 8, 2006
Fix for #255 - choosing GISBASE more user friendly.
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

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed
 

‎src/providers/grass/qgsgrass.cpp

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,22 +114,39 @@ void QgsGrass::init( void )
114114
}
115115

116116
bool userGisbase = false;
117-
while ( !isValidGrassBaseDir(gisBase) ) {
118-
// Keep asking user for GISBASE until we get a valid one
119-
//QMessageBox::warning( 0, "Warning", "QGIS can't find your GRASS installation,\nGRASS data "
120-
// "cannot be used.\nPlease select your GISBASE.\nGISBASE is full path to the\n"
121-
// "directory where GRASS is installed." );
117+
bool valid = false;
118+
while ( !(valid = isValidGrassBaseDir(gisBase)) ) {
119+
120+
// ask user if he wants to specify GISBASE
121+
int res = QMessageBox::warning(0, QObject::tr("GRASS plugin"),
122+
QObject::tr("QGIS couldn't find your GRASS installation.\n"
123+
"Would you like to specify path (GISBASE) to your GRASS installation?"),
124+
QMessageBox::Yes, QMessageBox::No);
125+
126+
if (res != QMessageBox::Yes)
127+
{
128+
userGisbase = false;
129+
break;
130+
}
131+
122132
// XXX Need to subclass this and add explantory message above to left side
123133
userGisbase = true;
124134
gisBase = QFileDialog::getExistingDirectory(
125-
0, "Choose GISBASE ...", gisBase);
135+
0, QObject::tr("Choose GRASS installation path (GISBASE)"), gisBase);
126136
if (gisBase == QString::null)
127137
{
128138
// User pressed cancel. No GRASS for you!
129139
userGisbase = false;
130140
break;
131141
}
132142
}
143+
144+
if (!valid)
145+
{
146+
// warn user
147+
QMessageBox::information(0, QObject::tr("GRASS plugin"),
148+
QObject::tr("GRASS data won't be available if GISBASE is not specified."));
149+
}
133150

134151
if ( userGisbase )
135152
{

0 commit comments

Comments
 (0)
Please sign in to comment.