SettingsDialog.st
author Claus Gittinger <cg@exept.de>
Tue, 21 May 2013 22:32:23 +0200
changeset 12765 22dc3b61ae68
parent 12029 fa8f6787ea95
child 12807 ba8c5416aa28
child 13086 4964c4ee8a9c
permissions -rw-r--r--
class: SettingsDialog changed: #windowSpec
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5140
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
     1
"
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
     2
 COPYRIGHT (c) 2002 by eXept Software AG
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
     3
              All Rights Reserved
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
     4
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
     5
 This software is furnished under a license and may be used
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
     6
 only in accordance with the terms of that license and with the
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
     8
 be provided or otherwise made available to, or used by, any
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
     9
 other person.  No title to or ownership of the software is
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
    10
 hereby transferred.
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
    11
"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
    12
"{ Package: 'stx:libtool' }"
7021197a578f initial checkin
penk
parents:
diff changeset
    13
7021197a578f initial checkin
penk
parents:
diff changeset
    14
ApplicationModel subclass:#SettingsDialog
7021197a578f initial checkin
penk
parents:
diff changeset
    15
	instanceVariableNames:'requestor subCanvasApplicationHolder help doReload doSave
7021197a578f initial checkin
penk
parents:
diff changeset
    16
		enableReload enableHelp enableOK selectedItem applicationList
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
    17
		categoryIcons lastSelection whyDisabledInfoHolder'
4378
7021197a578f initial checkin
penk
parents:
diff changeset
    18
	classVariableNames:'ApplicationList IconList'
7021197a578f initial checkin
penk
parents:
diff changeset
    19
	poolDictionaries:''
7021197a578f initial checkin
penk
parents:
diff changeset
    20
	category:'Interface-Smalltalk'
7021197a578f initial checkin
penk
parents:
diff changeset
    21
!
7021197a578f initial checkin
penk
parents:
diff changeset
    22
7021197a578f initial checkin
penk
parents:
diff changeset
    23
HierarchicalList subclass:#HierarchicalApplicationList
7021197a578f initial checkin
penk
parents:
diff changeset
    24
	instanceVariableNames:''
7021197a578f initial checkin
penk
parents:
diff changeset
    25
	classVariableNames:''
7021197a578f initial checkin
penk
parents:
diff changeset
    26
	poolDictionaries:''
7021197a578f initial checkin
penk
parents:
diff changeset
    27
	privateIn:SettingsDialog
7021197a578f initial checkin
penk
parents:
diff changeset
    28
!
7021197a578f initial checkin
penk
parents:
diff changeset
    29
6688
a191e7822668 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6635
diff changeset
    30
HierarchicalItemWithLabelAndIcon subclass:#ApplicationItem
a191e7822668 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6635
diff changeset
    31
	instanceVariableNames:'application applicationClass nameString'
4378
7021197a578f initial checkin
penk
parents:
diff changeset
    32
	classVariableNames:''
7021197a578f initial checkin
penk
parents:
diff changeset
    33
	poolDictionaries:''
7021197a578f initial checkin
penk
parents:
diff changeset
    34
	privateIn:SettingsDialog::HierarchicalApplicationList
7021197a578f initial checkin
penk
parents:
diff changeset
    35
!
7021197a578f initial checkin
penk
parents:
diff changeset
    36
7021197a578f initial checkin
penk
parents:
diff changeset
    37
!SettingsDialog class methodsFor:'documentation'!
7021197a578f initial checkin
penk
parents:
diff changeset
    38
5140
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
    39
copyright
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
    40
"
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
    41
 COPYRIGHT (c) 2002 by eXept Software AG
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
    42
              All Rights Reserved
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
    43
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
    44
 This software is furnished under a license and may be used
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
    45
 only in accordance with the terms of that license and with the
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
    46
 inclusion of the above copyright notice.   This software may not
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
    47
 be provided or otherwise made available to, or used by, any
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
    48
 other person.  No title to or ownership of the software is
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
    49
 hereby transferred.
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
    50
"
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
    51
!
36c7da05d814 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
    52
4378
7021197a578f initial checkin
penk
parents:
diff changeset
    53
documentation
7021197a578f initial checkin
penk
parents:
diff changeset
    54
"
6019
001740075800 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5975
diff changeset
    55
    This is an application which presents a hierarchy of settings applications.
001740075800 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5975
diff changeset
    56
    It is used (among others) in the launcher's and filebrowser's settings-dialogs.
001740075800 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5975
diff changeset
    57
    However, it is rather generic and can be setup for any applications setting dialog
001740075800 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5975
diff changeset
    58
    See class>>examples for more info.
4494
1a4271d84f7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4470
diff changeset
    59
4378
7021197a578f initial checkin
penk
parents:
diff changeset
    60
    [author:]
7021197a578f initial checkin
penk
parents:
diff changeset
    61
        Christian Penk, eXept Software AG
4494
1a4271d84f7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4470
diff changeset
    62
1a4271d84f7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4470
diff changeset
    63
    [see also:]
1a4271d84f7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4470
diff changeset
    64
        AbstractLauncherApplication defaultSettingsApplicationList 
4378
7021197a578f initial checkin
penk
parents:
diff changeset
    65
"
4400
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    66
!
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    67
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    68
examples
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    69
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    70
"
4494
1a4271d84f7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4470
diff changeset
    71
  start a Settings Dialog with a language Settings Application under root
4400
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    72
                                                                [exBegin]
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    73
    | settingsApp |
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    74
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    75
    settingsApp := self new.
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    76
    settingsApp addApplClass:#'AbstractSettingsApplication::LanguageSettingsAppl' 
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    77
                withName:'Language'.
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    78
    settingsApp open.
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    79
                                                                [exEnd]
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    80
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    81
4494
1a4271d84f7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4470
diff changeset
    82
  start a Settings Dialog with a language Settings Application under root/Test
4400
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    83
                                                                [exBegin]
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    84
    | settingsApp |
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    85
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    86
    settingsApp := self new.
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    87
    settingsApp addApplClass:#'AbstractSettingsApplication::LanguageSettingsAppl' 
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    88
                withName:'Test/Language'.
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    89
    settingsApp open.
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    90
                                                                [exEnd]
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    91
4494
1a4271d84f7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4470
diff changeset
    92
  start a Settings Dialog with a language Settings Application under root/Test
1a4271d84f7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4470
diff changeset
    93
  with an other category test icon
4400
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    94
                                                                [exBegin]
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    95
    | settingsApp |
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    96
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    97
    settingsApp := self new.
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    98
    settingsApp addApplClass:#'AbstractSettingsApplication::LanguageSettingsAppl' 
5b1bf011547f add examples
penk
parents: 4397
diff changeset
    99
                withName:'Test/Language'.
4401
cf3b37e747bd *** empty log message ***
penk
parents: 4400
diff changeset
   100
    settingsApp addIcon:ToolbarIconLibrary start22x22Icon forCategory:'Test'.
4400
5b1bf011547f add examples
penk
parents: 4397
diff changeset
   101
    settingsApp open.
5b1bf011547f add examples
penk
parents: 4397
diff changeset
   102
                                                                [exEnd]
4401
cf3b37e747bd *** empty log message ***
penk
parents: 4400
diff changeset
   103
4494
1a4271d84f7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4470
diff changeset
   104
  start a Settings Dialog with a language and memory Settings Application 
1a4271d84f7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4470
diff changeset
   105
  in different categories
4400
5b1bf011547f add examples
penk
parents: 4397
diff changeset
   106
                                                                [exBegin]
5b1bf011547f add examples
penk
parents: 4397
diff changeset
   107
    | settingsApp |
5b1bf011547f add examples
penk
parents: 4397
diff changeset
   108
5b1bf011547f add examples
penk
parents: 4397
diff changeset
   109
    settingsApp := self new.
5b1bf011547f add examples
penk
parents: 4397
diff changeset
   110
    settingsApp addIcon:ToolbarIconLibrary start22x22Icon forCategory:'Test'.
5b1bf011547f add examples
penk
parents: 4397
diff changeset
   111
    settingsApp addApplClass:#'AbstractSettingsApplication::LanguageSettingsAppl' 
5b1bf011547f add examples
penk
parents: 4397
diff changeset
   112
                withName:'Test/Language'.
5b1bf011547f add examples
penk
parents: 4397
diff changeset
   113
    settingsApp addApplClass:#'AbstractSettingsApplication::MemorySettingsAppl' 
5b1bf011547f add examples
penk
parents: 4397
diff changeset
   114
                withName:'Test2/Memory'.
5b1bf011547f add examples
penk
parents: 4397
diff changeset
   115
    settingsApp open.
5b1bf011547f add examples
penk
parents: 4397
diff changeset
   116
                                                                [exEnd]
5b1bf011547f add examples
penk
parents: 4397
diff changeset
   117
"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   118
! !
7021197a578f initial checkin
penk
parents:
diff changeset
   119
5399
3fa323d28c8e category rename
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
   120
!SettingsDialog class methodsFor:'initialization'!
3fa323d28c8e category rename
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
   121
3fa323d28c8e category rename
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
   122
initialize
3fa323d28c8e category rename
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
   123
    AbstractSettingsApplication autoload.
3fa323d28c8e category rename
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
   124
! !
3fa323d28c8e category rename
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
   125
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   126
!SettingsDialog class methodsFor:'accessing'!
7021197a578f initial checkin
penk
parents:
diff changeset
   127
7021197a578f initial checkin
penk
parents:
diff changeset
   128
itemClass
7021197a578f initial checkin
penk
parents:
diff changeset
   129
7021197a578f initial checkin
penk
parents:
diff changeset
   130
    ^ SettingsDialog::HierarchicalApplicationList::ApplicationItem
7021197a578f initial checkin
penk
parents:
diff changeset
   131
! !
7021197a578f initial checkin
penk
parents:
diff changeset
   132
7021197a578f initial checkin
penk
parents:
diff changeset
   133
!SettingsDialog class methodsFor:'application icons'!
7021197a578f initial checkin
penk
parents:
diff changeset
   134
7021197a578f initial checkin
penk
parents:
diff changeset
   135
defaultSettingsAppIcon
7021197a578f initial checkin
penk
parents:
diff changeset
   136
7021197a578f initial checkin
penk
parents:
diff changeset
   137
    ^ self settingsIcon
7021197a578f initial checkin
penk
parents:
diff changeset
   138
!
7021197a578f initial checkin
penk
parents:
diff changeset
   139
7021197a578f initial checkin
penk
parents:
diff changeset
   140
settingsIcon
7021197a578f initial checkin
penk
parents:
diff changeset
   141
    "This resource specification was automatically generated
7021197a578f initial checkin
penk
parents:
diff changeset
   142
     by the ImageEditor of ST/X."
7021197a578f initial checkin
penk
parents:
diff changeset
   143
7021197a578f initial checkin
penk
parents:
diff changeset
   144
    "Do not manually edit this!! If it is corrupted,
7021197a578f initial checkin
penk
parents:
diff changeset
   145
     the ImageEditor may not be able to read the specification."
7021197a578f initial checkin
penk
parents:
diff changeset
   146
7021197a578f initial checkin
penk
parents:
diff changeset
   147
    "
7021197a578f initial checkin
penk
parents:
diff changeset
   148
     self settingsIcon inspect
7021197a578f initial checkin
penk
parents:
diff changeset
   149
     ImageEditor openOnClass:self andSelector:#settingsIcon
7021197a578f initial checkin
penk
parents:
diff changeset
   150
     Icon flushCachedIcons
7021197a578f initial checkin
penk
parents:
diff changeset
   151
    "
7021197a578f initial checkin
penk
parents:
diff changeset
   152
7021197a578f initial checkin
penk
parents:
diff changeset
   153
    <resource: #image>
7021197a578f initial checkin
penk
parents:
diff changeset
   154
7021197a578f initial checkin
penk
parents:
diff changeset
   155
    ^Icon
8476
84fa59f05e50 image resource method fixes (key must be name of method)
Claus Gittinger <cg@exept.de>
parents: 8268
diff changeset
   156
        constantNamed:#'SettingsDialog class settingsIcon'
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   157
        ifAbsentPut:[(Depth8Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
7021197a578f initial checkin
penk
parents:
diff changeset
   158
@@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
7021197a578f initial checkin
penk
parents:
diff changeset
   159
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
7021197a578f initial checkin
penk
parents:
diff changeset
   160
,-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+::
7021197a578f initial checkin
penk
parents:
diff changeset
   161
-;8\TWECKBD9)T=0]R40AXOE2;F5-;:/G6)EKBD?ZF5KV#ITJ0M>''*B_''ZF]''5,(KA8)X8ENU#XR@ )L^1$YFQ$YFQ$WBA PE@QMVSDON82S@@@@@@@@@@@@
7021197a578f initial checkin
penk
parents:
diff changeset
   162
@@A_@F)IU#DQMWH@@@@@@@@@@@@@@@@@@F1JWC\LMJI''^ @@@@@@@@@@@@@@@F9GU28ROGI%+VY4@@@@@@@@@@@@@GIFXC(IL9(@^VR*X''\@@@@@@@@@@@AU
7021197a578f initial checkin
penk
parents:
diff changeset
   163
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]
5892
Claus Gittinger <cg@exept.de>
parents: 5838
diff changeset
   164
!
Claus Gittinger <cg@exept.de>
parents: 5838
diff changeset
   165
Claus Gittinger <cg@exept.de>
parents: 5838
diff changeset
   166
settingsIconOld
Claus Gittinger <cg@exept.de>
parents: 5838
diff changeset
   167
    <resource: #programImage>
Claus Gittinger <cg@exept.de>
parents: 5838
diff changeset
   168
Claus Gittinger <cg@exept.de>
parents: 5838
diff changeset
   169
    ^ self settingsIconOld.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   170
! !
7021197a578f initial checkin
penk
parents:
diff changeset
   171
4397
21f99307336a expand all parents on startup
penk
parents: 4388
diff changeset
   172
!SettingsDialog class methodsFor:'defaults'!
21f99307336a expand all parents on startup
penk
parents: 4388
diff changeset
   173
5892
Claus Gittinger <cg@exept.de>
parents: 5838
diff changeset
   174
defaultIcon
Claus Gittinger <cg@exept.de>
parents: 5838
diff changeset
   175
    <resource: #programImage>
Claus Gittinger <cg@exept.de>
parents: 5838
diff changeset
   176
Claus Gittinger <cg@exept.de>
parents: 5838
diff changeset
   177
    ^ ToolbarIconLibrary stxSettings24x24Icon
Claus Gittinger <cg@exept.de>
parents: 5838
diff changeset
   178
!
Claus Gittinger <cg@exept.de>
parents: 5838
diff changeset
   179
8621
0cc9ef232220 beepInEditor flag
Claus Gittinger <cg@exept.de>
parents: 8476
diff changeset
   180
defaultSettingsApplicationList
0cc9ef232220 beepInEditor flag
Claus Gittinger <cg@exept.de>
parents: 8476
diff changeset
   181
    ^ #(          
9859
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   182
        #('Language'                            #'AbstractSettingsApplication::LanguageSettingsAppl'            )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   183
        #('Keyboard Mappings'                   #'AbstractSettingsApplication::KbdMappingSettingsAppl'          )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   184
        #('ViewStyle'                           #'AbstractSettingsApplication::MiscDisplaySettingsAppl'         )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   185
        #('ViewStyle/Style'                     #'AbstractSettingsApplication::StyleSettingsAppl'               )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   186
        #('ViewStyle/Other'                     #'AbstractSettingsApplication::MiscDisplay2SettingsAppl'        )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   187
        #('ViewStyle/Fonts'                     #'AbstractSettingsApplication::FontSettingsAppl'                )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   188
        #('System Messages'                     #'AbstractSettingsApplication::SystemMessageSettingsAppl'       )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   189
        #('Memory'                              #'AbstractSettingsApplication::MemorySettingsAppl'              )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   190
        #('Processor & Scheduler'               #'AbstractSettingsApplication::ProcessorSchedulerSettingsAppl'  )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   191
        #('Tools'                               #'AbstractSettingsApplication::ToolsSettingsAppl'               )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   192
        #('Tools/Editor'                        #'AbstractSettingsApplication::EditSettingsAppl'                )
10905
7ec7015ab744 changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 10824
diff changeset
   193
        #('Tools/Editor/Code Editor 2'          #'Tools::CodeView2SettingsAppl'                                 )
7ec7015ab744 changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 10824
diff changeset
   194
        #('Tools/Editor/Syntax Color'           #'AbstractSettingsApplication::SyntaxColorSettingsAppl'         )
7ec7015ab744 changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 10824
diff changeset
   195
        #('Tools/Editor/Code Format'            #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl'    )
9859
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   196
        #('Tools/System Browser'                #'AbstractSettingsApplication::SystemBrowserSettingsAppl'       )
10905
7ec7015ab744 changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 10824
diff changeset
   197
        #('Tools/System Browser/Code Generator' #'AbstractSettingsApplication::CodeGeneratorSettingsAppl'       )
9859
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   198
        #('Tools/Changes'                       #'AbstractSettingsApplication::ChangeFileSettingsAppl'          )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   199
        #('Tools/Debugger'                      #'AbstractSettingsApplication::DebuggerSettingsAppl'            )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   200
        #('Tools/Compiler'                      #'AbstractSettingsApplication::GeneralCompilerSettingsAppl'     )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   201
        #('Tools/Compiler/ByteCode'             #'AbstractSettingsApplication::ByteCodeCompilerSettingsAppl'    )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   202
        #('Tools/Compiler/STC'                  #'AbstractSettingsApplication::STCCompilerSettingsAppl'         )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   203
        #('Tools/Compiler/Build'                #'AbstractSettingsApplication::BuildSettingsAppl'         )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   204
        #('Source Code Management'              #'AbstractSettingsApplication::SourceCodeManagementSettingsAppl')
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   205
        "/ see initializeSettingsList for how the following is expanded...
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   206
        #('Source Code Management/[% managerTypeName]'     
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   207
                                                '[ AbstractSourceCodeManager availableManagers 
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   208
                                                     collect:[:each | each settingsApplicationClass] ]'    
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   209
                                                                                                            '[% defaultIcon]' )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   210
"/        #('Source Code Management/CVS'          #'CVSSourceCodeManagementSettingsAppl')
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   211
"/        #('Source Code Management/PerForce'     #'P4SourceCodeManagementSettingsAppl')
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   212
"/        #('Source Code Management/SVN'          #'SVN::SettingsApp' )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   213
"/        #('Source Code Management/Store'        #'StoreSourceCodeManagementSettingsAppl')
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   214
"/        #('Source Code Management/SmallTeam'    #'SmallTeamSourceCodeManagementSettingsAppl')
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   215
        #('Printer'                             #'AbstractSettingsApplication::PrinterSettingsAppl'             )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   216
        #('Display'                             #'AbstractSettingsApplication::DisplaySettingsAppl'             )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   217
        #('Communication'                       nil                                                         #communicationIcon)
9275
bff5fac9e455 changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9186
diff changeset
   218
9859
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   219
        #('Communication/Logging'               #'AbstractSettingsApplication::CommunicationLoggingSettingsAppl')
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   220
        #('Communication/RDoIt'                 #'AbstractSettingsApplication::RDoItServerSettingsAppl'         )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   221
        #('Communication/OSI Protocol'          #'AbstractSettingsApplication::OsiSettingsAppl'                 )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   222
        #('Communication/Misc'                  #'AbstractSettingsApplication::MiscCommunicationSettingsAppl'   )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   223
        #('Communication/SQLServer'             #'AbstractSettingsApplication::SQLServerSettingsAppl'           )
38ac3e126c5b changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 9821
diff changeset
   224
        #('Communication/HTTPServer'            #'AbstractSettingsApplication::HTTPStartServerSettingsApplication'   )
8621
0cc9ef232220 beepInEditor flag
Claus Gittinger <cg@exept.de>
parents: 8476
diff changeset
   225
    ) asOrderedCollection
0cc9ef232220 beepInEditor flag
Claus Gittinger <cg@exept.de>
parents: 8476
diff changeset
   226
0cc9ef232220 beepInEditor flag
Claus Gittinger <cg@exept.de>
parents: 8476
diff changeset
   227
    "Modified: / 16-12-2002 / 18:12:28 / penk"
10396
1fef9bc97b89 - per-tool preference for CodeView2
vrany
parents: 9859
diff changeset
   228
    "Modified: / 26-07-2011 / 10:42:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10905
7ec7015ab744 changed: #defaultSettingsApplicationList
Claus Gittinger <cg@exept.de>
parents: 10824
diff changeset
   229
    "Modified: / 25-11-2011 / 15:28:42 / cg"
8621
0cc9ef232220 beepInEditor flag
Claus Gittinger <cg@exept.de>
parents: 8476
diff changeset
   230
!
0cc9ef232220 beepInEditor flag
Claus Gittinger <cg@exept.de>
parents: 8476
diff changeset
   231
4397
21f99307336a expand all parents on startup
penk
parents: 4388
diff changeset
   232
expandParents
21f99307336a expand all parents on startup
penk
parents: 4388
diff changeset
   233
21f99307336a expand all parents on startup
penk
parents: 4388
diff changeset
   234
    ^ true
5577
adcc748a39b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5465
diff changeset
   235
!
adcc748a39b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5465
diff changeset
   236
adcc748a39b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5465
diff changeset
   237
resourcePackName
7873
9e88f7f30bca comment
Claus Gittinger <cg@exept.de>
parents: 7719
diff changeset
   238
    "return the name which is used as the fileNameBase of my resource file.
9e88f7f30bca comment
Claus Gittinger <cg@exept.de>
parents: 7719
diff changeset
   239
     Here, use the same resources as the Launcher"
9e88f7f30bca comment
Claus Gittinger <cg@exept.de>
parents: 7719
diff changeset
   240
5577
adcc748a39b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5465
diff changeset
   241
    ^ AbstractLauncherApplication resourcePackName
4397
21f99307336a expand all parents on startup
penk
parents: 4388
diff changeset
   242
! !
21f99307336a expand all parents on startup
penk
parents: 4388
diff changeset
   243
12029
fa8f6787ea95 category of: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11983
diff changeset
   244
!SettingsDialog class methodsFor:'help specs'!
11982
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   245
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   246
flyByHelpSpec
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   247
    <resource: #help>
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   248
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   249
    ^ super flyByHelpSpec addPairsFrom:#(
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   250
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   251
#acceptChangedSettings
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   252
'Accept changed settings for the current ST/X session.\Notice, that these affect the current session only.\To make the current settings the default for futre settings, save them to the settings file (using the "Save" button). Also notice, that some values affect new opened windows/tools only.'
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   253
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   254
#discardChangedSettings
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   255
'Discard changes and revert to the current active settings values'
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   256
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   257
#helpOnSettings
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   258
'Show the online documentation on the shown values in an HTML viewer'
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   259
11983
4b9d7ce885b7 changed:
Claus Gittinger <cg@exept.de>
parents: 11982
diff changeset
   260
#loadSettingsFromFile
4b9d7ce885b7 changed:
Claus Gittinger <cg@exept.de>
parents: 11982
diff changeset
   261
'Load the settings from a file'
4b9d7ce885b7 changed:
Claus Gittinger <cg@exept.de>
parents: 11982
diff changeset
   262
4b9d7ce885b7 changed:
Claus Gittinger <cg@exept.de>
parents: 11982
diff changeset
   263
#saveSettingsToFile
4b9d7ce885b7 changed:
Claus Gittinger <cg@exept.de>
parents: 11982
diff changeset
   264
'Save the current settings into a file. The "settings.stx" file is automatically read upon every fresh start of ST/X.'
4b9d7ce885b7 changed:
Claus Gittinger <cg@exept.de>
parents: 11982
diff changeset
   265
11982
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   266
)
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   267
! !
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   268
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   269
!SettingsDialog class methodsFor:'interface specs'!
7021197a578f initial checkin
penk
parents:
diff changeset
   270
7021197a578f initial checkin
penk
parents:
diff changeset
   271
windowSpec
7021197a578f initial checkin
penk
parents:
diff changeset
   272
    "This resource specification was automatically generated
7021197a578f initial checkin
penk
parents:
diff changeset
   273
     by the UIPainter of ST/X."
7021197a578f initial checkin
penk
parents:
diff changeset
   274
7021197a578f initial checkin
penk
parents:
diff changeset
   275
    "Do not manually edit this!! If it is corrupted,
7021197a578f initial checkin
penk
parents:
diff changeset
   276
     the UIPainter may not be able to read the specification."
7021197a578f initial checkin
penk
parents:
diff changeset
   277
7021197a578f initial checkin
penk
parents:
diff changeset
   278
    "
7021197a578f initial checkin
penk
parents:
diff changeset
   279
     UIPainter new openOnClass:SettingsDialog andSelector:#windowSpec
7021197a578f initial checkin
penk
parents:
diff changeset
   280
     SettingsDialog new openInterface:#windowSpec
7021197a578f initial checkin
penk
parents:
diff changeset
   281
     SettingsDialog open
7021197a578f initial checkin
penk
parents:
diff changeset
   282
    "
7021197a578f initial checkin
penk
parents:
diff changeset
   283
7021197a578f initial checkin
penk
parents:
diff changeset
   284
    <resource: #canvas>
7021197a578f initial checkin
penk
parents:
diff changeset
   285
7021197a578f initial checkin
penk
parents:
diff changeset
   286
    ^ 
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   287
     #(FullSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   288
        name: windowSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   289
        window: 
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   290
       (WindowSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   291
          label: 'Settings Dialog'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   292
          name: 'Settings Dialog'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   293
          min: (Point 10 10)
6024
ab51dc9ad449 *** empty log message ***
ca
parents: 6020
diff changeset
   294
          bounds: (Rectangle 0 0 789 642)
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   295
          menu: mainMenu
5892
Claus Gittinger <cg@exept.de>
parents: 5838
diff changeset
   296
          icon: defaultIcon
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   297
        )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   298
        component: 
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   299
       (SpecCollection
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   300
          collection: (
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   301
           (VariableHorizontalPanelSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   302
              name: 'VariableHorizontalPanel1'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   303
              layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   304
              showHandle: true
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   305
              snapMode: both
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   306
              component: 
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   307
             (SpecCollection
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   308
                collection: (
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   309
                 (ViewSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   310
                    name: 'Box1'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   311
                    component: 
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   312
                   (SpecCollection
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   313
                      collection: (
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   314
                       (HierarchicalListViewSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   315
                          name: 'HierarchicalListView1'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   316
                          layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 -34 1)
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   317
                          model: selectedItem
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   318
                          hasHorizontalScrollBar: true
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   319
                          hasVerticalScrollBar: true
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   320
                          listModel: applicationList
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   321
                          useIndex: false
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   322
                          highlightMode: label
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   323
                          showLeftIndicators: false
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   324
                          indicatorSelector: doIndicatorClick:
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   325
                        )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   326
                       (HorizontalPanelViewSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   327
                          name: 'HorizontalPanel2'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   328
                          layout: (LayoutFrame 0 0.0 -34 1 0 1.0 0 1)
9021
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
   329
                          visibilityChannel: loadAndSaveSettingsItemVisible
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   330
                          horizontalLayout: fitSpace
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   331
                          verticalLayout: center
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   332
                          horizontalSpace: 3
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   333
                          verticalSpace: 3
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   334
                          component: 
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   335
                         (SpecCollection
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   336
                            collection: (
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   337
                             (ActionButtonSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   338
                                label: 'Save'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   339
                                name: 'Button3'
12765
22dc3b61ae68 class: SettingsDialog
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   340
                                activeHelpKey: saveSettingsToFile
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   341
                                translateLabel: true
7719
5ecbb0ae6799 tabability
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   342
                                tabable: true
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   343
                                model: saveSettingsWithoutAskingForFile
6024
ab51dc9ad449 *** empty log message ***
ca
parents: 6020
diff changeset
   344
                                extent: (Point 126 22)
4826
14296f826d27 next step
penk
parents: 4740
diff changeset
   345
                              )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   346
                             (ActionButtonSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   347
                                label: 'Load From...'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   348
                                name: 'Button2'
12765
22dc3b61ae68 class: SettingsDialog
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   349
                                activeHelpKey: loadSettingsFromFile
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   350
                                translateLabel: true
7719
5ecbb0ae6799 tabability
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   351
                                tabable: true
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   352
                                model: loadSettingsFromFile
6024
ab51dc9ad449 *** empty log message ***
ca
parents: 6020
diff changeset
   353
                                extent: (Point 126 22)
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   354
                              )
7021197a578f initial checkin
penk
parents:
diff changeset
   355
                             )
7021197a578f initial checkin
penk
parents:
diff changeset
   356
                           
7021197a578f initial checkin
penk
parents:
diff changeset
   357
                          )
7021197a578f initial checkin
penk
parents:
diff changeset
   358
                        )
7021197a578f initial checkin
penk
parents:
diff changeset
   359
                       )
7021197a578f initial checkin
penk
parents:
diff changeset
   360
                     
7021197a578f initial checkin
penk
parents:
diff changeset
   361
                    )
7021197a578f initial checkin
penk
parents:
diff changeset
   362
                  )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   363
                 (ViewSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   364
                    name: 'Box2'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   365
                    component: 
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   366
                   (SpecCollection
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   367
                      collection: (
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   368
                       (ViewSpec
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   369
                          name: 'DisabledSettingsBox'
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   370
                          layout: (LayoutFrame 0 0 0 0 0 1 0 1)
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   371
                          initiallyInvisible: true
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   372
                          component: 
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   373
                         (SpecCollection
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   374
                            collection: (
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   375
                             (LabelSpec
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   376
                                label: 'whyDisabledLabel'
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   377
                                name: 'whyDisabledLabel'
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   378
                                layout: (LayoutFrame 0 0 0 0 0 1 0 1)
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   379
                                translateLabel: true
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   380
                                labelChannel: whyDisabledInfoHolder
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   381
                              )
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   382
                             )
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   383
                           
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   384
                          )
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   385
                        )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   386
                       (SubCanvasSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   387
                          name: 'SubCanvas'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   388
                          layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 -34 1)
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   389
                          level: -1
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   390
                          hasHorizontalScrollBar: false
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   391
                          hasVerticalScrollBar: false
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   392
                          clientHolder: subCanvasApplicationHolder
9021
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
   393
                          createNewBuilder: false
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   394
                          postBuildCallback: postBuildSubCanvas:
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   395
                        )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   396
                       (HorizontalPanelViewSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   397
                          name: 'HorizontalPanel1'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   398
                          layout: (LayoutFrame 0 0.0 -34 1 0 1.0 0 1)
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   399
                          horizontalLayout: fitSpace
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   400
                          verticalLayout: center
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   401
                          horizontalSpace: 3
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   402
                          verticalSpace: 3
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   403
                          component: 
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   404
                         (SpecCollection
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   405
                            collection: (
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   406
                             (ActionButtonSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   407
                                label: 'Apply'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   408
                                name: 'Apply'
12765
22dc3b61ae68 class: SettingsDialog
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   409
                                activeHelpKey: acceptChangedSettings
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   410
                                translateLabel: true
7719
5ecbb0ae6799 tabability
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   411
                                tabable: true
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   412
                                model: doSave
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   413
                                enableChannel: enableOK
6024
ab51dc9ad449 *** empty log message ***
ca
parents: 6020
diff changeset
   414
                                extent: (Point 168 22)
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   415
                              )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   416
                             (ActionButtonSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   417
                                label: 'Discard'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   418
                                name: 'Reload'
12765
22dc3b61ae68 class: SettingsDialog
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   419
                                activeHelpKey: discardChangedSettings
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   420
                                translateLabel: true
7719
5ecbb0ae6799 tabability
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   421
                                tabable: true
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   422
                                model: doReload
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   423
                                enableChannel: enableReload
6024
ab51dc9ad449 *** empty log message ***
ca
parents: 6020
diff changeset
   424
                                extent: (Point 169 22)
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   425
                              )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   426
                             (ActionButtonSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   427
                                label: 'Help'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   428
                                name: 'Help'
12765
22dc3b61ae68 class: SettingsDialog
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   429
                                activeHelpKey: helpOnSettings
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   430
                                translateLabel: true
7719
5ecbb0ae6799 tabability
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   431
                                tabable: true
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   432
                                model: help
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   433
                                enableChannel: enableHelp
6024
ab51dc9ad449 *** empty log message ***
ca
parents: 6020
diff changeset
   434
                                extent: (Point 169 22)
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   435
                              )
7021197a578f initial checkin
penk
parents:
diff changeset
   436
                             )
7021197a578f initial checkin
penk
parents:
diff changeset
   437
                           
7021197a578f initial checkin
penk
parents:
diff changeset
   438
                          )
12765
22dc3b61ae68 class: SettingsDialog
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
   439
                          keepSpaceForOSXResizeHandleH: true
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   440
                        )
7021197a578f initial checkin
penk
parents:
diff changeset
   441
                       )
7021197a578f initial checkin
penk
parents:
diff changeset
   442
                     
7021197a578f initial checkin
penk
parents:
diff changeset
   443
                    )
7021197a578f initial checkin
penk
parents:
diff changeset
   444
                  )
7021197a578f initial checkin
penk
parents:
diff changeset
   445
                 )
7021197a578f initial checkin
penk
parents:
diff changeset
   446
               
7021197a578f initial checkin
penk
parents:
diff changeset
   447
              )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   448
              handles: (Any 0.3375 1.0)
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   449
            )
7021197a578f initial checkin
penk
parents:
diff changeset
   450
           )
7021197a578f initial checkin
penk
parents:
diff changeset
   451
         
7021197a578f initial checkin
penk
parents:
diff changeset
   452
        )
7021197a578f initial checkin
penk
parents:
diff changeset
   453
      )
7021197a578f initial checkin
penk
parents:
diff changeset
   454
! !
7021197a578f initial checkin
penk
parents:
diff changeset
   455
4548
337cca67b97e *** empty log message ***
penk
parents: 4494
diff changeset
   456
!SettingsDialog class methodsFor:'menu actions'!
337cca67b97e *** empty log message ***
penk
parents: 4494
diff changeset
   457
5465
2c1dc7101e03 *** empty log message ***
ca
parents: 5422
diff changeset
   458
askForFileAndSaveSettings
4552
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   459
    |fileName resources|
4548
337cca67b97e *** empty log message ***
penk
parents: 4494
diff changeset
   460
4552
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   461
    resources := self classResources.
4548
337cca67b97e *** empty log message ***
penk
parents: 4494
diff changeset
   462
4552
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   463
    fileName := Dialog 
9608
0f2613d5fc3f changed:
Claus Gittinger <cg@exept.de>
parents: 9558
diff changeset
   464
        requestFileNameForSave:(resources string:'Save Settings in File') 
4552
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   465
        default:'settings.stx'
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   466
        ok:(resources string:'Save') 
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   467
        abort:(resources string:'Cancel') 
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   468
        pattern:'*.stx'
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   469
        fromDirectory:'.'.
4548
337cca67b97e *** empty log message ***
penk
parents: 4494
diff changeset
   470
4552
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   471
    fileName size ~~ 0 ifTrue:[
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   472
        "not canceled"
4826
14296f826d27 next step
penk
parents: 4740
diff changeset
   473
        self saveSettingsTo:fileName.
4552
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   474
    ]
9608
0f2613d5fc3f changed:
Claus Gittinger <cg@exept.de>
parents: 9558
diff changeset
   475
0f2613d5fc3f changed:
Claus Gittinger <cg@exept.de>
parents: 9558
diff changeset
   476
    "Modified: / 27-10-2010 / 11:24:54 / cg"
4826
14296f826d27 next step
penk
parents: 4740
diff changeset
   477
!
14296f826d27 next step
penk
parents: 4740
diff changeset
   478
8119
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   479
saveSettingsAsDefaultSettings
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   480
    | file |
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   481
11739
fe57ab24ba67 changed:
Stefan Vogel <sv@exept.de>
parents: 10905
diff changeset
   482
    file := Filename currentDirectory construct:UserPreferences defaultSettingsFilename.
8119
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   483
    self saveSettingsTo:file.
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   484
!
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   485
4826
14296f826d27 next step
penk
parents: 4740
diff changeset
   486
saveSettingsTo:file
14296f826d27 next step
penk
parents: 4740
diff changeset
   487
    [
14296f826d27 next step
penk
parents: 4740
diff changeset
   488
        UserPreferences current saveIn:file.
14296f826d27 next step
penk
parents: 4740
diff changeset
   489
    ] on:StreamError do:[:ex|
8119
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   490
        self warn:(self resources 
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   491
                stringWithCRs:'Cannot save settings into: %1\(%2)' 
11739
fe57ab24ba67 changed:
Stefan Vogel <sv@exept.de>
parents: 10905
diff changeset
   492
                with:(file asAbsoluteFilename asString) 
8119
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   493
                with:ex description).
4826
14296f826d27 next step
penk
parents: 4740
diff changeset
   494
    ]
14296f826d27 next step
penk
parents: 4740
diff changeset
   495
!
14296f826d27 next step
penk
parents: 4740
diff changeset
   496
5465
2c1dc7101e03 *** empty log message ***
ca
parents: 5422
diff changeset
   497
saveSettingsWithoutAskingForFile
8119
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   498
    self saveSettingsAsDefaultSettings.
4548
337cca67b97e *** empty log message ***
penk
parents: 4494
diff changeset
   499
! !
337cca67b97e *** empty log message ***
penk
parents: 4494
diff changeset
   500
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   501
!SettingsDialog class methodsFor:'menu specs'!
7021197a578f initial checkin
penk
parents:
diff changeset
   502
7021197a578f initial checkin
penk
parents:
diff changeset
   503
mainMenu
7021197a578f initial checkin
penk
parents:
diff changeset
   504
    "This resource specification was automatically generated
7021197a578f initial checkin
penk
parents:
diff changeset
   505
     by the MenuEditor of ST/X."
7021197a578f initial checkin
penk
parents:
diff changeset
   506
7021197a578f initial checkin
penk
parents:
diff changeset
   507
    "Do not manually edit this!! If it is corrupted,
7021197a578f initial checkin
penk
parents:
diff changeset
   508
     the MenuEditor may not be able to read the specification."
7021197a578f initial checkin
penk
parents:
diff changeset
   509
7021197a578f initial checkin
penk
parents:
diff changeset
   510
    "
7021197a578f initial checkin
penk
parents:
diff changeset
   511
     MenuEditor new openOnClass:SettingsDialog andSelector:#mainMenu
7021197a578f initial checkin
penk
parents:
diff changeset
   512
     (Menu new fromLiteralArrayEncoding:(SettingsDialog mainMenu)) startUp
7021197a578f initial checkin
penk
parents:
diff changeset
   513
    "
7021197a578f initial checkin
penk
parents:
diff changeset
   514
7021197a578f initial checkin
penk
parents:
diff changeset
   515
    <resource: #menu>
7021197a578f initial checkin
penk
parents:
diff changeset
   516
7021197a578f initial checkin
penk
parents:
diff changeset
   517
    ^ 
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   518
     #(Menu
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   519
        (
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   520
         (MenuItem
7972
Claus Gittinger <cg@exept.de>
parents: 7895
diff changeset
   521
            label: '&File'
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   522
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   523
            submenu: 
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   524
           (Menu
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   525
              (
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   526
               (MenuItem
7972
Claus Gittinger <cg@exept.de>
parents: 7895
diff changeset
   527
                  label: '&Load From...'
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   528
                  itemValue: loadSettingsFromFile
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   529
                  translateLabel: true
9021
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
   530
                  isVisible: loadAndSaveSettingsItemVisible
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   531
                )
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   532
               (MenuItem
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   533
                  label: '-'
9021
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
   534
                  isVisible: loadAndSaveSettingsItemVisible
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   535
                )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   536
               (MenuItem
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   537
                  label: 'Save'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   538
                  itemValue: saveSettingsWithoutAskingForFile
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   539
                  translateLabel: true
9021
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
   540
                  isVisible: loadAndSaveSettingsItemVisible
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   541
                )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   542
               (MenuItem
7972
Claus Gittinger <cg@exept.de>
parents: 7895
diff changeset
   543
                  label: '&Save As...'
7473
3c436374677d *** empty log message ***
sr
parents: 7172
diff changeset
   544
                  itemValue: askForFileAndSaveSettings
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   545
                  translateLabel: true
9021
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
   546
                  isVisible: loadAndSaveSettingsItemVisible
4740
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
   547
                )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   548
               (MenuItem
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   549
                  label: '-'
9021
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
   550
                  isVisible: loadAndSaveSettingsItemVisible
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   551
                )
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   552
               (MenuItem
7972
Claus Gittinger <cg@exept.de>
parents: 7895
diff changeset
   553
                  label: 'E&xit'
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   554
                  itemValue: closeRequest
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   555
                  translateLabel: true
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   556
                )
7021197a578f initial checkin
penk
parents:
diff changeset
   557
               )
7021197a578f initial checkin
penk
parents:
diff changeset
   558
              nil
7021197a578f initial checkin
penk
parents:
diff changeset
   559
              nil
7021197a578f initial checkin
penk
parents:
diff changeset
   560
            )
7021197a578f initial checkin
penk
parents:
diff changeset
   561
          )
7021197a578f initial checkin
penk
parents:
diff changeset
   562
         )
7021197a578f initial checkin
penk
parents:
diff changeset
   563
        nil
7021197a578f initial checkin
penk
parents:
diff changeset
   564
        nil
7021197a578f initial checkin
penk
parents:
diff changeset
   565
      )
7021197a578f initial checkin
penk
parents:
diff changeset
   566
! !
7021197a578f initial checkin
penk
parents:
diff changeset
   567
7021197a578f initial checkin
penk
parents:
diff changeset
   568
!SettingsDialog methodsFor:'accessing'!
7021197a578f initial checkin
penk
parents:
diff changeset
   569
7021197a578f initial checkin
penk
parents:
diff changeset
   570
requestor
7021197a578f initial checkin
penk
parents:
diff changeset
   571
    "return the 'requestor' of the SettingsDialog"
7021197a578f initial checkin
penk
parents:
diff changeset
   572
7021197a578f initial checkin
penk
parents:
diff changeset
   573
    ^ requestor
7021197a578f initial checkin
penk
parents:
diff changeset
   574
!
7021197a578f initial checkin
penk
parents:
diff changeset
   575
7021197a578f initial checkin
penk
parents:
diff changeset
   576
requestor:something
7021197a578f initial checkin
penk
parents:
diff changeset
   577
    requestor := something.
6124
233e703f84a4 access to rootItem & showRoot
Claus Gittinger <cg@exept.de>
parents: 6024
diff changeset
   578
!
233e703f84a4 access to rootItem & showRoot
Claus Gittinger <cg@exept.de>
parents: 6024
diff changeset
   579
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   580
rootItem
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   581
    ^ self applicationList root.
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   582
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   583
    "Created: / 03-11-2007 / 14:23:01 / cg"
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   584
!
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   585
6126
fbe0461cda6b window label handling
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
   586
rootItemLabel
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   587
    ^ self rootItem label.
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   588
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   589
    "Modified: / 03-11-2007 / 14:23:18 / cg"
6126
fbe0461cda6b window label handling
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
   590
!
fbe0461cda6b window label handling
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
   591
6124
233e703f84a4 access to rootItem & showRoot
Claus Gittinger <cg@exept.de>
parents: 6024
diff changeset
   592
rootItemLabel:aString
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   593
    self rootItem label:aString.
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   594
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   595
    "Modified: / 03-11-2007 / 14:23:16 / cg"
6124
233e703f84a4 access to rootItem & showRoot
Claus Gittinger <cg@exept.de>
parents: 6024
diff changeset
   596
!
233e703f84a4 access to rootItem & showRoot
Claus Gittinger <cg@exept.de>
parents: 6024
diff changeset
   597
233e703f84a4 access to rootItem & showRoot
Claus Gittinger <cg@exept.de>
parents: 6024
diff changeset
   598
showRoot:aBoolean
10824
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   599
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   600
    self applicationList showRoot:aBoolean.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   601
    aBoolean ifFalse:[
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   602
        self applicationList root children do:[:e|e expand].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   603
    ]
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   604
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   605
    "Modified: / 15-10-2011 / 12:06:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   606
! !
7021197a578f initial checkin
penk
parents:
diff changeset
   607
7021197a578f initial checkin
penk
parents:
diff changeset
   608
!SettingsDialog methodsFor:'actions'!
7021197a578f initial checkin
penk
parents:
diff changeset
   609
5026
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   610
changeLabelTo:aLabel application:aApplication
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   611
    | item |
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   612
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   613
    item := self getItemByApplication:aApplication.
5043
4ea8ed8336f4 checkin from browser
penk
parents: 5026
diff changeset
   614
    item notNil ifTrue:[
4ea8ed8336f4 checkin from browser
penk
parents: 5026
diff changeset
   615
        item label:aLabel.
4ea8ed8336f4 checkin from browser
penk
parents: 5026
diff changeset
   616
        item changed.
4ea8ed8336f4 checkin from browser
penk
parents: 5026
diff changeset
   617
    ].
5026
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   618
!
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   619
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   620
destroyAll
6389
9f4010737320 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6325
diff changeset
   621
    self applicationList do:[:applItem |
9f4010737320 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6325
diff changeset
   622
        |application|
9f4010737320 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6325
diff changeset
   623
9f4010737320 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6325
diff changeset
   624
        applItem isCategory ifFalse:[
9f4010737320 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6325
diff changeset
   625
            (application := applItem application) notNil ifTrue:[
9f4010737320 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6325
diff changeset
   626
                application close.
9f4010737320 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6325
diff changeset
   627
            ].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   628
        ].
7021197a578f initial checkin
penk
parents:
diff changeset
   629
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
   630
!
7021197a578f initial checkin
penk
parents:
diff changeset
   631
7021197a578f initial checkin
penk
parents:
diff changeset
   632
doIndicatorClick:index 
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   633
    "handle a click on the indicator"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   634
7021197a578f initial checkin
penk
parents:
diff changeset
   635
    (self applicationList at:index) toggleExpand
7021197a578f initial checkin
penk
parents:
diff changeset
   636
!
7021197a578f initial checkin
penk
parents:
diff changeset
   637
7021197a578f initial checkin
penk
parents:
diff changeset
   638
doReload
4574
bcc59a552bca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4552
diff changeset
   639
    |item|
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   640
7021197a578f initial checkin
penk
parents:
diff changeset
   641
    item := self selectedItem value.
4574
bcc59a552bca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4552
diff changeset
   642
    (item isNil or:[item isCategory or:[item application isNil]]) ifTrue:[
bcc59a552bca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4552
diff changeset
   643
        ^ self
bcc59a552bca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4552
diff changeset
   644
    ].
bcc59a552bca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4552
diff changeset
   645
    item application readSettings
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   646
!
7021197a578f initial checkin
penk
parents:
diff changeset
   647
7021197a578f initial checkin
penk
parents:
diff changeset
   648
doSave
7021197a578f initial checkin
penk
parents:
diff changeset
   649
    | item |
7021197a578f initial checkin
penk
parents:
diff changeset
   650
7021197a578f initial checkin
penk
parents:
diff changeset
   651
    item := self selectedItem value.
7021197a578f initial checkin
penk
parents:
diff changeset
   652
    (item isNil or:[item isCategory or:[item application isNil]]) ifTrue:[ ^ self].
4388
4302767e1720 ressources from AbstractLauncherApplication
penk
parents: 4384
diff changeset
   653
    self withWaitCursorDo:[
4574
bcc59a552bca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4552
diff changeset
   654
        item application saveSettingsIfUnsavedChangesArePresent.
4388
4302767e1720 ressources from AbstractLauncherApplication
penk
parents: 4384
diff changeset
   655
    ].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   656
!
7021197a578f initial checkin
penk
parents:
diff changeset
   657
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   658
expandItemForApplication:aApplication
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   659
    | item |
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   660
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   661
    item := self applicationList detect:[:item | item application = aApplication] ifNone:[nil].
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   662
    item notNil ifTrue:[
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   663
        item expand
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   664
    ].
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   665
!
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   666
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   667
help
8034
0e1c05cd4bfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7972
diff changeset
   668
    |item |
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   669
7021197a578f initial checkin
penk
parents:
diff changeset
   670
    item := self selectedItem value.
7021197a578f initial checkin
penk
parents:
diff changeset
   671
    (item isNil or:[item isCategory or:[item application isNil]]) ifTrue:[ ^ self].
7021197a578f initial checkin
penk
parents:
diff changeset
   672
    item application help.
7021197a578f initial checkin
penk
parents:
diff changeset
   673
!
7021197a578f initial checkin
penk
parents:
diff changeset
   674
4740
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
   675
reopenLauncher
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
   676
    self requestor notNil ifTrue:[
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
   677
        self requestor reopenLauncher.
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
   678
    ] ifFalse:[
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
   679
        NewLauncher current reopenLauncher.
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
   680
    ].
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
   681
!
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
   682
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   683
sendLoadRequestToAll
4574
bcc59a552bca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4552
diff changeset
   684
    self applicationList do:[:applItem | 
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   685
        (applItem isCategory not and:[applItem application notNil]) ifTrue:[
9558
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
   686
            applItem application readSettings.
4574
bcc59a552bca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4552
diff changeset
   687
        ]
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   688
    ].
9558
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
   689
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
   690
    "Modified: / 24-08-2010 / 18:41:36 / sr"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   691
!
7021197a578f initial checkin
penk
parents:
diff changeset
   692
7021197a578f initial checkin
penk
parents:
diff changeset
   693
sendSaveRequestToAll
7021197a578f initial checkin
penk
parents:
diff changeset
   694
    self applicationList do:[ : applItem |
7021197a578f initial checkin
penk
parents:
diff changeset
   695
        (applItem isCategory not and:[applItem application notNil]) ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
   696
            applItem application saveRequest ifFalse:[
7021197a578f initial checkin
penk
parents:
diff changeset
   697
                ^ false
7021197a578f initial checkin
penk
parents:
diff changeset
   698
            ].
7021197a578f initial checkin
penk
parents:
diff changeset
   699
        ].
7021197a578f initial checkin
penk
parents:
diff changeset
   700
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
   701
    ^ true
4659
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   702
!
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   703
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   704
sendSaveRequestToCurrent
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   705
    | item |
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   706
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   707
    item := self selectedItem value.
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   708
    (item isNil or:[item isCategory or:[item application isNil]]) ifTrue:[ ^ true].
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   709
    self withWaitCursorDo:[
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   710
        ^ item application saveRequest.
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   711
    ].
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   712
    ^ true
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   713
! !
7021197a578f initial checkin
penk
parents:
diff changeset
   714
7021197a578f initial checkin
penk
parents:
diff changeset
   715
!SettingsDialog methodsFor:'application list access'!
7021197a578f initial checkin
penk
parents:
diff changeset
   716
4898
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   717
addApplClass:aClass forApplication:anApplication label:aLabel expand:aBoolean
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   718
    "add an application to the settingsTree, take the icon from the application classes defaultIcon method"
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   719
4898
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   720
    | class |
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   721
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   722
    class := Smalltalk classNamed:aClass.
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   723
    class isNil ifTrue:[
9781
9896a1dff42c changed:
Claus Gittinger <cg@exept.de>
parents: 9617
diff changeset
   724
        ('SettingsDialog [warning]: can''t find ', aClass asString, ' to register') infoPrintCR.
4898
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   725
        ^ nil
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   726
    ].
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   727
    class autoload.
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   728
    ^ self createItemForApplication:anApplication class:aClass label:aLabel icon:class defaultIcon expandParent:aBoolean replaceExisting:false
9781
9896a1dff42c changed:
Claus Gittinger <cg@exept.de>
parents: 9617
diff changeset
   729
9896a1dff42c changed:
Claus Gittinger <cg@exept.de>
parents: 9617
diff changeset
   730
    "Modified: / 14-02-2011 / 20:10:11 / cg"
4898
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   731
!
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   732
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   733
addApplClass:aClass withName:aName
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   734
   "add an application to the settingsTree, take the icon from the application classes defaultIcon method"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   735
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   736
    ^ self addApplClass:aClass withName:aName icon:nil.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   737
!
7021197a578f initial checkin
penk
parents:
diff changeset
   738
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   739
addApplClass:aClass withName:aName expand:aBoolean
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   740
   "add an application to the settingsTree, take the icon from the application classes defaultIcon method"
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   741
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   742
    ^ self addApplClass:aClass withName:aName icon:nil expand:aBoolean.
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   743
!
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   744
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   745
addApplClass:aClass withName:aName icon:icon
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   746
    ^ self addApplClass:aClass withName:aName icon:icon expand:false
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   747
!
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   748
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   749
addApplClass:aClass withName:aName icon:icon expand:doExpand
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   750
    |applicationLabel locIcon locClass|
7021197a578f initial checkin
penk
parents:
diff changeset
   751
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
   752
"/    (self applicationNames includes:aName) ifTrue:[
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
   753
"/        ^ self getItemForName:aName.
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
   754
"/    ].
4893
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   755
    
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   756
    aClass isNil ifTrue:[ 
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   757
        self addIcon:icon forCategory:aName.
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   758
        ^ self 
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   759
    ].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   760
    self addCategoriesFor:aName.
4893
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   761
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   762
    locIcon := icon.
7021197a578f initial checkin
penk
parents:
diff changeset
   763
    locClass := Smalltalk classNamed:aClass.
4469
27a610981cb5 *** empty log message ***
penk
parents: 4435
diff changeset
   764
    locClass isNil ifTrue:[
9781
9896a1dff42c changed:
Claus Gittinger <cg@exept.de>
parents: 9617
diff changeset
   765
        ('SettingsDialog [warning]: can''t find ', aClass asString, ' to register') infoPrintCR.
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   766
        ^ nil
4469
27a610981cb5 *** empty log message ***
penk
parents: 4435
diff changeset
   767
    ].
4838
60dfab83c50b autoload is understood by all classes (dummy if already loaded)
Claus Gittinger <cg@exept.de>
parents: 4826
diff changeset
   768
    locClass autoload.
60dfab83c50b autoload is understood by all classes (dummy if already loaded)
Claus Gittinger <cg@exept.de>
parents: 4826
diff changeset
   769
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   770
    (locIcon isNil and:[locClass respondsTo:#defaultIcon]) ifTrue:[ locIcon := locClass defaultIcon].
7021197a578f initial checkin
penk
parents:
diff changeset
   771
    applicationLabel := (aName asCollectionOfSubstringsSeparatedBy:$/) last.
5577
adcc748a39b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5465
diff changeset
   772
6325
0b18b7564248 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
   773
    ^ self 
0b18b7564248 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
   774
        createItemName:aName 
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
   775
        label:applicationLabel 
6325
0b18b7564248 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
   776
        class:locClass 
0b18b7564248 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
   777
        icon:locIcon 
0b18b7564248 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
   778
        expandParent:doExpand 
0b18b7564248 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
   779
        replaceExisting:false
9781
9896a1dff42c changed:
Claus Gittinger <cg@exept.de>
parents: 9617
diff changeset
   780
9896a1dff42c changed:
Claus Gittinger <cg@exept.de>
parents: 9617
diff changeset
   781
    "Modified: / 14-02-2011 / 20:10:04 / cg"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   782
!
7021197a578f initial checkin
penk
parents:
diff changeset
   783
7021197a578f initial checkin
penk
parents:
diff changeset
   784
addIcon:aIcon forCategory:aCategoryName
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   785
    "add a new category Icon for a category"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   786
4401
cf3b37e747bd *** empty log message ***
penk
parents: 4400
diff changeset
   787
    |existingItem|
cf3b37e747bd *** empty log message ***
penk
parents: 4400
diff changeset
   788
cf3b37e747bd *** empty log message ***
penk
parents: 4400
diff changeset
   789
    self categoryIcons at:aCategoryName put:aIcon.
cf3b37e747bd *** empty log message ***
penk
parents: 4400
diff changeset
   790
    existingItem := self getItemForName:aCategoryName.
cf3b37e747bd *** empty log message ***
penk
parents: 4400
diff changeset
   791
    existingItem notNil ifTrue:[
cf3b37e747bd *** empty log message ***
penk
parents: 4400
diff changeset
   792
        existingItem icon:aIcon
cf3b37e747bd *** empty log message ***
penk
parents: 4400
diff changeset
   793
    ].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   794
!
7021197a578f initial checkin
penk
parents:
diff changeset
   795
7021197a578f initial checkin
penk
parents:
diff changeset
   796
applicationNames
7021197a578f initial checkin
penk
parents:
diff changeset
   797
    ^ self applicationList collect:[:item | item nameString].
7021197a578f initial checkin
penk
parents:
diff changeset
   798
!
7021197a578f initial checkin
penk
parents:
diff changeset
   799
7021197a578f initial checkin
penk
parents:
diff changeset
   800
categoryIcons
7021197a578f initial checkin
penk
parents:
diff changeset
   801
    categoryIcons isNil ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
   802
        categoryIcons := Dictionary new.
7021197a578f initial checkin
penk
parents:
diff changeset
   803
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
   804
    ^ categoryIcons 
7021197a578f initial checkin
penk
parents:
diff changeset
   805
!
7021197a578f initial checkin
penk
parents:
diff changeset
   806
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   807
childrenApplicationItemFor:aApplication fromItem:anItem
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   808
    anItem application = aApplication ifTrue:[
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   809
        ^ anItem
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   810
    ].
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   811
    anItem hasChildren ifTrue:[
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   812
        anItem children do:[:aChildItem |
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   813
            ^ self childrenApplicationItemFor:aApplication fromItem:aChildItem.
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   814
        ].
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   815
    ].
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   816
    ^ nil
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   817
!
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   818
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   819
getAllChildrenAppsForApplication:aApplication 
5026
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   820
    ^ self getAllChildrenAppsForApplication:aApplication matchBlock:nil
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   821
!
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   822
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   823
getAllChildrenAppsForApplication:aApplication childrenClass:aClass 
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   824
    |matchBlock|
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   825
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   826
    matchBlock := [:aSubApplication | aSubApplication class == aClass ].
5026
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   827
    ^ self getAllChildrenAppsForApplication:aApplication matchBlock:matchBlock
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   828
!
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   829
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   830
getAllChildrenAppsForApplication:aApplication matchBlock:aMatchBlock
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   831
    | children |
5026
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   832
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   833
    children := self getAllChildrenByApplication:aApplication.
5026
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   834
    aMatchBlock notNil ifTrue:[
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   835
        children := children select:[:aChild | aMatchBlock value:(aChild application)]
4716
3df92d455996 *** empty log message ***
penk
parents: 4703
diff changeset
   836
    ].
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   837
    ^ children collect:[:item | item application].
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   838
!
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   839
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   840
getAllChildrenByApplication:aApplication
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   841
    | item |
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   842
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   843
    item := self getItemByApplication:aApplication.
4716
3df92d455996 *** empty log message ***
penk
parents: 4703
diff changeset
   844
    item isNil ifTrue:[ ^ #()].
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   845
    ^ item children.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   846
!
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   847
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   848
getApplicationsByClass:aClass
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   849
    | classEntries|
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   850
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   851
    self applicationList isNil ifTrue:[
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   852
        self initialize.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   853
    ].
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   854
    classEntries := self applicationList select:[:aEntry | aEntry application class == aClass].
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   855
    ^ classEntries collect:[:aItem | aItem application].
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   856
!
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   857
4898
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   858
getItemByApplication:anApplication
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   859
    |item|
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   860
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   861
    self applicationList do:[:anItem |
4898
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   862
        item := self childrenApplicationItemFor:anApplication fromItem:anItem.
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   863
        item notNil ifTrue:[ ^ item ].
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   864
    ].
5043
4ea8ed8336f4 checkin from browser
penk
parents: 5026
diff changeset
   865
    ^ nil
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   866
!
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   867
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   868
getNameOfApplication:aApplication
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   869
    |item|
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   870
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   871
    self applicationList do:[:anItem |
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   872
        item := self childrenApplicationItemFor:aApplication fromItem:anItem.
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   873
        item notNil ifTrue:[ ^ item nameString].
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   874
    ].
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   875
    ^ ''
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   876
!
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   877
4893
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   878
installSettingsEntries:aCollection
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   879
    aCollection do:[ :entry| 
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   880
        self installSettingsEntry:entry.
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   881
    ].
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   882
!
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   883
10824
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   884
installSettingsEntries: entries expand: expand
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   885
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   886
    "Installs given settings list. If expand is true,
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   887
     dynamic settings list is expanded"
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   888
    
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   889
    entries do:[ :entry| 
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   890
        self installSettingsEntry:entry expand: expand
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   891
    ].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   892
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   893
    "Created: / 15-10-2011 / 11:45:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   894
!
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   895
4893
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   896
installSettingsEntry:entry
4895
ccc8b0f0b666 *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 4893
diff changeset
   897
    |applName applClassOrNil iconHolderOrNil|
4893
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   898
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   899
    applName := entry at:1.
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   900
    applClassOrNil := entry at:2.
4895
ccc8b0f0b666 *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 4893
diff changeset
   901
    iconHolderOrNil := entry at:3 ifAbsent:nil.
ccc8b0f0b666 *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 4893
diff changeset
   902
    self addApplClass:applClassOrNil withName:applName icon:iconHolderOrNil value
4893
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   903
!
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   904
10824
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   905
installSettingsEntry:entry expand: expand
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   906
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   907
    | applName applClassOrNil iconHolderOrNil cookedList className code classList name nameCode nameBlock nameList|
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   908
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   909
    expand ifFalse:[
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   910
        applName := entry at:1.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   911
        applClassOrNil := entry at:2.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   912
        iconHolderOrNil := entry at:3 ifAbsent:nil.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   913
        self addApplClass:applClassOrNil withName:applName icon:iconHolderOrNil value.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   914
        ^self
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   915
    ].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   916
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   917
    cookedList := OrderedCollection new.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   918
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   919
    className := entry at:2 ifAbsent:nil.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   920
    (className notNil and:[className startsWith:'[']) ifTrue:[
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   921
        code := className copyFrom:2 to:(className size - 1).
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   922
        classList := (Parser evaluate:code) select:[:clsOrNil | clsOrNil notNil].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   923
        name := entry at:1.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   924
        self assert:(name includesString:'[').
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   925
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   926
        nameCode := name copyFrom:(name indexOf:$[)+1 to:(name indexOf:$])-1.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   927
        nameCode := '^ [:each | ' , (nameCode copyReplaceString:'%' withString:'each') ,']'.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   928
        nameBlock := Parser evaluate:nameCode.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   929
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   930
        nameList := classList collect:nameBlock.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   931
        nameList sortWith:classList.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   932
        nameList with:classList do:[:eachName :eachClass |
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   933
            |newEntry|
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   934
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   935
            newEntry := entry copy.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   936
            newEntry at:1 put:(name copyTo:(name indexOf:$[)-1),eachName.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   937
            newEntry at:2 put:eachClass name.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   938
            cookedList add:newEntry.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   939
        ].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   940
    ] ifFalse:[
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   941
        (className isNil "a directory entry"
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   942
        or:[ (Smalltalk at:className) notNil "a valid entry"]) ifTrue:[
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   943
            cookedList add:entry.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   944
        ].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   945
    ].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   946
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   947
    cookedList do:[:eachEntry |
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   948
        |iconCodeOrSelector iconCode iconBlock newEntry|
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   949
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   950
        iconCodeOrSelector := eachEntry at:3 ifAbsent:nil.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   951
        iconCodeOrSelector isNil ifTrue:[
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   952
            newEntry := eachEntry
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   953
        ] ifFalse:[
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   954
            newEntry := eachEntry copy.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   955
            (iconCodeOrSelector startsWith:'[') ifTrue:[
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   956
                iconCode := iconCodeOrSelector copyFrom:(iconCodeOrSelector indexOf:$[)+1 to:(iconCodeOrSelector indexOf:$])-1.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   957
                iconCode := '^ [:each | ' , (iconCode copyReplaceString:'%' withString:'each') ,']'.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   958
                iconBlock := Parser evaluate:iconCode.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   959
                newEntry at:3 put:(iconBlock value:(Smalltalk classNamed:(eachEntry at:2))).
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   960
            ] ifFalse:[
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   961
                newEntry at:3 put:(self perform:iconCodeOrSelector).
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   962
            ].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   963
        ].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   964
        self installSettingsEntry:newEntry expand: false.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   965
    ].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   966
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   967
    "
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   968
     self withAllSubclassesDo:[:cls | cls initializeSettingsList ]
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   969
    "
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   970
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   971
    "Modified: / 16-12-2002 / 18:12:50 / penk"
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   972
    "Modified: / 20-04-2011 / 17:03:33 / cg"
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   973
    "Created: / 15-10-2011 / 11:49:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   974
!
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   975
5345
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   976
parentApplicationFor:aApplication
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   977
    |item parent|
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   978
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   979
    item := (self getItemByApplication:aApplication).
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   980
    parent := item parent.
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   981
    parent notNil ifTrue:[
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   982
        ^ parent application.
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   983
    ].
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   984
    ^ nil
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   985
!
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   986
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   987
remApplClassByName:aName 
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   988
    "remove an application from the settingsTree"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   989
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   990
    |item|
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   991
7021197a578f initial checkin
penk
parents:
diff changeset
   992
    item := self getItemForName:aName.
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   993
    self removeItem:item 
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   994
!
7021197a578f initial checkin
penk
parents:
diff changeset
   995
4893
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   996
removeAllApplicationsByClass:aClass
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   997
    |apps|
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   998
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   999
    apps := self getApplicationsByClass:aClass.
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
  1000
    apps do:[:aApp |
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
  1001
        self removeByApplication:aApp.
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
  1002
    ].
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
  1003
!
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
  1004
5050
566eab79b16b checkin from browser
penk
parents: 5043
diff changeset
  1005
removeAllSubApplicationsFor:aApp
566eab79b16b checkin from browser
penk
parents: 5043
diff changeset
  1006
    |apps|
566eab79b16b checkin from browser
penk
parents: 5043
diff changeset
  1007
566eab79b16b checkin from browser
penk
parents: 5043
diff changeset
  1008
    apps := self getAllChildrenAppsForApplication:aApp.
566eab79b16b checkin from browser
penk
parents: 5043
diff changeset
  1009
    apps do:[:aApp |
566eab79b16b checkin from browser
penk
parents: 5043
diff changeset
  1010
        self removeByApplication:aApp.
566eab79b16b checkin from browser
penk
parents: 5043
diff changeset
  1011
    ].
566eab79b16b checkin from browser
penk
parents: 5043
diff changeset
  1012
!
566eab79b16b checkin from browser
penk
parents: 5043
diff changeset
  1013
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1014
removeApplicationByClass:aClass
7021197a578f initial checkin
penk
parents:
diff changeset
  1015
    | classEntries|
7021197a578f initial checkin
penk
parents:
diff changeset
  1016
7021197a578f initial checkin
penk
parents:
diff changeset
  1017
    self applicationList isNil ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1018
        self initialize.
7021197a578f initial checkin
penk
parents:
diff changeset
  1019
    ].
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1020
    classEntries := self applicationList select:[:aEntry | aEntry application class == aClass].
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1021
    classEntries do:[:aItem |
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1022
        self removeItem:aItem.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1023
    ].
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1024
!
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1025
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1026
removeApplicationFromTree:aApplication
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1027
    | classEntries|
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1028
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1029
    self applicationList isNil ifTrue:[
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1030
        self initialize.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1031
    ].
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1032
    classEntries := self applicationList select:[:aEntry | aEntry application == aApplication].
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1033
    classEntries do:[:aItem |
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1034
        self removeItem:aItem.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1035
    ].
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1036
    self applicationList removeAllFoundIn:classEntries.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1037
!
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1038
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1039
removeByApplication:aApplication
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
  1040
    | item |
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1041
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1042
    item := self getItemByApplication:aApplication.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1043
    item notNil ifTrue:[
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1044
        self removeItem:item.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1045
    ]
5058
bfa6a2d39edb *** empty log message ***
penk
parents: 5050
diff changeset
  1046
!
bfa6a2d39edb *** empty log message ***
penk
parents: 5050
diff changeset
  1047
bfa6a2d39edb *** empty log message ***
penk
parents: 5050
diff changeset
  1048
sortSubApplicationsFor:anApplication
5059
a39dd428776c *** empty log message ***
penk
parents: 5058
diff changeset
  1049
    |item|
5058
bfa6a2d39edb *** empty log message ***
penk
parents: 5050
diff changeset
  1050
bfa6a2d39edb *** empty log message ***
penk
parents: 5050
diff changeset
  1051
    item := self getItemByApplication:anApplication.
8268
ad2da5c435b9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8119
diff changeset
  1052
    item sort:[:a :b| a label < b label].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1053
! !
7021197a578f initial checkin
penk
parents:
diff changeset
  1054
6325
0b18b7564248 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  1055
!SettingsDialog methodsFor:'application list access-private'!
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1056
7021197a578f initial checkin
penk
parents:
diff changeset
  1057
addCategoriesFor:aName
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
  1058
    "create all the categories"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1059
5253
193cbf909cef not ifTrue -> ifFalse
Claus Gittinger <cg@exept.de>
parents: 5164
diff changeset
  1060
    (aName includes:$/) ifFalse:[ ^ self].
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1061
    self treeName:aName butLast:1 do:[:currentLabel :currentName| 
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1062
        |length icon|
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1063
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1064
        currentLabel notEmpty ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1065
            icon := self categoryIcons at:currentName ifAbsent:[nil].
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1066
            self createItemName:currentName label:currentLabel icon:icon replaceExisting:true.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1067
        ]
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1068
    ].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1069
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1070
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1071
createItemForApplication:anApplication class:aClass label:aLabel icon:anIcon expandParent:expandParent replaceExisting:doReplaceExisting
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
  1072
    "create an application item in my application list"
4898
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1073
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1074
    | newItem parent locIcon item|
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1075
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1076
    parent := self getItemByApplication:anApplication.
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1077
    parent isNil ifTrue:[
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1078
        ^ nil
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1079
    ].
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1080
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1081
    doReplaceExisting ifTrue:[
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1082
        parent children notNil ifTrue:[
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1083
            (item := parent children detect:[ :anItem | anItem application == anApplication] ifNone:[nil]) notNil ifTrue:[
4898
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1084
                ^ item.
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1085
            ]
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1086
        ]
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1087
    ].
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1088
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1089
    newItem := self class itemClass new.  
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1090
    "/ newItem label:(resources string:aLabel) "allBold".
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1091
    newItem label:aLabel "allBold".
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1092
    newItem nameString:(anApplication itemPathName , aLabel).
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1093
    newItem applicationClass:aClass.
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1094
    locIcon := anIcon.
4898
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1095
    locIcon isNil ifTrue:[ locIcon := self class defaultSettingsAppIcon].
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1096
    newItem icon:locIcon.
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1097
    parent add:newItem.
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1098
    expandParent ifTrue:[
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1099
        parent expand.
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1100
    ].
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1101
    ^ newItem
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1102
!
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1103
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1104
createItemName:aNameString label:aLabel class:aClass icon:anIcon
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1105
    ^ self createItemName:aNameString label:aLabel class:aClass icon:anIcon expandParent:false
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
  1106
!
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
  1107
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1108
createItemName:aNameString label:aLabel class:aClass icon:anIcon expandParent:expandParent
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1109
    ^ self
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1110
        createItemName:aNameString 
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1111
        label:aLabel 
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1112
        class:aClass 
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1113
        icon:anIcon 
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1114
        expandParent:expandParent
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1115
        replaceExisting:true
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1116
!
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1117
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1118
createItemName:aNameString label:untranslatedLabel class:aClass icon:anIcon expandParent:expandParent replaceExisting:doReplaceExisting
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
  1119
    "create an application item in my application list"
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
  1120
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1121
    |newItem parentsName parent locIcon item|
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1122
5577
adcc748a39b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5465
diff changeset
  1123
    (aNameString includes:$/) ifTrue:[
adcc748a39b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5465
diff changeset
  1124
        parentsName := aNameString copyTo:(aNameString lastIndexOf:$/)-1.
adcc748a39b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5465
diff changeset
  1125
        parent := self getItemForName:parentsName.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1126
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1127
    parent isNil ifTrue:[
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1128
        parent := self rootItem.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1129
    ].
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1130
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1131
    doReplaceExisting ifTrue:[
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1132
        parent children notNil ifTrue:[
5577
adcc748a39b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5465
diff changeset
  1133
            (item := parent children detect:[ :anItem | anItem nameString = aNameString] ifNone:[nil]) notNil ifTrue:[
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1134
                ^ item.
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1135
            ]
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1136
        ]
7021197a578f initial checkin
penk
parents:
diff changeset
  1137
    ].
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1138
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1139
    newItem := self class itemClass new.  
4740
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
  1140
    "/ newItem label:(resources string:aLabel) "allBold".
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1141
    newItem label:(resources string:untranslatedLabel) "allBold".
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1142
    newItem nameString:aNameString.
7021197a578f initial checkin
penk
parents:
diff changeset
  1143
    newItem applicationClass:aClass.
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1144
    locIcon := anIcon.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1145
    locIcon isNil ifTrue:[ locIcon := self class defaultSettingsAppIcon].
7021197a578f initial checkin
penk
parents:
diff changeset
  1146
    newItem icon:locIcon.
4384
e16e816f6680 *** empty log message ***
penk
parents: 4378
diff changeset
  1147
    parent add:newItem.
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
  1148
    expandParent ifTrue:[
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
  1149
        parent expand.
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
  1150
    ].
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1151
    ^ newItem
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1152
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1153
    "Modified: / 03-11-2007 / 14:23:32 / cg"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1154
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1155
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1156
createItemName:aNameString label:aLabel icon:anIcon
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
  1157
    "create an application item in my application list"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1158
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1159
    self createItemName:aNameString label:aLabel class:nil icon:anIcon expandParent:false
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1160
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1161
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1162
createItemName:aNameString label:aLabel icon:anIcon replaceExisting:doReplaceExisting
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
  1163
    "create an application item in my application list"
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1164
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1165
    self createItemName:aNameString label:aLabel class:nil icon:anIcon expandParent:false replaceExisting:doReplaceExisting
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1166
!
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1167
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1168
getItemForName:aName
7021197a578f initial checkin
penk
parents:
diff changeset
  1169
    | searchItem|
7021197a578f initial checkin
penk
parents:
diff changeset
  1170
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1171
    searchItem := self rootItem.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1172
    self treeName:aName do:[:currentLabel :currentName|
7021197a578f initial checkin
penk
parents:
diff changeset
  1173
        searchItem children isNil ifTrue:[ ^ nil].
7021197a578f initial checkin
penk
parents:
diff changeset
  1174
        searchItem := searchItem children detect:[: item | item nameString = currentName] ifNone:[nil].
7021197a578f initial checkin
penk
parents:
diff changeset
  1175
        searchItem isNil ifTrue:[ ^ nil].
7021197a578f initial checkin
penk
parents:
diff changeset
  1176
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1177
    ^ searchItem
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1178
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1179
    "Modified: / 03-11-2007 / 14:23:28 / cg"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1180
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1181
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1182
removeItem:anItem 
7895
c658466812c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7880
diff changeset
  1183
    "remove an application from the settingsTree"
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1184
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1185
    |parent remParent|
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1186
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1187
    anItem application release.
4893
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
  1188
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1189
    parent := anItem parent.
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1190
    parent isNil ifTrue:[" already removed " ^ self].
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1191
    parent remove:anItem.
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1192
    
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1193
    [parent isCategory and:[parent children isEmptyOrNil]] whileTrue:[
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1194
        remParent := parent.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1195
        parent := remParent parent.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1196
        parent remove:remParent.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1197
    ].
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1198
    self applicationList remove:anItem ifAbsent:[nil].
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1199
    self selectedItem value:parent.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1200
!
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1201
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1202
treeName:aName butLast:last do:aBlock 
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1203
    | tree  length|
7021197a578f initial checkin
penk
parents:
diff changeset
  1204
7021197a578f initial checkin
penk
parents:
diff changeset
  1205
    tree := aName asCollectionOfSubstringsSeparatedBy:$/.
7021197a578f initial checkin
penk
parents:
diff changeset
  1206
    tree from:1 to:(tree size - last) keysAndValuesDo:[:idx :aCategory| | itemName |
7021197a578f initial checkin
penk
parents:
diff changeset
  1207
        length := 0.
7021197a578f initial checkin
penk
parents:
diff changeset
  1208
        tree from:1 to:idx keysAndValuesDo:[:idx2 : el | 
7021197a578f initial checkin
penk
parents:
diff changeset
  1209
            length := length + el size.
7021197a578f initial checkin
penk
parents:
diff changeset
  1210
            idx2 > 1 ifTrue:[length := length + 1].
7021197a578f initial checkin
penk
parents:
diff changeset
  1211
        ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1212
        itemName := aName copyTo:length.
7021197a578f initial checkin
penk
parents:
diff changeset
  1213
        aBlock value:aCategory value:itemName.
7021197a578f initial checkin
penk
parents:
diff changeset
  1214
    ].
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1215
!
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1216
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1217
treeName:aName do:aBlock
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1218
    self treeName:aName butLast:0 do:aBlock
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1219
! !
7021197a578f initial checkin
penk
parents:
diff changeset
  1220
7021197a578f initial checkin
penk
parents:
diff changeset
  1221
!SettingsDialog methodsFor:'aspects'!
7021197a578f initial checkin
penk
parents:
diff changeset
  1222
7021197a578f initial checkin
penk
parents:
diff changeset
  1223
applicationList
7021197a578f initial checkin
penk
parents:
diff changeset
  1224
    applicationList isNil ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1225
        applicationList := SettingsDialog::HierarchicalApplicationList new.
7021197a578f initial checkin
penk
parents:
diff changeset
  1226
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1227
    ^ applicationList.
7021197a578f initial checkin
penk
parents:
diff changeset
  1228
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1229
7021197a578f initial checkin
penk
parents:
diff changeset
  1230
enableHelp
7021197a578f initial checkin
penk
parents:
diff changeset
  1231
    enableHelp isNil ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1232
        enableHelp := true asValue.
7021197a578f initial checkin
penk
parents:
diff changeset
  1233
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1234
    ^ enableHelp.
7021197a578f initial checkin
penk
parents:
diff changeset
  1235
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1236
7021197a578f initial checkin
penk
parents:
diff changeset
  1237
enableOK
7021197a578f initial checkin
penk
parents:
diff changeset
  1238
    enableOK isNil ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1239
        enableOK := true asValue.
7021197a578f initial checkin
penk
parents:
diff changeset
  1240
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1241
    ^ enableOK.
7021197a578f initial checkin
penk
parents:
diff changeset
  1242
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1243
7021197a578f initial checkin
penk
parents:
diff changeset
  1244
enableReload
7021197a578f initial checkin
penk
parents:
diff changeset
  1245
    enableReload isNil ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1246
        enableReload := true asValue.
7021197a578f initial checkin
penk
parents:
diff changeset
  1247
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1248
    ^ enableReload.
7021197a578f initial checkin
penk
parents:
diff changeset
  1249
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1250
9021
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1251
loadAndSaveSettingsItemVisible
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1252
    "for now, only show these if I have a requestor 
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1253
     (i.e. I am a full settings Dialog as opposed to a DebugView, FileBrowser or other
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1254
     settingsDialog. I think this has to be reworked..."
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1255
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1256
    ^ requestor notNil "/ loadAndSaveSettingsItemVisible
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1257
!
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1258
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1259
selectedItem
7021197a578f initial checkin
penk
parents:
diff changeset
  1260
    selectedItem isNil ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1261
        selectedItem := ValueHolder new.
7021197a578f initial checkin
penk
parents:
diff changeset
  1262
        selectedItem addDependent:self.
7021197a578f initial checkin
penk
parents:
diff changeset
  1263
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1264
    ^ selectedItem.
7021197a578f initial checkin
penk
parents:
diff changeset
  1265
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1266
7021197a578f initial checkin
penk
parents:
diff changeset
  1267
subCanvasApplicationHolder
7021197a578f initial checkin
penk
parents:
diff changeset
  1268
    subCanvasApplicationHolder isNil ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1269
        subCanvasApplicationHolder := ValueHolder new.
7021197a578f initial checkin
penk
parents:
diff changeset
  1270
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1271
    ^ subCanvasApplicationHolder.
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1272
!
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1273
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1274
whyDisabledInfoHolder
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1275
    whyDisabledInfoHolder isNil ifTrue:[
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1276
        whyDisabledInfoHolder := '' asValue.
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1277
    ].
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1278
    ^ whyDisabledInfoHolder.
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1279
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1280
    "Created: / 25-01-2007 / 17:13:50 / cg"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1281
! !
7021197a578f initial checkin
penk
parents:
diff changeset
  1282
7021197a578f initial checkin
penk
parents:
diff changeset
  1283
!SettingsDialog methodsFor:'change & update'!
7021197a578f initial checkin
penk
parents:
diff changeset
  1284
7021197a578f initial checkin
penk
parents:
diff changeset
  1285
modifiedChanged
7021197a578f initial checkin
penk
parents:
diff changeset
  1286
    |changedObject|
7021197a578f initial checkin
penk
parents:
diff changeset
  1287
7021197a578f initial checkin
penk
parents:
diff changeset
  1288
    changedObject := self subCanvasApplicationHolder value modifiedChannel.
7021197a578f initial checkin
penk
parents:
diff changeset
  1289
    self enableOK value:(changedObject value).
7021197a578f initial checkin
penk
parents:
diff changeset
  1290
    self enableReload value:(changedObject value).
7021197a578f initial checkin
penk
parents:
diff changeset
  1291
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1292
9617
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1293
selectItemWithClass:aClass
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1294
    |entry|
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1295
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1296
    entry := applicationList root
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1297
                recursiveDetect:[:entry | entry applicationClass = aClass].
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1298
    entry makeVisible.
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1299
    self selectedItem value:entry
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1300
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1301
    "Created: / 29-10-2010 / 11:54:13 / cg"
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1302
!
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1303
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1304
selectionChanged
7613
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1305
    |item oldAppl noApp lbl window app itemLabel|
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1306
4405
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1307
    self selectedItem value == lastSelection  ifTrue:[ ^ self].
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1308
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1309
    oldAppl := self subCanvasApplicationHolder value.
7021197a578f initial checkin
penk
parents:
diff changeset
  1310
    oldAppl notNil ifTrue:[
4405
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1311
        oldAppl saveRequest ifFalse:[
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1312
            lastSelection notNil ifTrue:[
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1313
            self
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1314
                enqueueMessage:#value 
9617
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1315
                for:[ self selectedItem value:lastSelection ]
4405
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1316
                arguments:#().
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1317
            ].
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1318
            ^ self
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1319
        ].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1320
        oldAppl modifiedChannel removeDependent:self.
7021197a578f initial checkin
penk
parents:
diff changeset
  1321
    ].
4435
854d330d659e care for nil selection
Claus Gittinger <cg@exept.de>
parents: 4433
diff changeset
  1322
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1323
    item := self selectedItem value.
4405
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1324
    lastSelection := item.
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1325
    noApp := (item isNil) ifTrue:true ifFalse:[item isCategory].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1326
    self enableOK value:(noApp not).
7021197a578f initial checkin
penk
parents:
diff changeset
  1327
    self enableReload value:(noApp not).
7021197a578f initial checkin
penk
parents:
diff changeset
  1328
    self enableHelp value:(noApp not).
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1329
4435
854d330d659e care for nil selection
Claus Gittinger <cg@exept.de>
parents: 4433
diff changeset
  1330
    window := self window.
854d330d659e care for nil selection
Claus Gittinger <cg@exept.de>
parents: 4433
diff changeset
  1331
    window notNil ifTrue:[
6126
fbe0461cda6b window label handling
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
  1332
        lbl := self rootItemLabel ? 'Settings Dialog'.
4435
854d330d659e care for nil selection
Claus Gittinger <cg@exept.de>
parents: 4433
diff changeset
  1333
        item notNil ifTrue:[
6126
fbe0461cda6b window label handling
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
  1334
            itemLabel := (item label copyReplaceAll:(Character cr) with:(Character space)).
fbe0461cda6b window label handling
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
  1335
            itemLabel ~= lbl ifTrue:[
fbe0461cda6b window label handling
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
  1336
                lbl := lbl , ' [', itemLabel, ']'.
fbe0461cda6b window label handling
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
  1337
            ]
4435
854d330d659e care for nil selection
Claus Gittinger <cg@exept.de>
parents: 4433
diff changeset
  1338
        ].
854d330d659e care for nil selection
Claus Gittinger <cg@exept.de>
parents: 4433
diff changeset
  1339
        window label:lbl.
4406
d157f56c5ac9 *** empty log message ***
penk
parents: 4405
diff changeset
  1340
    ].
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1341
7613
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1342
    builder notNil ifTrue:[ |box|
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1343
        "hide the DisabledSettingsBox"
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1344
        box := builder componentAt:#DisabledSettingsBox.
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1345
        box notNil ifTrue:[
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1346
            box beInvisible; lower.
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1347
        ].
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1348
    ].
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1349
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1350
    noApp ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1351
        self subCanvasApplicationHolder value:nil.
7021197a578f initial checkin
penk
parents:
diff changeset
  1352
        ^ self
7021197a578f initial checkin
penk
parents:
diff changeset
  1353
    ].
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1354
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1355
    app := item application.
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1356
    app isNil ifTrue:[
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1357
        app := item applicationClass basicNew.
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1358
        (app isEnabledInSettingsDialog:self) ifFalse:[
7613
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1359
            "raise the DisabledSettingsBox above the settings window"
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1360
            self whyDisabledInfoHolder value:('These Settings are currently disabled, because\',app whyDisabledInSettingsDialogInfo) withCRs.
7613
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1361
            builder notNil ifTrue:[ |box|
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1362
                box := builder componentAt:#DisabledSettingsBox.
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1363
                box notNil ifTrue:[
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1364
                    box beVisible; raise.
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1365
                ].
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1366
            ].
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1367
            self subCanvasApplicationHolder value:nil.
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1368
            ^ self
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1369
        ].
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1370
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1371
        item application:app.
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1372
        app basicInitialize.
5026
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
  1373
        app settingsDialog:self.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1374
    ].
5164
35a9d096be9b *** empty log message ***
penk
parents: 5146
diff changeset
  1375
    self withWaitCursorDo:[
35a9d096be9b *** empty log message ***
penk
parents: 5146
diff changeset
  1376
        app initialize.
35a9d096be9b *** empty log message ***
penk
parents: 5146
diff changeset
  1377
        app readSettings.
35a9d096be9b *** empty log message ***
penk
parents: 5146
diff changeset
  1378
    ].
4435
854d330d659e care for nil selection
Claus Gittinger <cg@exept.de>
parents: 4433
diff changeset
  1379
    app modifiedChannel addDependent:self.
854d330d659e care for nil selection
Claus Gittinger <cg@exept.de>
parents: 4433
diff changeset
  1380
    self subCanvasApplicationHolder value:app.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1381
    self modifiedChanged.
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1382
9617
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1383
    "Modified: / 29-10-2010 / 11:51:13 / cg"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1384
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1385
7021197a578f initial checkin
penk
parents:
diff changeset
  1386
update:something with:aParameter from:changedObject
6293
1c16cd8fdb79 stupid comment
Claus Gittinger <cg@exept.de>
parents: 6127
diff changeset
  1387
    |subCanvasApplication|
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1388
7021197a578f initial checkin
penk
parents:
diff changeset
  1389
    changedObject == self selectedItem ifTrue:[
4405
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1390
        super update:something with:aParameter from:changedObject.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1391
        self selectionChanged.
4405
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1392
        ^ self.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1393
    ].
6293
1c16cd8fdb79 stupid comment
Claus Gittinger <cg@exept.de>
parents: 6127
diff changeset
  1394
    subCanvasApplication := self subCanvasApplicationHolder value.
1c16cd8fdb79 stupid comment
Claus Gittinger <cg@exept.de>
parents: 6127
diff changeset
  1395
    (subCanvasApplication notNil 
1c16cd8fdb79 stupid comment
Claus Gittinger <cg@exept.de>
parents: 6127
diff changeset
  1396
    and:[changedObject == subCanvasApplication modifiedChannel]) ifTrue:[
1c16cd8fdb79 stupid comment
Claus Gittinger <cg@exept.de>
parents: 6127
diff changeset
  1397
        self modifiedChanged.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1398
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1399
    super update:something with:aParameter from:changedObject
7021197a578f initial checkin
penk
parents:
diff changeset
  1400
! !
7021197a578f initial checkin
penk
parents:
diff changeset
  1401
7021197a578f initial checkin
penk
parents:
diff changeset
  1402
!SettingsDialog methodsFor:'initialization & release'!
7021197a578f initial checkin
penk
parents:
diff changeset
  1403
7021197a578f initial checkin
penk
parents:
diff changeset
  1404
closeRequest
7021197a578f initial checkin
penk
parents:
diff changeset
  1405
    "This is a hook method generated by the Browser.
7021197a578f initial checkin
penk
parents:
diff changeset
  1406
     It will be invoked when your app/dialog-window is about to be
7021197a578f initial checkin
penk
parents:
diff changeset
  1407
     closed (this method has a chance to suppress the close).
7021197a578f initial checkin
penk
parents:
diff changeset
  1408
     See also #closeDownViews, which is invoked when the close is really done."
7021197a578f initial checkin
penk
parents:
diff changeset
  1409
4400
5b1bf011547f add examples
penk
parents: 4397
diff changeset
  1410
    | req |
6019
001740075800 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5975
diff changeset
  1411
4659
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
  1412
    (self sendSaveRequestToCurrent == false) ifTrue:[^ self].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1413
    self destroyAll.
4400
5b1bf011547f add examples
penk
parents: 4397
diff changeset
  1414
5b1bf011547f add examples
penk
parents: 4397
diff changeset
  1415
    req := self requestor.
5b1bf011547f add examples
penk
parents: 4397
diff changeset
  1416
    req notNil ifTrue:[
5b1bf011547f add examples
penk
parents: 4397
diff changeset
  1417
        req settingsClosed.
5b1bf011547f add examples
penk
parents: 4397
diff changeset
  1418
    ].
6635
e20f08617728 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6505
diff changeset
  1419
    super closeRequest
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1420
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1421
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1422
createRootItem
7172
042c3e1278e4 order of setting items
Claus Gittinger <cg@exept.de>
parents: 7100
diff changeset
  1423
    |rootItem lbl|
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1424
7021197a578f initial checkin
penk
parents:
diff changeset
  1425
    resources := AbstractLauncherApplication resources.
7021197a578f initial checkin
penk
parents:
diff changeset
  1426
    rootItem := self class itemClass new.
7172
042c3e1278e4 order of setting items
Claus Gittinger <cg@exept.de>
parents: 7100
diff changeset
  1427
    lbl := resources string:'Settings'.
042c3e1278e4 order of setting items
Claus Gittinger <cg@exept.de>
parents: 7100
diff changeset
  1428
    rootItem label:lbl "allBold".
042c3e1278e4 order of setting items
Claus Gittinger <cg@exept.de>
parents: 7100
diff changeset
  1429
    rootItem nameString:lbl.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1430
    rootItem icon:self class settingsIcon.
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1431
    ^ rootItem
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1432
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1433
    "Created: / 03-11-2007 / 14:22:01 / cg"
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1434
!
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1435
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1436
initialize
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1437
    |rootItem|
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1438
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1439
    rootItem := self createRootItem.
6124
233e703f84a4 access to rootItem & showRoot
Claus Gittinger <cg@exept.de>
parents: 6024
diff changeset
  1440
    self applicationList root:rootItem; showRoot:true "false".
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1441
    self selectedItem value:rootItem.
7021197a578f initial checkin
penk
parents:
diff changeset
  1442
    super initialize.
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1443
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1444
    "Modified: / 03-11-2007 / 14:22:18 / cg"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1445
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1446
7021197a578f initial checkin
penk
parents:
diff changeset
  1447
postBuildSubCanvas:aWidget
7021197a578f initial checkin
penk
parents:
diff changeset
  1448
    aWidget keepClientView:true. 
7021197a578f initial checkin
penk
parents:
diff changeset
  1449
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1450
7021197a578f initial checkin
penk
parents:
diff changeset
  1451
postOpenWith:aBuilder
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1452
    self rootItem expand.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1453
    super postOpenWith:aBuilder.
10742
c6c9b272ac55 changed: #postOpenWith: (pre-select settings if there is only one child of the root)
vrany
parents: 10396
diff changeset
  1454
    self rootItem children size == 1 ifTrue:[
c6c9b272ac55 changed: #postOpenWith: (pre-select settings if there is only one child of the root)
vrany
parents: 10396
diff changeset
  1455
        self selectedItem value: self rootItem children anyOne.
c6c9b272ac55 changed: #postOpenWith: (pre-select settings if there is only one child of the root)
vrany
parents: 10396
diff changeset
  1456
    ]
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1457
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1458
    "Modified: / 03-11-2007 / 14:23:25 / cg"
10742
c6c9b272ac55 changed: #postOpenWith: (pre-select settings if there is only one child of the root)
vrany
parents: 10396
diff changeset
  1459
    "Modified: / 03-10-2011 / 16:27:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1460
! !
7021197a578f initial checkin
penk
parents:
diff changeset
  1461
7021197a578f initial checkin
penk
parents:
diff changeset
  1462
!SettingsDialog methodsFor:'menu actions'!
7021197a578f initial checkin
penk
parents:
diff changeset
  1463
5465
2c1dc7101e03 *** empty log message ***
ca
parents: 5422
diff changeset
  1464
askForFileAndSaveSettings
2c1dc7101e03 *** empty log message ***
ca
parents: 5422
diff changeset
  1465
    self class askForFileAndSaveSettings.
2c1dc7101e03 *** empty log message ***
ca
parents: 5422
diff changeset
  1466
!
2c1dc7101e03 *** empty log message ***
ca
parents: 5422
diff changeset
  1467
4574
bcc59a552bca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4552
diff changeset
  1468
loadSettingsFromFile
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1469
    "restore settings from a settings-file."
7021197a578f initial checkin
penk
parents:
diff changeset
  1470
7021197a578f initial checkin
penk
parents:
diff changeset
  1471
    "a temporary kludge - we need a central systemSettings object for this,
7021197a578f initial checkin
penk
parents:
diff changeset
  1472
     which can be saved/restored with a single store/read."
7021197a578f initial checkin
penk
parents:
diff changeset
  1473
5629
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1474
    |fileName transcript launcher|
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1475
7021197a578f initial checkin
penk
parents:
diff changeset
  1476
    fileName := Dialog 
4740
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
  1477
        requestFileName:(resources string:'Load Settings from File') 
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1478
        default:'settings.stx'
7021197a578f initial checkin
penk
parents:
diff changeset
  1479
        ok:(resources string:'Load') 
7021197a578f initial checkin
penk
parents:
diff changeset
  1480
        abort:(resources string:'Cancel') 
7021197a578f initial checkin
penk
parents:
diff changeset
  1481
        pattern:'*.stx'
7021197a578f initial checkin
penk
parents:
diff changeset
  1482
        fromDirectory:nil.
7021197a578f initial checkin
penk
parents:
diff changeset
  1483
7021197a578f initial checkin
penk
parents:
diff changeset
  1484
    (fileName size == 0) ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1485
        "/ canceled
7021197a578f initial checkin
penk
parents:
diff changeset
  1486
        ^ self
7021197a578f initial checkin
penk
parents:
diff changeset
  1487
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1488
7021197a578f initial checkin
penk
parents:
diff changeset
  1489
    self withWaitCursorDo:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1490
        Smalltalk fileIn:fileName.
5629
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1491
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1492
        "/ Transcript current topView model reOpen.
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1493
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1494
        transcript := Transcript current.
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1495
        (transcript notNil and:[transcript isExternalStream not]) ifTrue:[
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1496
            launcher := transcript application.
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1497
            launcher notNil ifTrue:[
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1498
                launcher reopenLauncher.
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1499
            ]
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1500
        ].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1501
        self sendLoadRequestToAll.
7021197a578f initial checkin
penk
parents:
diff changeset
  1502
    ].
7100
e273c6f4602d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6688
diff changeset
  1503
e273c6f4602d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6688
diff changeset
  1504
    "Modified: / 08-09-2006 / 19:23:15 / cg"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1505
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1506
5465
2c1dc7101e03 *** empty log message ***
ca
parents: 5422
diff changeset
  1507
saveSettingsWithoutAskingForFile
2c1dc7101e03 *** empty log message ***
ca
parents: 5422
diff changeset
  1508
    self class saveSettingsWithoutAskingForFile.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1509
! !
7021197a578f initial checkin
penk
parents:
diff changeset
  1510
7021197a578f initial checkin
penk
parents:
diff changeset
  1511
!SettingsDialog::HierarchicalApplicationList::ApplicationItem methodsFor:'accessing'!
7021197a578f initial checkin
penk
parents:
diff changeset
  1512
7021197a578f initial checkin
penk
parents:
diff changeset
  1513
application
7021197a578f initial checkin
penk
parents:
diff changeset
  1514
    "return the value of the instance variable 'application' (automatically generated)"
7021197a578f initial checkin
penk
parents:
diff changeset
  1515
7021197a578f initial checkin
penk
parents:
diff changeset
  1516
    ^ application
7021197a578f initial checkin
penk
parents:
diff changeset
  1517
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1518
7021197a578f initial checkin
penk
parents:
diff changeset
  1519
application:something
7021197a578f initial checkin
penk
parents:
diff changeset
  1520
    "set the value of the instance variable 'application' (automatically generated)"
7021197a578f initial checkin
penk
parents:
diff changeset
  1521
7021197a578f initial checkin
penk
parents:
diff changeset
  1522
    application := something.
7021197a578f initial checkin
penk
parents:
diff changeset
  1523
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1524
7021197a578f initial checkin
penk
parents:
diff changeset
  1525
applicationClass
7021197a578f initial checkin
penk
parents:
diff changeset
  1526
    "return the value of the instance variable 'applicationClass' (automatically generated)"
7021197a578f initial checkin
penk
parents:
diff changeset
  1527
7021197a578f initial checkin
penk
parents:
diff changeset
  1528
    ^ applicationClass
7021197a578f initial checkin
penk
parents:
diff changeset
  1529
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1530
7021197a578f initial checkin
penk
parents:
diff changeset
  1531
applicationClass:something
7021197a578f initial checkin
penk
parents:
diff changeset
  1532
    "set the value of the instance variable 'applicationClass' (automatically generated)"
7021197a578f initial checkin
penk
parents:
diff changeset
  1533
7021197a578f initial checkin
penk
parents:
diff changeset
  1534
    applicationClass := something.
7021197a578f initial checkin
penk
parents:
diff changeset
  1535
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1536
9425
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1537
label:something
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1538
    "reset the with in pixels..."
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1539
    width := nil.
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1540
    label := something.
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1541
!
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1542
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1543
nameString
7021197a578f initial checkin
penk
parents:
diff changeset
  1544
    "return the value of the instance variable 'nameString' (automatically generated)"
7021197a578f initial checkin
penk
parents:
diff changeset
  1545
7021197a578f initial checkin
penk
parents:
diff changeset
  1546
    ^ nameString
7021197a578f initial checkin
penk
parents:
diff changeset
  1547
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1548
7021197a578f initial checkin
penk
parents:
diff changeset
  1549
nameString:something
7021197a578f initial checkin
penk
parents:
diff changeset
  1550
    "set the value of the instance variable 'nameString' (automatically generated)"
7021197a578f initial checkin
penk
parents:
diff changeset
  1551
7021197a578f initial checkin
penk
parents:
diff changeset
  1552
    nameString := something.
7021197a578f initial checkin
penk
parents:
diff changeset
  1553
! !
7021197a578f initial checkin
penk
parents:
diff changeset
  1554
5078
9fafc6b058bc new middleButtonMenu for remove service in SettingsDialog
penk
parents: 5059
diff changeset
  1555
!SettingsDialog::HierarchicalApplicationList::ApplicationItem methodsFor:'menu'!
9fafc6b058bc new middleButtonMenu for remove service in SettingsDialog
penk
parents: 5059
diff changeset
  1556
9fafc6b058bc new middleButtonMenu for remove service in SettingsDialog
penk
parents: 5059
diff changeset
  1557
middleButtonMenu
9fafc6b058bc new middleButtonMenu for remove service in SettingsDialog
penk
parents: 5059
diff changeset
  1558
9fafc6b058bc new middleButtonMenu for remove service in SettingsDialog
penk
parents: 5059
diff changeset
  1559
    <resource: #programMenu >
9fafc6b058bc new middleButtonMenu for remove service in SettingsDialog
penk
parents: 5059
diff changeset
  1560
5838
290edc109c4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5629
diff changeset
  1561
    |application|
290edc109c4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5629
diff changeset
  1562
290edc109c4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5629
diff changeset
  1563
    (application := self application) isNil ifTrue:[ ^ nil].
290edc109c4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5629
diff changeset
  1564
    ^ application settingsDialogPopUpMenu
5078
9fafc6b058bc new middleButtonMenu for remove service in SettingsDialog
penk
parents: 5059
diff changeset
  1565
! !
9fafc6b058bc new middleButtonMenu for remove service in SettingsDialog
penk
parents: 5059
diff changeset
  1566
4405
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1567
!SettingsDialog::HierarchicalApplicationList::ApplicationItem methodsFor:'printing & storing'!
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1568
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1569
displayString
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1570
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1571
    ^ super printString, ' [', (label isText ifTrue:[label string] ifFalse:[label]) ,']'
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1572
!
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1573
9558
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
  1574
printOn:aStream
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
  1575
    aStream 
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
  1576
        nextPutAll:self class nameWithoutPrefix;
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
  1577
        nextPutAll:' ';
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
  1578
        nextPutAll:self label ? '???'.
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
  1579
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
  1580
    "Created: / 24-08-2010 / 18:36:17 / sr"
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
  1581
!
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
  1582
4405
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1583
printString
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1584
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1585
    ^ super printString, ' [', (label isText ifTrue:[label string] ifFalse:[label]) ,']'
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1586
! !
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1587
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1588
!SettingsDialog::HierarchicalApplicationList::ApplicationItem methodsFor:'queries'!
7021197a578f initial checkin
penk
parents:
diff changeset
  1589
9425
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1590
canCollapse
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1591
    "the rootItem is cannot be collapsed"
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1592
    ^ self isRootItem not
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1593
!
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1594
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1595
isCategory
7021197a578f initial checkin
penk
parents:
diff changeset
  1596
7021197a578f initial checkin
penk
parents:
diff changeset
  1597
    ^ self applicationClass isNil
7021197a578f initial checkin
penk
parents:
diff changeset
  1598
! !
7021197a578f initial checkin
penk
parents:
diff changeset
  1599
7021197a578f initial checkin
penk
parents:
diff changeset
  1600
!SettingsDialog class methodsFor:'documentation'!
7021197a578f initial checkin
penk
parents:
diff changeset
  1601
7021197a578f initial checkin
penk
parents:
diff changeset
  1602
version
12765
22dc3b61ae68 class: SettingsDialog
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
  1603
    ^ '$Header: /cvs/stx/stx/libtool/SettingsDialog.st,v 1.102 2013-05-21 20:32:23 cg Exp $'
9021
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1604
!
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1605
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1606
version_CVS
12765
22dc3b61ae68 class: SettingsDialog
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
  1607
    ^ '$Header: /cvs/stx/stx/libtool/SettingsDialog.st,v 1.102 2013-05-21 20:32:23 cg Exp $'
10396
1fef9bc97b89 - per-tool preference for CodeView2
vrany
parents: 9859
diff changeset
  1608
!
1fef9bc97b89 - per-tool preference for CodeView2
vrany
parents: 9859
diff changeset
  1609
1fef9bc97b89 - per-tool preference for CodeView2
vrany
parents: 9859
diff changeset
  1610
version_SVN
12765
22dc3b61ae68 class: SettingsDialog
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
  1611
    ^ '$Id: SettingsDialog.st,v 1.102 2013-05-21 20:32:23 cg Exp $'
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1612
! !
4469
27a610981cb5 *** empty log message ***
penk
parents: 4435
diff changeset
  1613
12765
22dc3b61ae68 class: SettingsDialog
Claus Gittinger <cg@exept.de>
parents: 12029
diff changeset
  1614
4469
27a610981cb5 *** empty log message ***
penk
parents: 4435
diff changeset
  1615
SettingsDialog initialize!