Browse Source

Fix NVIZ parts broken by other GRASS 7 changes

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@47680 15284696-431f-4ddb-bdfa-cd5b030d7da7
Maris Nartiss 13 years ago
parent
commit
a43b917efe

+ 9 - 0
visualization/nviz/scripts/config.tcl

@@ -39,6 +39,15 @@ if {[info exists env(MSYSCON)]} {
     set mingw "0"
 }
 
+# set correct devnull 
+if {![catch {set env(OS)}] && $env(OS) == "Windows_NT"} {
+        set mingw "1"
+        set devnull "NUL:"
+} else {
+        set mingw "0"
+        set devnull "/dev/null"
+}
+
 # Set up auto_path directories
 if {[catch {set env(Nviz_PanelPath)} user_path]} then {
     set user_path [list]

+ 3 - 2
visualization/nviz/scripts/mapBrowser.tcl

@@ -34,11 +34,12 @@ proc g.gisenv {name} {
 
 proc grass_mapset_list {} {
     global src_boot
+    global devnull
 
     set list {}
     set location [grass_location]
-
-    foreach name [exec $src_boot/bin/g.mapsets -p] {
+    
+    foreach name [exec $src_boot/bin/g.mapsets -p 2> $devnull] {
 	if {[file isdir $location/$name]} {
 	    lappend list $name
 	}

+ 4 - 2
visualization/nviz/scripts/nviz2.2_script

@@ -261,8 +261,10 @@ if {$DEBUG} {puts "toplevel made"}
 		-background #FFFFFF -textvariable Nv_(text)
 	pack .bottom.entry -side left -fill both -expand yes
 
-	set cwidth [exec $src_boot/bin/g.gisenv X3D_WIDTH]
-	set cheight [exec $src_boot/bin/g.gisenv X3D_HEIGHT]
+	set cwidth {}
+	set cheight {}
+	catch { set cwidth [exec $src_boot/bin/g.gisenv X3D_WIDTH] }
+	catch { set cheight [exec $src_boot/bin/g.gisenv X3D_HEIGHT] }
 	
 	if {$cwidth > 0 && $cheight > 0} {
 		if { [catch {togl $Nv_(TOP).canvas -rgba true -double true -depth true \