1 2pack .header -side top -padx 10 -pady 10 -expand on 3pack .f0 -side top -padx 15 -pady 10 -fill y -expand on 4 5# 6# Misc buttons to save/restore state and so forth. 7# 8frame .f0_bot 9frame .f0_bot.r 10frame .f0_bot.l 11 12# 13# Read the user's settings from .config. These will override whatever is 14# in config.in. Don't do this if the user specified a -D to force 15# the defaults. 16# 17if { [file readable .config] == 1} then { 18 if { $argc > 0 } then { 19 if { [lindex $argv 0] != "-D" } then { 20 read_config .config 21 } 22 else 23 { 24 read_config $defaults 25 } 26 } else { 27 read_config .config 28 } 29} else { 30 read_config $defaults 31} 32 33update_mainmenu .f0 34 35button .f0_bot.r.save -text "Save and Exit" -width 25 -command { 36 writeconfig .config include/linux/autoconf.h; wrapup .wrap } 37 38button .f0_bot.r.quit -text "Quit Without Saving" -width 25 \ 39 -command { maybe_exit .maybe } 40 41button .f0_bot.l.store -text "Store Configuration to File" -width 25 -command { 42 load_configfile .load "Save Configuration in file" write_config_file 43} 44 45button .f0_bot.l.load -text "Load Configuration from File" -width 25 -command { 46 load_configfile .load "Load Configuration from file" read_config_file 47} 48 49pack .f0_bot.r.save .f0_bot.r.quit -padx 25 -ipadx 10 -ipady 2 -expand on 50pack .f0_bot.l.load .f0_bot.l.store -padx 25 -ipadx 10 -ipady 2 -expand on 51 52pack .f0_bot.r -side left -padx 15 -pady 10 -expand on -fill y 53pack .f0_bot.l -side right -padx 15 -pady 10 -expand on -fill y 54 55pack .f0_bot -fill both -expand on 56 57# 58# If we cannot write our config files, disable the write button. 59# 60if { [file exists .config] == 1 } then { 61 if { [file writable .config] == 0 } then { 62 .f0_bot.r.save configure -state disabled 63 } 64 } else { 65 if { [file writable .] == 0 } then { 66 .f0_bot.r.save configure -state disabled 67 } 68 } 69 70if { [file exists include/linux/autoconf.h] == 1 } then { 71 if { [file writable include/linux/autoconf.h] == 0 } then { 72 .f0_bot.r.save configure -state disabled 73 } 74 } else { 75 if { [file writable include/linux/] == 0 } then { 76 .f0_bot.r.save configure -state disabled 77 } 78 } 79

