[squeak-dev] The Inbox: System-ct.1248.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Nov 2 13:08:59 UTC 2021
A new version of System was added to project The Inbox:
http://source.squeak.org/inbox/System-ct.1248.mcz
==================== Summary ====================
Name: System-ct.1248
Author: ct
Time: 2 November 2021, 2:08:54.644566 pm
UUID: dd319d9f-bf79-3348-a4fa-ab08d6074eb1
Ancestors: System-eem.1244
Honor the preference #checkForUnsavedProjects when closing a project.
=============== Diff against System-eem.1244 ===============
Item was changed:
----- Method: Project>>okToChange (in category 'release') -----
okToChange
"Answer whether the window in which the project is housed can be dismissed -- which is destructive. We never clobber a project without confirmation"
| answer |
(self isCurrentProject and: [self isTopProject]) ifTrue: [
self inform: 'You cannot close the top project.'.
^ false].
+ ((Preferences valueOfFlag: #checkForUnsavedProjects) = false ==>
+ [self confirm: ('Do you really want to delete the project\{1}\and all its content?' withCRs translated format:{self name})])
- (self confirm: ('Do you really want to delete the project\{1}\and all its content?' withCRs translated format:{self name}))
ifFalse: [^ false].
self subProjects ifNotEmpty: [:sp |
answer := Project uiManager
chooseFrom: #(
"1" 'Lift all sub-projects'
"2" 'Discard all sub-projects (NO UNDO!!)'
"3 or 0" 'Cancel')
lines: #(2)
title: ('The project {1}\contains {2} sub-project(s).' withCRs translated format:{self name. sp size}).
(answer = 0 or: [answer = 3]) ifTrue: [^ false].
answer = 1 ifTrue: [self liftSubProjects. ^ true].
answer = 2 ifTrue: [^ sp allSatisfy: [:ea |
[ea okToChange] valueSuppressingMessages: {'*delete the project*and all its content*'}]]].
^ true!
More information about the Squeak-dev
mailing list
|