/[ascend]/trunk/tcltk/tk/UtilProc.tcl
ViewVC logotype

Diff of /trunk/tcltk/tk/UtilProc.tcl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2034 by jpye, Wed Apr 29 06:20:28 2009 UTC revision 2035 by ballan, Mon May 18 15:01:21 2009 UTC
# Line 269  proc Util_do_OK {} { Line 269  proc Util_do_OK {} {
269  # Reads in settings from ~/ascdata/ascend-config if that is available.  # Reads in settings from ~/ascdata/ascend-config if that is available.
270  #------------------------------------------------------------------------  #------------------------------------------------------------------------
271  proc Util_do_Read {} {  proc Util_do_Read {} {
272    global env    global env ascOrgEnv
273    set configread 0    set configread 0
274    
275    if {!$configread && [file exists ~/ascdata/ascend-config] &&    if {!$configread && [file exists ~/ascdata/ascend-config] &&
# Line 291  proc Util_do_Read {} { Line 291  proc Util_do_Read {} {
291  # save ~/ascdata/ascend-config. overwrite whatever there.  # save ~/ascdata/ascend-config. overwrite whatever there.
292  #------------------------------------------------------------------------  #------------------------------------------------------------------------
293  proc Util_do_Save {} {  proc Util_do_Save {} {
294    global ascUtilVect ascGlobalVect    global ascUtilVect ascGlobalVect ascOrgEnv
295    
296    if {$ascGlobalVect(saveoptions) == 0} {    if {$ascGlobalVect(saveoptions) == 0} {
297      puts stdout "cannot write ascend configure file"      puts stdout "cannot write ascend configure file"
# Line 315  proc Util_do_Save {} { Line 315  proc Util_do_Save {} {
315    foreach s $subs {    foreach s $subs {
316      set varname [Util_Get_Var $s]      set varname [Util_Get_Var $s]
317      set aname [lindex [split $varname (] 0]      set aname [lindex [split $varname (] 0]
318        set aindex [lindex [split $varname "()"] 1]
319      global $varname      global $varname
320  # we don't save environment vars  # we save environment vars unconditionally now; they ar be ignored on read if set by user
321    # or wrapper script.
322      if {[string range $varname 0 2] !="env"} {      if {[string range $varname 0 2] !="env"} {
323        puts $conffile "  global $aname"        puts $conffile "  global $aname"
324        puts $conffile "  set $varname {[.util.box.main_frm.val_frm.$s get]}"        puts $conffile "  set $varname {[.util.box.main_frm.val_frm.$s get]}"
325        } else {
326          puts $conffile "  global $aname ascOrgEnv"
327          puts $conffile "  if {\[info exists ascOrgEnv($aindex)\] && \$ascOrgEnv($aindex) != \"\"} {"
328          puts $conffile "    puts \"Ignoring ascend-config value of $varname in favor of environment.\""
329          puts $conffile "  } else {"
330          puts $conffile "    puts \"Setting $varname from ascend-config.\""
331          puts $conffile "    set $varname {[.util.box.main_frm.val_frm.$s get]}"
332          puts $conffile "  }"
333      }      }
334    }    }
335    close $conffile    close $conffile

Legend:
Removed from v.2034  
changed lines
  Added in v.2035

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22