[Pkg] The Trunk: Morphic-eem.1063.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Jan 6 01:45:30 UTC 2016

Eliot Miranda uploaded a new version of Morphic to project The Trunk:

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

Name: Morphic-eem.1063
Author: eem
Time: 5 January 2016, 5:44:45.9636 pm
UUID: 5874da4f-b659-476a-8f3f-ac77ab444305
Ancestors: Morphic-eem.1062

Avoid translating strings in MenuIcons redundantly on start-up.  This is for the VM simulator, but it'll also shave a few milliseconds off start-up, even on a fast machine (e.g. my 2.2GHz Core i7 takes ~ 3.75msecs to initializeTranslations).

=============== Diff against Morphic-eem.1062 ===============

Item was changed:
  Object subclass: #MenuIcons
  	instanceVariableNames: ''
+ 	classVariableNames: 'Icons TranslatedIcons TranslationLocale'
- 	classVariableNames: 'Icons TranslatedIcons'
  	poolDictionaries: ''
  	category: 'Morphic-Menus'!
  !MenuIcons commentStamp: 'sd 11/9/2003 14:09' prior: 0!
  I represent a registry for icons.  You can see the icons I contain using the following script:
  | dict methods |
  dict := Dictionary new. 
  methods := MenuIcons class selectors select: [:each | '*Icon' match: each asString].
  methods do: [:each | dict at: each put: (MenuIcons perform: each)].
  GraphicalDictionaryMenu openOn: dict withLabel: 'MenuIcons'!

Item was changed:
  ----- Method: MenuIcons class>>initializeTranslations (in category 'class initialization') -----
  	"Initialize the dictionary of <translated menu string>-><icon>"
+ 	TranslationLocale := LocaleID current.
  	TranslatedIcons := Dictionary new.
+ 	self itemsIcons do:
+ 		[:assoc|
+ 		assoc key do:
+ 			[:str| TranslatedIcons at: str translated asLowercase put: assoc value]]!
- 	self itemsIcons do: [ :assoc |
- 		assoc key do: [ :str | TranslatedIcons at: str translated asLowercase put: assoc value ]
- 	]!

Item was changed:
  ----- Method: MenuIcons class>>startUp: (in category 'class initialization') -----
  startUp: resuming 
+ 	resuming ifFalse: [^self].
+ 	TranslationLocale = LocaleID current ifTrue:
+ 		[^self].
- 	resuming
- 		ifFalse: [^ self].
  	self initializeTranslations!

More information about the Packages mailing list