[squeak-dev] The Inbox: System-ct.1373.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Oct 12 08:23:32 UTC 2022


Christoph Thiede uploaded a new version of System to project The Inbox:
http://source.squeak.org/inbox/System-ct.1373.mcz

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

Name: System-ct.1373
Author: ct
Time: 12 October 2022, 10:23:28.580894 am
UUID: 3305a796-cbc2-ac4e-a29f-0c3050d6b258
Ancestors: System-ct.1372

Proposal: When failing to open the sources or changes files, make it possible to retry from the dialog. Improves multilingual support.

=============== Diff against System-ct.1372 ===============

Item was changed:
  ----- Method: SmalltalkImage>>openSourcesAndChanges:forImage: (in category 'image, changes names') -----
  openSourcesAndChanges: changesName forImage: imageName 
  	"Open the changes and sources files and install them in SourceFiles. Inform the user of problems regarding write permissions or CR/CRLF mixups."
  	"Note: SourcesName and imageName are full paths; changesName is a  
  	local name."
+ 	| sources changes rmsg wmsg msgBlock |
+ 	rmsg := 'Squeak cannot locate {1}.
- 	| sources changes msg wmsg |
- 	msg := 'Squeak cannot locate {1}.
  
+ Please check that the file is named properly and is in the same directory as this image.' translated.
- Please check that the file is named properly and is in the same directory as this image.'.
  	wmsg := 'Squeak cannot write to {1}.
  
  Please check that you have write permission for this file.
  
+ You won''t be able to save this image correctly until you fix this.' translated.
+ 	msgBlock := [:msg | (Project uiManager
+ 		chooseOptionFromLabeledValues: (OrderedDictionary new
+ 			at: 'retry' translated put: [
+ 				self closeSourceFiles.
+ 				^ self openSourcesAndChanges: changesName forImage: imageName];
+ 			at: 'ignore' translated put: [];
+ 			yourself)
+ 		title: msg)
+ 			value].
+ 	
- You won''t be able to save this image correctly until you fix this.'.
- 
  	sources := Smalltalk openSources.
  	sources ifNotNil: [sources setConverterForCode].
  	changes := Smalltalk openChanges: changesName forImage: imageName.
  	changes ifNotNil: [changes setConverterForCode].
+ 	
- 
  	((sources == nil or: [sources atEnd])
+ 		and: [Preferences valueOfFlag: #warnIfNoSourcesFile])
+ 		ifTrue: [
+ 			Smalltalk platformName = 'Mac OS'
+ 				ifTrue: [rmsg := rmsg , '
+ Make sure the sources file is not an Alias.' translated].
+ 			msgBlock value: (rmsg format: { 'the sources file named {1}' translated format: {self sourcesName} })].
+ 	
- 			and: [Preferences valueOfFlag: #warnIfNoSourcesFile])
- 		ifTrue: [Smalltalk platformName = 'Mac OS'
- 				ifTrue: [msg := msg , '
- Make sure the sources file is not an Alias.'].
- self inform: (msg format: { 'the sources file named ' , self sourcesName })].
- 
  	(changes == nil
+ 		and: [Preferences valueOfFlag: #warnIfNoChangesFile])
+ 		ifTrue: [msgBlock value: (rmsg format: { 'the changes file named {1}' translated format: {changesName} })].
+ 	
- 			and: [Preferences valueOfFlag: #warnIfNoChangesFile])
- 		ifTrue: [self inform: (msg format: { 'the changes file named ' , changesName })].
- 
  	((Preferences valueOfFlag: #warnIfNoChangesFile) and: [changes notNil])
+ 		ifTrue: [
+ 			changes isReadOnly
+ 				ifTrue: [msgBlock value: (wmsg format: { 'the changes file named ' , changesName })].
+ 			
+ 			((changes next: 200) includesSubstring: String crlf)
+ 				ifTrue: [msgBlock value: ('The changes file named <b>{1}</b> has been injured by an unpacking utility. Line endings were changed from Cr to CrLf.<br><br>Please set the preferences in your decompressing program to 
- 		ifTrue: [changes isReadOnly
- 				ifTrue: [self inform: (wmsg format: { 'the changes file named ' , changesName })].
- 
- 			((changes next: 200)
- 					includesSubstring: String crlf)
- 				ifTrue: [self inform: ('The changes file named <b>{1}</b> has been injured by an unpacking utility. Line endings were changed from Cr to CrLf.<br><br>Please set the preferences in your decompressing program to 
  <b>do not convert text files</b> and unpack the system again.' translated format: { changesName }) asTextFromHtml]].
+ 	
- 
  	SourceFiles := Array with: sources with: changes!



More information about the Squeak-dev mailing list