[squeak-dev] The Inbox: Tools-ct.960.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Tue Mar 17 19:08:01 UTC 2020


By the way, further possible refactorings could include:


1. Deduplicate these menu implementations via CodeHolder (pragmas are a bequest you cannot refuse, but we could helper methods or so)


2. I added this for XmasDecorations and would consider it helpful for the Trunk as well: Add something like #onOrOffString<https://github.com/LinqLover/XmasDecorations/blob/master/packages/XmasDecorations.package/Boolean.extension/instance/onOrOffString.st> to Boolean, via an extension category of Tools? There are really many senders writing that mapping again and again. It might also be useful if we had a less noisy way to pass a state selector to the menu constructor ... 😊


Best,

Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Dienstag, 17. März 2020 19:48:03
An: squeak-dev at lists.squeakfoundation.org
Betreff: [squeak-dev] The Inbox: Tools-ct.960.mcz

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

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

Name: Tools-ct.960
Author: ct
Time: 17 March 2020, 7:47:55.955389 pm
UUID: 2080d250-68a3-104f-82ee-cb57b534fd00
Ancestors: Tools-mt.955

Revise message list menus and make "toggle break on entry" an actual toggle item. Improves multilingual support.

=============== Diff against Tools-mt.955 ===============

Item was changed:
  ----- Method: Browser>>mainMessageListMenu: (in category 'message functions') -----
  mainMessageListMenu: aMenu
         <messageListMenuShifted: false>
+
+        ^ aMenu
+                addTranslatedList: #(
+                        ('what to show...'                      offerWhatToShowMenu));
+                add: (self isBreakOnEntry ifTrue: ['<on>'] ifFalse: ['<off>']) , 'break on entry' translated
+                        action: #toggleBreakOnEntry;
+                addTranslatedList: #(
-        ^ aMenu addList: #(
-                        ('what to show...'                      offerWhatToShowMenu)
-                        ('toggle break on entry'                toggleBreakOnEntry)
                         -
                         ('browse full (b)'                       browseMethodFull)
                         ('browse hierarchy (h)'         browseClassHierarchy)
                         ('browse protocol (p)'                  browseFullProtocol)
                         -
                         ('fileOut'                                      fileOutMessage)
                         ('printOut'                                     printOutMessage)
                         ('copy selector (c)'                    copySelector)
                         ('copy reference (C)'           copyReference)
                         -
                         ('senders of... (n)'                    browseSendersOfMessages)
                         ('implementors of... (m)'               browseMessages)
                         ('inheritance (i)'                      methodHierarchy)
                         ('versions (v)'                         browseVersions)
                         -
                         ('references... (r)'                    browseVariableReferences)
                         ('assignments... (a)'                   browseVariableAssignments)
                         ('class refs (N)'                       browseClassRefs)
                         -
                         ('remove method (x)'                    removeMessage)
                         ('explore method'                       exploreMethod)
                         ('inspect method'                       inspectMethod));
+                yourself!
-                yourself
- !

Item was added:
+ ----- Method: CodeHolder>>isBreakOnEntry (in category 'breakpoints') -----
+ isBreakOnEntry
+
+        | selectedMethod |
+        selectedMethod := self selectedClassOrMetaClass
+                compiledMethodAt: self selectedMessageName
+                ifAbsent: [^ false].
+        ^ selectedMethod hasBreakpoint!

Item was changed:
  ----- Method: Debugger>>mainContextStackMenu: (in category 'context stack menu') -----
  mainContextStackMenu: aMenu
         "Set up the menu appropriately for the context-stack-list, unshifted"
         <contextStackMenuShifted: false>
+        ^ aMenu
+                addTranslatedList: #(
-        ^ aMenu addList: #(
                         ('fullStack (f)'                                 fullStack)
                         ('restart (r)'                           restart)
                         ('proceed (p)'                           proceed)
                         ('step (t)'                                      doStep)
                         ('step through (T)'               stepIntoBlock)
                         ('send (e)'                                      send)
                         ('where (w)'                             where)
                         ('peel to first like this'               peelToFirst)
                         -
                         ('return entered value'          returnValue)
+                        - );
+                add: (self isBreakOnEntry ifTrue: ['<on>'] ifFalse: ['<off>']) , 'break on entry' translated
+                        action: #toggleBreakOnEntry;
+                addTranslatedList: #(
-                        -
-                        ('toggle break on entry'        toggleBreakOnEntry)
                         ('senders of    (n)'                     browseSendersOfMessages)
                         ('implementors of    (m)'        browseMessages)
                         ('inheritance (i)'                       methodHierarchy)
-                        -
                         ('versions (v)'                          browseVersions)
                         -
                         ('references    (r)'                     browseVariableReferences)
                         ('assignments    (a)'            browseVariableAssignments)
                         -
                         ('class refs (N)'                                browseClassRefs)
                         ('browse full (b)'                       browseMethodFull)
                         ('file out '                               fileOutMessage)
                         ('remove method (x) '            removeMessage)
                         -
                         ('copy bug report to clipboard' copyBugReportToClipboard));
+                yourself!
-                yourself
- !

Item was changed:
  ----- Method: MessageSet>>mainMessageListMenu: (in category 'message list') -----
  mainMessageListMenu: aMenu
-        "Answer the message-list menu"
         <messageListMenuShifted: false>
+
+        ^ aMenu
+                addTranslatedList: #(
+                        ('what to show...'                      offerWhatToShowMenu));
+                add: (self isBreakOnEntry ifTrue: ['<on>'] ifFalse: ['<off>']) , 'break on entry' translated
+                        action: #toggleBreakOnEntry;
+                addTranslatedList: #(
-        aMenu addList: #(
-                        ('what to show...'                      offerWhatToShowMenu)
-                        ('toggle break on entry'                toggleBreakOnEntry)
                         -
                         ('browse full (b)'                       browseMethodFull)
                         ('browse hierarchy (h)'                 browseClassHierarchy)
                         ('browse protocol (p)'                  browseFullProtocol)
                         -
                         ('fileOut'                              fileOutMessage)
                         ('printOut'                             printOutMessage)
                         ('copy selector (c)'            copySelector)
                         ('copy reference (C)'   copyReference)
                         -
                         ('senders of... (n)'                    browseSendersOfMessages)
                         ('implementors of... (m)'               browseMessages)
                         ('inheritance (i)'                      methodHierarchy)
                         ('versions (v)'                         browseVersions)
                         -
                         ('references... (r)'                    browseVariableReferences)
                         ('assignments... (a)'                   browseVariableAssignments)
                         ('class refs (N)'                       browseClassRefs)
                         -
                         ('remove method (x)'                    removeMessage)
                         ('explore method'                       exploreMethod)
+                        ('inspect method'                       inspectMethod));
+                yourself!
-                        ('inspect method'                       inspectMethod)).
-        ^ aMenu!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200317/079a38da/attachment-0001.html>


More information about the Squeak-dev mailing list