]> git.entuzijast.net Git - imunes.git/commitdiff
Shell selection for remote execution.
authormiljenko <miljenko>
Thu, 8 Dec 2005 10:24:27 +0000 (10:24 +0000)
committermiljenko <miljenko>
Thu, 8 Dec 2005 10:24:27 +0000 (10:24 +0000)
Active remote host selection.

Bug found by:
Submitted by:
Requested by:
Reviewed by:
Approved by:
Obtained from:

editor.tcl

index 4113227fe67d51bfbee58fe904fc015df41eef50..11281d2117b99ff9347dc76fc15fa28d6b57c741 100755 (executable)
@@ -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
 }