Launcher.st
changeset 1465 4e73891eba4a
parent 1459 b15dfcd25441
child 1492 b703e42a7bd0
--- a/Launcher.st	Thu Feb 05 23:53:23 1998 +0100
+++ b/Launcher.st	Fri Feb 06 00:03:06 1998 +0100
@@ -1910,101 +1910,101 @@
     listOfLanguages := resources at:'LIST_OF_OFFERED_LANGUAGES' default:#('default').
     listOfLanguages := listOfLanguages asOrderedCollection.
     translatedLanguages := listOfLanguages collect:[:lang | |item|
-					item := resources at:lang.
-					item isString ifTrue:[
-					    item
-					] ifFalse:[
-					    item at:1
-					]
-				].
+                                        item := resources at:lang.
+                                        item isString ifTrue:[
+                                            item
+                                        ] ifFalse:[
+                                            item at:1
+                                        ]
+                                ].
     flags := listOfLanguages collect:[:lang | |item|
-					item := resources at:lang.
-					item isArray ifTrue:[
-					    item at:2
-					] ifFalse:[
-					    nil
-					]
-				].
+                                        item := resources at:lang.
+                                        item isArray ifTrue:[
+                                            item at:2
+                                        ] ifFalse:[
+                                            nil
+                                        ]
+                                ].
     flags := flags collect:[:nm | nm notNil ifTrue:[Image fromFile:nm] ifFalse:[nil]].
 
     languageList := translatedLanguages with:flags collect:[:lang :flag |
-				LabelAndIcon icon:flag string:lang.
-			].
+                                LabelAndIcon icon:flag string:lang.
+                        ].
 
     box := ListSelectionBox title:(resources string:'LANG_MSG') withCRs.
     box label:(resources string:'Language selection').
     box list:languageList.
     box initialText:(Language).
     box action:[:newLanguage |
-	self withWaitCursorDo:[
-	    |fontPref idx language oldLanguage enc answer matchingFonts|
-
-	    idx := translatedLanguages indexOf:newLanguage withoutSeparators.
-	    idx ~~ 0 ifTrue:[
-		language := listOfLanguages at:idx
-	    ] ifFalse:[
-		language := newLanguage
-	    ].
-
-	    "/ check if the new language needs a differently encoded font;
-	    "/ ask user to switch font and allow cancellation.
-	    "/ Otherwise, you are left with unreadable menu & button items ...
-
-	    oldLanguage := Smalltalk language.
-	    Smalltalk language:language asSymbol.
-	    ResourcePack flushCachedResourcePacks.
-	    fontPref := self class classResources at:'PREFERRED_FONT_ENCODING'.
-	    Smalltalk language:oldLanguage.
-
-	    switch := true.
-	    enc := MenuView defaultFont encoding.
-	    (fontPref match:enc) ifFalse:[
-		"/ look if there is one at all.
-		matchingFonts := Screen current listOfAvailableFonts select:[:f | fontPref match:f encoding].
-		matchingFonts size == 0 ifTrue:[
-		    (Dialog 
-			confirm:(resources 
-				    string:'your display does not offer any %1-encoded font.\\Change the language anyway ?\ (texts will probably be unreadable then)'
-				      with:fontPref) withCRs)
-		    ifFalse:[
-			switch := false
-		    ]
-		] ifFalse:[
-		    answer := Dialog 
-				confirmWithCancel:(resources 
-							string:'menu font is not %1-encoded.\\Change it ?'
-							with:fontPref) withCRs
-					   labels:(resources
-							array:#('cancel' 'no' 'yes'))
-					   default:3.
-		    answer isNil ifTrue:[
-			switch := false
-		    ] ifFalse:[
-			answer ifTrue:[
-			    switch := (self fontBoxForEncoding:fontPref)
-			]
-		    ].
-		].
-	    ].
-
-	    switch ifTrue:[
-		transcript showCR:'change language to ' , newLanguage , ' ...'.
-		Smalltalk language:language asSymbol.
-		ResourcePack flushCachedResourcePacks
-	    ].
-	].
-	switch ifTrue:[
-	    self reopenLauncher.
-	    DebugView newDebugger.
-	]
+        self withWaitCursorDo:[
+            |fontPref idx language oldLanguage enc answer matchingFonts|
+
+            idx := translatedLanguages indexOf:newLanguage withoutSeparators.
+            idx ~~ 0 ifTrue:[
+                language := listOfLanguages at:idx
+            ] ifFalse:[
+                language := newLanguage
+            ].
+
+            "/ check if the new language needs a differently encoded font;
+            "/ ask user to switch font and allow cancellation.
+            "/ Otherwise, you are left with unreadable menu & button items ...
+
+            oldLanguage := Smalltalk language.
+            Smalltalk language:language asSymbol.
+            ResourcePack flushCachedResourcePacks.
+            fontPref := self class classResources at:'PREFERRED_FONT_ENCODING' default:'iso8859*'.
+            Smalltalk language:oldLanguage.
+
+            switch := true.
+            enc := MenuView defaultFont encoding.
+            (fontPref match:enc) ifFalse:[
+                "/ look if there is one at all.
+                matchingFonts := Screen current listOfAvailableFonts select:[:f | fontPref match:f encoding].
+                matchingFonts size == 0 ifTrue:[
+                    (Dialog 
+                        confirm:(resources 
+                                    string:'your display does not offer any %1-encoded font.\\Change the language anyway ?\ (texts will probably be unreadable then)'
+                                      with:fontPref) withCRs)
+                    ifFalse:[
+                        switch := false
+                    ]
+                ] ifFalse:[
+                    answer := Dialog 
+                                confirmWithCancel:(resources 
+                                                        string:'menu font is not %1-encoded.\\Change it ?'
+                                                        with:fontPref) withCRs
+                                           labels:(resources
+                                                        array:#('cancel' 'no' 'yes'))
+                                           default:3.
+                    answer isNil ifTrue:[
+                        switch := false
+                    ] ifFalse:[
+                        answer ifTrue:[
+                            switch := (self fontBoxForEncoding:fontPref)
+                        ]
+                    ].
+                ].
+            ].
+
+            switch ifTrue:[
+                transcript showCR:'change language to ' , newLanguage , ' ...'.
+                Smalltalk language:language asSymbol.
+                ResourcePack flushCachedResourcePacks
+            ].
+        ].
+        switch ifTrue:[
+            self reopenLauncher.
+            DebugView newDebugger.
+        ]
     ].    
     box
-	addHelpButtonFor:'Launcher/languageSetting.html'.
+        addHelpButtonFor:'Launcher/languageSetting.html'.
     box open.
     box destroy
 
-    "Modified: 9.9.1996 / 22:43:27 / stefan"
-    "Modified: 24.6.1997 / 16:48:30 / cg"
+    "Modified: / 9.9.1996 / 22:43:27 / stefan"
+    "Modified: / 6.2.1998 / 00:00:38 / cg"
 !
 
 memorySettings
@@ -4933,7 +4933,7 @@
 "/ dialog (ask before changing the language, to have
 "/ proper texts in the dialogs).
 "/
-"/    fontPref := self class classResources at:'PREFERRED_FONT_ENCODING'.
+"/    fontPref := self class classResources at:'PREFERRED_FONT_ENCODING' default:'iso8859*'.
 "/    enc := MenuView defaultFont encoding.
 "/    (fontPref match:enc) ifFalse:[
 "/        (self confirm:'menu font is not ' , fontPref , '-encoded.\\Change it ?' withCRs)
@@ -4948,7 +4948,7 @@
     newLauncher := builder application.
     newLauncher transcript list:contents; hideCursor; scrollToBottom; cursorToEnd; showCursor
 
-    "Modified: / 5.2.1998 / 20:09:50 / cg"
+    "Modified: / 6.2.1998 / 00:00:45 / cg"
 !
 
 saveAllViews
@@ -4997,5 +4997,5 @@
 !Launcher class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Launcher.st,v 1.315 1998-02-05 19:11:03 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Launcher.st,v 1.316 1998-02-05 23:03:06 cg Exp $'
 ! !