[GRASS-SVN] r31456 - grass/trunk/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 21 03:53:04 EDT 2008


Author: glynn
Date: 2008-05-21 03:53:04 -0400 (Wed, 21 May 2008)
New Revision: 31456

Modified:
   grass/trunk/lib/init/epsg_option.tcl
   grass/trunk/lib/init/file_option.tcl
   grass/trunk/lib/init/gis_set.tcl
Log:
Merge r31283 from 6.4


Modified: grass/trunk/lib/init/epsg_option.tcl
===================================================================
--- grass/trunk/lib/init/epsg_option.tcl	2008-05-21 07:01:37 UTC (rev 31455)
+++ grass/trunk/lib/init/epsg_option.tcl	2008-05-21 07:53:04 UTC (rev 31456)
@@ -49,18 +49,18 @@
 #############################################################################
 
 namespace eval epsgOpt {
-	variable browsedepsg #path to EPSG code file
-	variable epsgLocation #name of new location to be created
-	variable epsg_code  #EPSG code number
-	variable searchterm #text string searched in EPSG file
+	variable browsedepsg ;#path to EPSG code file
+	variable epsgLocation ;#name of new location to be created
+	variable epsg_code  ;#EPSG code number
+	variable searchterm ;#text string searched in EPSG file
 	variable dir 
-	variable start #starting index for searching EPSG text widget
-	variable epsgtxt #text widget with EPSG definitions and codes
-	variable dtnum #datum transformation number
+	variable start ;#starting index for searching EPSG text widget
+	variable epsgtxt ;#text widget with EPSG definitions and codes
+	variable dtnum ;#datum transformation number
 	global env
 	global database 
 	global refresh
-	global mingw #test to see if we are running a windows version in mingw
+	global mingw ;#test to see if we are running a windows version in mingw
 
 
 }

Modified: grass/trunk/lib/init/file_option.tcl
===================================================================
--- grass/trunk/lib/init/file_option.tcl	2008-05-21 07:01:37 UTC (rev 31455)
+++ grass/trunk/lib/init/file_option.tcl	2008-05-21 07:53:04 UTC (rev 31456)
@@ -43,11 +43,11 @@
 # 
 #############################################################################
 namespace eval fileOpt {
-	variable fileLocation #name of new location to be created
-	variable filepath  #path to georeferenced file
+	variable fileLocation ;#name of new location to be created
+	variable filepath  ;#path to georeferenced file
 	global env
 	global database 
-	global mingw #test to see if we are running a windows version in mingw
+	global mingw ;#test to see if we are running a windows version in mingw
 	global refresh
 }
 

Modified: grass/trunk/lib/init/gis_set.tcl
===================================================================
--- grass/trunk/lib/init/gis_set.tcl	2008-05-21 07:01:37 UTC (rev 31455)
+++ grass/trunk/lib/init/gis_set.tcl	2008-05-21 07:53:04 UTC (rev 31456)
@@ -118,7 +118,6 @@
 
 proc CheckLocation {} {
 	# Returns 0, if location is invalid, 1 othervise.
-	# Are hardcoded / in path's OK? They where here before me :) Maris.
     global database location
     
     set found 0
@@ -138,12 +137,9 @@
     } else {
         cdir $dir
         .frame0.frameNMS.second.entry configure -state disabled
-        if {[file isdirectory "PERMANENT"]} {
-            # All good locations have valid PERMANENT mapset.
-            if {[file exists "$dir/PERMANENT/DEFAULT_WIND"] != 0} {
-                set found 1
-                .frame0.frameNMS.second.entry configure -state normal
-            }
+        if {[file isdirectory "PERMANENT"] && [file exists "$dir/PERMANENT/DEFAULT_WIND"]} {
+            set found 1
+            .frame0.frameNMS.second.entry configure -state normal
         }
     }
     
@@ -151,6 +147,16 @@
     return $found
 }
 
+proc CheckMapset {} {
+	global database location mapset
+	
+	if { $mapset == "" } { return 0; }
+	
+	if { [file exists "$database/$location/$mapset/WIND"] } {
+		return 1
+	}
+	return 0
+}
 
 #############################################################################
 proc gisSetWindow {} {
@@ -483,12 +489,11 @@
 				0 OK;
 			set mapset ""
             } else {
-                if {[file exists "$database/$location/$mapset/WIND"] == 0} {
+                if {[CheckMapset] == 0} {
                     DialogGen .wrnDlg [G_msg "WARNING: invalid mapset"] warning \
                     [format [G_msg "Warning: <%s> is not a valid mapset"] $mapset] \
                     0 OK;
-                }
-                if { $mapset != "" && [file exists "$database/$location/$mapset/WIND"] != 0} {
+                } else {
                     puts stdout "GISDBASE='$database';"
                     puts stdout "LOCATION_NAME='$location';"
                     puts stdout "MAPSET='$mapset';"
@@ -647,12 +652,11 @@
 				0 OK;
 			set mapset ""
             } else {
-                if {[file exists "$database/$location/$mapset/WIND"] == 0} {
+                if {[CheckMapset] == 0} {
                     DialogGen .wrnDlg [G_msg "WARNING: invalid mapset"] warning \
                     [format [G_msg "Warning: <%%s> is not a valid mapset"] $mapset] \
                     0 OK;
-                }
-                if { $mapset != "" && [file exists "$database/$location/$mapset/WIND"] != 0} {
+                } else {
                     puts stdout "GISDBASE='$database';"
                     puts stdout "LOCATION_NAME='$location';"
                     puts stdout "MAPSET='$mapset';"



More information about the grass-commit mailing list