[GRASS-SVN] r31332 - grass/branches/develbranch_6/gui/tcltk/gis.m

svn_grass at osgeo.org svn_grass at osgeo.org
Tue May 13 08:35:57 EDT 2008


Author: marisn
Date: 2008-05-13 08:35:57 -0400 (Tue, 13 May 2008)
New Revision: 31332

Modified:
   grass/branches/develbranch_6/gui/tcltk/gis.m/gm.tcl
   grass/branches/develbranch_6/gui/tcltk/gis.m/gmlib.tcl
   grass/branches/develbranch_6/gui/tcltk/gis.m/mapcanvas.tcl
Log:
Fix gis.m startup error messages and make g.gisenv errors fatal

Modified: grass/branches/develbranch_6/gui/tcltk/gis.m/gm.tcl
===================================================================
--- grass/branches/develbranch_6/gui/tcltk/gis.m/gm.tcl	2008-05-13 12:16:21 UTC (rev 31331)
+++ grass/branches/develbranch_6/gui/tcltk/gis.m/gm.tcl	2008-05-13 12:35:57 UTC (rev 31332)
@@ -31,27 +31,43 @@
 # path to GIS Manager files
 set gmpath $env(GISBASE)/etc/gm
 
+# Load GUI stuff required for error reporting etc.
+source $env(GISBASE)/etc/gui.tcl
+
 # Load common procedure library
 source $gmpath/gmlib.tcl
 
+# gisenv errors are fatal. 
 if {[catch {set env(GISDBASE) [exec g.gisenv get=GISDBASE]} error]} {
-	Gm::errmsg $error
+	GmLib::errmsg $error
+	puts $error
+	exit 1
 }
 if {[catch {set env(LOCATION_NAME) [exec g.gisenv get=LOCATION_NAME]} error]} {
-	Gm::errmsg $error
+	GmLib::errmsg $error
+	puts $error
+	exit 1
 }
 if {[catch {set env(MAPSET) [exec g.gisenv get=MAPSET]} error]} {
-	Gm::errmsg $error
+	GmLib::errmsg $error
+	puts $error
+	exit 1
 }
 
 if {[catch {set gisdbase [exec g.gisenv get=GISDBASE]} error]} {
-	Gm::errmsg $error
+	GmLib::errmsg $error
+	puts $error
+	exit 1
 }
 if {[catch {set location_name [exec g.gisenv get=LOCATION_NAME]} error]} {
-	Gm::errmsg $error
+	GmLib::errmsg $error
+	puts $error
+	exit 1
 }
 if {[catch {set mapset [exec g.gisenv get=MAPSET]} error]} {
-	Gm::errmsg $error
+	GmLib::errmsg $error
+	puts $error
+	exit 1
 }
 
 
@@ -104,11 +120,11 @@
 set GRASSVERSION [read -nonewline $fp]
 
 if {[catch {close $fp} error]} {
-	Gm::errmsg $error
+	GmLib::errmsg $error
 }
 
 
-source $env(GISBASE)/etc/gui.tcl
+#source $env(GISBASE)/etc/gui.tcl
 # gui.tcl also sources these:
 # $env(GISBASE)/etc/gtcltk/gmsg.tcl
 # $env(GISBASE)/etc/gtcltk/options.tcl
@@ -378,7 +394,7 @@
     wm title .dispfont [G_msg "Select GRASS display font"]
     
     if {[catch {set fontlist [exec d.font --q -l]} error]} {
-	    Gm::errmsg $error "d.font error"
+	    GmLib::errmsg $error "d.font error"
     }
     set fontlist [string trim $fontlist]
     set fontlist [split $fontlist "\n"]

Modified: grass/branches/develbranch_6/gui/tcltk/gis.m/gmlib.tcl
===================================================================
--- grass/branches/develbranch_6/gui/tcltk/gis.m/gmlib.tcl	2008-05-13 12:16:21 UTC (rev 31331)
+++ grass/branches/develbranch_6/gui/tcltk/gis.m/gmlib.tcl	2008-05-13 12:35:57 UTC (rev 31332)
@@ -129,6 +129,10 @@
 	
 	set message ""
 	
+	if { [winfo exists .intro]} {
+		destroy .intro
+	}
+	
 	if { $args != ""} { 
 	    set message [join $args]
 	    append message ": " 

Modified: grass/branches/develbranch_6/gui/tcltk/gis.m/mapcanvas.tcl
===================================================================
--- grass/branches/develbranch_6/gui/tcltk/gis.m/mapcanvas.tcl	2008-05-13 12:16:21 UTC (rev 31331)
+++ grass/branches/develbranch_6/gui/tcltk/gis.m/mapcanvas.tcl	2008-05-13 12:35:57 UTC (rev 31332)
@@ -1161,6 +1161,7 @@
 
 	} else {
 		puts $input
+		exit 1
 	}
 }
 



More information about the grass-commit mailing list