LicenceBox.st
changeset 250 645390ad8e95
parent 249 6698113011ea
child 527 30d5dfb51612
equal deleted inserted replaced
249:6698113011ea 250:645390ad8e95
     1 "
     1 "
     2  COPYRIGHT (c) 1996 by eXept Software AG
     2  COPYRIGHT (c) 1996 by eXept Software AG
     3               All Rights Reserved
     3 	      All Rights Reserved
     4 
     4 
     5  This software is furnished under a license and may be used
     5  This software is furnished under a license and may be used
     6  only in accordance with the terms of that license and with the
     6  only in accordance with the terms of that license and with the
     7  inclusion of the above copyright notice.   This software may not
     7  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
    22 !LicenceBox  class methodsFor:'documentation'!
    22 !LicenceBox  class methodsFor:'documentation'!
    23 
    23 
    24 copyright
    24 copyright
    25 "
    25 "
    26  COPYRIGHT (c) 1996 by eXept Software AG
    26  COPYRIGHT (c) 1996 by eXept Software AG
    27               All Rights Reserved
    27 	      All Rights Reserved
    28 
    28 
    29  This software is furnished under a license and may be used
    29  This software is furnished under a license and may be used
    30  only in accordance with the terms of that license and with the
    30  only in accordance with the terms of that license and with the
    31  inclusion of the above copyright notice.   This software may not
    31  inclusion of the above copyright notice.   This software may not
    32  be provided or otherwise made available to, or used by, any
    32  be provided or otherwise made available to, or used by, any
    81     "open myself modal and return true if accepted, false otherwise"
    81     "open myself modal and return true if accepted, false otherwise"
    82 
    82 
    83     ^ super open accepted.
    83     ^ super open accepted.
    84 
    84 
    85     "
    85     "
    86      self open
    86      LicenceBox open
    87     "
    87     "
    88 
    88 
    89     "Modified: 9.9.1996 / 17:52:48 / stefan"
    89     "Modified: 9.9.1996 / 17:52:48 / stefan"
    90 ! !
    90 ! !
    91 
    91 
   136     super initialize.
   136     super initialize.
   137     accepted := false.
   137     accepted := false.
   138 
   138 
   139     (self addTextLabel:(resources string:'Please read the licence terms:')) adjust:#left.
   139     (self addTextLabel:(resources string:'Please read the licence terms:')) adjust:#left.
   140     textView := self addTextBoxOn:nil 
   140     textView := self addTextBoxOn:nil 
   141                         class:HTMLDocumentView
   141 			class:HTMLDocumentView
   142                         withNumberOfLines:40 
   142 			withNumberOfLines:40 
   143                         hScrollable:true 
   143 			hScrollable:true 
   144                         vScrollable:true.
   144 			vScrollable:true.
       
   145 
   145     self width:(textView preferredExtentForLines:40 cols:70) x.
   146     self width:(textView preferredExtentForLines:40 cols:70) x.
   146     textView setText:(self licenceText).
   147     textView setText:(self licenceText).
   147     textView setTopDirectoryName:(self topDirectory).
   148     textView setTopDirectoryName:(self topDirectory).
   148     self addAbortButtonLabelled:(resources string:'reject licence terms').
   149     self addAbortButtonLabelled:(resources string:'reject licence terms').
   149     self addOkButtonLabelled:(resources string:'accept licence terms').
   150     self addOkButtonLabelled:(resources string:'accept licence terms').
   160     "get filename of licence file"
   161     "get filename of licence file"
   161 
   162 
   162     |fn|
   163     |fn|
   163 
   164 
   164     fileName isNil ifTrue:[
   165     fileName isNil ifTrue:[
   165         fileName := fn := resources at:'LICENCEFILE' default:nil.
   166 	fileName := fn := resources at:'LICENCEFILE' default:nil.
   166         fileName isNil ifTrue:[
   167 	fileName isNil ifTrue:[
   167              fileName := fn := 'doc/online/english/LICENCE.STX.html'.
   168 	     fileName := fn := 'doc/online/english/LICENCE.STX.html'.
   168         ].
   169 	].
   169         fileName asFilename exists ifFalse:[
   170 	fileName asFilename exists ifFalse:[
   170             fileName := Smalltalk getSystemFileName:fileName.
   171 	    fileName := Smalltalk getSystemFileName:fileName.
   171             fileName isNil ifTrue:[
   172 	    fileName isNil ifTrue:[
   172                 fileName := '../../' , fn.
   173 		fileName := '../../' , fn.
   173                 fileName asFilename exists ifFalse:[
   174 		fileName asFilename exists ifFalse:[
   174                     fileName := Smalltalk getSystemFileName:'doc/online/german/LICENCE.STX.html'.
   175 		    fileName := Smalltalk getSystemFileName:'doc/online/german/LICENCE.STX.html'.
   175                     fileName isNil ifTrue:[
   176 		    fileName isNil ifTrue:[
   176                         fileName := '../../doc/online/german/LICENCE.STX.html'.
   177 			fileName := '../../doc/online/german/LICENCE.STX.html'.
   177                     ]
   178 		    ]
   178                 ]
   179 		]
   179             ].
   180 	    ].
   180         ].
   181 	].
   181         fileName asFilename exists ifFalse:[
   182 	fileName asFilename exists ifFalse:[
   182             fileName := nil
   183 	    fileName := nil
   183         ].
   184 	].
   184     ].
   185     ].
   185     ^ fileName 
   186     ^ fileName 
   186 
   187 
   187     "
   188     "
   188      LicenceBox new licenceFile
   189      LicenceBox new licenceFile
   195 
   196 
   196     |file|
   197     |file|
   197 
   198 
   198     file := self licenceFile.
   199     file := self licenceFile.
   199     file isNil ifTrue:[
   200     file isNil ifTrue:[
   200         ^ 'oops - you are not allowed to remove the LICENSE file !!'
   201 	^ 'oops - you are not allowed to remove the LICENSE file !!'
   201     ].
   202     ].
   202     ^ file asFilename contents.
   203     ^ file asFilename contents.
   203 
   204 
   204     "
   205     "
   205      LicenceBox new licenceText
   206      LicenceBox new licenceText
   212 
   213 
   213     |file|
   214     |file|
   214 
   215 
   215     file := self licenceFile.
   216     file := self licenceFile.
   216     file isNil ifTrue:[
   217     file isNil ifTrue:[
   217         ^ ''
   218 	^ ''
   218     ].
   219     ].
   219     ^ file asFilename directoryName.
   220     ^ file asFilename directoryName.
   220 
   221 
   221     "
   222     "
   222      LicenceBox new topDirectory
   223      LicenceBox new topDirectory
   225 ! !
   226 ! !
   226 
   227 
   227 !LicenceBox  class methodsFor:'documentation'!
   228 !LicenceBox  class methodsFor:'documentation'!
   228 
   229 
   229 version
   230 version
   230     ^ '$Header: /cvs/stx/stx/libwidg2/LicenceBox.st,v 1.6 1996-09-23 22:45:32 stefan Exp $'
   231     ^ '$Header: /cvs/stx/stx/libwidg2/LicenceBox.st,v 1.7 1996-09-24 11:31:48 cg Exp $'
   231 ! !
   232 ! !
   232 LicenceBox initialize!
   233 LicenceBox initialize!