@@ -114,22 +114,39 @@ void QgsGrass::init( void )
114
114
}
115
115
116
116
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
+
122
132
// XXX Need to subclass this and add explantory message above to left side
123
133
userGisbase = true ;
124
134
gisBase = QFileDialog::getExistingDirectory (
125
- 0 , " Choose GISBASE ... " , gisBase);
135
+ 0 , QObject::tr ( " Choose GRASS installation path (GISBASE) " ) , gisBase);
126
136
if (gisBase == QString::null)
127
137
{
128
138
// User pressed cancel. No GRASS for you!
129
139
userGisbase = false ;
130
140
break ;
131
141
}
132
142
}
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
+ }
133
150
134
151
if ( userGisbase )
135
152
{
0 commit comments