if { ! $remote_exec } { return }
- set exec_host [lindex [lindex $exec_hosts 0] 0]
- set exec_port [lindex [lindex $exec_hosts 0] 1]
- set monitor_port [lindex [lindex $exec_hosts 0] 2]
+ set remote_exec false
+ set n [llength $exec_hosts]
+ for { set i 0 } { $i < $n } { incr i } {
+ if { [lindex [lindex $exec_hosts $i] 3] } {
+ set exec_host [lindex [lindex $exec_hosts $i] 0]
+ set exec_port [lindex [lindex $exec_hosts $i] 1]
+ set monitor_port [lindex [lindex $exec_hosts $i] 2]
+ set remote_exec true
+ break
+ }
+ }
+ if { ! $remote_exec } { return }
set exec_sock [socket -async $exec_host $exec_port]
set monitor_sock [socket -async $exec_host $monitor_port]
"" 0 "Retry" "Configure remote hosts" "Editor only mode" ]
switch $sel {
1 { configRemoteHosts
- set exec_host [lindex [lindex $exec_hosts 0] 0]
- set exec_port [lindex [lindex $exec_hosts 0] 1]
- set monitor_port [lindex [lindex $exec_hosts 0] 2]
- set exec_sock [socket -async $exec_host $exec_port]
- set monitor_sock [socket -async $exec_host $monitor_port] }
+ set at_least_one_up false
+ set n [llength $exec_hosts]
+ for { set i 0 } { $i < $n } { incr i } {
+ if { [lindex [lindex $exec_hosts $i] 3] } {
+ set exec_host [lindex [lindex $exec_hosts $i] 0]
+ set exec_port [lindex [lindex $exec_hosts $i] 1]
+ set monitor_port [lindex [lindex $exec_hosts $i] 2]
+ set at_least_one_up true
+ break
+ }
+ }
+ if { $remote_exec && ! $at_least_one_up } {
+ set editor_only true
+ .menubat.experiment entryconfigure \
+ "Execute" -state disabled
+ } else {
+ set exec_sock
+ [socket -async $exec_host $exec_port]
+ set monitor_sock
+ [socket -async $exec_host $monitor_port]
+ }
+ }
+
2 { set editor_only true; set fail false; return }
default { }
}