[squeak-dev] The Trunk: Tools-mt.1116.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Jan 27 11:10:00 UTC 2022
Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.1116.mcz
==================== Summary ====================
Name: Tools-mt.1116
Author: mt
Time: 27 January 2022, 12:09:57.521541 pm
UUID: f1b16021-118a-e64d-a71d-8646f9cb90e2
Ancestors: Tools-ct.1115
Makes the #fileOutOnAccept preference trigger an opt-in per Workspace window so that users actually learn where those contents will be saved.
=============== Diff against Tools-ct.1115 ===============
Item was changed:
----- Method: Workspace class>>open (in category 'instance creation') -----
open
| workspace |
workspace := self new.
- self fileOutOnAccept
- ifTrue: [workspace appendContentsToFileOnAccept].
^ self embedTranscript
ifTrue: [workspace buildAndOpenWorkspaceTranscript]
ifFalse: [workspace buildAndOpen]!
Item was changed:
----- Method: Workspace>>acceptContents: (in category 'accessing') -----
acceptContents: aString
+ (self class fileOutOnAccept and: [acceptAction isNil]) ifTrue: [
+ (Project uiManager
+ confirm: ('Do you want to append the contents to\\ {1}\\on accept so that you can safely close this window?\\{2}' translated withCRs asText format: {
+ (self suggestedFileNameForSave withNoLineLongerThan: 40) asText allBold.
+ '(You will not be asked again for this window. Use the window\menu to revise your decision later. Disable this prompt via the\system-wide #fileOutOnAccept preference.)' translated withCRs asText
+ addAttribute: (TextFontReference toFont: Preferences standardButtonFont)})
+ title: 'Accept Changes')
+ ifTrue: [self appendContentsToFileOnAccept]
+ ifFalse: [acceptAction := [:edits | true ]]].
+
- (self class fileOutOnAccept and: [acceptAction isNil]) ifTrue: [self inform: 'Your edits were <b>not persisted</b>. Please do not close this<br>window. If you want to save your edits to a file on accept,<br>check the workspace preferences or this window''s menu.' translated asTextFromHtml].
-
^ (acceptAction ifNotNil: [acceptAction value: aString]) ~~ false
and: [super acceptContents: aString]!
More information about the Squeak-dev
mailing list
|