set function_name ""
if {[info exists argv]} {
set function_name [lindex $argv 0]
}
package require java
proc boolean { int } {
if { $int == "0" } {
return "false"
}
return "true"
}
set client_manager [ java::call com.surpac.client.ClientManager getSharedInstance ]
if {$function_name == "TOGGLE"} {
set currValue [ $client_manager isAutoSaveConfigEnabled ]
if {$currValue} {
$client_manager setAutoSaveConfigEnabled "false"
} else {
$client_manager setAutoSaveConfigEnabled "true"
}
} else {
GuidoForm WindowsOptions {
-default_buttons
-label "Windows Options"
-tip "This form allows you to customise the windows."
-layout BoxLayout Y_AXIS
-help_id 1738
GuidoPanel main {
-layout CentreLineLayout
GuidoCheckBox auto_save {
-label "Auto save windows layout"
-tip "Automatically saves the windows layout when the application exits."
}
}
}
$auto_save setCurrentValue [ boolean [ $client_manager isAutoSaveConfigEnabled ] ]
set status ""
while { $status != "apply" && $status != "cancel" } {
$WindowsOptions interact
set status [ $WindowsOptions getStatus ]
}
if { $status == "apply" } {
$client_manager setAutoSaveConfigEnabled [ $auto_save getCurrentValue ]
}
$WindowsOptions destroy
}
