'From Moshi of 3 March 2007 [latest update: #253] on 20 July 2007 at 2:31:48 am'! "Change Set: flapsOnLanguageChg--sw Date: 20 July 2007 Author: Scott Wallace Let the sugarNavigator preference dominate over the eToyFriendly flag in determining which flaps to put up after a langauge change: * If sugarNavigator is true, put up the sugar flaps. * If sugarNavigator is false, then put up either - developer's flaps, i.e. Tools, Widgets, etc., if eToyFriendly is false - 'classic' etoy flaps (a la Squeakland) if eToyFriendly is true. * If user has destroyed existing flaps, the flaps menu offers all three alternatives for fresh flap installation. Cross-published from moshi update 0258flapsOnLanguageChg-sw. "! !Flaps class methodsFor: 'menu support' stamp: 'sw 7/16/2007 03:12'! enableClassicEToyFlaps "Start using global flaps, plug-in version, given that they were not present." Cursor wait showWhile: [Preferences disable: #sugarNavigator. self addAndEnableEToyFlaps. self sharedFlapsAlongBottom. WorldState addDeferredUIMessage: [self positionNavigatorAndOtherFlapsAccordingToPreference]. self enableGlobalFlaps]! ! !Flaps class methodsFor: 'menu support' stamp: 'sw 7/19/2007 22:37'! enableDeveloperFlaps "Start using the developers' flaps.given that they were not present." Cursor wait showWhile: [Preferences disable: #sugarNavigator. self enableGlobalFlaps. WorldState addDeferredUIMessage: [self positionNavigatorAndOtherFlapsAccordingToPreference]]! ! !Flaps class methodsFor: 'menu support' stamp: 'sw 7/16/2007 03:13'! enableOLPCEToyFlaps "Start using global flaps, plug-in version, given that they were not present." Cursor wait showWhile: [Preferences enable: #sugarNavigator. self addAndEnableEToyFlaps. self enableGlobalFlaps]! ! !Flaps class methodsFor: '*green' stamp: 'sw 4/20/2004 20:42'! destroyFlapDotDotDot "Prompt the user for a flap, and destroy the one chosen" | aMenu | aMenu _ MenuMorph new. aMenu title: 'Destroy flap named...'. self globalFlapTabsIfAny do: [:aFlapTab | aMenu add: aFlapTab flapID target: aFlapTab selector: #destroyFlap]. aMenu popUpInWorld. ! ! !Project methodsFor: 'language' stamp: 'sw 7/19/2007 17:39'! updateLocaleDependentsWithPreviousSupplies: aCollection gently: gentlyFlag "Set the project's natural language as indicated" ActiveWorld allTileScriptingElements do: [:viewerOrScriptor | viewerOrScriptor localeChanged]. Flaps disableGlobalFlaps: false. Preferences sugarNavigator ifTrue: [Flaps addAndEnableEToyFlapsWithPreviousEntries: aCollection. ActiveWorld addGlobalFlaps] ifFalse: [Preferences eToyFriendly ifTrue: [Flaps addAndEnableEToyFlaps. ActiveWorld addGlobalFlaps] ifFalse: [Flaps enableGlobalFlaps]]. (Project current isFlapIDEnabled: 'Navigator' translated) ifFalse: [Flaps enableDisableGlobalFlapWithID: 'Navigator' translated]. ParagraphEditor initializeTextEditorMenus. MenuIcons initializeTranslations. gentlyFlag ifTrue: [ LanguageEnvironment localeChangedGently. ] ifFalse: [ LanguageEnvironment localeChanged. ]. #(PartsBin ParagraphEditor BitEditor FormEditor StandardSystemController) do: [ :key | Smalltalk at: key ifPresent: [ :class | class initialize ]]. ActiveWorld reformulateUpdatingMenus. "self setFlaps. self setPaletteFor: aLanguageSymbol." ! ! !TheWorldMenu methodsFor: '*green' stamp: 'sw 7/19/2007 22:44'! formulateFlapsMenu: aMenu "Fill aMenu with appropriate content" aMenu addTitle: 'flaps' translated. aMenu addStayUpItem. Preferences classicNavigatorEnabled ifTrue: [aMenu addUpdating: #navigatorShowingString enablementSelector: #enableProjectNavigator target: Preferences selector: #togglePreference: argumentList: #(showProjectNavigator). aMenu balloonTextForLastItem: (Preferences preferenceAt: #showProjectNavigator) helpString translated]. Flaps sharedFlapsAllowed ifTrue: [self fillIn: aMenu from: {{#suppressFlapsString. {CurrentProjectRefactoring. #currentToggleFlapsSuppressed}. 'Whether prevailing flaps should be shown in the project right now or not.'}}. aMenu addUpdating: #automaticFlapLayoutString target: Preferences selector: #togglePreference: argumentList: #(automaticFlapLayout). aMenu balloonTextForLastItem: (Preferences preferenceAt: #automaticFlapLayout) helpString translated. aMenu addLine. Flaps addIndividualGlobalFlapItemsTo: aMenu]. self fillIn: aMenu from: { nil. {'make a new flap'. {Flaps. #addLocalFlap}. 'Create a new flap. You can later make it into a shared flap is you wish.'}. nil.}. Flaps sharedFlapsAllowed ifTrue: [aMenu addWithLabel: 'put shared flaps on bottom' translated enablementSelector: #showSharedFlaps target: Flaps selector: #sharedFlapsAlongBottom argumentList: #(). aMenu balloonTextForLastItem: 'Group all the standard shared flaps along the bottom edge of the screen' translated. self fillIn: aMenu from: { {'destroy all shared flaps'. {Flaps. #disableGlobalFlaps}. 'Destroy all the shared flaps and disable their use in all projects.'}. {'destroy flap...'. {Flaps. #destroyFlapDotDotDot}. 'Choose a flap to destroy, from a pop-up list that will be presented'}}] ifFalse: [aMenu add: 'install olpc etoy flaps' translated target: Flaps action: #enableOLPCEToyFlaps. aMenu balloonTextForLastItem: 'Put up the default etoy flaps: a custom Supplies flap and the Navigator flap' translated. aMenu add: 'install developers'' flaps' translated target: Flaps action: #enableDeveloperFlaps. aMenu balloonTextForLastItem: 'Create the default set of shared flaps used by successive versions of the Squeak development platform' translated. aMenu add: 'install classic etoy flaps' translated target: Flaps action: #enableClassicEToyFlaps. aMenu addLine]. self fillIn: aMenu from: { nil. {'about flaps...'. {Flaps . #explainFlaps}. 'Gives a window full of details about how to use flaps.'}}! !