The Trunk: System-mt.839.mcz

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

The Trunk: System-mt.839.mcz

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

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

Name: System-mt.839
Author: mt
Time: 21 July 2016, 12:00:37.651126 pm
UUID: b03d59a3-0b13-6f45-87f3-6cc36ac0eb78
Ancestors: System-mt.838

A more descriptive dialog when removing a selector that is used in the system.

=============== Diff against System-mt.838 ===============

Item was changed:
  ----- Method: SystemNavigation>>confirmRemovalOf:on: (in category 'ui') -----
  confirmRemovalOf: aSelector on: aClass
  "Determine if it is okay to remove the given selector. Answer 1 if it  
  should be removed, 2 if it should be removed followed by a senders  
  browse, and 3 if it should not be removed."
  | count answer caption allCalls |
  allCalls := self allCallsOn: aSelector.
  (count := allCalls size) = 0
  ifTrue: [^ 1].
  "no senders -- let the removal happen without warning"
  count = 1
  ifTrue: [(allCalls first actualClass == aClass
  and: [allCalls first methodSymbol == aSelector])
  ifTrue: [^ 1]].
  "only sender is itself"
+ caption := 'The message "{1}" has {2} sender{3}.' translated format: {aSelector. count. count > 1 ifTrue: ['s'] ifFalse: ['']}.
+
- caption := 'This message has ' , count printString , ' sender'.
- count > 1
- ifTrue: [caption := caption copyWith: $s].
  answer := UIManager default
  chooseFrom: #('Remove it'
  'Remove, then browse senders'
  'Don''t remove, but show me those senders'
  'Forget it -- do nothing -- sorry I asked') title: caption.
  answer = 3
  ifTrue: [self
  browseMessageList: allCalls
  name: 'Senders of ' , aSelector
  autoSelect: aSelector keywords first].
  answer = 0
  ifTrue: [answer := 3].
  "If user didn't answer, treat it as cancel"
  ^ answer min: 3!