From 2da1ef6b812753564c7f8d9455f963b928121edc Mon Sep 17 00:00:00 2001 From: miljenko Date: Thu, 8 Dec 2005 10:24:27 +0000 Subject: [PATCH] Shell selection for remote execution. Active remote host selection. Bug found by: Submitted by: Requested by: Reviewed by: Approved by: Obtained from: --- editor.tcl | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/editor.tcl b/editor.tcl index 4113227..11281d2 100755 --- a/editor.tcl +++ b/editor.tcl @@ -801,7 +801,7 @@ proc spawnShell { node cmd } { set node_id $eid\_$node if { $remote_exec } { - nexec vimageShellServer.sh $node_id 1234 & + nexec vimageShellServer.sh $node_id 1234 $cmd & if { $gui_unix } { exec xterm -sb -rightbar \ -T "IMUNES: [getNodeName $node] (console)" \ @@ -2160,9 +2160,9 @@ proc toolOptions {} { proc configRemoteHosts {} { global exec_hosts - global exec_host exec_port monitor_port remote_exec - global old_remote_exec - global editor_only + global remote_exec old_remote_exec editor_only + global active_host + set old_remote_exec $remote_exec if { $remote_exec } { @@ -2203,6 +2203,8 @@ proc configRemoteHosts {} { label $wi.hosts.ports.label -text "Port" -anchor w frame $wi.hosts.monitors -borderwidth 2 label $wi.hosts.monitors.label -text "Monitor port" -anchor w + frame $wi.hosts.active -borderwidth 2 + label $wi.hosts.active.label -text "Active" -anchor w set i 0 foreach host_elem $exec_hosts { @@ -2221,10 +2223,13 @@ proc configRemoteHosts {} { -validate focus -invcmd "focusAndFlash" $wi.hosts.monitors.v$i insert 0 [lindex $host_elem 2] + eval checkbutton $wi.hosts.active.v$i \ + -variable active_host($i) -onvalue true -offvalue false + incr i } - foreach j [list labels address ports monitors] { + foreach j [list labels address ports monitors active] { eval pack $wi.hosts.$j.label -side top -padx 4 -pady 2 -fill x set n [llength $exec_hosts] for {set i 0} {$i < $n} {incr i} { @@ -2232,7 +2237,7 @@ proc configRemoteHosts {} { } } pack $wi.hosts.labels $wi.hosts.address $wi.hosts.ports \ - $wi.hosts.monitors -side left -fill x + $wi.hosts.monitors $wi.hosts.active -side left -fill x pack $wi.select $wi.hosts -side top -fill x -padx 4 frame $wi.butt -borderwidth 4 @@ -2251,21 +2256,28 @@ proc configRemoteHosts {} { } ;# Apply and Cancel explicitly destroy $wi vwait forever - ;# return } proc configRemoteHostsApply { wi } { global exec_hosts + global active_host + global remote_exec editor_only set n [llength $exec_hosts] set exec_hosts [] + set at_least_one_up false for {set i 0} {$i < $n} {incr i} { set ent [list [$wi.hosts.address.v$i get] \ [$wi.hosts.ports.v$i get] \ [$wi.hosts.monitors.v$i get]\ - ] + $active_host($i) ] lappend exec_hosts $ent + if { $active_host($i) } { set at_least_one_up true } + } + if { $remote_exec && ! $at_least_one_up } { + set editor_only true + .menubar.experiment entryconfigure "Execute" -state disabled } destroy $wi } -- 2.39.5