The Inbox: Tools-ct.1028.mcz

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

The Inbox: Tools-ct.1028.mcz

commits-2
Christoph Thiede uploaded a new version of Tools to project The Inbox:
http://source.squeak.org/inbox/Tools-ct.1028.mcz

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

Name: Tools-ct.1028
Author: ct
Time: 2 March 2021, 3:44:29.75717 pm
UUID: 9b55450f-acf1-274e-b4fd-a502f8a89d86
Ancestors: Tools-mt.1027

Refactors removal of selectors. Complements System-ct.1221. Includes deduplication, better reusage of the removal confirmation dialogs, and fixes the "remove and/or browse" options for the FileContentsBrowser.

=============== Diff against Tools-mt.1027 ===============

Item was changed:
  ----- Method: Browser>>removeMessage (in category 'message functions') -----
  removeMessage
+
+ self hasMessageSelected ifFalse: [^ false].
+
+ super removeMessage ifFalse: [^ false].
- "If a message is selected, create a Confirmer so the user can verify that  
- the currently selected message should be removed from the system. If
- so,  
- remove it. If the Preference 'confirmMethodRemoves' is set to false, the
- confirmer is bypassed."
- | messageName confirmation |
- self hasMessageSelected not
- ifTrue: [^ self].
- self okToChange
- ifFalse: [^ self].
- messageName := self selectedMessageName.
- confirmation := self systemNavigation   confirmRemovalOf: messageName on: self selectedClassOrMetaClass.
- confirmation = 3
- ifTrue: [^ self].
- self selectedClassOrMetaClass removeSelector: messageName.
  self selectMessageNamed: nil.
  self changed: #messageList.
  self setClassOrganizer.
+
+ ^ true!
- "In case organization not cached"
- confirmation = 2
- ifTrue: [self systemNavigation browseAllCallsOn: messageName]!

Item was changed:
  ----- Method: ChangeSorter>>removeMessage (in category 'message list') -----
  removeMessage
+
+ ^ super removeMessage
+ ifTrue: [self update];
+ yourself!
- "Remove the selected msg from the system. Real work done by the
- parent, a ChangeSorter"
- | confirmation sel |
- self okToChange
- ifFalse: [^ self].
- currentSelector
- ifNotNil: [confirmation := self systemNavigation   confirmRemovalOf: (sel := self selectedMessageName) on: self selectedClassOrMetaClass.
- confirmation = 3
- ifTrue: [^ self].
- self selectedClassOrMetaClass removeSelector: sel.
- self update.
- confirmation = 2
- ifTrue: [self systemNavigation browseAllCallsOn: sel]]!

Item was added:
+ ----- Method: CodeHolder>>removeMessage (in category 'commands') -----
+ removeMessage
+ "If a message is selected, create a Confirmer so the user can verify that the currently selected message should be removed from the system. If so, remove it. Answer a boolean indicating whether the removal was succesful."
+ self okToChange ifFalse: [^ false].
+
+ ^ self systemNavigation
+ confirmAndRemoveSelector: self selectedMessageName
+ class: self selectedClassOrMetaClass!

Item was changed:
  ----- Method: Debugger>>removeMessage (in category 'context stack menu') -----
  removeMessage
 
+ | oldContext method cleanIndex  |
- | oldContext method cleanIndex confirmation  |
  self okToChange ifFalse: [^ false].
  contextStackIndex isZero ifTrue: [^ false].
 
  oldContext := self selectedContext.
  method := oldContext method.
  cleanIndex := self findCleanHomeBelow: method.
  contextStack at: cleanIndex ifAbsent: [
  self inform: 'Sender of method not found on stack, can''t remove message'.
  ^ false].
  (self confirm: 'I will have to revert to the sender of this message.  Is that OK?')
  ifFalse: [^ false].
 
+ super removeMessage ifFalse: [^ false].
- confirmation := self systemNavigation
- confirmRemovalOf: method selector
- on: method methodClass.
- confirmation = 3 ifTrue: [^ self].
- self selectedClassOrMetaClass removeSelector: method selector.
-
  self
  contextStackIndex: cleanIndex oldContextWas: oldContext;
  tryRestartFrom: self selectedContext.
+
+ ^ true!
- confirmation = 2
- ifTrue: [self systemNavigation browseAllCallsOn: method selector].!

Item was changed:
  ----- Method: FileContentsBrowser>>removeMessage (in category 'removing') -----
  removeMessage
+
+ self hasMessageSelected ifFalse: [^ false].
+
+ super removeMessage ifFalse: [^ false].
- | messageName |
- self hasMessageSelected
- ifFalse: [^ self].
- self okToChange
- ifFalse: [^ self].
- messageName := self selectedMessageName.
- (self selectedClass confirmRemovalOf: messageName)
- ifFalse: [^ false].
- self selectedClassOrMetaClass removeMethod: self selectedMessageName.
  self selectMessageNamed: nil.
  self setClassOrganizer.
  "In case organization not cached"
+ self changed: #messageList.!
- self changed: #messageList!

Item was changed:
  ----- Method: MessageSet>>removeMessage (in category 'message functions') -----
  removeMessage
+
+ self hasMessageSelected ifFalse: [^ false].
+
+ super removeMessage ifFalse: [^ false].
- "Remove the selected message from the system. 1/15/96 sw"
- | messageName confirmation |
- self hasMessageSelected
- ifFalse: [^ self].
- self okToChange
- ifFalse: [^ self].
- messageName := self selectedMessageName.
- confirmation := self systemNavigation  confirmRemovalOf: messageName on: self selectedClassOrMetaClass.
- confirmation = 3
- ifTrue: [^ self].
- self selectedClassOrMetaClass removeSelector: messageName.
  self deleteFromMessageList: self selection.
  self reformulateList.
+
+ ^ true!
- confirmation = 2
- ifTrue: [self systemNavigation browseAllCallsOn: messageName]!

Item was changed:
  ----- Method: MessageTrace>>removeMessage (in category 'actions') -----
  removeMessage
  "Remove the selected messages from the system."
  self selectedMessages size = 0 ifTrue: [ ^self ].
  self selectedMessages size = 1 ifTrue: [ ^super removeMessage ].
+ (self confirm: ('Are you certain you want to remove all the {1} selected methods from the image?' translated format: {self selectedMessages size})) ifFalse: [ ^self ].
- (self confirm: 'Are you certain you want to remove all of the selected methods from the image?') ifFalse: [ ^self ].
  self selectedMessages do:
  [ :each |
  each actualClass removeSelector: each methodSymbol.
  self deleteFromMessageList: each ]!