Christoph Thiede uploaded a new version of Tools to project The Inbox: http://source.squeak.org/inbox/Tools-ct.962.mcz
==================== Summary ====================
Name: Tools-ct.962 Author: ct Time: 20 March 2020, 6:58:18.856237 pm UUID: c4cbd7b0-ddf5-3b4b-93ed-55e5b2c80465 Ancestors: Tools-mt.955
Makes variable bindings in Workspace more comfortable:
- Ask for a useful variable name when dropping something into a workspace - Validate variable name before creating inaccessible bindings - Do not propose invalid names at all (for example, dropped class were given an invalid name in the past) - Ask before removing variable bindings. This also increases responsiveness of the UI. - Improves multilingual support
=============== Diff against Tools-mt.955 ===============
Item was changed: ----- Method: Workspace>>acceptDroppingMorph:event:inMorph: (in category 'drag and drop') ----- acceptDroppingMorph: dropee event: evt inMorph: targetMorph + "Return the dropee to its old position, and add a reference to it at the cursor point." + - "Return the dropee to its old position, and add a reference to it at the - cursor point." | bindingName externalName reference | (dropee isKindOf: TransferMorph) ifTrue: [reference := dropee passenger. externalName := dropee passenger className] ifFalse: [reference := dropee. externalName := dropee externalName]. externalName := externalName isOctetString + ifTrue: [externalName] + ifFalse: ['a' , externalName]. + + bindingName := Project uiManager + request: 'Please enter a name for the dropped object:' translated + initialAnswer: (externalName withFirstCharacterDownshifted , reference identityHash printString) asLegalSelector. + bindingName isEmptyOrNil ifTrue: [^ false]. + bindingName := Parser new parseSelector: bindingName. + bindingName ifNil: [ + self inform: 'Invalid selector.' translated. + ^ false]. + - ifTrue: [externalName] - ifFalse: ['a' , externalName]. - bindingName := externalName withFirstCharacterDownshifted , reference identityHash printString. - targetMorph correctSelectionWithString: bindingName , ' '. (self bindingOf: bindingName) value: reference. + targetMorph correctSelectionWithString: bindingName , ' '. (dropee isKindOf: TransferMorph) ifFalse: [dropee rejectDropMorphEvent: evt]. + ^ true "success"! - ^ true"success"!
Item was changed: ----- Method: Workspace>>addModelItemsToWindowMenu: (in category 'menu commands') ----- addModelItemsToWindowMenu: aMenu aMenu addLine. aMenu + add: 'save contents to file...' translated - add: 'save contents to file...' target: self action: #saveContentsInFile. aMenu + add: 'inspect variables' translated - add: 'inspect variables' target: self action: #inspectBindings. aMenu + add: 'reset variables' translated - add: 'reset variables' target: self + action: #resetBindings. - action: #initializeBindings. aMenu addUpdating: #mustDeclareVariableWording target: self action: #toggleVariableDeclarationMode. aMenu addUpdating: #acceptDroppedMorphsWording target: self action: #toggleDroppingMorphForReference.
+ self addToggleStylingMenuItemTo: aMenu.! - self addToggleStylingMenuItemTo: aMenu. - !
Item was added: + ----- Method: Workspace>>resetBindings (in category 'menu commands') ----- + resetBindings + + (self bindings notEmpty ==> [self confirm: ('Are you sure you would like to remove {1} variables?' translated format: {self bindings size})]) + ifFalse: [^ self]. + self initializeBindings.!