Procházet zdrojové kódy

nviz: Fix also other places where closing map choices window makes nviz to go bad. Continues https://trac.osgeo.org/grass/changeset/41205 Spotted on issue https://trac.osgeo.org/grass/ticket/852

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@41206 15284696-431f-4ddb-bdfa-cd5b030d7da7
Maris Nartiss před 15 roky
rodič
revize
5a4769c678

+ 1 - 1
visualization/nviz/scripts/attIsosurfPopup.tcl

@@ -250,7 +250,7 @@ proc aip_get_rasterfile {att} {
     global attIsoPopup_Status attIsoPopup_Type
 
     set new [create_map_browser .browse_rast_file vol 1]
-    if { $new == "-1" } then { return }
+    if { $new == "-1"  || $new == "" } then { return }
 
     set attIsoPopup_Type non_constant
     set attIsoPopup_Status $new

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

@@ -263,7 +263,6 @@ proc ap_get_topofile {} {
     set new [create_map_browser .browse_topo_file surf 1]
     if { $new == "" || $new == -1 } then { return }
     
-    puts "returned from create_map_browser"
     set attPopup_Type non_constant
     set attPopup_Status $new
 }
@@ -283,7 +282,7 @@ proc ap_get_colorfile {} {
     global attPopup_Status attPopup_Type
 
     set new [create_map_browser .browse_color_file surf 1]
-    if { $new == "" } then { return }
+    if { $new == ""  || $new == -1 } then { return }
 
     set attPopup_Type non_constant
     set attPopup_Status $new
@@ -362,7 +361,7 @@ proc ap_get_rasterfile {att} {
     global attPopup_Status attPopup_Type
 
     set new [create_map_browser .browse_rast_file surf 1]
-    if { $new == "" } then { return }
+    if { $new == ""  || $new == -1 } then { return }
 
     set attPopup_Type non_constant    
     set attPopup_Status $new

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

@@ -141,6 +141,8 @@ proc create_map_browser {{w .map_browser} {type all} {mode 0}} {
     wm title $w "Map Browser"
     tkwait visibility $w
 
+    # Answer must be set to not use uninitialized variable by accident
+    set map_browser($w,Answer) -1
     #puts "BROWSER: $w TYPE: $type MODE: $mode"
 
     entry $w.filename -bd 2 -relief sunken

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

@@ -720,7 +720,7 @@ proc save_3dview { dummy } {
 	# Ask the user for a file name to save in
 	set file_name [create_map_browser .browse_3dview_file "3d.view" 1]
 
-	if {$file_name == -1} then return
+	if {$file_name == -1 || $file_name == "" } then return
 
 	Nsave_3dview $file_name
 }
@@ -730,7 +730,7 @@ proc load_3dview { dummy } {
 	# Ask the user for a file name to load from
 	set file_name [create_map_browser .browse_3dview_file "3d.view" 1]
 
-	if {$file_name == -1} then return
+	if {$file_name == -1 || $file_name == "" } then return
 
         appBusy
         # Do not redraw automaticly display while loading state...

+ 1 - 1
visualization/nviz/scripts/panel_vect.tcl

@@ -333,7 +333,7 @@ proc add_map {type} {
     # Let user know that we are busy
     appBusy
 
-    if {$new != "-1"} {
+    if { $new != "" && $new != "-1" } {
 	set temp [Nnew_map_obj $type]
 	$temp set_att map $new
 	set_new_curr $type [string range $temp 5 end]

+ 1 - 1
visualization/nviz/scripts/panel_vol.tcl

@@ -356,7 +356,7 @@ proc new_vol {} {
     # Let user know that we are busy
     appBusy
 
-    if {$new != "-1"} {
+    if { $new != "-1" && $new != "" } {
         set temp [Nnew_map_obj vol]
         $temp set_att map $new