The Trunk: ToolBuilder-Morphic-cmm.211.mcz

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

The Trunk: ToolBuilder-Morphic-cmm.211.mcz

commits-2
Chris Muller uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-cmm.211.mcz

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

Name: ToolBuilder-Morphic-cmm.211
Author: cmm
Time: 7 April 2018, 7:16:02.444544 pm
UUID: e0ee1d62-8009-4ece-9e9a-8a781b7a8407
Ancestors: ToolBuilder-Morphic-cmm.210

Fix the FileSaverDialog case where the file is named .extension.extension and the user wishes to remove the double-extension.  #selectExistingFilename was not enough to filter that case.

=============== Diff against ToolBuilder-Morphic-cmm.210 ===============

Item was changed:
  ----- Method: FileSaverDialog>>selectFilename: (in category 'filename') -----
  selectFilename: aText
  "The user has entered a potential filename in the text field.  Check it against the current pattern; if it is ok we can accept it and then if it is a file in the current list, highlight it.  If it would not match the pattern, alert the user."
  fileName := aText asString.
  ^ self selectExistingFilename
  ifTrue:
  [ self changed: #fileListIndex.
  true ]
  ifFalse:
  [ suffixList size = 1
  ifTrue:
+ [ | suffix |
+ ((suffix := '.' , suffixList anyOne)
+ compare: (fileName last: suffix size)
+ caseSensitive: FileDirectory default isCaseSensitive) = 2 ifFalse: [ fileName := fileName , '.' , suffixList first ].
- [ fileName := fileName , '.' , suffixList first.
  true ]
  ifFalse:
  [ suffixList
  at:
  (UIManager default
  chooseFrom: suffixList
  title: 'Please choose the type of file to save.')
  ifPresent:
  [ : choice | fileName := fileName , '.' , choice.
  true ]
  ifAbsent:
  [ suffixList isEmpty or:
  [ UIManager default inform: 'WARNING:  File not saved!!  A filename matching one of ' , patternList asArray asString , ' patterns is required.'.
  false ] ] ] ]!