The Trunk: Tools-mt.917.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Tools-mt.917.mcz

commits-2
Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.917.mcz

==================== Summary ====================

Name: Tools-mt.917
Author: mt
Time: 22 November 2019, 2:11:23.895303 pm
UUID: 7a9645dc-bdfb-f949-b322-05f1162c7f9a
Ancestors: Tools-ct.916, Tools-ct.902, Tools-ct.904

Merges Tools-ct.916, Tools-ct.902, Tools-ct.904.

Changes #handleWarning: text to a different style and to use the new #suppressWarnings interface in Warning.

=============== Diff against Tools-ct.916 ===============

Item was changed:
  ----- Method: Inspector class>>openOn: (in category 'instance creation') -----
  openOn: anObject
  "Create and schedule an instance of me on the model, anInspector. "
 
+ ^ self openOn: anObject withLabel: anObject defaultLabelForInspector!
- ^ self openOn: anObject withEvalPane: true!

Item was removed:
- ----- Method: Inspector class>>openOn:withEvalPane: (in category 'instance creation') -----
- openOn: anObject withEvalPane: withEval
- "Create and schedule an instance of me on the model, anInspector. "
-
- ^ self openOn: anObject withEvalPane: withEval withLabel: anObject defaultLabelForInspector!

Item was removed:
- ----- Method: Inspector class>>openOn:withEvalPane:withLabel: (in category 'instance creation') -----
- openOn: anObject withEvalPane: withEval withLabel: label
-         ^ToolBuilder open: (self inspect: anObject) label: label!

Item was added:
+ ----- Method: Inspector class>>openOn:withLabel: (in category 'instance creation') -----
+ openOn: anObject withLabel: label
+
+ ^ ToolBuilder open: (self inspect: anObject) label: label!

Item was changed:
  ----- Method: ProcessBrowser>>browseContext (in category 'stack list') -----
  browseContext
+ ToolSet browseMethod: selectedContext method!
- selectedContext
- ifNil: [^ self].
- ToolSet browse: self selectedClass selector: self selectedSelector!

Item was changed:
  ----- Method: ProcessBrowser>>changePriority (in category 'process actions') -----
  changePriority
  | str newPriority nameAndRules |
- selectedProcess ifNil: [^ self].
  nameAndRules := self nameAndRulesForSelectedProcess.
  nameAndRules third
  ifFalse: [self inform: 'Nope, won''t change priority of ' , nameAndRules first.
  ^ self].
  str := UIManager default
  request: 'New priority'
   initialAnswer: selectedProcess priority asString.
  newPriority := str asNumber asInteger.
  newPriority
  ifNil: [^ self].
  (newPriority < 1
  or: [newPriority > Processor highestPriority])
  ifTrue: [self inform: 'Bad priority'.
  ^ self].
  self class setProcess: selectedProcess toPriority: newPriority.
  self updateProcessList!

Item was changed:
  ----- Method: ProcessBrowser>>chasePointers (in category 'process actions') -----
  chasePointers
  | saved |
- selectedProcess ifNil: [^ self].
  saved := selectedProcess.
  [selectedProcess := nil.
  (Smalltalk includesKey: #PointerFinder)
  ifTrue: [PointerFinder on: saved]
  ifFalse: [self inspectPointers]]
  ensure: [selectedProcess := saved]!

Item was changed:
  ----- Method: ProcessBrowser>>debugProcess (in category 'process actions') -----
  debugProcess
  | nameAndRules |
- selectedProcess ifNil: [^ self].
  nameAndRules := self nameAndRulesForSelectedProcess.
  nameAndRules third
  ifFalse: [self inform: 'Nope, won''t debug ' , nameAndRules first.
  ^ self].
  self class debugProcess: selectedProcess.!

Item was changed:
  ----- Method: ProcessBrowser>>exploreContext (in category 'stack list') -----
  exploreContext
+ selectedContext explore!
- selectedContext ifNotNil: #explore!

Item was changed:
  ----- Method: ProcessBrowser>>exploreProcess (in category 'process list') -----
  exploreProcess
+ selectedProcess explore!
- selectedProcess ifNotNil: #explore!

Item was changed:
  ----- Method: ProcessBrowser>>exploreReceiver (in category 'stack list') -----
  exploreReceiver
+ selectedContext receiver explore!
- selectedContext ifNotNil: [
- selectedContext receiver explore]!

Item was changed:
  ----- Method: ProcessBrowser>>inspectContext (in category 'stack list') -----
  inspectContext
+ selectedContext inspect!
- selectedContext ifNotNil: #inspect!

Item was changed:
  ----- Method: ProcessBrowser>>inspectPointers (in category 'process actions') -----
  inspectPointers
  | tc pointers |
- selectedProcess ifNil: [^ self].
  tc := thisContext.
  pointers := PointerFinder
  pointersTo: selectedProcess
  except: {
  self processList.
  tc.
  self}.
  pointers isEmpty ifTrue: [^ self].
  OrderedCollectionInspector
  openOn: pointers
- withEvalPane: false
  withLabel: 'Objects pointing to ' , selectedProcess browserPrintString!

Item was changed:
  ----- Method: ProcessBrowser>>inspectProcess (in category 'process list') -----
  inspectProcess
+ selectedProcess inspect!
- selectedProcess ifNotNil: #inspect!

Item was changed:
  ----- Method: ProcessBrowser>>inspectReceiver (in category 'stack list') -----
  inspectReceiver
+ selectedContext receiver inspect!
- selectedContext ifNotNil: [
- selectedContext receiver inspect]!

Item was changed:
  ----- Method: ProcessBrowser>>messageTally (in category 'stack list') -----
  messageTally
  | secString secs |
- selectedProcess ifNil: [^ self].
  secString := UIManager default request: 'Profile for how many seconds?' initialAnswer: '4'.
  secString isEmptyOrNil ifTrue: [^ self].
  secs := secString asNumber asInteger.
  (secs isNil or: [secs isZero])
  ifTrue: [^ self].
  [ TimeProfileBrowser spyOnProcess: selectedProcess forMilliseconds: secs * 1000 ] forkAt: selectedProcess priority + 1.!

Item was changed:
  ----- Method: ProcessBrowser>>processListKey:from: (in category 'process list') -----
+ processListKey: aKey from: aView
+
+ aKey
+ caseOf: {
+ [$f] -> [^ self findContext].
+ [$g] -> [^ self nextContext].
+ [$a] -> [^ self toggleAutoUpdate].
+ [$u] -> [^ self updateProcessList] }
+ otherwise: [].
+ selectedProcess ifNil: [^ self changed: #flash].
+ ^ aKey
+ caseOf: {
+ [$i] -> [self inspectProcess].
+ [$I] -> [self exploreProcess].
+ [$c] -> [self chasePointers].
+ [$P] -> [self inspectPointers].
+ [$t] -> [self terminateProcess].
+ [$r] -> [self resumeProcess].
+ [$s] -> [self suspendProcess].
+ [$d] -> [self debugProcess].
+ [$p] -> [self changePriority].
+ [$m] -> [self messageTally].
+ [$S] -> [self signalSemaphore].
+ [$k] -> [self moreStack]}
+ otherwise: [self arrowKey: aKey from: aView]!
- processListKey: aKey from: aView
- ^ aKey caseOf: {
- [$i] -> [self inspectProcess].
- [$I] -> [self exploreProcess].
- [$c] -> [self chasePointers].
- [$P] -> [self inspectPointers].
- [$t] -> [self terminateProcess].
- [$r] -> [self resumeProcess].
- [$s] -> [self suspendProcess].
- [$d] -> [self debugProcess].
- [$p] -> [self changePriority].
- [$m] -> [self messageTally].
- [$f] -> [self findContext].
- [$g] -> [self nextContext].
- [$a] -> [self toggleAutoUpdate].
- [$u] -> [self updateProcessList].
- [$S] -> [self signalSemaphore].
- [$k] -> [self moreStack]}
- otherwise: [self arrowKey: aKey from: aView]!

Item was changed:
  ----- Method: ProcessBrowser>>resumeProcess (in category 'process actions') -----
  resumeProcess
- selectedProcess ifNil: [^ self].
  self class resumeProcess: selectedProcess.
  self updateProcessList!

Item was changed:
  ----- Method: ProcessBrowser>>signalSemaphore (in category 'process actions') -----
  signalSemaphore
- selectedProcess ifNil: [^ self].
  (selectedProcess suspendingList isKindOf: Semaphore)
  ifFalse: [^ self].
  [selectedProcess suspendingList signal] fork.
  (Delay forMilliseconds: 300) wait.
  "Hate to make the UI wait, but it's convenient..."
  self updateProcessList!

Item was changed:
  ----- Method: ProcessBrowser>>stackListKey:from: (in category 'views') -----
+ stackListKey: aKey from: aView
+
+ selectedContext ifNil: [^ self changed: #flash].
+ ^ aKey
+ caseOf: {
+ [$c] -> [self inspectContext].
+ [$C] -> [self exploreContext].
+ [$i] -> [self inspectReceiver].
+ [$I] -> [self exploreReceiver].
+ [$b] -> [self browseContext]}
+ otherwise: [self arrowKey: aKey from: aView]!
- stackListKey: aKey from: aView
- ^ aKey caseOf: {
- [$c] -> [self inspectContext].
- [$C] -> [self exploreContext].
- [$i] -> [self inspectReceiver].
- [$I] -> [self exploreReceiver].
- [$b] -> [self browseContext]}
- otherwise: [self arrowKey: aKey from: aView]!

Item was changed:
  ----- Method: ProcessBrowser>>suspendProcess (in category 'process actions') -----
  suspendProcess
  | nameAndRules |
- selectedProcess ifNil: [^ self].
  selectedProcess isSuspended
  ifTrue: [^ self].
  nameAndRules := self nameAndRulesForSelectedProcess.
  nameAndRules second
  ifFalse: [self inform: 'Nope, won''t suspend ' , nameAndRules first.
  ^ self].
  self class suspendProcess: selectedProcess.
  self updateProcessList!

Item was changed:
  ----- Method: ProcessBrowser>>terminateProcess (in category 'process actions') -----
  terminateProcess
  | nameAndRules |
- selectedProcess ifNil: [^ self].
  nameAndRules := self nameAndRulesForSelectedProcess.
  nameAndRules second
  ifFalse: [self inform: 'Nope, won''t kill ' , nameAndRules first.
  ^ self].
  self class terminateProcess: selectedProcess.
  self updateProcessList!

Item was changed:
  ----- Method: StandardToolSet class>>handleWarning: (in category 'debugging - handlers') -----
  handleWarning: aWarning
  "Double dispatch. Let the active process take care of that warning, which usually calls back here to #debugProcess:..."
 
+ | message |
+ message := '{1}\\{2}' withCRs asText format: {
+ "First, show the actual text of this warning."
+ aWarning messageText.
+ "Second, append some helpful information that apply to all kinds of warnings."
+ ('{1} {2}' asText format: {
+ 'Select "Proceed" to continue or close this window to cancel the operation.' translated.
+ 'If you do not want to be interrupted anymore, you can {1} this kind of warning. You can also {2}, which resets such warnings on the next image startup.' translated asText format: {
+ "Provide clickable text links so that the user can directly suppress warnings."
+ 'always suppress' asText
+ addAttribute: (PluggableTextAttribute evalBlock: [
+ aWarning class suppressWarnings.
+ self inform: ('All ''{1}'' warnings will be suppressed.' translated format: {aWarning class name})]).
+ 'suppress temporarily' asText
+ addAttribute: (PluggableTextAttribute evalBlock: [
+ aWarning class suppressAndResetOnStartUp.
+ self inform: ('All ''{1}'' warnings will be suppressed\and reset on the next image startup.' withCRs translated format: {aWarning class name})])}.
+ }) addAttribute: (
+ "Show this helpful information in a smaller font."
+ TextFontReference toFont: Preferences standardButtonFont)}.
+
  ^ Processor activeProcess
  debug: aWarning signalerContext
  title: 'Warning' translated
  full: false
+ contents: message!
- contents: aWarning messageText , '\\Select Proceed to continue, or close this window to cancel the operation.' withCRs translated!

Item was changed:
  ----- Method: StandardToolSet class>>inspect:label: (in category 'inspecting') -----
  inspect: anObject label: aString
  "Open an inspector on the given object. The tool set must know which inspector type to use for which object - the object cannot possibly know what kind of inspectors the toolset provides."
+ ^ anObject inspectorClass openOn: anObject withLabel: aString!
- ^ anObject inspectorClass openOn: anObject withEvalPane: true withLabel: aString!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-mt.917.mcz

marcel.taeumel

Am 22.11.2019 14:11:37 schrieb [hidden email] <[hidden email]>:

Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.917.mcz

==================== Summary ====================

Name: Tools-mt.917
Author: mt
Time: 22 November 2019, 2:11:23.895303 pm
UUID: 7a9645dc-bdfb-f949-b322-05f1162c7f9a
Ancestors: Tools-ct.916, Tools-ct.902, Tools-ct.904

Merges Tools-ct.916, Tools-ct.902, Tools-ct.904.

Changes #handleWarning: text to a different style and to use the new #suppressWarnings interface in Warning.

=============== Diff against Tools-ct.916 ===============

Item was changed:
----- Method: Inspector class>>openOn: (in category 'instance creation') -----
openOn: anObject
"Create and schedule an instance of me on the model, anInspector. "

+ ^ self openOn: anObject withLabel: anObject defaultLabelForInspector!
- ^ self openOn: anObject withEvalPane: true!

Item was removed:
- ----- Method: Inspector class>>openOn:withEvalPane: (in category 'instance creation') -----
- openOn: anObject withEvalPane: withEval
- "Create and schedule an instance of me on the model, anInspector. "
-
- ^ self openOn: anObject withEvalPane: withEval withLabel: anObject defaultLabelForInspector!

Item was removed:
- ----- Method: Inspector class>>openOn:withEvalPane:withLabel: (in category 'instance creation') -----
- openOn: anObject withEvalPane: withEval withLabel: label
- ^ToolBuilder open: (self inspect: anObject) label: label!

Item was added:
+ ----- Method: Inspector class>>openOn:withLabel: (in category 'instance creation') -----
+ openOn: anObject withLabel: label
+
+ ^ ToolBuilder open: (self inspect: anObject) label: label!

Item was changed:
----- Method: ProcessBrowser>>browseContext (in category 'stack list') -----
browseContext
+ ToolSet browseMethod: selectedContext method!
- selectedContext
- ifNil: [^ self].
- ToolSet browse: self selectedClass selector: self selectedSelector!

Item was changed:
----- Method: ProcessBrowser>>changePriority (in category 'process actions') -----
changePriority
| str newPriority nameAndRules |
- selectedProcess ifNil: [^ self].
nameAndRules := self nameAndRulesForSelectedProcess.
nameAndRules third
ifFalse: [self inform: 'Nope, won''t change priority of ' , nameAndRules first.
^ self].
str := UIManager default
request: 'New priority'
initialAnswer: selectedProcess priority asString.
newPriority := str asNumber asInteger.
newPriority
ifNil: [^ self].
(newPriority <>
or: [newPriority > Processor highestPriority])
ifTrue: [self inform: 'Bad priority'.
^ self].
self class setProcess: selectedProcess toPriority: newPriority.
self updateProcessList!

Item was changed:
----- Method: ProcessBrowser>>chasePointers (in category 'process actions') -----
chasePointers
| saved |
- selectedProcess ifNil: [^ self].
saved := selectedProcess.
[selectedProcess := nil.
(Smalltalk includesKey: #PointerFinder)
ifTrue: [PointerFinder on: saved]
ifFalse: [self inspectPointers]]
ensure: [selectedProcess := saved]!

Item was changed:
----- Method: ProcessBrowser>>debugProcess (in category 'process actions') -----
debugProcess
| nameAndRules |
- selectedProcess ifNil: [^ self].
nameAndRules := self nameAndRulesForSelectedProcess.
nameAndRules third
ifFalse: [self inform: 'Nope, won''t debug ' , nameAndRules first.
^ self].
self class debugProcess: selectedProcess.!

Item was changed:
----- Method: ProcessBrowser>>exploreContext (in category 'stack list') -----
exploreContext
+ selectedContext explore!
- selectedContext ifNotNil: #explore!

Item was changed:
----- Method: ProcessBrowser>>exploreProcess (in category 'process list') -----
exploreProcess
+ selectedProcess explore!
- selectedProcess ifNotNil: #explore!

Item was changed:
----- Method: ProcessBrowser>>exploreReceiver (in category 'stack list') -----
exploreReceiver
+ selectedContext receiver explore!
- selectedContext ifNotNil: [
- selectedContext receiver explore]!

Item was changed:
----- Method: ProcessBrowser>>inspectContext (in category 'stack list') -----
inspectContext
+ selectedContext inspect!
- selectedContext ifNotNil: #inspect!

Item was changed:
----- Method: ProcessBrowser>>inspectPointers (in category 'process actions') -----
inspectPointers
| tc pointers |
- selectedProcess ifNil: [^ self].
tc := thisContext.
pointers := PointerFinder
pointersTo: selectedProcess
except: {
self processList.
tc.
self}.
pointers isEmpty ifTrue: [^ self].
OrderedCollectionInspector
openOn: pointers
- withEvalPane: false
withLabel: 'Objects pointing to ' , selectedProcess browserPrintString!

Item was changed:
----- Method: ProcessBrowser>>inspectProcess (in category 'process list') -----
inspectProcess
+ selectedProcess inspect!
- selectedProcess ifNotNil: #inspect!

Item was changed:
----- Method: ProcessBrowser>>inspectReceiver (in category 'stack list') -----
inspectReceiver
+ selectedContext receiver inspect!
- selectedContext ifNotNil: [
- selectedContext receiver inspect]!

Item was changed:
----- Method: ProcessBrowser>>messageTally (in category 'stack list') -----
messageTally
| secString secs |
- selectedProcess ifNil: [^ self].
secString := UIManager default request: 'Profile for how many seconds?' initialAnswer: '4'.
secString isEmptyOrNil ifTrue: [^ self].
secs := secString asNumber asInteger.
(secs isNil or: [secs isZero])
ifTrue: [^ self].
[ TimeProfileBrowser spyOnProcess: selectedProcess forMilliseconds: secs * 1000 ] forkAt: selectedProcess priority + 1.!

Item was changed:
----- Method: ProcessBrowser>>processListKey:from: (in category 'process list') -----
+ processListKey: aKey from: aView
+
+ aKey
+ caseOf: {
+ [$f] -> [^ self findContext].
+ [$g] -> [^ self nextContext].
+ [$a] -> [^ self toggleAutoUpdate].
+ [$u] -> [^ self updateProcessList] }
+ otherwise: [].
+ selectedProcess ifNil: [^ self changed: #flash].
+ ^ aKey
+ caseOf: {
+ [$i] -> [self inspectProcess].
+ [$I] -> [self exploreProcess].
+ [$c] -> [self chasePointers].
+ [$P] -> [self inspectPointers].
+ [$t] -> [self terminateProcess].
+ [$r] -> [self resumeProcess].
+ [$s] -> [self suspendProcess].
+ [$d] -> [self debugProcess].
+ [$p] -> [self changePriority].
+ [$m] -> [self messageTally].
+ [$S] -> [self signalSemaphore].
+ [$k] -> [self moreStack]}
+ otherwise: [self arrowKey: aKey from: aView]!
- processListKey: aKey from: aView
- ^ aKey caseOf: {
- [$i] -> [self inspectProcess].
- [$I] -> [self exploreProcess].
- [$c] -> [self chasePointers].
- [$P] -> [self inspectPointers].
- [$t] -> [self terminateProcess].
- [$r] -> [self resumeProcess].
- [$s] -> [self suspendProcess].
- [$d] -> [self debugProcess].
- [$p] -> [self changePriority].
- [$m] -> [self messageTally].
- [$f] -> [self findContext].
- [$g] -> [self nextContext].
- [$a] -> [self toggleAutoUpdate].
- [$u] -> [self updateProcessList].
- [$S] -> [self signalSemaphore].
- [$k] -> [self moreStack]}
- otherwise: [self arrowKey: aKey from: aView]!

Item was changed:
----- Method: ProcessBrowser>>resumeProcess (in category 'process actions') -----
resumeProcess
- selectedProcess ifNil: [^ self].
self class resumeProcess: selectedProcess.
self updateProcessList!

Item was changed:
----- Method: ProcessBrowser>>signalSemaphore (in category 'process actions') -----
signalSemaphore
- selectedProcess ifNil: [^ self].
(selectedProcess suspendingList isKindOf: Semaphore)
ifFalse: [^ self].
[selectedProcess suspendingList signal] fork.
(Delay forMilliseconds: 300) wait.
"Hate to make the UI wait, but it's convenient..."
self updateProcessList!

Item was changed:
----- Method: ProcessBrowser>>stackListKey:from: (in category 'views') -----
+ stackListKey: aKey from: aView
+
+ selectedContext ifNil: [^ self changed: #flash].
+ ^ aKey
+ caseOf: {
+ [$c] -> [self inspectContext].
+ [$C] -> [self exploreContext].
+ [$i] -> [self inspectReceiver].
+ [$I] -> [self exploreReceiver].
+ [$b] -> [self browseContext]}
+ otherwise: [self arrowKey: aKey from: aView]!
- stackListKey: aKey from: aView
- ^ aKey caseOf: {
- [$c] -> [self inspectContext].
- [$C] -> [self exploreContext].
- [$i] -> [self inspectReceiver].
- [$I] -> [self exploreReceiver].
- [$b] -> [self browseContext]}
- otherwise: [self arrowKey: aKey from: aView]!

Item was changed:
----- Method: ProcessBrowser>>suspendProcess (in category 'process actions') -----
suspendProcess
| nameAndRules |
- selectedProcess ifNil: [^ self].
selectedProcess isSuspended
ifTrue: [^ self].
nameAndRules := self nameAndRulesForSelectedProcess.
nameAndRules second
ifFalse: [self inform: 'Nope, won''t suspend ' , nameAndRules first.
^ self].
self class suspendProcess: selectedProcess.
self updateProcessList!

Item was changed:
----- Method: ProcessBrowser>>terminateProcess (in category 'process actions') -----
terminateProcess
| nameAndRules |
- selectedProcess ifNil: [^ self].
nameAndRules := self nameAndRulesForSelectedProcess.
nameAndRules second
ifFalse: [self inform: 'Nope, won''t kill ' , nameAndRules first.
^ self].
self class terminateProcess: selectedProcess.
self updateProcessList!

Item was changed:
----- Method: StandardToolSet class>>handleWarning: (in category 'debugging - handlers') -----
handleWarning: aWarning
"Double dispatch. Let the active process take care of that warning, which usually calls back here to #debugProcess:..."

+ | message |
+ message := '{1}\\{2}' withCRs asText format: {
+ "First, show the actual text of this warning."
+ aWarning messageText.
+ "Second, append some helpful information that apply to all kinds of warnings."
+ ('{1} {2}' asText format: {
+ 'Select "Proceed" to continue or close this window to cancel the operation.' translated.
+ 'If you do not want to be interrupted anymore, you can {1} this kind of warning. You can also {2}, which resets such warnings on the next image startup.' translated asText format: {
+ "Provide clickable text links so that the user can directly suppress warnings."
+ 'always suppress' asText
+ addAttribute: (PluggableTextAttribute evalBlock: [
+ aWarning class suppressWarnings.
+ self inform: ('All ''{1}'' warnings will be suppressed.' translated format: {aWarning class name})]).
+ 'suppress temporarily' asText
+ addAttribute: (PluggableTextAttribute evalBlock: [
+ aWarning class suppressAndResetOnStartUp.
+ self inform: ('All ''{1}'' warnings will be suppressed\and reset on the next image startup.' withCRs translated format: {aWarning class name})])}.
+ }) addAttribute: (
+ "Show this helpful information in a smaller font."
+ TextFontReference toFont: Preferences standardButtonFont)}.
+
^ Processor activeProcess
debug: aWarning signalerContext
title: 'Warning' translated
full: false
+ contents: message!
- contents: aWarning messageText , '\\Select Proceed to continue, or close this window to cancel the operation.' withCRs translated!

Item was changed:
----- Method: StandardToolSet class>>inspect:label: (in category 'inspecting') -----
inspect: anObject label: aString
"Open an inspector on the given object. The tool set must know which inspector type to use for which object - the object cannot possibly know what kind of inspectors the toolset provides."
+ ^ anObject inspectorClass openOn: anObject withLabel: aString!
- ^ anObject inspectorClass openOn: anObject withEvalPane: true withLabel: aString!




Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-mt.917.mcz

marcel.taeumel
Hi all.

Note that we have not so much UI-design possibilities for that "Warning window" at the moment. Something like this is not that simple at the moment:



For example, we cannot rely on DialogWindow >> #getUserResponse to "suspend" the control flow. Debugger itself is not that flexible at the moment.

Best,
Marcel

Am 22.11.2019 14:19:40 schrieb Marcel Taeumel <[hidden email]>:


Am 22.11.2019 14:11:37 schrieb [hidden email] <[hidden email]>:

Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.917.mcz

==================== Summary ====================

Name: Tools-mt.917
Author: mt
Time: 22 November 2019, 2:11:23.895303 pm
UUID: 7a9645dc-bdfb-f949-b322-05f1162c7f9a
Ancestors: Tools-ct.916, Tools-ct.902, Tools-ct.904

Merges Tools-ct.916, Tools-ct.902, Tools-ct.904.

Changes #handleWarning: text to a different style and to use the new #suppressWarnings interface in Warning.

=============== Diff against Tools-ct.916 ===============

Item was changed:
----- Method: Inspector class>>openOn: (in category 'instance creation') -----
openOn: anObject
"Create and schedule an instance of me on the model, anInspector. "

+ ^ self openOn: anObject withLabel: anObject defaultLabelForInspector!
- ^ self openOn: anObject withEvalPane: true!

Item was removed:
- ----- Method: Inspector class>>openOn:withEvalPane: (in category 'instance creation') -----
- openOn: anObject withEvalPane: withEval
- "Create and schedule an instance of me on the model, anInspector. "
-
- ^ self openOn: anObject withEvalPane: withEval withLabel: anObject defaultLabelForInspector!

Item was removed:
- ----- Method: Inspector class>>openOn:withEvalPane:withLabel: (in category 'instance creation') -----
- openOn: anObject withEvalPane: withEval withLabel: label
- ^ToolBuilder open: (self inspect: anObject) label: label!

Item was added:
+ ----- Method: Inspector class>>openOn:withLabel: (in category 'instance creation') -----
+ openOn: anObject withLabel: label
+
+ ^ ToolBuilder open: (self inspect: anObject) label: label!

Item was changed:
----- Method: ProcessBrowser>>browseContext (in category 'stack list') -----
browseContext
+ ToolSet browseMethod: selectedContext method!
- selectedContext
- ifNil: [^ self].
- ToolSet browse: self selectedClass selector: self selectedSelector!

Item was changed:
----- Method: ProcessBrowser>>changePriority (in category 'process actions') -----
changePriority
| str newPriority nameAndRules |
- selectedProcess ifNil: [^ self].
nameAndRules := self nameAndRulesForSelectedProcess.
nameAndRules third
ifFalse: [self inform: 'Nope, won''t change priority of ' , nameAndRules first.
^ self].
str := UIManager default
request: 'New priority'
initialAnswer: selectedProcess priority asString.
newPriority := str asNumber asInteger.
newPriority
ifNil: [^ self].
(newPriority <>
or: [newPriority > Processor highestPriority])
ifTrue: [self inform: 'Bad priority'.
^ self].
self class setProcess: selectedProcess toPriority: newPriority.
self updateProcessList!

Item was changed:
----- Method: ProcessBrowser>>chasePointers (in category 'process actions') -----
chasePointers
| saved |
- selectedProcess ifNil: [^ self].
saved := selectedProcess.
[selectedProcess := nil.
(Smalltalk includesKey: #PointerFinder)
ifTrue: [PointerFinder on: saved]
ifFalse: [self inspectPointers]]
ensure: [selectedProcess := saved]!

Item was changed:
----- Method: ProcessBrowser>>debugProcess (in category 'process actions') -----
debugProcess
| nameAndRules |
- selectedProcess ifNil: [^ self].
nameAndRules := self nameAndRulesForSelectedProcess.
nameAndRules third
ifFalse: [self inform: 'Nope, won''t debug ' , nameAndRules first.
^ self].
self class debugProcess: selectedProcess.!

Item was changed:
----- Method: ProcessBrowser>>exploreContext (in category 'stack list') -----
exploreContext
+ selectedContext explore!
- selectedContext ifNotNil: #explore!

Item was changed:
----- Method: ProcessBrowser>>exploreProcess (in category 'process list') -----
exploreProcess
+ selectedProcess explore!
- selectedProcess ifNotNil: #explore!

Item was changed:
----- Method: ProcessBrowser>>exploreReceiver (in category 'stack list') -----
exploreReceiver
+ selectedContext receiver explore!
- selectedContext ifNotNil: [
- selectedContext receiver explore]!

Item was changed:
----- Method: ProcessBrowser>>inspectContext (in category 'stack list') -----
inspectContext
+ selectedContext inspect!
- selectedContext ifNotNil: #inspect!

Item was changed:
----- Method: ProcessBrowser>>inspectPointers (in category 'process actions') -----
inspectPointers
| tc pointers |
- selectedProcess ifNil: [^ self].
tc := thisContext.
pointers := PointerFinder
pointersTo: selectedProcess
except: {
self processList.
tc.
self}.
pointers isEmpty ifTrue: [^ self].
OrderedCollectionInspector
openOn: pointers
- withEvalPane: false
withLabel: 'Objects pointing to ' , selectedProcess browserPrintString!

Item was changed:
----- Method: ProcessBrowser>>inspectProcess (in category 'process list') -----
inspectProcess
+ selectedProcess inspect!
- selectedProcess ifNotNil: #inspect!

Item was changed:
----- Method: ProcessBrowser>>inspectReceiver (in category 'stack list') -----
inspectReceiver
+ selectedContext receiver inspect!
- selectedContext ifNotNil: [
- selectedContext receiver inspect]!

Item was changed:
----- Method: ProcessBrowser>>messageTally (in category 'stack list') -----
messageTally
| secString secs |
- selectedProcess ifNil: [^ self].
secString := UIManager default request: 'Profile for how many seconds?' initialAnswer: '4'.
secString isEmptyOrNil ifTrue: [^ self].
secs := secString asNumber asInteger.
(secs isNil or: [secs isZero])
ifTrue: [^ self].
[ TimeProfileBrowser spyOnProcess: selectedProcess forMilliseconds: secs * 1000 ] forkAt: selectedProcess priority + 1.!

Item was changed:
----- Method: ProcessBrowser>>processListKey:from: (in category 'process list') -----
+ processListKey: aKey from: aView
+
+ aKey
+ caseOf: {
+ [$f] -> [^ self findContext].
+ [$g] -> [^ self nextContext].
+ [$a] -> [^ self toggleAutoUpdate].
+ [$u] -> [^ self updateProcessList] }
+ otherwise: [].
+ selectedProcess ifNil: [^ self changed: #flash].
+ ^ aKey
+ caseOf: {
+ [$i] -> [self inspectProcess].
+ [$I] -> [self exploreProcess].
+ [$c] -> [self chasePointers].
+ [$P] -> [self inspectPointers].
+ [$t] -> [self terminateProcess].
+ [$r] -> [self resumeProcess].
+ [$s] -> [self suspendProcess].
+ [$d] -> [self debugProcess].
+ [$p] -> [self changePriority].
+ [$m] -> [self messageTally].
+ [$S] -> [self signalSemaphore].
+ [$k] -> [self moreStack]}
+ otherwise: [self arrowKey: aKey from: aView]!
- processListKey: aKey from: aView
- ^ aKey caseOf: {
- [$i] -> [self inspectProcess].
- [$I] -> [self exploreProcess].
- [$c] -> [self chasePointers].
- [$P] -> [self inspectPointers].
- [$t] -> [self terminateProcess].
- [$r] -> [self resumeProcess].
- [$s] -> [self suspendProcess].
- [$d] -> [self debugProcess].
- [$p] -> [self changePriority].
- [$m] -> [self messageTally].
- [$f] -> [self findContext].
- [$g] -> [self nextContext].
- [$a] -> [self toggleAutoUpdate].
- [$u] -> [self updateProcessList].
- [$S] -> [self signalSemaphore].
- [$k] -> [self moreStack]}
- otherwise: [self arrowKey: aKey from: aView]!

Item was changed:
----- Method: ProcessBrowser>>resumeProcess (in category 'process actions') -----
resumeProcess
- selectedProcess ifNil: [^ self].
self class resumeProcess: selectedProcess.
self updateProcessList!

Item was changed:
----- Method: ProcessBrowser>>signalSemaphore (in category 'process actions') -----
signalSemaphore
- selectedProcess ifNil: [^ self].
(selectedProcess suspendingList isKindOf: Semaphore)
ifFalse: [^ self].
[selectedProcess suspendingList signal] fork.
(Delay forMilliseconds: 300) wait.
"Hate to make the UI wait, but it's convenient..."
self updateProcessList!

Item was changed:
----- Method: ProcessBrowser>>stackListKey:from: (in category 'views') -----
+ stackListKey: aKey from: aView
+
+ selectedContext ifNil: [^ self changed: #flash].
+ ^ aKey
+ caseOf: {
+ [$c] -> [self inspectContext].
+ [$C] -> [self exploreContext].
+ [$i] -> [self inspectReceiver].
+ [$I] -> [self exploreReceiver].
+ [$b] -> [self browseContext]}
+ otherwise: [self arrowKey: aKey from: aView]!
- stackListKey: aKey from: aView
- ^ aKey caseOf: {
- [$c] -> [self inspectContext].
- [$C] -> [self exploreContext].
- [$i] -> [self inspectReceiver].
- [$I] -> [self exploreReceiver].
- [$b] -> [self browseContext]}
- otherwise: [self arrowKey: aKey from: aView]!

Item was changed:
----- Method: ProcessBrowser>>suspendProcess (in category 'process actions') -----
suspendProcess
| nameAndRules |
- selectedProcess ifNil: [^ self].
selectedProcess isSuspended
ifTrue: [^ self].
nameAndRules := self nameAndRulesForSelectedProcess.
nameAndRules second
ifFalse: [self inform: 'Nope, won''t suspend ' , nameAndRules first.
^ self].
self class suspendProcess: selectedProcess.
self updateProcessList!

Item was changed:
----- Method: ProcessBrowser>>terminateProcess (in category 'process actions') -----
terminateProcess
| nameAndRules |
- selectedProcess ifNil: [^ self].
nameAndRules := self nameAndRulesForSelectedProcess.
nameAndRules second
ifFalse: [self inform: 'Nope, won''t kill ' , nameAndRules first.
^ self].
self class terminateProcess: selectedProcess.
self updateProcessList!

Item was changed:
----- Method: StandardToolSet class>>handleWarning: (in category 'debugging - handlers') -----
handleWarning: aWarning
"Double dispatch. Let the active process take care of that warning, which usually calls back here to #debugProcess:..."

+ | message |
+ message := '{1}\\{2}' withCRs asText format: {
+ "First, show the actual text of this warning."
+ aWarning messageText.
+ "Second, append some helpful information that apply to all kinds of warnings."
+ ('{1} {2}' asText format: {
+ 'Select "Proceed" to continue or close this window to cancel the operation.' translated.
+ 'If you do not want to be interrupted anymore, you can {1} this kind of warning. You can also {2}, which resets such warnings on the next image startup.' translated asText format: {
+ "Provide clickable text links so that the user can directly suppress warnings."
+ 'always suppress' asText
+ addAttribute: (PluggableTextAttribute evalBlock: [
+ aWarning class suppressWarnings.
+ self inform: ('All ''{1}'' warnings will be suppressed.' translated format: {aWarning class name})]).
+ 'suppress temporarily' asText
+ addAttribute: (PluggableTextAttribute evalBlock: [
+ aWarning class suppressAndResetOnStartUp.
+ self inform: ('All ''{1}'' warnings will be suppressed\and reset on the next image startup.' withCRs translated format: {aWarning class name})])}.
+ }) addAttribute: (
+ "Show this helpful information in a smaller font."
+ TextFontReference toFont: Preferences standardButtonFont)}.
+
^ Processor activeProcess
debug: aWarning signalerContext
title: 'Warning' translated
full: false
+ contents: message!
- contents: aWarning messageText , '\\Select Proceed to continue, or close this window to cancel the operation.' withCRs translated!

Item was changed:
----- Method: StandardToolSet class>>inspect:label: (in category 'inspecting') -----
inspect: anObject label: aString
"Open an inspector on the given object. The tool set must know which inspector type to use for which object - the object cannot possibly know what kind of inspectors the toolset provides."
+ ^ anObject inspectorClass openOn: anObject withLabel: aString!
- ^ anObject inspectorClass openOn: anObject withEvalPane: true withLabel: aString!