ProcessMonitor.st
changeset 817 a2c25d3e8186
parent 775 f741dc4afe19
child 979 c1e318bee326
--- a/ProcessMonitor.st	Mon Oct 28 14:52:20 1996 +0100
+++ b/ProcessMonitor.st	Mon Oct 28 21:13:31 1996 +0100
@@ -520,7 +520,7 @@
 !
 
 processMenu
-    |labels selectors m|
+    |labels selectors m sel allRestartable|
 
     device ctrlDown ifTrue:[
         labels := resources array:#(
@@ -540,6 +540,7 @@
                              'abort'
                              'terminate'
                              'terminate group'
+                             'restart'
                              '-'  
                              'raise prio'  
                              'lower prio'  
@@ -554,6 +555,7 @@
                              abortProcess
                              terminateProcess
                              terminateProcessGroup
+                             restartProcess
                              nil  
                              raisePrio
                              lowerPrio
@@ -567,6 +569,35 @@
     m := PopUpMenu labels:labels
                    selectors:selectors.
 
+
+    (sel := listView selection) isNil ifTrue:[
+        m disableAll:#(
+                             inspectProcess  
+                             debugProcess  
+                             nil  
+                             resumeProcess  
+                             suspendProcess  
+                             stopProcess  
+                             restartProcess
+                             abortProcess
+                             terminateProcess
+                             terminateProcessGroup
+                             nil  
+                             raisePrio
+                             lowerPrio
+                      )
+    ] ifFalse:[
+        allRestartable := true.
+        self selectedProcessesDo:[:p |
+            p isRestartable ifFalse:[
+                allRestartable := false
+            ].
+        ].
+        allRestartable ifFalse:[
+            m disable:#restartProcess
+        ].
+    ].
+
     m checkToggleAt:#detail put:showDetail.
     ^ m
 !
@@ -579,6 +610,14 @@
     ]
 !
 
+restartProcess
+    "abort (raise AbortSignal in) the selected process"
+
+    self selectedProcessesDo:[:p |
+        p restart.
+    ]
+!
+
 resumeProcess
     "resume the selected process (i.e. let it run) "
 
@@ -604,7 +643,7 @@
 !
 
 terminateProcessGroup
-    "terminate the selected process"
+    "terminate the selected process with all of its subprocesses"
 
     self selectedProcessesSend:#terminateGroup
 ! !
@@ -657,4 +696,4 @@
 !ProcessMonitor class methodsFor:'documentation'!
 
 version
-^ '$Header: /cvs/stx/stx/libtool/ProcessMonitor.st,v 1.42 1996-10-18 12:37:51 cg Exp $'! !
+^ '$Header: /cvs/stx/stx/libtool/ProcessMonitor.st,v 1.43 1996-10-28 20:13:31 cg Exp $'! !