# HG changeset patch # User ca # Date 1080299333 -3600 # Node ID cbf2079fd723eba72d8ef3e469a4527018f33688 # Parent 338ca80609c7abc303ec68558f665d2d07022081 bugfix: test whether specClass is a symbol not a string diff -r 338ca80609c7 -r cbf2079fd723 UIPainter.st --- a/UIPainter.st Wed Mar 24 11:52:31 2004 +0100 +++ b/UIPainter.st Fri Mar 26 12:08:53 2004 +0100 @@ -1,5 +1,3 @@ -"{ Encoding: utf8 }" - " COPYRIGHT (c) 1995-1998 by eXept Software AG All Rights Reserved @@ -3460,26 +3458,32 @@ doDefineClassAndSelector "launches a dialog for defining class, superclass, and selector of the application" - |again tmp| + |again readFromModelKeyed| + + readFromModelKeyed := [:aKey| |ret| + ret := (self aspectFor:aKey) value. + ret isEmptyOrNil ifTrue:[ + ret := nil + ] ifFalse:[ + ret isString ifTrue:[ + ret := ret string withoutSeparators. + ret := ret isEmpty ifTrue:[nil] ifFalse:[ret asSymbol]. + ]. + ]. + ret + ]. [ again := false. - (tmp := specClass) isNil ifTrue:[tmp := 'NewApplication']. - aspects at:#classNameChannel put:tmp asValue. - - (tmp := specSelector) isNil ifTrue:[tmp := 'windowSpec']. - aspects at:#methodNameChannel put:tmp asValue. - - (tmp := specSuperclass) isNil ifTrue:[tmp := 'ApplicationModel']. - aspects at:#superclassNameChannel put:tmp asValue. + aspects at:#classNameChannel put:(specClass ? 'NewApplication') asValue. + aspects at:#methodNameChannel put:(specSelector ? 'windowSpec') asValue. + aspects at:#superclassNameChannel put:(specSuperclass ? 'ApplicationModel') asValue. (self openDialogInterface:#dialogSpecForDefiningClassAndSelector) ifTrue:[ - - specClass := (self aspectFor:#classNameChannel) value. - specSelector := (self aspectFor:#methodNameChannel) value. - specSelector notNil ifTrue:[specSelector := specSelector asSymbol]. - specSuperclass := (self aspectFor:#superclassNameChannel) value. + specClass := readFromModelKeyed value:#classNameChannel. + specSelector := readFromModelKeyed value:#methodNameChannel. + specSuperclass := readFromModelKeyed value:#superclassNameChannel. (again := self checkClassAndSelector not) ifFalse:[ self painter className:specClass