Whilst trying to commit a bunch of stuff I keep getting MC errors in #answer: where the modalProcess is not the current process.
Anybody got something to tell us?
tim
--
tim Rowledge; tim(a)rowledge.org; http://www.rowledge.org/tim
Strange OpCodes: CCC: Crash if Carry Clear
David T. Lewis uploaded a new version of Tools to project The Inbox:
http://source.squeak.org/inbox/Tools-dtl.782.mcz
==================== Summary ====================
Name: Tools-dtl.782
Author: dtl
Time: 21 December 2017, 10:51:28.91189 pm
UUID: fcb991de-fc3c-4cdc-9cf2-a2aa3f961a2a
Ancestors: Tools-tpr.781
Make instance creation methods more uniform for FileChooserDialog andFileSaverDialog, and update class comments accordingly.
=============== Diff against Tools-tpr.781 ===============
Item was changed:
----- Method: DirectoryChooserDialog class>>openOn:label: (in category 'instance creation') -----
openOn: aDirectory label: labelString
"open a directory chooser starting with aDirectory"
+ "DirectoryChooserDialog openOn: FileDirectory default label: 'Choose the directory to use' "
+
^DirectoryChooserDialog new
directory: aDirectory;
message: labelString;
getUserResponse!
Item was changed:
FileAbstractSelectionDialog subclass: #FileChooserDialog
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Tools-FileDialogs'!
+ !FileChooserDialog commentStamp: 'dtl 12/21/2017 22:18' prior: 0!
- !FileChooserDialog commentStamp: 'tpr 11/21/2017 18:02' prior: 0!
A FileChooserDialog is a modal dialog to allow choosing a file. The full file name is returned, or nil if no selection was made.
Normal usage would be
+ myFilename := FileChooserDialog openOn: myApplicationDefaultDirectory pattern: '*.myapp' label: 'Choose the file to load'
- myFilename := FileChooserDialog openOn: myApplicationDefaultDirectory pattern: '*.myapp' message: 'Choose the file to load'
to find a file with a name matching *.myapp and with the directory initial choice set to myApplicationDefaultDirectory. Only filenames matching the pattern will appear in the file list view.
!
Item was changed:
----- Method: FileChooserDialog class>>openOn: (in category 'instance creation') -----
openOn: aDirectory
+ "Open a modal dialog to choose a file. Start the dialog with aDirectory selected
+ and files matching the default 'everything' pattern"
- "open a modal dialog to choose a file. Start the dialog with aDirectory selected and files matching the default 'everything' pattern"
+ "FileChooserDialog openOn: FileDirectory default"
+
+ ^self openOn: aDirectory pattern: nil label: nil
+ !
- ^self new directory: aDirectory;
- getUserResponse!
Item was added:
+ ----- Method: FileChooserDialog class>>openOn:pattern:label: (in category 'instance creation') -----
+ openOn: aDirectory pattern: matchString label: labelString
+ "Open a modal dialog to choose a file. Start the dialog with aDirectory selected
+ and files matching the matchString pattern. Set the user message to labelString."
+
+ "FileChooserDialog openOn: FileDirectory default pattern: '*.changes' label: 'Do something with the selected files' "
+
+ ^self new
+ directory: aDirectory;
+ pattern: matchString;
+ message: labelString;
+ getUserResponse!
Item was added:
+ ----- Method: FileChooserDialog class>>openOn:suffixList:label: (in category 'instance creation') -----
+ openOn: aDirectory suffixList: patternList label: labelString
+ "Open a modal dialog to choose a file. Start the dialog with aDirectory selected
+ and files matching the file name suffixes in patternList. Set the user message
+ to labelString."
+
+ "FileChooserDialog openOn: FileDirectory default suffixList: { '*.changes' . '*image' } label: 'Do something with the selected files' "
+
+ ^self new
+ directory: aDirectory;
+ suffixList: patternList;
+ message: labelString;
+ getUserResponse!
Item was changed:
----- Method: FileChooserDialog class>>openOnPattern:label: (in category 'instance creation') -----
+ openOnPattern: matchString label: labelString
+ "Open a modal dialog to choose a file. Start the dialog with a default directory
+ selected and with files matching the default 'everything' pattern Set the user
+ message to labelString"
- openOnPattern: patternList label: messageString
- "open a modal dialog to choose a file. Start the dialog with aDirectory selected and files matching the default 'everything' pattern"
+ "FileChooserDialog openOnPattern: '*.changes' label: 'Do something with the selected files' "
+
+ ^self openOn: nil pattern: matchString label: labelString
+ !
- ^self new
- pattern: patternList;
- message: messageString;
- getUserResponse!
Item was changed:
----- Method: FileChooserDialog class>>openOnSuffixList:label: (in category 'instance creation') -----
+ openOnSuffixList: patternList label: labelString
+ "Open a modal dialog to choose a file. Start the dialog with a default directory
+ selected and with files matching the file name suffixes in patternList. Set the
+ user message to labelString."
- openOnSuffixList: patternList label: messageString
- "open a modal dialog to choose a file. Start the dialog with aDirectory selected and files matching the default 'everything' pattern"
+ "FileChooserDialog openOnSuffixList: { '*.changes' . '*image' } label: 'Do something with the selected files' "
+
+ ^self openOn: nil suffixList: patternList label: labelString
+ !
- ^self new
- suffixList: patternList;
- message: messageString;
- getUserResponse!
Item was changed:
FileAbstractSelectionDialog subclass: #FileSaverDialog
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Tools-FileDialogs'!
+ !FileSaverDialog commentStamp: 'dtl 12/21/2017 22:47' prior: 0!
- !FileSaverDialog commentStamp: 'tpr 11/21/2017 17:53' prior: 0!
A FileSaverDialog is a modal dialog for choosing a file name to use for saving a file.
Users can enter a filename in the text input view that will
a) if it exists in the current directry listing, be selected
b) over ride any filenames in the current directory, providing a way to specify a completely new file.
This will not affect the selected directory path.
Normal usage would be
myFilename := FileSaverDialog openOnInitialFilename: myApp saveFileName
which would derive a directory, an initial filename and filename suffix from the given file name. Thus a typical application save might be
... openOnInitialFilename: '/home/pi/myApp/examplePicture.jpg'
and would set the initial directory to /home/pi/myapp, the initial filename to examplePicture.jpg and set a suffix pattern of 'jpg'. Only filenames with the specified suffix will appear in the file list view. It is possible to specify several suffices, (see #suffixList:) and use wildcards within the suffix.
myFilename := FileSaverDialog openOn: myApplicationDefaultDirectory initialFilename: 'foo.myapp'
would set directory initial choice set to myApplicationDefaultDirectory and ignore any directory found in the filename. It would be quite possible to choose a file from any other directory and with any other name that matches the suffix if the user wishes, so the file name must be carefully checked.
The full set of options would involve
myFilename := FileSaverDialog openOn: myApplicationDefaultDirectory initialFilename: 'foo.myapp' suffix: 'mya' message: 'Save your myApp file to ... '
+ It is also possible to set a more general pattern to match filenames against but since this seems less useful for normal application usage there are no convenience messages as yet.
- It is also possible to set a more general pattern to match filenames against but since this seems less useful for normal application usage ther are no convenience messages as yet.
See the class side methods for details. See my parent class for most implementation details!
Item was changed:
----- Method: FileSaverDialog class>>openOn: (in category 'instance creation') -----
openOn: aDirectory
+ "open a modal dialog to save a file. Start the dialog with aDirectory selected
+ and no suggested file name"
- "open a modal dialog to save a file. Start the dialog with aDirectory selected and no suggested file name"
+ "FileSaverDialog openOn: FileDirectory default"
- ^self new directory: aDirectory;
- getUserResponse
+ ^self openOn: aDirectory initialFilename: nil label: nil
!
Item was changed:
----- Method: FileSaverDialog class>>openOn:initialFilename: (in category 'instance creation') -----
openOn: aDirectory initialFilename: aString
+ "Open a modal dialog to save a file. Start the dialog with aDirectory selected
+ and aString as the suggested file name. Note that we set the directory after
+ the initialFilename becuase we want a specific directory and not neccesarily
+ the directory of the file."
- "open a modal dialog to save a file. Start the dialog with aDirectory selected and the suggested file name. Note that we set the directory after the initialFilename becuase we want a specific directory and not neccesarily the directory of the file"
+ "FileSaverDialog openOn: FileDirectory default initialFilename: 'aSuggestedFileName' "
- ^self new
- initialFilename: aString;
- directory: aDirectory;
- getUserResponse
+ ^self openOn: aDirectory initialFilename: aString label: nil
+ !
- !
Item was added:
+ ----- Method: FileSaverDialog class>>openOn:initialFilename:label: (in category 'instance creation') -----
+ openOn: aDirectory initialFilename: aString label: labelString
+ "Open a modal dialog to save a file. Start the dialog with aDirectory selected
+ and aString as the suggested file name. Set the user message to labelString.
+ Note that we set the directory after the initialFilename becuase we want a
+ specific directory and not neccesarily the directory of the file"
+
+ "FileSaverDialog openOn: FileDirectory default initialFilename: 'aSuggestedFileName' label: 'Select a flie and do something with it' "
+
+ ^self new
+ initialFilename: aString;
+ directory: aDirectory;
+ message: labelString;
+ getUserResponse
+
+ !
Item was changed:
----- Method: FileSaverDialog class>>openOnInitialFilename: (in category 'instance creation') -----
openOnInitialFilename: filenameString
+ "Open a modal dialog to save a file. Start the dialog with the default directory
+ selected and the suggested file name."
- "open a modal dialog to save a file. Start the dialog with the default directory selected and the suggested file name"
+ "FileSaverDialog openOnInitialFilename: 'aSuggestedFileName' "
-
- ^self new initialFilename: filenameString;
- getUserResponse
+ ^self openOn: nil initialFilename: filenameString label: nil
+ !
- !
Item was changed:
----- Method: FileSaverDialog class>>openOnInitialFilename:label: (in category 'instance creation') -----
openOnInitialFilename: filenameString label: labelString
+ "Open a modal dialog to save a file. Start the dialog with the default directory
+ selected and the suggested file name, set the user message to labelString"
- "open a modal dialog to save a file. Start the dialog with the default directory selected and the suggested file name, set the user message to labelString"
+ "FileSaverDialog openOnInitialFilename: 'aSuggestedFileName' label: 'Select a flie and do something with it' "
-
- ^self new
- initialFilename: filenameString;
- message: labelString;
- getUserResponse
+ ^self openOn: nil initialFilename: filenameString label: labelString
+ !
- !
tim Rowledge uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-tpr.991.mcz
==================== Summary ====================
Name: System-tpr.991
Author: tpr
Time: 21 December 2017, 12:28:58.277846 pm
UUID: 9d4fc5f3-acd3-4406-a00e-7e61a91b62bc
Ancestors: System-mt.990
vm/image name related clean ups
=============== Diff against System-mt.990 ===============
Item was changed:
----- Method: FileDirectory class>>setDefaultDirectory: (in category '*System-Files') -----
setDefaultDirectory: directoryName
"Initialize the default directory to the directory supplied. This method is called when the image starts up."
| dirName |
DirectoryClass := self activeDirectoryClass.
+ "There doesn't seem to be any really good reason to use the FilePath conversion stuff here; after all, this method gets sent after having read the image path and explicitly converting it"
dirName := (FilePath pathName: directoryName) asSqueakPathName.
[dirName endsWith: self slash] whileTrue:[
dirName := dirName copyFrom: 1 to: dirName size - self slash size.
].
DefaultDirectory := self on: dirName.!
Item was changed:
----- Method: SecurityManager>>secureUserDirectory (in category 'accessing') -----
secureUserDirectory
"SecurityManager default secureUserDirectory"
| dir |
dir := self primSecureUserDirectory.
^ dir
ifNil: [FileDirectory default pathName]
+ ifNotNil: [dir vmPathToSqueakPath]!
- ifNotNil: [(FilePath pathName: dir isEncoded: true) asSqueakPathName]!
Item was changed:
----- Method: SecurityManager>>untrustedUserDirectory (in category 'accessing') -----
untrustedUserDirectory
"SecurityManager default untrustedUserDirectory"
| dir |
dir := self primUntrustedUserDirectory.
^ dir
ifNil: [FileDirectory default pathName]
+ ifNotNil: [dir vmPathToSqueakPath]!
- ifNotNil: [(FilePath pathName: dir isEncoded: true) asSqueakPathName]!
Item was changed:
----- Method: SmalltalkImage>>imageName (in category 'image, changes names') -----
imageName
"Answer the full path name for the current image."
"Smalltalk imageName"
+ ^ self primImageName vmPathToSqueakPath
- | str |
- str := self primImageName.
- ^ (FilePath pathName: str isEncoded: true) asSqueakPathName.
!
Item was changed:
----- Method: SmalltalkImage>>imageName: (in category 'image, changes names') -----
imageName: newName
"Set the the full path name for the current image. All further snapshots will use this."
+ self primImageName: newName asVmPathName.
- | encoded |
- encoded := (FilePath pathName: newName isEncoded: false) asVmPathName.
- self primImageName: encoded.
!
Item was changed:
----- Method: SmalltalkImage>>vmFileName (in category 'command line') -----
vmFileName
"Answer the absolute file name of the the Smalltalk virtual machine"
"Smalltalk vmFileName"
+ ^ self primVmFileName vmPathToSqueakPath
- ^ (FilePath pathName: (self primVmFileName) isEncoded: true) asSqueakPathName.
!
Item was changed:
----- Method: SmalltalkImage>>vmPath (in category 'command line') -----
vmPath
+ "Answer the path for the directory containing the Smalltalk virtual machine, making sure to convert the vm string to a Squeak string as required."
- "Answer the path for the directory containing the Smalltalk virtual machine. Return the empty string if this primitive is not implemented."
"Smalltalk vmPath"
+ ^self primVmPath vmPathToSqueakPath
- ^ (FilePath pathName: (self primVmPath) isEncoded: true) asSqueakPathName.
!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1383.mcz
==================== Summary ====================
Name: Morphic-mt.1383
Author: mt
Time: 21 December 2017, 9:28:24.688535 pm
UUID: fb18b808-6654-884a-a1cf-d00df8f2755d
Ancestors: Morphic-mt.1382
Fixes a rare bug in text selections. NewParagraph >> #selectionRectsFrom:to: did not honor the contract as of NewParagraph >> #lineIndexOfCharacterIndex:, which is never use a line index < 1.
=============== Diff against Morphic-mt.1382 ===============
Item was changed:
----- Method: NewParagraph>>selectionRectsFrom:to: (in category 'selection') -----
selectionRectsFrom: characterBlock1 to: characterBlock2
"Return an array of rectangles representing the area between the two character blocks given as arguments."
| line1 line2 rects cb1 cb2 w |
characterBlock1 <= characterBlock2
ifTrue: [cb1 := characterBlock1. cb2 := characterBlock2]
ifFalse: [cb2 := characterBlock1. cb1 := characterBlock2].
cb1 = cb2 ifTrue:
[w := self caretWidth.
^ Array with: (cb1 topLeft - (w@0) corner: cb1 bottomLeft + ((w+1)@0))].
line1 := self lineIndexOfCharacterIndex: cb1 stringIndex.
line2 := self lineIndexOfCharacterIndex: cb2 stringIndex.
cb1 top = (lines at: line1) top
ifFalse:
["a word did not fit on prev line - start selection on prev line"
+ line1 := line1 - 1 max: 1].
- line1 := line1 - 1].
line1 = line2 ifTrue:
[^ Array with: (cb1 topLeft corner: cb2 bottomRight)].
rects := OrderedCollection new.
rects addLast: (cb1 topLeft corner: (lines at: line1) bottomRight).
line1+1 to: line2-1 do: [ :i |
| line |
line := lines at: i.
(line left = rects last left and: [ line right = rects last right ])
ifTrue: [ "new line has same margins as old one -- merge them, so that the caller gets as few rectangles as possible"
| lastRect |
lastRect := rects removeLast.
rects add: (lastRect bottom: line bottom) ]
ifFalse: [ "differing margins; cannot merge"
rects add: line rectangle ] ].
rects addLast: ((lines at: line2) topLeft corner: cb2 bottomLeft).
^ rects!
tim Rowledge uploaded a new version of ToolBuilder-MVC to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-MVC-tpr.51.mcz
==================== Summary ====================
Name: ToolBuilder-MVC-tpr.51
Author: tpr
Time: 21 December 2017, 12:16:12.950398 pm
UUID: 88429193-fa3e-40d3-ab97-76a522fa74e6
Ancestors: ToolBuilder-MVC-tpr.50
delete obsolete version
=============== Diff against ToolBuilder-MVC-tpr.50 ===============
Item was removed:
- ----- Method: MVCUIManager>>filenameSaverRequest:initialAnswer: (in category 'ui requests') -----
- filenameSaverRequest: queryString initialAnswer: defaultAnswer
- "Open a FileSaverDialog to ask for a place and filename to use for saving a file. The initial suggestion for the filename is defaultAnswer but the user may choose any existing file or type in a new name entirely"
- "Note that this is a trulyawful message name but I can't think of a better one right now"
- "MVC has to stick with the boring way of doing it"
- ^self request: queryString initialAnswer: defaultAnswer
- !
tim Rowledge uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-tpr.781.mcz
==================== Summary ====================
Name: Tools-tpr.781
Author: tpr
Time: 21 December 2017, 12:12:06.862491 pm
UUID: aff0d926-0733-4bdb-b10a-cd95a4ca7ee9
Ancestors: Tools-tpr.780
Class comment fr DirectoryChooser, couple of improvements
=============== Diff against Tools-tpr.780 ===============
Item was changed:
FileAbstractSelectionDialog subclass: #DirectoryChooserDialog
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Tools-FileDialogs'!
+
+ !DirectoryChooserDialog commentStamp: 'tpr 12/21/2017 11:32' prior: 0!
+ A DirectoryChooserDialog is a modal dialog to allow choosing a directory. The full directory name is returned, or nil if no selection was made.
+
+ Normal usage would be
+ myDirname := DirectoryChooserDialog openOn: myApplicationDefaultDirectory label: 'Choose the directory to use'
+ !
Item was added:
+ ----- Method: DirectoryChooserDialog class>>openOn:label: (in category 'instance creation') -----
+ openOn: aDirectory label: labelString
+ "open a directory chooser starting with aDirectory"
+
+ ^DirectoryChooserDialog new
+ directory: aDirectory;
+ message: labelString;
+ getUserResponse!
Item was added:
+ ----- Method: DirectoryChooserDialog>>initialExtent (in category 'toolbuilder') -----
+ initialExtent
+ "Since this is a single list it can be a bit narrower than a FileChooserDialog"
+
+ ^300@400!
Item was added:
+ ----- Method: FileChooserDialog class>>openOnPattern:label: (in category 'instance creation') -----
+ openOnPattern: patternList label: messageString
+ "open a modal dialog to choose a file. Start the dialog with aDirectory selected and files matching the default 'everything' pattern"
+
+ ^self new
+ pattern: patternList;
+ message: messageString;
+ getUserResponse!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1382.mcz
==================== Summary ====================
Name: Morphic-mt.1382
Author: mt
Time: 21 December 2017, 9:59:30.675674 am
UUID: 0c6a96d1-6bac-9848-bfa1-faced8611cb6
Ancestors: Morphic-mt.1381
Small fix considering text selection after text-drag cancel.
Try a different offset for drag-transfer morphs. Let's see if we can point the dragged morphs more easily now.
=============== Diff against Morphic-mt.1381 ===============
Item was changed:
----- Method: TextMorph>>startDrag: (in category 'event handling') -----
startDrag: evt
+ self removeProperty: #waitingForTextDrag.
+
[evt hand grabMorph: (TransferMorph withPassenger: self selection from: self)]
ensure: [evt hand releaseMouseFocus: self].!
Item was changed:
----- Method: TextMorphForEditView>>acceptDroppingMorph:event: (in category 'dropping/grabbing') -----
acceptDroppingMorph: aTransferMorph event: evt
"Accept a text to be inserted at the event/cursor position. Either remove or keep the source text depending on the transfer morph's copy state."
- self removeProperty: #waitingForTextDrag.
-
self
handleInteraction: [
aTransferMorph shouldCopy
ifFalse: [(aTransferMorph source respondsTo: #editor)
ifTrue: [aTransferMorph source editor destructiveBackWord]].
self editor addText: aTransferMorph passenger asText event: evt]
fromEvent: evt.
evt hand newKeyboardFocus: self.!
Item was changed:
----- Method: TransferMorph>>aboutToBeGrabbedBy: (in category 'dropping/grabbing') -----
aboutToBeGrabbedBy: aHand
"The receiver is being grabbed by a hand.
Perform necessary adjustments (if any) and return the actual morph
that should be added to the hand."
"Since this morph has been initialized automatically with bounds origin
0@0, we have to move it to aHand position."
super aboutToBeGrabbedBy: aHand.
+ self align: self fullBounds topLeft with: aHand position + (aHand extent // 3).
- self align: self fullBounds bottomLeft with: aHand position.
aHand newKeyboardFocus: self.!