[GRASS-SVN] r36060 - grass/branches/releasebranch_6_4/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Feb 22 18:57:46 EST 2009


Author: neteler
Date: 2009-02-22 18:57:45 -0500 (Sun, 22 Feb 2009)
New Revision: 36060

Modified:
   grass/branches/releasebranch_6_4/lib/init/gis_set.tcl
   grass/branches/releasebranch_6_4/lib/init/init.bat
   grass/branches/releasebranch_6_4/lib/init/init.sh
Log:
maris: Use HOME as initial GISDBASE; Make new messages localisable (trac #499, merge from devel_branch6, r36056)

Modified: grass/branches/releasebranch_6_4/lib/init/gis_set.tcl
===================================================================
--- grass/branches/releasebranch_6_4/lib/init/gis_set.tcl	2009-02-22 20:58:20 UTC (rev 36059)
+++ grass/branches/releasebranch_6_4/lib/init/gis_set.tcl	2009-02-22 23:57:45 UTC (rev 36060)
@@ -424,7 +424,7 @@
     		refresh_ms
     		selFromList .frame0.frameLOC.listbox $location
     		selFromList .frame0.frameMS.listbox $mapset
-    		.frame0.frameBUTTONS.ok configure -state normal}
+    		if { [CheckLocation] } { .frame0.frameBUTTONS.ok configure -state normal }}
 
     button .frame0.frameNMS.sixth.button \
     	-text [G_msg "EPSG codes"] \
@@ -437,7 +437,7 @@
     		refresh_ms
     		selFromList .frame0.frameLOC.listbox $location
     		selFromList .frame0.frameMS.listbox $mapset
-    		.frame0.frameBUTTONS.ok configure -state normal} }
+    		if { [CheckLocation] } { .frame0.frameBUTTONS.ok configure -state normal } } }
     	    			
     button .frame0.frameNMS.seventh.button \
     	-text [G_msg "Projection values"] \
@@ -555,8 +555,19 @@
 
     .frame0.frameDB.mid.entry xview moveto 1
     
-    if { ! [file exists $database] } {
-      	DialogGen .wrnDlg [G_msg "WARNING: Invalid Database"] warning \
+    if { [string equal $location "<UNKNOWN>"] } {
+	DialogGen .wrnDlg [G_msg "Starting GRASS for the first time"] warning \
+	[G_msg "GRASS needs a directory in which to store its data. \
+Create one now if you have not already done so. \
+A popular choice is \"grassdata\", located in your home directory."] 0 OK
+
+	set tmp [tk_chooseDirectory -initialdir $database \
+		-parent .frame0 -title [G_msg "Select GIS data directory"] -mustexist true]
+	if {$tmp != ""} { set database $tmp }
+	set location ""
+	.frame0.frameBUTTONS.ok configure -state disabled
+    } elseif { ! [file exists $database] } {
+	DialogGen .wrnDlg [G_msg "WARNING: Invalid Database"] warning \
 	    [G_msg "WARNING: Invalid database. Finding first valid directory in parent tree"] \
 	    0 OK
       

Modified: grass/branches/releasebranch_6_4/lib/init/init.bat
===================================================================
--- grass/branches/releasebranch_6_4/lib/init/init.bat	2009-02-22 20:58:20 UTC (rev 36059)
+++ grass/branches/releasebranch_6_4/lib/init/init.bat	2009-02-22 23:57:45 UTC (rev 36060)
@@ -61,7 +61,7 @@
 if exist "%WINGISRC%" goto aftercreategisrc
 
 rem Create an initial GISRC file based on current directory
-"%WINGISBASE%\etc\echo" "GISDBASE: %CD%" | g.dirseps -g > "%WINGISRC%"
+"%WINGISBASE%\etc\echo" "GISDBASE: %USERPROFILE%" | g.dirseps -g > "%WINGISRC%"
 "%WINGISBASE%\etc\echo" "LOCATION_NAME: <UNKNOWN>" >> "%WINGISRC%"
 "%WINGISBASE%\etc\echo" "MAPSET: <UNKNOWN>" >> "%WINGISRC%"
 	    

Modified: grass/branches/releasebranch_6_4/lib/init/init.sh
===================================================================
--- grass/branches/releasebranch_6_4/lib/init/init.sh	2009-02-22 20:58:20 UTC (rev 36059)
+++ grass/branches/releasebranch_6_4/lib/init/init.sh	2009-02-22 23:57:45 UTC (rev 36060)
@@ -399,7 +399,7 @@
     read ans
 
     #for convenience, define pwd as GISDBASE:
-    echo "GISDBASE: $PWD" > "$GISRC"
+    echo "GISDBASE: $HOME" > "$GISRC"
     echo 'LOCATION_NAME: <UNKNOWN>' >> "$GISRC"
     echo 'MAPSET: <UNKNOWN>' >> "$GISRC"
 



More information about the grass-commit mailing list