SettingsDialog.st
changeset 4378 7021197a578f
child 4384 e16e816f6680
equal deleted inserted replaced
4377:088d29ff7029 4378:7021197a578f
       
     1 "{ Package: 'stx:libtool' }"
       
     2 
       
     3 ApplicationModel subclass:#SettingsDialog
       
     4 	instanceVariableNames:'requestor subCanvasApplicationHolder help doReload doSave
       
     5 		enableReload enableHelp enableOK selectedItem applicationList
       
     6 		categoryIcons'
       
     7 	classVariableNames:'ApplicationList IconList'
       
     8 	poolDictionaries:''
       
     9 	category:'Interface-Smalltalk'
       
    10 !
       
    11 
       
    12 HierarchicalList subclass:#HierarchicalApplicationList
       
    13 	instanceVariableNames:''
       
    14 	classVariableNames:''
       
    15 	poolDictionaries:''
       
    16 	privateIn:SettingsDialog
       
    17 !
       
    18 
       
    19 HierarchicalItem subclass:#ApplicationItem
       
    20 	instanceVariableNames:'application applicationClass icon label nameString'
       
    21 	classVariableNames:''
       
    22 	poolDictionaries:''
       
    23 	privateIn:SettingsDialog::HierarchicalApplicationList
       
    24 !
       
    25 
       
    26 !SettingsDialog class methodsFor:'documentation'!
       
    27 
       
    28 documentation
       
    29 
       
    30 "
       
    31     This is an application which can displays a list of Settings applications inherited by AbstractSettingsApplication
       
    32     You have to add the SettingsApplications with:
       
    33     
       
    34     [author:]
       
    35         Christian Penk, eXept Software AG
       
    36 "
       
    37 ! !
       
    38 
       
    39 !SettingsDialog class methodsFor:'accessing'!
       
    40 
       
    41 itemClass
       
    42 
       
    43     ^ SettingsDialog::HierarchicalApplicationList::ApplicationItem
       
    44 ! !
       
    45 
       
    46 !SettingsDialog class methodsFor:'application icons'!
       
    47 
       
    48 defaultSettingsAppIcon
       
    49 
       
    50     ^ self settingsIcon
       
    51 !
       
    52 
       
    53 settingsIcon
       
    54     "This resource specification was automatically generated
       
    55      by the ImageEditor of ST/X."
       
    56 
       
    57     "Do not manually edit this!! If it is corrupted,
       
    58      the ImageEditor may not be able to read the specification."
       
    59 
       
    60     "
       
    61      self settingsIcon inspect
       
    62      ImageEditor openOnClass:self andSelector:#settingsIcon
       
    63      Icon flushCachedIcons
       
    64     "
       
    65 
       
    66     <resource: #image>
       
    67 
       
    68     ^Icon
       
    69         constantNamed:#'AbstractLauncherApplication::SettingsDialog class settingsIcon'
       
    70         ifAbsentPut:[(Depth8Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
       
    71 @@BP#8>O#8>M  @@@@@@@@@@@@@@@@BJ%9&Y&Y&Y%R^B@@@@@@@@@@@@@@BI&J^(*J"(*JZTIIFQ$YFQ$YH@@@@@ JN#(:N#(:N#(9.V%)ZV%)ZKZP@@@HOU
       
    72 4=OS4=OL3,''I0<B;/]F3*TE?@@BC5MKR4-KM,\^:.MJ:-;21/:1D_@@@ =SR4-KM3<+K/<J01,R20+R+QG0@@HOT4-KR/,^?-\[H1(Q^WW"1*4Q<@@BC5MKR
       
    73 ,-CO1<>/+(X*F1(S,Z1D_@@@ =SR4-J:2,[J0X  TU!!BE+F$GS!!=@HOT,+WK.\J/28\&TV=EKAV1RELG  BC5L7H0-KB/HT TV-CKA8>TG@=_H8M ;[H1+::
       
    74 -;8\TWECKBD9)T=0]R40AXOE2;F5-;:/G6)EKBD?ZF5KV#ITJ0M>''*B_''ZF]''5,(KA8)X8ENU#XR@ )L^1$YFQ$YFQ$WBA PE@QMVSDON82S@@@@@@@@@@@@
       
    75 @@A_@F)IU#DQMWH@@@@@@@@@@@@@@@@@@F1JWC\LMJI''^ @@@@@@@@@@@@@@@F9GU28ROGI%+VY4@@@@@@@@@@@@@GIFXC(IL9(@^VR*X''\@@@@@@@@@@@AU
       
    76 IPXKP@@@@@A3XZ4#@@@@@@@@@@@@# 8AK90@@@@@@GX"T @a') ; colorMapFromArray:#[0 0 0 0 60 60 0 84 84 4 45 45 21 20 15 38 38 38 38 192 192 43 43 43 45 45 45 45 151 151 46 99 99 46 147 147 46 151 151 47 47 47 47 88 88 47 151 151 48 48 48 48 144 144 48 145 145 56 53 38 57 57 49 59 52 40 62 56 43 65 65 53 65 65 65 67 67 54 68 68 68 70 70 70 72 64 47 72 72 35 72 72 72 73 69 48 73 73 73 74 74 74 80 44 10 80 62 43 81 81 24 84 132 132 85 85 76 86 86 36 86 86 86 87 87 49 87 87 77 87 193 193 88 88 88 91 101 101 92 193 193 94 117 117 97 97 97 97 193 193 98 195 195 99 120 120 101 75 31 101 107 89 101 193 193 102 193 193 103 103 103 104 86 69 106 193 193 107 120 120 107 121 121 109 109 109 110 96 70 111 78 42 111 119 119 113 113 60 113 113 113 115 115 115 116 116 56 116 116 116 116 145 145 118 147 147 119 121 85 121 150 150 122 151 151 122 152 148 124 124 124 124 146 139 124 151 149 127 118 78 127 119 78 128 128 128 129 120 112 133 157 157 135 216 216 137 137 137 139 207 207 140 206 206 141 141 141 141 201 201 141 202 202 142 136 75 142 201 201 143 128 88 143 143 88 144 144 144 144 204 204 145 85 24 146 126 100 147 82 13 148 83 17 148 86 24 148 123 91 148 127 98 149 122 89 150 150 150 151 151 151 152 152 152 152 155 155 153 129 100 154 154 154 156 156 156 156 199 199 157 157 157 158 158 158 159 159 159 160 160 160 162 179 179 163 161 159 163 163 162 164 151 101 164 160 156 164 163 161 165 165 150 165 165 165 168 168 168 169 169 62 171 171 171 172 172 71 174 117 58 177 177 177 178 178 89 185 174 113 186 178 115 186 186 115 189 179 116 189 189 115 189 189 132 190 190 139 192 192 142 192 192 192 193 193 154 194 194 194 196 196 155 197 197 159 200 200 168 202 202 174 202 202 202 204 204 102 205 205 97 206 206 149 210 210 144 210 210 149 213 213 103 213 213 213 215 215 164 215 215 215 227 212 124 227 213 140 227 217 124 227 220 124 227 227 124 234 156 79 236 236 197 239 214 144 243 201 148 243 243 146 243 243 155 244 244 147 245 232 157 247 165 83 248 215 149 248 231 149 255 170 86 255 227 156 255 228 156 255 229 156 255 230 156 255 231 156 255 233 168 255 234 156 255 235 156 255 235 193 255 236 156 255 237 156 255 238 156 255 239 156 255 239 168 255 240 156 255 240 168 255 241 156 255 242 156 255 242 168 255 243 156 255 244 156 255 244 168 255 245 156 255 245 193 255 246 156 255 247 156 255 248 156 255 248 168 255 249 156 255 250 156 255 250 168 255 251 156 255 251 168 255 252 156 255 253 156 255 253 168 255 255 156 255 255 168 255 255 193 255 255 200]; mask:((ImageMask new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'O<@@_>@@???@??? ???0???0???0???0???0???8???8???<???<???<???<???8@B? @A?0@C?8@G=<@G0<@G0\') ; yourself); yourself]
       
    77 ! !
       
    78 
       
    79 !SettingsDialog class methodsFor:'interface specs'!
       
    80 
       
    81 windowSpec
       
    82     "This resource specification was automatically generated
       
    83      by the UIPainter of ST/X."
       
    84 
       
    85     "Do not manually edit this!! If it is corrupted,
       
    86      the UIPainter may not be able to read the specification."
       
    87 
       
    88     "
       
    89      UIPainter new openOnClass:SettingsDialog andSelector:#windowSpec
       
    90      SettingsDialog new openInterface:#windowSpec
       
    91      SettingsDialog open
       
    92     "
       
    93 
       
    94     <resource: #canvas>
       
    95 
       
    96     ^ 
       
    97      #(#FullSpec
       
    98         #name: #windowSpec
       
    99         #window: 
       
   100        #(#WindowSpec
       
   101           #label: 'Settings Dialog'
       
   102           #name: 'Settings Dialog'
       
   103           #min: #(#Point 10 10)
       
   104           #max: #(#Point 1024 768)
       
   105           #bounds: #(#Rectangle 16 42 816 662)
       
   106           #menu: #mainMenu
       
   107         )
       
   108         #component: 
       
   109        #(#SpecCollection
       
   110           #collection: #(
       
   111            #(#VariableHorizontalPanelSpec
       
   112               #name: 'VariableHorizontalPanel1'
       
   113               #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
       
   114               #showHandle: true
       
   115               #snapMode: #both
       
   116               #component: 
       
   117              #(#SpecCollection
       
   118                 #collection: #(
       
   119                  #(#ViewSpec
       
   120                     #name: 'Box1'
       
   121                     #component: 
       
   122                    #(#SpecCollection
       
   123                       #collection: #(
       
   124                        #(#HierarchicalListViewSpec
       
   125                           #name: 'HierarchicalListView1'
       
   126                           #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -34 1)
       
   127                           #model: #selectedItem
       
   128                           #hasHorizontalScrollBar: true
       
   129                           #hasVerticalScrollBar: true
       
   130                           #listModel: #applicationList
       
   131                           #useIndex: false
       
   132                           #highlightMode: #label
       
   133                           #showLeftIndicators: false
       
   134                           #indicatorSelector: #doIndicatorClick:
       
   135                         )
       
   136                        #(#HorizontalPanelViewSpec
       
   137                           #name: 'HorizontalPanel2'
       
   138                           #layout: #(#LayoutFrame 0 0.0 -34 1 0 1.0 0 1)
       
   139                           #horizontalLayout: #fitSpace
       
   140                           #verticalLayout: #center
       
   141                           #horizontalSpace: 3
       
   142                           #verticalSpace: 3
       
   143                           #component: 
       
   144                          #(#SpecCollection
       
   145                             #collection: #(
       
   146                              #(#ActionButtonSpec
       
   147                                 #label: 'Save as...'
       
   148                                 #name: 'Button1'
       
   149                                 #translateLabel: true
       
   150                                 #model: #saveSettings
       
   151                                 #extent: #(#Point 128 22)
       
   152                               )
       
   153                              #(#ActionButtonSpec
       
   154                                 #label: 'Load from...'
       
   155                                 #name: 'Button2'
       
   156                                 #translateLabel: true
       
   157                                 #model: #loadSettings
       
   158                                 #extent: #(#Point 128 22)
       
   159                               )
       
   160                              )
       
   161                            
       
   162                           )
       
   163                         )
       
   164                        )
       
   165                      
       
   166                     )
       
   167                   )
       
   168                  #(#ViewSpec
       
   169                     #name: 'Box2'
       
   170                     #component: 
       
   171                    #(#SpecCollection
       
   172                       #collection: #(
       
   173                        #(#SubCanvasSpec
       
   174                           #name: 'SubCanvas'
       
   175                           #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -34 1)
       
   176                           #level: -1
       
   177                           #hasHorizontalScrollBar: false
       
   178                           #hasVerticalScrollBar: false
       
   179                           #clientHolder: #subCanvasApplicationHolder
       
   180                           #postBuildCallback: #postBuildSubCanvas:
       
   181                         )
       
   182                        #(#HorizontalPanelViewSpec
       
   183                           #name: 'HorizontalPanel1'
       
   184                           #layout: #(#LayoutFrame 0 0.0 -34 1 0 1.0 0 1)
       
   185                           #horizontalLayout: #fitSpace
       
   186                           #verticalLayout: #center
       
   187                           #horizontalSpace: 3
       
   188                           #verticalSpace: 3
       
   189                           #component: 
       
   190                          #(#SpecCollection
       
   191                             #collection: #(
       
   192                              #(#ActionButtonSpec
       
   193                                 #label: 'OK'
       
   194                                 #name: 'OK'
       
   195                                 #translateLabel: true
       
   196                                 #model: #doSave
       
   197                                 #enableChannel: #enableOK
       
   198                                 #extent: #(#Point 127 22)
       
   199                               )
       
   200                              #(#ActionButtonSpec
       
   201                                 #label: 'Discard'
       
   202                                 #name: 'Reload'
       
   203                                 #translateLabel: true
       
   204                                 #model: #doReload
       
   205                                 #enableChannel: #enableReload
       
   206                                 #extent: #(#Point 128 22)
       
   207                               )
       
   208                              #(#ActionButtonSpec
       
   209                                 #label: 'Close'
       
   210                                 #name: 'Close'
       
   211                                 #translateLabel: true
       
   212                                 #model: #closeRequest
       
   213                                 #extent: #(#Point 127 22)
       
   214                               )
       
   215                              #(#ActionButtonSpec
       
   216                                 #label: 'Help'
       
   217                                 #name: 'Help'
       
   218                                 #translateLabel: true
       
   219                                 #model: #help
       
   220                                 #enableChannel: #enableHelp
       
   221                                 #extent: #(#Point 128 22)
       
   222                               )
       
   223                              )
       
   224                            
       
   225                           )
       
   226                         )
       
   227                        )
       
   228                      
       
   229                     )
       
   230                   )
       
   231                  )
       
   232                
       
   233               )
       
   234               #handles: #(#Any 0.3375 1.0)
       
   235             )
       
   236            )
       
   237          
       
   238         )
       
   239       )
       
   240 ! !
       
   241 
       
   242 !SettingsDialog class methodsFor:'menu specs'!
       
   243 
       
   244 mainMenu
       
   245     "This resource specification was automatically generated
       
   246      by the MenuEditor of ST/X."
       
   247 
       
   248     "Do not manually edit this!! If it is corrupted,
       
   249      the MenuEditor may not be able to read the specification."
       
   250 
       
   251     "
       
   252      MenuEditor new openOnClass:SettingsDialog andSelector:#mainMenu
       
   253      (Menu new fromLiteralArrayEncoding:(SettingsDialog mainMenu)) startUp
       
   254     "
       
   255 
       
   256     <resource: #menu>
       
   257 
       
   258     ^ 
       
   259      #(#Menu
       
   260         #(
       
   261          #(#MenuItem
       
   262             #label: 'File'
       
   263             #translateLabel: true
       
   264             #submenu: 
       
   265            #(#Menu
       
   266               #(
       
   267                #(#MenuItem
       
   268                   #label: 'Load from...'
       
   269                   #itemValue: #loadSettings
       
   270                   #translateLabel: true
       
   271                 )
       
   272                #(#MenuItem
       
   273                   #label: 'Save as...'
       
   274                   #itemValue: #saveSettings
       
   275                   #translateLabel: true
       
   276                 )
       
   277                #(#MenuItem
       
   278                   #label: 'Exit'
       
   279                   #itemValue: #closeRequest
       
   280                   #translateLabel: true
       
   281                 )
       
   282                )
       
   283               nil
       
   284               nil
       
   285             )
       
   286           )
       
   287          )
       
   288         nil
       
   289         nil
       
   290       )
       
   291 ! !
       
   292 
       
   293 !SettingsDialog methodsFor:'accessing'!
       
   294 
       
   295 requestor
       
   296     "return the 'requestor' of the SettingsDialog"
       
   297 
       
   298     ^ requestor
       
   299 !
       
   300 
       
   301 requestor:something
       
   302     "set the value of the instance variable 'requestor' (automatically generated)"
       
   303 
       
   304     requestor := something.
       
   305 ! !
       
   306 
       
   307 !SettingsDialog methodsFor:'actions'!
       
   308 
       
   309 destroyAll
       
   310 
       
   311     self applicationList do:[ : applItem |
       
   312         (applItem isCategory not and:[applItem application notNil]) ifTrue:[
       
   313             applItem application close.
       
   314         ].
       
   315     ].
       
   316     ^ true
       
   317 !
       
   318 
       
   319 doIndicatorClick:index 
       
   320     "handle a click on the indicator
       
   321     "
       
   322 
       
   323     (self applicationList at:index) toggleExpand
       
   324 !
       
   325 
       
   326 doReload
       
   327 
       
   328     | item |
       
   329 
       
   330     item := self selectedItem value.
       
   331     (item isNil or:[item isCategory or:[item application isNil]]) ifTrue:[ ^ self].
       
   332     item application loadRequest.
       
   333 !
       
   334 
       
   335 doSave
       
   336     | item |
       
   337 
       
   338     item := self selectedItem value.
       
   339     (item isNil or:[item isCategory or:[item application isNil]]) ifTrue:[ ^ self].
       
   340     item application saveSettings.
       
   341 !
       
   342 
       
   343 help
       
   344 
       
   345     | item |
       
   346 
       
   347     item := self selectedItem value.
       
   348     (item isNil or:[item isCategory or:[item application isNil]]) ifTrue:[ ^ self].
       
   349     item application help.
       
   350 !
       
   351 
       
   352 sendLoadRequestToAll
       
   353 
       
   354     self applicationList do:[ : applItem |
       
   355         (applItem isCategory not and:[applItem application notNil]) ifTrue:[
       
   356             ^ applItem application loadRequest 
       
   357         ].
       
   358     ].
       
   359     ^ true
       
   360 !
       
   361 
       
   362 sendSaveRequestToAll
       
   363 
       
   364     self applicationList do:[ : applItem |
       
   365         (applItem isCategory not and:[applItem application notNil]) ifTrue:[
       
   366             applItem application saveRequest ifFalse:[
       
   367                 ^ false
       
   368             ].
       
   369         ].
       
   370     ].
       
   371     ^ true
       
   372 ! !
       
   373 
       
   374 !SettingsDialog methodsFor:'application list access'!
       
   375 
       
   376 addApplClass:aClass withName:aName
       
   377 " add a application in the to the settingsTree, take the icon from the application class defaultIcon method"
       
   378 
       
   379     self addApplClass:aClass withName:aName icon:nil.
       
   380 !
       
   381 
       
   382 addApplClass:aClass withName:aName icon:icon
       
   383 
       
   384     |applicationLabel locIcon locClass|
       
   385 
       
   386     (self applicationNames includes:aName) ifTrue:[
       
   387         ^ self.
       
   388     ].
       
   389     self addCategoriesFor:aName.
       
   390     locIcon := icon.
       
   391     locClass := Smalltalk classNamed:aClass.
       
   392     (locIcon isNil and:[locClass respondsTo:#defaultIcon]) ifTrue:[ locIcon := locClass defaultIcon].
       
   393     applicationLabel := (aName asCollectionOfSubstringsSeparatedBy:$/) last.
       
   394     self createItemName:aName label:applicationLabel class:locClass icon:locIcon
       
   395 !
       
   396 
       
   397 addIcon:aIcon forCategory:aCategoryName
       
   398 
       
   399 " add a new category Icon for a categorie "
       
   400 
       
   401     self categoryIcons at:aCategoryName put:aIcon
       
   402 !
       
   403 
       
   404 applicationNames
       
   405 
       
   406     ^ self applicationList collect:[:item | item nameString].
       
   407 !
       
   408 
       
   409 categoryIcons
       
   410 
       
   411     categoryIcons isNil ifTrue:[
       
   412         categoryIcons := Dictionary new.
       
   413     ].
       
   414     ^ categoryIcons 
       
   415 !
       
   416 
       
   417 remApplClass:aName 
       
   418 " remove a application from the settingsTree"
       
   419 
       
   420     |item parent remParent|
       
   421 
       
   422     item := self getItemForName:aName.
       
   423     parent := item parent.
       
   424     parent remove:item.
       
   425     
       
   426     [parent isCategory and:[parent children isEmptyOrNil]] whileTrue:[
       
   427         remParent := parent.
       
   428         parent := remParent parent.
       
   429         parent remove:remParent.
       
   430     ].
       
   431 !
       
   432 
       
   433 removeApplicationByClass:aClass
       
   434 
       
   435     | classEntries|
       
   436 
       
   437     self applicationList isNil ifTrue:[
       
   438         self initialize.
       
   439     ].
       
   440     classEntries := self applicationList select:[: aEntry | ((aEntry at:2) == aClass)].
       
   441     ApplicationList removeAll:classEntries.
       
   442 ! !
       
   443 
       
   444 !SettingsDialog methodsFor:'application list access -private'!
       
   445 
       
   446 addCategoriesFor:aName
       
   447 
       
   448     " create all the categories before application itself
       
   449     "
       
   450 
       
   451     (aName includes:$/) not ifTrue:[ ^ self].
       
   452     self treeName:aName do:[:currentLabel :currentName| | length icon|
       
   453         currentLabel notEmpty ifTrue:[
       
   454             icon := self categoryIcons at:currentName ifAbsent:[nil].
       
   455             self createItemName:currentName label:currentLabel icon:icon.
       
   456         ]
       
   457     ] forgetLast:1.
       
   458 !
       
   459 
       
   460 createItemName:aNameString label:aLabel class:aClass icon:aIcon
       
   461 
       
   462     " create an application item in my application list 
       
   463     "
       
   464     | newItem rootItem parent locIcon|
       
   465 
       
   466     aNameString ~= aLabel ifTrue:[
       
   467         parent := self getItemForName:(aNameString copyTo:(aNameString size - aLabel size - 1)).
       
   468     ].
       
   469     parent isNil ifTrue:[
       
   470         parent := self applicationList root.
       
   471     ].
       
   472     parent children notNil ifTrue:[
       
   473         (parent children detect:[ :aItem | aItem label = aLabel] ifNone:[nil]) notNil ifTrue:[
       
   474             ^ self.
       
   475         ]
       
   476     ].
       
   477     newItem := self class itemClass new.  
       
   478     newItem label:(Text string:aLabel emphasis:#bold).
       
   479     newItem nameString:aNameString.
       
   480     newItem applicationClass:aClass.
       
   481     locIcon := aIcon.
       
   482     locIcon isNil ifTrue:[ locIcon := self class defaultSettingsAppIcon].
       
   483     newItem icon:locIcon.
       
   484     rootItem := self applicationList root.
       
   485     parent children isNil ifTrue:[
       
   486         parent children:(OrderedCollection with:newItem)
       
   487     ] ifFalse:[
       
   488         | newColl alreadyIn|
       
   489         newColl := parent children copy.
       
   490         newColl add:newItem.
       
   491         parent children:newColl.
       
   492     ]
       
   493 !
       
   494 
       
   495 createItemName:aNameString label:aLabel icon:aIcon
       
   496 
       
   497     " create an application item in my application list 
       
   498     "
       
   499     self createItemName:aNameString label:aLabel class:nil icon:aIcon
       
   500 !
       
   501 
       
   502 getItemForName:aName
       
   503 
       
   504     | searchItem|
       
   505 
       
   506     searchItem := self applicationList root.
       
   507     self treeName:aName do:[:currentLabel :currentName|
       
   508         searchItem children isNil ifTrue:[ ^ nil].
       
   509         searchItem := searchItem children detect:[: item | item nameString = currentName] ifNone:[nil].
       
   510         searchItem isNil ifTrue:[ ^ nil].
       
   511     ].
       
   512     ^ searchItem
       
   513 !
       
   514 
       
   515 treeName:aName do:aBlock
       
   516 
       
   517     self treeName:aName do:aBlock forgetLast:0
       
   518 !
       
   519 
       
   520 treeName:aName do:aBlock forgetLast:last
       
   521 
       
   522     | tree  length|
       
   523 
       
   524     tree := aName asCollectionOfSubstringsSeparatedBy:$/.
       
   525     tree from:1 to:(tree size - last) keysAndValuesDo:[:idx :aCategory| | itemName |
       
   526         length := 0.
       
   527         tree from:1 to:idx keysAndValuesDo:[:idx2 : el | 
       
   528             length := length + el size.
       
   529             idx2 > 1 ifTrue:[length := length + 1].
       
   530         ].
       
   531         itemName := aName copyTo:length.
       
   532         aBlock value:aCategory value:itemName.
       
   533     ].
       
   534 ! !
       
   535 
       
   536 !SettingsDialog methodsFor:'aspects'!
       
   537 
       
   538 applicationList
       
   539 
       
   540     applicationList isNil ifTrue:[
       
   541         applicationList := SettingsDialog::HierarchicalApplicationList new.
       
   542     ].
       
   543     ^ applicationList.
       
   544 !
       
   545 
       
   546 enableHelp
       
   547 
       
   548     enableHelp isNil ifTrue:[
       
   549         enableHelp := true asValue.
       
   550     ].
       
   551     ^ enableHelp.
       
   552 !
       
   553 
       
   554 enableOK
       
   555 
       
   556     enableOK isNil ifTrue:[
       
   557         enableOK := true asValue.
       
   558     ].
       
   559     ^ enableOK.
       
   560 !
       
   561 
       
   562 enableReload
       
   563 
       
   564     enableReload isNil ifTrue:[
       
   565         enableReload := true asValue.
       
   566     ].
       
   567     ^ enableReload.
       
   568 !
       
   569 
       
   570 selectedItem
       
   571 
       
   572     selectedItem isNil ifTrue:[
       
   573         selectedItem := ValueHolder new.
       
   574         selectedItem addDependent:self.
       
   575     ].
       
   576     ^ selectedItem.
       
   577 !
       
   578 
       
   579 subCanvasApplicationHolder
       
   580 
       
   581     subCanvasApplicationHolder isNil ifTrue:[
       
   582         subCanvasApplicationHolder := ValueHolder new.
       
   583     ].
       
   584     ^ subCanvasApplicationHolder.
       
   585 ! !
       
   586 
       
   587 !SettingsDialog methodsFor:'change & update'!
       
   588 
       
   589 modifiedChanged
       
   590 
       
   591     |changedObject|
       
   592 
       
   593     changedObject := self subCanvasApplicationHolder value modifiedChannel.
       
   594     self enableOK value:(changedObject value).
       
   595     self enableReload value:(changedObject value).
       
   596 !
       
   597 
       
   598 selectionChanged
       
   599 
       
   600     | item oldAppl noApp|
       
   601 
       
   602     oldAppl := self subCanvasApplicationHolder value.
       
   603     oldAppl notNil ifTrue:[
       
   604         oldAppl saveRequest.
       
   605         oldAppl modifiedChannel removeDependent:self.
       
   606     ].
       
   607     item := self selectedItem value.
       
   608     item isNil ifTrue:[ noApp := true] ifFalse:[noApp := item isCategory].
       
   609     self enableOK value:(noApp not).
       
   610     self enableReload value:(noApp not).
       
   611     self enableHelp value:(noApp not).
       
   612     noApp ifTrue:[
       
   613         self subCanvasApplicationHolder value:nil.
       
   614         ^ self
       
   615     ].
       
   616     item application isNil ifTrue:[
       
   617         item application:(item applicationClass new).
       
   618 
       
   619     ].
       
   620     item application modifiedChannel addDependent:self.
       
   621     self subCanvasApplicationHolder value:item application.
       
   622     self modifiedChanged.
       
   623 !
       
   624 
       
   625 update:something with:aParameter from:changedObject
       
   626     "Invoked when an object that I depend upon sends a change notification."
       
   627 
       
   628     "stub code automatically generated - please change as required"
       
   629 
       
   630     changedObject == self selectedItem ifTrue:[
       
   631         self selectionChanged.
       
   632         ^ self
       
   633     ].
       
   634     changedObject == self subCanvasApplicationHolder value modifiedChannel ifTrue:[
       
   635         self modifiedChanged.
       
   636         ^ self
       
   637     ].
       
   638 
       
   639     super update:something with:aParameter from:changedObject
       
   640 ! !
       
   641 
       
   642 !SettingsDialog methodsFor:'initialization & release'!
       
   643 
       
   644 closeRequest
       
   645     "This is a hook method generated by the Browser.
       
   646      It will be invoked when your app/dialog-window is about to be
       
   647      closed (this method has a chance to suppress the close).
       
   648      See also #closeDownViews, which is invoked when the close is really done."
       
   649 
       
   650     self sendSaveRequestToAll ifFalse:[ ^ self].
       
   651     self destroyAll.
       
   652     self requestor settingsClosed.
       
   653     ^ super closeRequest
       
   654 !
       
   655 
       
   656 initialize
       
   657 
       
   658     |rootItem|
       
   659 
       
   660     resources := AbstractLauncherApplication resources.
       
   661     rootItem := self class itemClass new.
       
   662     rootItem label:(Text string:(resources string:'Settings') emphasis:#bold).
       
   663     rootItem nameString:'Settings'.
       
   664     rootItem icon:self class settingsIcon.
       
   665     self applicationList root:rootItem.
       
   666     self applicationList showRoot:true.
       
   667     self selectedItem value:rootItem.
       
   668     super initialize.
       
   669 !
       
   670 
       
   671 postBuildSubCanvas:aWidget
       
   672 
       
   673     aWidget keepClientView:true. 
       
   674 !
       
   675 
       
   676 postOpenWith:aBuilder
       
   677 
       
   678     self applicationList root expand.
       
   679     super postOpenWith:aBuilder.
       
   680 ! !
       
   681 
       
   682 !SettingsDialog methodsFor:'menu actions'!
       
   683 
       
   684 loadSettings
       
   685 
       
   686     "restore settings from a settings-file."
       
   687 
       
   688     "a temporary kludge - we need a central systemSettings object for this,
       
   689      which can be saved/restored with a single store/read."
       
   690 
       
   691     |fileName|
       
   692 
       
   693     fileName := Dialog 
       
   694         requestFileName:(resources string:'Load Settings From:') 
       
   695         default:'settings.stx'
       
   696         ok:(resources string:'Load') 
       
   697         abort:(resources string:'Cancel') 
       
   698         pattern:'*.stx'
       
   699         fromDirectory:nil.
       
   700 
       
   701     (fileName size == 0) ifTrue:[
       
   702         "/ canceled
       
   703         ^ self
       
   704     ].
       
   705 
       
   706     self withWaitCursorDo:[
       
   707         Smalltalk fileIn:fileName.
       
   708         Transcript current topView model reOpen.
       
   709         self sendLoadRequestToAll.
       
   710     ].
       
   711 !
       
   712 
       
   713 saveSettings
       
   714 
       
   715     |fileName resources|
       
   716 
       
   717     resources := self class owningClass classResources.
       
   718 
       
   719     fileName := Dialog 
       
   720         requestFileName:(resources string:'Save settings in:') 
       
   721         default:'settings.stx'
       
   722         ok:(resources string:'Save') 
       
   723         abort:(resources string:'Cancel') 
       
   724         pattern:'*.stx'
       
   725         fromDirectory:'.'.
       
   726 
       
   727     fileName size ~~ 0 ifTrue:[
       
   728         "not canceled"
       
   729         self saveSettingsIn:fileName.
       
   730     ]
       
   731 !
       
   732 
       
   733 saveSettingsIn:fileName
       
   734     "save settings to a settings-file."
       
   735 
       
   736     "a temporary kludge - we need a central systemSettings object for this,
       
   737      which can be saved/restored with a single store/read.
       
   738      Will move entries over to UserPreferences over time;
       
   739      new items should always go there."
       
   740 
       
   741     |resources s screen currentUserPrefs|
       
   742 
       
   743     resources := self class owningClass classResources.
       
   744 
       
   745     s := fileName asFilename writeStream.
       
   746     s isNil ifTrue:[
       
   747         self warn:(resources string:'Cannot write the %1 file !!' with:fileName).
       
   748         ^ self
       
   749     ].
       
   750 
       
   751     currentUserPrefs := UserPreferences current.
       
   752     screen := Screen current.
       
   753 
       
   754     s nextPutLine:'"/ ST/X saved settings';
       
   755       nextPutLine:'"/ DO NOT MODIFY MANUALLY';
       
   756       nextPutLine:'"/ (modifications would be lost with next save-settings)';
       
   757       nextPutLine:'"/';
       
   758       nextPutLine:'"/ this file was automatically generated by the';
       
   759       nextPutLine:'"/ ''save settings'' function of the Launcher';
       
   760       nextPutLine:'"/'.
       
   761     s cr.
       
   762 
       
   763     s nextPutLine:'"/'.
       
   764     s nextPutLine:'"/ saved by ' , OperatingSystem getLoginName , '@' , OperatingSystem getHostName , ' at ' , AbsoluteTime now printString.
       
   765     s nextPutLine:'"/'.
       
   766     s cr.
       
   767 
       
   768     s nextPutLine:'"/'.
       
   769     s nextPutLine:'"/ Display settings:'.
       
   770     s nextPutLine:'"/'.
       
   771     s nextPutLine:'"/ only restore the display settings, if on the same Display ...'.
       
   772     s nextPutLine:'Display notNil ifTrue:['.
       
   773     s nextPutLine:' Display displayName = ' , (screen displayName storeString) , ' ifTrue:['.
       
   774       screen fixColors notNil ifTrue:[
       
   775         s nextPutLine:'  Image flushDeviceImages.'.
       
   776         s nextPutLine:'  Color colorAllocationFailSignal catch:['.
       
   777         s nextPutLine:'    Color getColorsRed:6 green:6 blue:4 on:Display'.
       
   778         s nextPutLine:'  ].'.
       
   779       ] ifFalse:[
       
   780         s nextPutLine:'  Display releaseFixColors.'.
       
   781       ].
       
   782       s nextPutLine:'  Display hasColors: ' , (screen hasColors storeString) , '.'.
       
   783       s nextPutLine:'  Display widthInMillimeter: ' , (screen widthInMillimeter storeString) , '.'.
       
   784       s nextPutLine:'  Display heightInMillimeter: ' , (screen heightInMillimeter storeString) , '.'.
       
   785       s nextPutLine:'  Display supportsDeepIcons: ' , (screen supportsDeepIcons storeString) , '.'.
       
   786       s nextPutLine:'  Image ditherAlgorithm: ' , (Image ditherAlgorithm storeString) , '.'.
       
   787       s nextPutLine:'  View defaultStyle:' , View defaultStyle storeString , '.'.
       
   788     s nextPutLine:' ].'.
       
   789     s nextPutLine:'].'.
       
   790     s cr.
       
   791 
       
   792     s nextPutLine:'"/'.
       
   793     s nextPutLine:'"/ Compiler settings:'.
       
   794     s nextPutLine:'"/'.
       
   795     s nextPutLine:'Compiler warnSTXSpecials: ' , (Compiler warnSTXSpecials storeString) , '.';
       
   796       nextPutLine:'Compiler warnUnderscoreInIdentifier: ' , (Compiler warnUnderscoreInIdentifier storeString) , '.';
       
   797       nextPutLine:'Compiler warnOldStyleAssignment: ' , (Compiler warnOldStyleAssignment storeString) , '.';
       
   798       nextPutLine:'Compiler warnCommonMistakes: ' , (Compiler warnCommonMistakes storeString) , '.';
       
   799       nextPutLine:'Compiler warnPossibleIncompatibilities: ' , (Compiler warnPossibleIncompatibilities storeString) , '.';
       
   800       nextPutLine:'Compiler allowUnderscoreInIdentifier: ' , (Compiler allowUnderscoreInIdentifier storeString) , '.';
       
   801       nextPutLine:'Compiler allowSqueakExtensions: ' , (Compiler allowSqueakExtensions storeString) , '.';
       
   802       nextPutLine:'Compiler allowDolphinExtensions: ' , (Compiler allowDolphinExtensions storeString) , '.';
       
   803       nextPutLine:'Compiler arraysAreImmutable: ' , (Compiler arraysAreImmutable storeString) , '.';
       
   804       nextPutLine:'Compiler lineNumberInfo: ' , (Compiler lineNumberInfo storeString) , '.';
       
   805 
       
   806       nextPutLine:'Compiler foldConstants: ' , (Compiler foldConstants storeString) , '.';
       
   807       nextPutLine:'Compiler stcCompilation: ' , (Compiler stcCompilation storeString) , '.';
       
   808       nextPutLine:'OperatingSystem getOSType = ' , (OperatingSystem getOSType storeString) , ' ifTrue:[';
       
   809       nextPutLine:'  Compiler stcCompilationIncludes: ' , (Compiler stcCompilationIncludes storeString) , '.';
       
   810       nextPutLine:'  Compiler stcCompilationDefines: ' , (Compiler stcCompilationDefines storeString) , '.';
       
   811       nextPutLine:'  Compiler stcCompilationOptions: ' , (Compiler stcCompilationOptions storeString) , '.';
       
   812       nextPutLine:'  ' , (Compiler stcModulePath storeString) , ' asFilename exists ifTrue:[';
       
   813       nextPutLine:'    Compiler stcModulePath: ' , (Compiler stcModulePath storeString) , '.';
       
   814       nextPutLine:'  ].';
       
   815       nextPutLine:'  Compiler stcPath: ' , (Compiler stcPath storeString) , '.';
       
   816       nextPutLine:'  Compiler ccCompilationOptions: ' , (Compiler ccCompilationOptions storeString) , '.';
       
   817       nextPutLine:'  Compiler ccPath: ' , (Compiler ccPath storeString) , '.';
       
   818       nextPutLine:'  ObjectFileLoader linkArgs: ' , (ObjectFileLoader linkArgs storeString) , '.';
       
   819       nextPutLine:'  ObjectFileLoader linkCommand: ' , (ObjectFileLoader linkCommand storeString) , '.';
       
   820       nextPutLine:'  ObjectFileLoader libPath: ' , (ObjectFileLoader libPath storeString) , '.';
       
   821       nextPutLine:'  ObjectFileLoader searchedLibraries: ' , (ObjectFileLoader searchedLibraries storeString) , '.';
       
   822       nextPutLine:'].';
       
   823 
       
   824       nextPutLine:'ObjectMemory justInTimeCompilation: ' , (ObjectMemory justInTimeCompilation storeString) , '.';
       
   825       nextPutLine:'ObjectMemory fullSingleStepSupport: ' , (ObjectMemory fullSingleStepSupport storeString) , '.'.
       
   826 
       
   827     HistoryManager notNil ifTrue:[
       
   828         HistoryManager isActive ifTrue:[
       
   829             s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager activate].'.
       
   830             s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager fullHistoryUpdate:' , HistoryManager fullHistoryUpdate storeString , '].'.
       
   831         ] ifFalse:[
       
   832             s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager deactivate].'.
       
   833         ].
       
   834     ].
       
   835 
       
   836     ObjectFileLoader notNil ifTrue:[
       
   837         s nextPutLine:'ObjectFileLoader searchedLibraries: ' , (ObjectFileLoader searchedLibraries storeString) , '.'.
       
   838         s nextPutLine:'ObjectFileLoader libPath: ' , (ObjectFileLoader libPath storeString) , '.'.
       
   839     ].
       
   840 
       
   841     s nextPutLine:'Class catchMethodRedefinitions: ' , (Class catchMethodRedefinitions storeString) , '.'.
       
   842     s nextPutLine:'ClassCategoryReader sourceMode: ' , (ClassCategoryReader sourceMode storeString) , '.'.
       
   843 
       
   844     s cr.
       
   845     s nextPutLine:'"/'.
       
   846     s nextPutLine:'"/ Info & Debug Messages:'.
       
   847     s nextPutLine:'"/'.
       
   848     s nextPutLine:'ObjectMemory infoPrinting: ' , (ObjectMemory infoPrinting storeString) , '.';
       
   849       nextPutLine:'ObjectMemory debugPrinting: ' , (ObjectMemory debugPrinting storeString) , '.';
       
   850       nextPutLine:'Object infoPrinting: ' , (Object infoPrinting storeString) , '.';
       
   851       nextPutLine:'DeviceWorkstation errorPrinting: ' , (DeviceWorkstation errorPrinting storeString) , '.'.
       
   852 
       
   853     FlyByHelp isActive ifTrue:[
       
   854         s nextPutLine:'FlyByHelp start.'
       
   855     ].
       
   856 
       
   857     s cr.
       
   858     s nextPutLine:'"/'.
       
   859     s nextPutLine:'"/ Edit settings:'.
       
   860     s nextPutLine:'"/'.
       
   861     "/ s nextPutLine:'EditTextView st80Mode: ' , (EditTextView st80Mode storeString) , '.'.
       
   862     s nextPutLine:'TextView st80SelectMode: ' , (TextView st80SelectMode storeString) , '.'.
       
   863     s nextPutLine:'UserPreferences current syntaxColoring: ' , (currentUserPrefs syntaxColoring storeString) , '.'.
       
   864     (ListView userDefaultTabPositions = ListView tab4Positions) ifTrue:[
       
   865         s nextPutLine:'ListView userDefaultTabPositions:(ListView tab4Positions).'.
       
   866     ] ifFalse:[
       
   867         s nextPutLine:'ListView userDefaultTabPositions:(ListView tab8Positions).'.
       
   868     ].
       
   869 
       
   870     s nextPutLine:'"/'.
       
   871     s nextPutLine:'"/ User preference values:'.
       
   872     s nextPutLine:'"/'.
       
   873     currentUserPrefs keysAndValuesDo:[:k :v |
       
   874         (UserPreferences includesSelector:(k , ':') asSymbol) ifTrue:[
       
   875             s nextPutLine:'UserPreferences current ' , k , ':' , v storeString , '.'.
       
   876         ] ifFalse:[
       
   877             s nextPutLine:'UserPreferences current at:' , k storeString , ' put:' , v storeString , '.'.
       
   878         ]
       
   879     ].
       
   880 
       
   881     s cr.
       
   882     s nextPutLine:'"/'.
       
   883     s nextPutLine:'"/ Misc settings:'.
       
   884     s nextPutLine:'"/'.
       
   885     s nextPutLine:'Class keepMethodHistory: ' , (Class methodHistory notNil storeString) , '.';
       
   886       nextPutLine:'Smalltalk logDoits: ' , (Smalltalk logDoits storeString) , '.';
       
   887       nextPutLine:'Autoload compileLazy: ' , (Autoload compileLazy storeString) , '.';
       
   888       nextPutLine:'Smalltalk loadBinaries: ' , (Smalltalk loadBinaries storeString) , '.';
       
   889       nextPutLine:'StandardSystemView includeHostNameInLabel: ' , (StandardSystemView includeHostNameInLabel storeString) , '.';
       
   890 
       
   891       "/ claus - I dont think its a good idea to save those ...
       
   892       nextPutLine:'"/ Class updateChanges: ' , (Class updatingChanges storeString) , '.';
       
   893       nextPutLine:'"/ ObjectMemory nameForChanges: ' , (ObjectMemory nameForChanges storeString) , '.';
       
   894 
       
   895       nextPutLine:'StandardSystemView returnFocusWhenClosingModalBoxes: ' , (StandardSystemView returnFocusWhenClosingModalBoxes storeString) , '.';
       
   896       nextPutLine:'StandardSystemView takeFocusWhenMapped: ' , (StandardSystemView takeFocusWhenMapped storeString) , '.';
       
   897       nextPutLine:'Display notNil ifTrue:[';
       
   898       nextPutLine:' Display activateOnClick: ' , ((screen activateOnClick:nil) storeString) , '.';
       
   899       nextPutLine:'].';
       
   900       nextPutLine:'MenuView showAcceleratorKeys: ' , (MenuView showAcceleratorKeys storeString) , '.';
       
   901       nextPutLine:'Class tryLocalSourceFirst: ' , (Class tryLocalSourceFirst storeString) , '.'.
       
   902     (Exception emergencyHandler == AbstractLauncherApplication notifyingEmergencyHandler) ifTrue:[
       
   903         s nextPutLine:'Exception emergencyHandler:(AbstractLauncherApplication notifyingEmergencyHandler).'.
       
   904     ].
       
   905     Processor isTimeSlicing ifTrue:[
       
   906         s nextPutLine:'Processor startTimeSlicing.'.
       
   907         s nextPutLine:('Processor supportDynamicPriorities:' , (Processor supportDynamicPriorities ? false) storeString , '.').
       
   908     ] ifFalse:[
       
   909         s nextPutLine:'Processor stopTimeSlicing.'.
       
   910     ].
       
   911 
       
   912     s cr.
       
   913     s nextPutLine:'"/'.
       
   914     s nextPutLine:'"/ Printer settings:'.
       
   915     s nextPutLine:'"/'.
       
   916     s nextPutLine:'Printer := ' , (Printer name) , '.';
       
   917       nextPutLine:'Printer printCommand: ' , (Printer printCommand storeString) , '.'.
       
   918 
       
   919     Printer supportsPageSizes ifTrue:[
       
   920         s nextPutLine:'Printer pageFormat: ' , (Printer pageFormat storeString) , '.'.
       
   921         s nextPutLine:'Printer landscape: ' , (Printer landscape storeString) , '.'.
       
   922     ].
       
   923     Printer supportsMargins ifTrue:[
       
   924         s nextPutLine:'Printer topMargin: ' , (Printer topMargin storeString) , '.'.
       
   925         s nextPutLine:'Printer leftMargin: ' , (Printer leftMargin storeString) , '.'.
       
   926         s nextPutLine:'Printer rightMargin: ' , (Printer rightMargin storeString) , '.'.
       
   927         s nextPutLine:'Printer bottomMargin: ' , (Printer bottomMargin storeString) , '.'.
       
   928     ].
       
   929     Printer supportsPostscript ifTrue:[
       
   930         s nextPutLine:'Printer supportsColor: ' , (Printer supportsColor storeString) , '.'.
       
   931     ].
       
   932 
       
   933     s cr.
       
   934     s nextPutLine:'"/'.
       
   935     s nextPutLine:'"/ Font settings:'.
       
   936     s nextPutLine:'"/ (only restored, if image is restarted on the same display)'.
       
   937     s nextPutLine:'"/'.
       
   938     s nextPutLine:'Display notNil ifTrue:['.
       
   939     s nextPutLine:' Display displayName = ' , (screen displayName storeString) , ' ifTrue:['.
       
   940     s nextPutLine:'  View defaultFont: ' , (View defaultFont storeString) , '.'.
       
   941     s nextPutLine:'  Label defaultFont: ' , (Label defaultFont storeString) , '.'.
       
   942     s nextPutLine:'  Button defaultFont: ' , (Button defaultFont storeString) , '.'.
       
   943     s nextPutLine:'  Toggle defaultFont: ' , (Toggle defaultFont storeString) , '.'.
       
   944     s nextPutLine:'  SelectionInListView defaultFont: ' , (SelectionInListView defaultFont storeString) , '.'.
       
   945     s nextPutLine:'  MenuView defaultFont: ' , (MenuView defaultFont storeString) , '.'.
       
   946     s nextPutLine:'  PullDownMenu defaultFont: ' , (PullDownMenu defaultFont storeString) , '.'.
       
   947     s nextPutLine:'  TextView defaultFont: ' , (TextView defaultFont storeString) , '.'.
       
   948     s nextPutLine:'  EditTextView defaultFont: ' , (EditTextView defaultFont storeString) , '.'.
       
   949     s nextPutLine:'  CodeView defaultFont: ' , (CodeView defaultFont storeString) , '.'.
       
   950     s nextPutLine:' ].'.
       
   951     s nextPutLine:'].'.
       
   952 
       
   953     s cr.
       
   954     s nextPutLine:'"/'.
       
   955     s nextPutLine:'"/ Language setting:'.
       
   956     s nextPutLine:'"/'.
       
   957     s nextPutLine:'Smalltalk language: ' , (Smalltalk language storeString) , '.'.
       
   958     s nextPutLine:'Smalltalk languageTerritory: ' , (Smalltalk languageTerritory storeString) , '.'.
       
   959 
       
   960     s cr.
       
   961     s nextPutLine:'"/'.
       
   962     s nextPutLine:'"/ SourceCodeManager settings:'.
       
   963     s nextPutLine:'"/ (only restored, if image is restarted on the same host)'.
       
   964     s nextPutLine:'"/'.
       
   965     s nextPutLine:'OperatingSystem getHostName = ' , (OperatingSystem getHostName storeString) , ' ifTrue:['.
       
   966     s nextPutLine:'  Class tryLocalSourceFirst:' , Class tryLocalSourceFirst storeString , '.'.
       
   967     (Smalltalk at:#SourceCodeManager) == CVSSourceCodeManager ifTrue:[
       
   968     s nextPutLine:'  Smalltalk at:#SourceCodeManager put: CVSSourceCodeManager.'.
       
   969     s nextPutLine:'  AbstractSourceCodeManager cacheDirectoryName:' , AbstractSourceCodeManager cacheDirectoryName storeString , '.'.
       
   970     s nextPutLine:'  CVSSourceCodeManager cvsBinDirectory:' , CVSSourceCodeManager cvsBinDirectory storeString , '.'.
       
   971     s nextPutLine:'  CVSSourceCodeManager repositoryNamesPerModule:' , CVSSourceCodeManager repositoryNamesPerModule storeString , '.'.
       
   972     s nextPutLine:'  CVSSourceCodeManager initializeForRepository:' , CVSSourceCodeManager repositoryName storeString , '.'.
       
   973     ].
       
   974     s nextPutLine:'].'.
       
   975 
       
   976     s close.
       
   977 
       
   978     "
       
   979      Transcript topView application saveSettings
       
   980     "
       
   981 
       
   982     "Modified: / 6.1.1999 / 14:24:16 / cg"
       
   983 ! !
       
   984 
       
   985 !SettingsDialog methodsFor:'queries'!
       
   986 
       
   987 recursiveGetParentFor:aCategory fromItem:aItem
       
   988 
       
   989     | children |
       
   990     children := aItem children.
       
   991     children notNil ifTrue:[
       
   992         children do:[:aChildItem | | newItem |
       
   993             aChildItem nameString = aCategory ifTrue:[ ^ aChildItem].
       
   994             newItem := self recursiveGetParentFor:aCategory fromItem:aChildItem.
       
   995             newItem notNil ifTrue:[^ newItem].
       
   996         ].
       
   997     ].
       
   998     ^ nil
       
   999 ! !
       
  1000 
       
  1001 !SettingsDialog::HierarchicalApplicationList::ApplicationItem methodsFor:'accessing'!
       
  1002 
       
  1003 application
       
  1004     "return the value of the instance variable 'application' (automatically generated)"
       
  1005 
       
  1006     ^ application
       
  1007 !
       
  1008 
       
  1009 application:something
       
  1010     "set the value of the instance variable 'application' (automatically generated)"
       
  1011 
       
  1012     application := something.
       
  1013 !
       
  1014 
       
  1015 applicationClass
       
  1016     "return the value of the instance variable 'applicationClass' (automatically generated)"
       
  1017 
       
  1018     ^ applicationClass
       
  1019 !
       
  1020 
       
  1021 applicationClass:something
       
  1022     "set the value of the instance variable 'applicationClass' (automatically generated)"
       
  1023 
       
  1024     applicationClass := something.
       
  1025 !
       
  1026 
       
  1027 icon
       
  1028     "return the value of the instance variable 'icon' (automatically generated)"
       
  1029 
       
  1030     ^ icon
       
  1031 !
       
  1032 
       
  1033 icon:something
       
  1034     "set the value of the instance variable 'icon' (automatically generated)"
       
  1035 
       
  1036     icon := something.
       
  1037 !
       
  1038 
       
  1039 label
       
  1040     "return the value of the instance variable 'label' (automatically generated)"
       
  1041 
       
  1042     ^ label
       
  1043 !
       
  1044 
       
  1045 label:something
       
  1046     "set the value of the instance variable 'label' (automatically generated)"
       
  1047 
       
  1048     label := something.
       
  1049 !
       
  1050 
       
  1051 nameString
       
  1052     "return the value of the instance variable 'nameString' (automatically generated)"
       
  1053 
       
  1054     ^ nameString
       
  1055 !
       
  1056 
       
  1057 nameString:something
       
  1058     "set the value of the instance variable 'nameString' (automatically generated)"
       
  1059 
       
  1060     nameString := something.
       
  1061 ! !
       
  1062 
       
  1063 !SettingsDialog::HierarchicalApplicationList::ApplicationItem methodsFor:'queries'!
       
  1064 
       
  1065 isCategory
       
  1066 
       
  1067     ^ self applicationClass isNil
       
  1068 ! !
       
  1069 
       
  1070 !SettingsDialog class methodsFor:'documentation'!
       
  1071 
       
  1072 version
       
  1073     ^ '$Header: /cvs/stx/stx/libtool/SettingsDialog.st,v 1.1 2002-12-13 16:27:35 penk Exp $'
       
  1074 ! !