allow task modifications in Process Monitor can be disabled now
authorpenk
Mon, 03 Mar 2003 14:47:03 +0100
changeset 4649 37f55d741468
parent 4648 f36ffc19982c
child 4650 c358bcfef403
allow task modifications in Process Monitor can be disabled now
ProcessMonitorV2.st
--- a/ProcessMonitorV2.st	Mon Mar 03 11:23:54 2003 +0100
+++ b/ProcessMonitorV2.st	Mon Mar 03 14:47:03 2003 +0100
@@ -9,7 +9,7 @@
 		enableDecreaseListDelayTime enableDecreaseContentsDelayTime
 		enableIncreaseListDelayTime enableIncreaseContentsDelayTime
 		listUpdateDelay updateDelay updateBlock listUpdateBlock
-		updateProcess visibleBlock'
+		updateProcess visibleBlock allowModifications tableMenu'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Monitors-ST/X'
@@ -52,6 +52,13 @@
 
                                                                 [exEnd]
 
+  Starting the application withot any possibilities to change
+  the processes
+                                                                [exBegin]
+    ProcessMonitorV2 openAllowNoModifications
+
+                                                                [exEnd]
+
   more examples to be added:
                                                                 [exBegin]
     ... add code fragment for 
@@ -64,6 +71,18 @@
     "Created: / 14.1.2003 / 11:16:10 / penk"
 ! !
 
+!ProcessMonitorV2 class methodsFor:'instance creation'!
+
+openAllowNoModifications
+
+
+    |application|
+
+    application := self new.
+    application open.
+    application allowModifications value:false.
+! !
+
 !ProcessMonitorV2 class methodsFor:'defaults'!
 
 defaultIcon
@@ -581,7 +600,7 @@
           #name: 'ProcessMonitorV2'
           #min: #(#Point 10 10)
           #max: #(#Point 1024 768)
-          #bounds: #(#Rectangle 12 22 803 380)
+          #bounds: #(#Rectangle 16 45 807 403)
           #menu: #mainMenu
         )
         #component: 
@@ -594,7 +613,7 @@
               #textDefault: true
             )
            #(#DataSetSpec
-              #name: 'Process Table'
+              #name: 'ProcessTable'
               #layout: #(#LayoutFrame 0 0.0 32 0.0 0 1.0 -23 1)
               #model: #selectedProcesses
               #menu: #tableMenu
@@ -730,6 +749,7 @@
          #(#MenuItem
             #label: 'Process'
             #translateLabel: true
+            #isVisible: #allowModifications
             #submenuChannel: #tableMenu
           )
          #(#MenuItem
@@ -896,6 +916,7 @@
             #itemValue: #inspectSelection
             #translateLabel: true
             #isButton: true
+            #isVisible: #allowModifications
             #labelImage: #(#ResourceRetriever #ProcessMonitorV2 #processInspect22x22Icon)
           )
          #(#MenuItem
@@ -905,10 +926,12 @@
             #itemValue: #debugProcess
             #translateLabel: true
             #isButton: true
+            #isVisible: #allowModifications
             #labelImage: #(#ResourceRetriever #ProcessMonitorV2 #processDebug22x22Icon)
           )
          #(#MenuItem
             #label: ''
+            #isVisible: #allowModifications
           )
          #(#MenuItem
             #activeHelpKey: #Resume
@@ -917,6 +940,7 @@
             #itemValue: #resumeProcess
             #translateLabel: true
             #isButton: true
+            #isVisible: #allowModifications
             #labelImage: #(#ResourceRetriever #ProcessMonitorV2 #processResume22x22Icon)
           )
          #(#MenuItem
@@ -926,6 +950,7 @@
             #itemValue: #suspendProcess
             #translateLabel: true
             #isButton: true
+            #isVisible: #allowModifications
             #labelImage: #(#ResourceRetriever #ProcessMonitorV2 #processSuspend22x22Icon)
           )
          #(#MenuItem
@@ -935,10 +960,12 @@
             #itemValue: #stopProcess
             #translateLabel: true
             #isButton: true
+            #isVisible: #allowModifications
             #labelImage: #(#ResourceRetriever #ProcessMonitorV2 #processStop22x22Icon)
           )
          #(#MenuItem
             #label: ''
+            #isVisible: #allowModifications
           )
          #(#MenuItem
             #activeHelpKey: #Terminate
@@ -947,6 +974,7 @@
             #itemValue: #terminateProcess
             #translateLabel: true
             #isButton: true
+            #isVisible: #allowModifications
             #labelImage: #(#ResourceRetriever #ProcessMonitorV2 #processTerminate22x22Icon)
           )
          #(#MenuItem
@@ -956,6 +984,7 @@
             #itemValue: #terminateProcessGroup
             #translateLabel: true
             #isButton: true
+            #isVisible: #allowModifications
             #labelImage: #(#ResourceRetriever #ProcessMonitorV2 #processTerminateGroup22x22Icon)
           )
          #(#MenuItem
@@ -965,10 +994,12 @@
             #itemValue: #restartProcess
             #translateLabel: true
             #isButton: true
+            #isVisible: #allowModifications
             #labelImage: #(#ResourceRetriever #ProcessMonitorV2 #processRestart22x22Icon)
           )
          #(#MenuItem
             #label: ''
+            #isVisible: #allowModifications
           )
          #(#MenuItem
             #activeHelpKey: #'Raise Prio'
@@ -977,6 +1008,7 @@
             #itemValue: #raisePrio
             #translateLabel: true
             #isButton: true
+            #isVisible: #allowModifications
             #labelImage: #(#ResourceRetriever #ProcessMonitorV2 #processRaisePrio22x22Icon)
           )
          #(#MenuItem
@@ -986,15 +1018,17 @@
             #itemValue: #lowerPrio
             #translateLabel: true
             #isButton: true
+            #isVisible: #allowModifications
             #labelImage: #(#ResourceRetriever #ProcessMonitorV2 #processLowerPrio22x22Icon)
           )
          #(#MenuItem
             #label: ''
+            #isVisible: #allowModifications
           )
          #(#MenuItem
             #activeHelpKey: #'Update Process List'
             #label: 'Update'
-            #itemValue: #updateView
+            #itemValue: #updateList
             #translateLabel: true
             #isButton: true
             #startGroup: #right
@@ -1354,7 +1388,7 @@
     | contDelaySmallerListDelay |
 
     contDelaySmallerListDelay := (self scaledUpdateContentsDelayTime < (self scaledUpdateListDelayTime)).
-    self enableDecreaseContentsDelayTime value:((self scaledUpdateContentsDelayTime <= 0.1) not).
+    self enableDecreaseContentsDelayTime value:((self scaledUpdateContentsDelayTime <= 0.5) not).
     self enableDecreaseListDelayTime value:contDelaySmallerListDelay.
     self enableIncreaseContentsDelayTime value:contDelaySmallerListDelay.
 !
@@ -1410,6 +1444,14 @@
 
 !ProcessMonitorV2 methodsFor:'aspects'!
 
+allowModifications
+
+    allowModifications isNil ifTrue:[
+        allowModifications := true asValue
+    ].
+    ^ allowModifications
+!
+
 currentSortOrder
     "return/create the 'currentSortOrder' value holder (automatically generated)"
 
@@ -1833,6 +1875,27 @@
     super release
 ! !
 
+!ProcessMonitorV2 methodsFor:'menu accessing'!
+
+tableMenu
+
+    ^[
+        self tableMenuAccess
+    ]
+!
+
+tableMenuAccess
+
+    self allowModifications value ifTrue:[
+        tableMenu isNil ifTrue:[
+            tableMenu := Menu new fromLiteralArrayEncoding:(self class tableMenu).
+            tableMenu receiver:self.
+        ].
+        ^tableMenu
+    ].
+    ^nil
+! !
+
 !ProcessMonitorV2 methodsFor:'menu actions'!
 
 abortProcess
@@ -2809,5 +2872,5 @@
 !ProcessMonitorV2 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/ProcessMonitorV2.st,v 1.12 2003-02-20 14:28:28 penk Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/ProcessMonitorV2.st,v 1.13 2003-03-03 13:47:03 penk Exp $'
 ! !