SettingsDialog.st
author Claus Gittinger <cg@exept.de>
Thu, 01 Nov 2012 14:52:37 +0100
changeset 11982 027f2e7a175e
parent 11739 fe57ab24ba67
child 11983 4b9d7ce885b7
permissions -rw-r--r--
added: #flyByHelpSpec
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
11982
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   244
!SettingsDialog class methodsFor:'help'!
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
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   260
)
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   261
! !
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   262
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   263
!SettingsDialog class methodsFor:'interface specs'!
7021197a578f initial checkin
penk
parents:
diff changeset
   264
7021197a578f initial checkin
penk
parents:
diff changeset
   265
windowSpec
7021197a578f initial checkin
penk
parents:
diff changeset
   266
    "This resource specification was automatically generated
7021197a578f initial checkin
penk
parents:
diff changeset
   267
     by the UIPainter of ST/X."
7021197a578f initial checkin
penk
parents:
diff changeset
   268
7021197a578f initial checkin
penk
parents:
diff changeset
   269
    "Do not manually edit this!! If it is corrupted,
7021197a578f initial checkin
penk
parents:
diff changeset
   270
     the UIPainter may not be able to read the specification."
7021197a578f initial checkin
penk
parents:
diff changeset
   271
7021197a578f initial checkin
penk
parents:
diff changeset
   272
    "
7021197a578f initial checkin
penk
parents:
diff changeset
   273
     UIPainter new openOnClass:SettingsDialog andSelector:#windowSpec
7021197a578f initial checkin
penk
parents:
diff changeset
   274
     SettingsDialog new openInterface:#windowSpec
7021197a578f initial checkin
penk
parents:
diff changeset
   275
     SettingsDialog open
7021197a578f initial checkin
penk
parents:
diff changeset
   276
    "
7021197a578f initial checkin
penk
parents:
diff changeset
   277
7021197a578f initial checkin
penk
parents:
diff changeset
   278
    <resource: #canvas>
7021197a578f initial checkin
penk
parents:
diff changeset
   279
7021197a578f initial checkin
penk
parents:
diff changeset
   280
    ^ 
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   281
     #(FullSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   282
        name: windowSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   283
        window: 
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   284
       (WindowSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   285
          label: 'Settings Dialog'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   286
          name: 'Settings Dialog'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   287
          min: (Point 10 10)
6024
ab51dc9ad449 *** empty log message ***
ca
parents: 6020
diff changeset
   288
          bounds: (Rectangle 0 0 789 642)
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   289
          menu: mainMenu
5892
Claus Gittinger <cg@exept.de>
parents: 5838
diff changeset
   290
          icon: defaultIcon
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   291
        )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   292
        component: 
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   293
       (SpecCollection
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   294
          collection: (
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   295
           (VariableHorizontalPanelSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   296
              name: 'VariableHorizontalPanel1'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   297
              layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   298
              showHandle: true
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   299
              snapMode: both
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   300
              component: 
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   301
             (SpecCollection
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   302
                collection: (
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   303
                 (ViewSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   304
                    name: 'Box1'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   305
                    component: 
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   306
                   (SpecCollection
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   307
                      collection: (
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   308
                       (HierarchicalListViewSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   309
                          name: 'HierarchicalListView1'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   310
                          layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 -34 1)
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   311
                          model: selectedItem
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   312
                          hasHorizontalScrollBar: true
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   313
                          hasVerticalScrollBar: true
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   314
                          listModel: applicationList
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   315
                          useIndex: false
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   316
                          highlightMode: label
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   317
                          showLeftIndicators: false
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   318
                          indicatorSelector: doIndicatorClick:
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   319
                        )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   320
                       (HorizontalPanelViewSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   321
                          name: 'HorizontalPanel2'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   322
                          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
   323
                          visibilityChannel: loadAndSaveSettingsItemVisible
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   324
                          horizontalLayout: fitSpace
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   325
                          verticalLayout: center
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   326
                          horizontalSpace: 3
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   327
                          verticalSpace: 3
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   328
                          component: 
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   329
                         (SpecCollection
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   330
                            collection: (
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   331
                             (ActionButtonSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   332
                                label: 'Save'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   333
                                name: 'Button3'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   334
                                translateLabel: true
7719
5ecbb0ae6799 tabability
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   335
                                tabable: true
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   336
                                model: saveSettingsWithoutAskingForFile
6024
ab51dc9ad449 *** empty log message ***
ca
parents: 6020
diff changeset
   337
                                extent: (Point 126 22)
4826
14296f826d27 next step
penk
parents: 4740
diff changeset
   338
                              )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   339
                             (ActionButtonSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   340
                                label: 'Load From...'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   341
                                name: 'Button2'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   342
                                translateLabel: true
7719
5ecbb0ae6799 tabability
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   343
                                tabable: true
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   344
                                model: loadSettingsFromFile
6024
ab51dc9ad449 *** empty log message ***
ca
parents: 6020
diff changeset
   345
                                extent: (Point 126 22)
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   346
                              )
7021197a578f initial checkin
penk
parents:
diff changeset
   347
                             )
7021197a578f initial checkin
penk
parents:
diff changeset
   348
                           
7021197a578f initial checkin
penk
parents:
diff changeset
   349
                          )
7021197a578f initial checkin
penk
parents:
diff changeset
   350
                        )
7021197a578f initial checkin
penk
parents:
diff changeset
   351
                       )
7021197a578f initial checkin
penk
parents:
diff changeset
   352
                     
7021197a578f initial checkin
penk
parents:
diff changeset
   353
                    )
7021197a578f initial checkin
penk
parents:
diff changeset
   354
                  )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   355
                 (ViewSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   356
                    name: 'Box2'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   357
                    component: 
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   358
                   (SpecCollection
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   359
                      collection: (
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   360
                       (ViewSpec
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   361
                          name: 'DisabledSettingsBox'
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   362
                          layout: (LayoutFrame 0 0 0 0 0 1 0 1)
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   363
                          initiallyInvisible: true
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   364
                          component: 
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   365
                         (SpecCollection
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   366
                            collection: (
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   367
                             (LabelSpec
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   368
                                label: 'whyDisabledLabel'
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   369
                                name: 'whyDisabledLabel'
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
                                translateLabel: true
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   372
                                labelChannel: whyDisabledInfoHolder
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   373
                              )
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   374
                             )
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   375
                           
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   376
                          )
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
   377
                        )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   378
                       (SubCanvasSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   379
                          name: 'SubCanvas'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   380
                          layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 -34 1)
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   381
                          level: -1
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   382
                          hasHorizontalScrollBar: false
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   383
                          hasVerticalScrollBar: false
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   384
                          clientHolder: subCanvasApplicationHolder
9021
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
   385
                          createNewBuilder: false
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   386
                          postBuildCallback: postBuildSubCanvas:
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   387
                        )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   388
                       (HorizontalPanelViewSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   389
                          name: 'HorizontalPanel1'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   390
                          layout: (LayoutFrame 0 0.0 -34 1 0 1.0 0 1)
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   391
                          horizontalLayout: fitSpace
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   392
                          verticalLayout: center
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   393
                          horizontalSpace: 3
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   394
                          verticalSpace: 3
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   395
                          component: 
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   396
                         (SpecCollection
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   397
                            collection: (
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   398
                             (ActionButtonSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   399
                                label: 'Apply'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   400
                                name: 'Apply'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   401
                                translateLabel: true
7719
5ecbb0ae6799 tabability
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   402
                                tabable: true
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   403
                                model: doSave
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   404
                                enableChannel: enableOK
11982
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   405
                                activeHelpKey: acceptChangedSettings
6024
ab51dc9ad449 *** empty log message ***
ca
parents: 6020
diff changeset
   406
                                extent: (Point 168 22)
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   407
                              )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   408
                             (ActionButtonSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   409
                                label: 'Discard'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   410
                                name: 'Reload'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   411
                                translateLabel: true
7719
5ecbb0ae6799 tabability
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   412
                                tabable: true
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   413
                                model: doReload
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   414
                                enableChannel: enableReload
11982
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   415
                                activeHelpKey: discardChangedSettings
6024
ab51dc9ad449 *** empty log message ***
ca
parents: 6020
diff changeset
   416
                                extent: (Point 169 22)
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   417
                              )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   418
                             (ActionButtonSpec
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   419
                                label: 'Help'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   420
                                name: 'Help'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   421
                                translateLabel: true
7719
5ecbb0ae6799 tabability
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   422
                                tabable: true
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   423
                                model: help
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   424
                                enableChannel: enableHelp
6024
ab51dc9ad449 *** empty log message ***
ca
parents: 6020
diff changeset
   425
                                extent: (Point 169 22)
11982
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
   426
                                activeHelpKey: helpOnSettings
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   427
                              )
7021197a578f initial checkin
penk
parents:
diff changeset
   428
                             )
7021197a578f initial checkin
penk
parents:
diff changeset
   429
                           
7021197a578f initial checkin
penk
parents:
diff changeset
   430
                          )
7021197a578f initial checkin
penk
parents:
diff changeset
   431
                        )
7021197a578f initial checkin
penk
parents:
diff changeset
   432
                       )
7021197a578f initial checkin
penk
parents:
diff changeset
   433
                     
7021197a578f initial checkin
penk
parents:
diff changeset
   434
                    )
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
              )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   439
              handles: (Any 0.3375 1.0)
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
4548
337cca67b97e *** empty log message ***
penk
parents: 4494
diff changeset
   447
!SettingsDialog class methodsFor:'menu actions'!
337cca67b97e *** empty log message ***
penk
parents: 4494
diff changeset
   448
5465
2c1dc7101e03 *** empty log message ***
ca
parents: 5422
diff changeset
   449
askForFileAndSaveSettings
4552
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   450
    |fileName resources|
4548
337cca67b97e *** empty log message ***
penk
parents: 4494
diff changeset
   451
4552
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   452
    resources := self classResources.
4548
337cca67b97e *** empty log message ***
penk
parents: 4494
diff changeset
   453
4552
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   454
    fileName := Dialog 
9608
0f2613d5fc3f changed:
Claus Gittinger <cg@exept.de>
parents: 9558
diff changeset
   455
        requestFileNameForSave:(resources string:'Save Settings in File') 
4552
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   456
        default:'settings.stx'
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   457
        ok:(resources string:'Save') 
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   458
        abort:(resources string:'Cancel') 
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   459
        pattern:'*.stx'
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   460
        fromDirectory:'.'.
4548
337cca67b97e *** empty log message ***
penk
parents: 4494
diff changeset
   461
4552
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   462
    fileName size ~~ 0 ifTrue:[
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   463
        "not canceled"
4826
14296f826d27 next step
penk
parents: 4740
diff changeset
   464
        self saveSettingsTo:fileName.
4552
a8df4916183a saveSettings moved to UserPreferences
Claus Gittinger <cg@exept.de>
parents: 4548
diff changeset
   465
    ]
9608
0f2613d5fc3f changed:
Claus Gittinger <cg@exept.de>
parents: 9558
diff changeset
   466
0f2613d5fc3f changed:
Claus Gittinger <cg@exept.de>
parents: 9558
diff changeset
   467
    "Modified: / 27-10-2010 / 11:24:54 / cg"
4826
14296f826d27 next step
penk
parents: 4740
diff changeset
   468
!
14296f826d27 next step
penk
parents: 4740
diff changeset
   469
8119
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   470
saveSettingsAsDefaultSettings
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   471
    | file |
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   472
11739
fe57ab24ba67 changed:
Stefan Vogel <sv@exept.de>
parents: 10905
diff changeset
   473
    file := Filename currentDirectory construct:UserPreferences defaultSettingsFilename.
8119
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   474
    self saveSettingsTo:file.
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   475
!
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   476
4826
14296f826d27 next step
penk
parents: 4740
diff changeset
   477
saveSettingsTo:file
14296f826d27 next step
penk
parents: 4740
diff changeset
   478
    [
14296f826d27 next step
penk
parents: 4740
diff changeset
   479
        UserPreferences current saveIn:file.
14296f826d27 next step
penk
parents: 4740
diff changeset
   480
    ] on:StreamError do:[:ex|
8119
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   481
        self warn:(self resources 
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   482
                stringWithCRs:'Cannot save settings into: %1\(%2)' 
11739
fe57ab24ba67 changed:
Stefan Vogel <sv@exept.de>
parents: 10905
diff changeset
   483
                with:(file asAbsoluteFilename asString) 
8119
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   484
                with:ex description).
4826
14296f826d27 next step
penk
parents: 4740
diff changeset
   485
    ]
14296f826d27 next step
penk
parents: 4740
diff changeset
   486
!
14296f826d27 next step
penk
parents: 4740
diff changeset
   487
5465
2c1dc7101e03 *** empty log message ***
ca
parents: 5422
diff changeset
   488
saveSettingsWithoutAskingForFile
8119
f3b1dfbeb5ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8034
diff changeset
   489
    self saveSettingsAsDefaultSettings.
4548
337cca67b97e *** empty log message ***
penk
parents: 4494
diff changeset
   490
! !
337cca67b97e *** empty log message ***
penk
parents: 4494
diff changeset
   491
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   492
!SettingsDialog class methodsFor:'menu specs'!
7021197a578f initial checkin
penk
parents:
diff changeset
   493
7021197a578f initial checkin
penk
parents:
diff changeset
   494
mainMenu
7021197a578f initial checkin
penk
parents:
diff changeset
   495
    "This resource specification was automatically generated
7021197a578f initial checkin
penk
parents:
diff changeset
   496
     by the MenuEditor of ST/X."
7021197a578f initial checkin
penk
parents:
diff changeset
   497
7021197a578f initial checkin
penk
parents:
diff changeset
   498
    "Do not manually edit this!! If it is corrupted,
7021197a578f initial checkin
penk
parents:
diff changeset
   499
     the MenuEditor may not be able to read the specification."
7021197a578f initial checkin
penk
parents:
diff changeset
   500
7021197a578f initial checkin
penk
parents:
diff changeset
   501
    "
7021197a578f initial checkin
penk
parents:
diff changeset
   502
     MenuEditor new openOnClass:SettingsDialog andSelector:#mainMenu
7021197a578f initial checkin
penk
parents:
diff changeset
   503
     (Menu new fromLiteralArrayEncoding:(SettingsDialog mainMenu)) startUp
7021197a578f initial checkin
penk
parents:
diff changeset
   504
    "
7021197a578f initial checkin
penk
parents:
diff changeset
   505
7021197a578f initial checkin
penk
parents:
diff changeset
   506
    <resource: #menu>
7021197a578f initial checkin
penk
parents:
diff changeset
   507
7021197a578f initial checkin
penk
parents:
diff changeset
   508
    ^ 
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   509
     #(Menu
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   510
        (
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   511
         (MenuItem
7972
Claus Gittinger <cg@exept.de>
parents: 7895
diff changeset
   512
            label: '&File'
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   513
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   514
            submenu: 
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   515
           (Menu
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   516
              (
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   517
               (MenuItem
7972
Claus Gittinger <cg@exept.de>
parents: 7895
diff changeset
   518
                  label: '&Load From...'
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   519
                  itemValue: loadSettingsFromFile
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   520
                  translateLabel: true
9021
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
   521
                  isVisible: loadAndSaveSettingsItemVisible
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   522
                )
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   523
               (MenuItem
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   524
                  label: '-'
9021
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
   525
                  isVisible: loadAndSaveSettingsItemVisible
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   526
                )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   527
               (MenuItem
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   528
                  label: 'Save'
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   529
                  itemValue: saveSettingsWithoutAskingForFile
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   530
                  translateLabel: true
9021
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
   531
                  isVisible: loadAndSaveSettingsItemVisible
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   532
                )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   533
               (MenuItem
7972
Claus Gittinger <cg@exept.de>
parents: 7895
diff changeset
   534
                  label: '&Save As...'
7473
3c436374677d *** empty log message ***
sr
parents: 7172
diff changeset
   535
                  itemValue: askForFileAndSaveSettings
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   536
                  translateLabel: true
9021
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
   537
                  isVisible: loadAndSaveSettingsItemVisible
4740
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
   538
                )
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   539
               (MenuItem
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   540
                  label: '-'
9021
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
   541
                  isVisible: loadAndSaveSettingsItemVisible
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   542
                )
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   543
               (MenuItem
7972
Claus Gittinger <cg@exept.de>
parents: 7895
diff changeset
   544
                  label: 'E&xit'
5624
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   545
                  itemValue: closeRequest
Claus Gittinger <cg@exept.de>
parents: 5577
diff changeset
   546
                  translateLabel: true
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   547
                )
7021197a578f initial checkin
penk
parents:
diff changeset
   548
               )
7021197a578f initial checkin
penk
parents:
diff changeset
   549
              nil
7021197a578f initial checkin
penk
parents:
diff changeset
   550
              nil
7021197a578f initial checkin
penk
parents:
diff changeset
   551
            )
7021197a578f initial checkin
penk
parents:
diff changeset
   552
          )
7021197a578f initial checkin
penk
parents:
diff changeset
   553
         )
7021197a578f initial checkin
penk
parents:
diff changeset
   554
        nil
7021197a578f initial checkin
penk
parents:
diff changeset
   555
        nil
7021197a578f initial checkin
penk
parents:
diff changeset
   556
      )
7021197a578f initial checkin
penk
parents:
diff changeset
   557
! !
7021197a578f initial checkin
penk
parents:
diff changeset
   558
7021197a578f initial checkin
penk
parents:
diff changeset
   559
!SettingsDialog methodsFor:'accessing'!
7021197a578f initial checkin
penk
parents:
diff changeset
   560
7021197a578f initial checkin
penk
parents:
diff changeset
   561
requestor
7021197a578f initial checkin
penk
parents:
diff changeset
   562
    "return the 'requestor' of the SettingsDialog"
7021197a578f initial checkin
penk
parents:
diff changeset
   563
7021197a578f initial checkin
penk
parents:
diff changeset
   564
    ^ requestor
7021197a578f initial checkin
penk
parents:
diff changeset
   565
!
7021197a578f initial checkin
penk
parents:
diff changeset
   566
7021197a578f initial checkin
penk
parents:
diff changeset
   567
requestor:something
7021197a578f initial checkin
penk
parents:
diff changeset
   568
    requestor := something.
6124
233e703f84a4 access to rootItem & showRoot
Claus Gittinger <cg@exept.de>
parents: 6024
diff changeset
   569
!
233e703f84a4 access to rootItem & showRoot
Claus Gittinger <cg@exept.de>
parents: 6024
diff changeset
   570
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   571
rootItem
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   572
    ^ self applicationList root.
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   573
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   574
    "Created: / 03-11-2007 / 14:23:01 / cg"
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   575
!
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   576
6126
fbe0461cda6b window label handling
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
   577
rootItemLabel
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   578
    ^ self rootItem label.
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   579
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   580
    "Modified: / 03-11-2007 / 14:23:18 / cg"
6126
fbe0461cda6b window label handling
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
   581
!
fbe0461cda6b window label handling
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
   582
6124
233e703f84a4 access to rootItem & showRoot
Claus Gittinger <cg@exept.de>
parents: 6024
diff changeset
   583
rootItemLabel:aString
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   584
    self rootItem label:aString.
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   585
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
   586
    "Modified: / 03-11-2007 / 14:23:16 / cg"
6124
233e703f84a4 access to rootItem & showRoot
Claus Gittinger <cg@exept.de>
parents: 6024
diff changeset
   587
!
233e703f84a4 access to rootItem & showRoot
Claus Gittinger <cg@exept.de>
parents: 6024
diff changeset
   588
233e703f84a4 access to rootItem & showRoot
Claus Gittinger <cg@exept.de>
parents: 6024
diff changeset
   589
showRoot:aBoolean
10824
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   590
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   591
    self applicationList showRoot:aBoolean.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   592
    aBoolean ifFalse:[
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   593
        self applicationList root children do:[:e|e expand].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   594
    ]
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   595
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   596
    "Modified: / 15-10-2011 / 12:06:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   597
! !
7021197a578f initial checkin
penk
parents:
diff changeset
   598
7021197a578f initial checkin
penk
parents:
diff changeset
   599
!SettingsDialog methodsFor:'actions'!
7021197a578f initial checkin
penk
parents:
diff changeset
   600
5026
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   601
changeLabelTo:aLabel application:aApplication
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   602
    | item |
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   603
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   604
    item := self getItemByApplication:aApplication.
5043
4ea8ed8336f4 checkin from browser
penk
parents: 5026
diff changeset
   605
    item notNil ifTrue:[
4ea8ed8336f4 checkin from browser
penk
parents: 5026
diff changeset
   606
        item label:aLabel.
4ea8ed8336f4 checkin from browser
penk
parents: 5026
diff changeset
   607
        item changed.
4ea8ed8336f4 checkin from browser
penk
parents: 5026
diff changeset
   608
    ].
5026
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   609
!
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   610
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   611
destroyAll
6389
9f4010737320 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6325
diff changeset
   612
    self applicationList do:[:applItem |
9f4010737320 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6325
diff changeset
   613
        |application|
9f4010737320 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6325
diff changeset
   614
9f4010737320 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6325
diff changeset
   615
        applItem isCategory ifFalse:[
9f4010737320 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6325
diff changeset
   616
            (application := applItem application) notNil ifTrue:[
9f4010737320 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6325
diff changeset
   617
                application close.
9f4010737320 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6325
diff changeset
   618
            ].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   619
        ].
7021197a578f initial checkin
penk
parents:
diff changeset
   620
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
   621
!
7021197a578f initial checkin
penk
parents:
diff changeset
   622
7021197a578f initial checkin
penk
parents:
diff changeset
   623
doIndicatorClick:index 
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   624
    "handle a click on the indicator"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   625
7021197a578f initial checkin
penk
parents:
diff changeset
   626
    (self applicationList at:index) toggleExpand
7021197a578f initial checkin
penk
parents:
diff changeset
   627
!
7021197a578f initial checkin
penk
parents:
diff changeset
   628
7021197a578f initial checkin
penk
parents:
diff changeset
   629
doReload
4574
bcc59a552bca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4552
diff changeset
   630
    |item|
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   631
7021197a578f initial checkin
penk
parents:
diff changeset
   632
    item := self selectedItem value.
4574
bcc59a552bca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4552
diff changeset
   633
    (item isNil or:[item isCategory or:[item application isNil]]) ifTrue:[
bcc59a552bca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4552
diff changeset
   634
        ^ self
bcc59a552bca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4552
diff changeset
   635
    ].
bcc59a552bca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4552
diff changeset
   636
    item application readSettings
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   637
!
7021197a578f initial checkin
penk
parents:
diff changeset
   638
7021197a578f initial checkin
penk
parents:
diff changeset
   639
doSave
7021197a578f initial checkin
penk
parents:
diff changeset
   640
    | item |
7021197a578f initial checkin
penk
parents:
diff changeset
   641
7021197a578f initial checkin
penk
parents:
diff changeset
   642
    item := self selectedItem value.
7021197a578f initial checkin
penk
parents:
diff changeset
   643
    (item isNil or:[item isCategory or:[item application isNil]]) ifTrue:[ ^ self].
4388
4302767e1720 ressources from AbstractLauncherApplication
penk
parents: 4384
diff changeset
   644
    self withWaitCursorDo:[
4574
bcc59a552bca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4552
diff changeset
   645
        item application saveSettingsIfUnsavedChangesArePresent.
4388
4302767e1720 ressources from AbstractLauncherApplication
penk
parents: 4384
diff changeset
   646
    ].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   647
!
7021197a578f initial checkin
penk
parents:
diff changeset
   648
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   649
expandItemForApplication:aApplication
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   650
    | item |
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   651
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   652
    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
   653
    item notNil ifTrue:[
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   654
        item expand
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   655
    ].
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   656
!
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   657
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   658
help
8034
0e1c05cd4bfa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7972
diff changeset
   659
    |item |
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   660
7021197a578f initial checkin
penk
parents:
diff changeset
   661
    item := self selectedItem value.
7021197a578f initial checkin
penk
parents:
diff changeset
   662
    (item isNil or:[item isCategory or:[item application isNil]]) ifTrue:[ ^ self].
7021197a578f initial checkin
penk
parents:
diff changeset
   663
    item application help.
7021197a578f initial checkin
penk
parents:
diff changeset
   664
!
7021197a578f initial checkin
penk
parents:
diff changeset
   665
4740
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
   666
reopenLauncher
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
   667
    self requestor notNil ifTrue:[
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
   668
        self requestor reopenLauncher.
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
   669
    ] ifFalse:[
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
   670
        NewLauncher current reopenLauncher.
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
   671
    ].
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
   672
!
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
   673
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   674
sendLoadRequestToAll
4574
bcc59a552bca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4552
diff changeset
   675
    self applicationList do:[:applItem | 
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   676
        (applItem isCategory not and:[applItem application notNil]) ifTrue:[
9558
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
   677
            applItem application readSettings.
4574
bcc59a552bca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4552
diff changeset
   678
        ]
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   679
    ].
9558
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
   680
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
   681
    "Modified: / 24-08-2010 / 18:41:36 / sr"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   682
!
7021197a578f initial checkin
penk
parents:
diff changeset
   683
7021197a578f initial checkin
penk
parents:
diff changeset
   684
sendSaveRequestToAll
7021197a578f initial checkin
penk
parents:
diff changeset
   685
    self applicationList do:[ : applItem |
7021197a578f initial checkin
penk
parents:
diff changeset
   686
        (applItem isCategory not and:[applItem application notNil]) ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
   687
            applItem application saveRequest ifFalse:[
7021197a578f initial checkin
penk
parents:
diff changeset
   688
                ^ false
7021197a578f initial checkin
penk
parents:
diff changeset
   689
            ].
7021197a578f initial checkin
penk
parents:
diff changeset
   690
        ].
7021197a578f initial checkin
penk
parents:
diff changeset
   691
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
   692
    ^ true
4659
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   693
!
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   694
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   695
sendSaveRequestToCurrent
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   696
    | item |
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   697
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   698
    item := self selectedItem value.
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   699
    (item isNil or:[item isCategory or:[item application isNil]]) ifTrue:[ ^ true].
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   700
    self withWaitCursorDo:[
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   701
        ^ item application saveRequest.
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   702
    ].
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
   703
    ^ true
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   704
! !
7021197a578f initial checkin
penk
parents:
diff changeset
   705
7021197a578f initial checkin
penk
parents:
diff changeset
   706
!SettingsDialog methodsFor:'application list access'!
7021197a578f initial checkin
penk
parents:
diff changeset
   707
4898
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   708
addApplClass:aClass forApplication:anApplication label:aLabel expand:aBoolean
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   709
    "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
   710
4898
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   711
    | class |
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   712
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   713
    class := Smalltalk classNamed:aClass.
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   714
    class isNil ifTrue:[
9781
9896a1dff42c changed:
Claus Gittinger <cg@exept.de>
parents: 9617
diff changeset
   715
        ('SettingsDialog [warning]: can''t find ', aClass asString, ' to register') infoPrintCR.
4898
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   716
        ^ nil
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   717
    ].
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   718
    class autoload.
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   719
    ^ 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
   720
9896a1dff42c changed:
Claus Gittinger <cg@exept.de>
parents: 9617
diff changeset
   721
    "Modified: / 14-02-2011 / 20:10:11 / cg"
4898
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   722
!
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   723
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   724
addApplClass:aClass withName:aName
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   725
   "add an application to the settingsTree, take the icon from the application classes defaultIcon method"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   726
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   727
    ^ self addApplClass:aClass withName:aName icon:nil.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   728
!
7021197a578f initial checkin
penk
parents:
diff changeset
   729
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   730
addApplClass:aClass withName:aName expand:aBoolean
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   731
   "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
   732
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   733
    ^ self addApplClass:aClass withName:aName icon:nil expand:aBoolean.
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   734
!
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   735
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   736
addApplClass:aClass withName:aName icon:icon
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   737
    ^ self addApplClass:aClass withName:aName icon:icon expand:false
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   738
!
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   739
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   740
addApplClass:aClass withName:aName icon:icon expand:doExpand
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   741
    |applicationLabel locIcon locClass|
7021197a578f initial checkin
penk
parents:
diff changeset
   742
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
   743
"/    (self applicationNames includes:aName) ifTrue:[
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
   744
"/        ^ self getItemForName:aName.
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
   745
"/    ].
4893
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   746
    
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   747
    aClass isNil ifTrue:[ 
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   748
        self addIcon:icon forCategory:aName.
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   749
        ^ self 
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   750
    ].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   751
    self addCategoriesFor:aName.
4893
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   752
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   753
    locIcon := icon.
7021197a578f initial checkin
penk
parents:
diff changeset
   754
    locClass := Smalltalk classNamed:aClass.
4469
27a610981cb5 *** empty log message ***
penk
parents: 4435
diff changeset
   755
    locClass isNil ifTrue:[
9781
9896a1dff42c changed:
Claus Gittinger <cg@exept.de>
parents: 9617
diff changeset
   756
        ('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
   757
        ^ nil
4469
27a610981cb5 *** empty log message ***
penk
parents: 4435
diff changeset
   758
    ].
4838
60dfab83c50b autoload is understood by all classes (dummy if already loaded)
Claus Gittinger <cg@exept.de>
parents: 4826
diff changeset
   759
    locClass autoload.
60dfab83c50b autoload is understood by all classes (dummy if already loaded)
Claus Gittinger <cg@exept.de>
parents: 4826
diff changeset
   760
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   761
    (locIcon isNil and:[locClass respondsTo:#defaultIcon]) ifTrue:[ locIcon := locClass defaultIcon].
7021197a578f initial checkin
penk
parents:
diff changeset
   762
    applicationLabel := (aName asCollectionOfSubstringsSeparatedBy:$/) last.
5577
adcc748a39b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5465
diff changeset
   763
6325
0b18b7564248 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
   764
    ^ self 
0b18b7564248 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
   765
        createItemName:aName 
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
   766
        label:applicationLabel 
6325
0b18b7564248 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
   767
        class:locClass 
0b18b7564248 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
   768
        icon:locIcon 
0b18b7564248 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
   769
        expandParent:doExpand 
0b18b7564248 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
   770
        replaceExisting:false
9781
9896a1dff42c changed:
Claus Gittinger <cg@exept.de>
parents: 9617
diff changeset
   771
9896a1dff42c changed:
Claus Gittinger <cg@exept.de>
parents: 9617
diff changeset
   772
    "Modified: / 14-02-2011 / 20:10:04 / cg"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   773
!
7021197a578f initial checkin
penk
parents:
diff changeset
   774
7021197a578f initial checkin
penk
parents:
diff changeset
   775
addIcon:aIcon forCategory:aCategoryName
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   776
    "add a new category Icon for a category"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   777
4401
cf3b37e747bd *** empty log message ***
penk
parents: 4400
diff changeset
   778
    |existingItem|
cf3b37e747bd *** empty log message ***
penk
parents: 4400
diff changeset
   779
cf3b37e747bd *** empty log message ***
penk
parents: 4400
diff changeset
   780
    self categoryIcons at:aCategoryName put:aIcon.
cf3b37e747bd *** empty log message ***
penk
parents: 4400
diff changeset
   781
    existingItem := self getItemForName:aCategoryName.
cf3b37e747bd *** empty log message ***
penk
parents: 4400
diff changeset
   782
    existingItem notNil ifTrue:[
cf3b37e747bd *** empty log message ***
penk
parents: 4400
diff changeset
   783
        existingItem icon:aIcon
cf3b37e747bd *** empty log message ***
penk
parents: 4400
diff changeset
   784
    ].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   785
!
7021197a578f initial checkin
penk
parents:
diff changeset
   786
7021197a578f initial checkin
penk
parents:
diff changeset
   787
applicationNames
7021197a578f initial checkin
penk
parents:
diff changeset
   788
    ^ self applicationList collect:[:item | item nameString].
7021197a578f initial checkin
penk
parents:
diff changeset
   789
!
7021197a578f initial checkin
penk
parents:
diff changeset
   790
7021197a578f initial checkin
penk
parents:
diff changeset
   791
categoryIcons
7021197a578f initial checkin
penk
parents:
diff changeset
   792
    categoryIcons isNil ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
   793
        categoryIcons := Dictionary new.
7021197a578f initial checkin
penk
parents:
diff changeset
   794
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
   795
    ^ categoryIcons 
7021197a578f initial checkin
penk
parents:
diff changeset
   796
!
7021197a578f initial checkin
penk
parents:
diff changeset
   797
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   798
childrenApplicationItemFor:aApplication fromItem:anItem
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   799
    anItem application = aApplication ifTrue:[
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   800
        ^ anItem
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   801
    ].
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   802
    anItem hasChildren ifTrue:[
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   803
        anItem children do:[:aChildItem |
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   804
            ^ self childrenApplicationItemFor:aApplication fromItem:aChildItem.
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   805
        ].
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   806
    ].
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   807
    ^ nil
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   808
!
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   809
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   810
getAllChildrenAppsForApplication:aApplication 
5026
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   811
    ^ self getAllChildrenAppsForApplication:aApplication matchBlock:nil
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   812
!
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   813
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   814
getAllChildrenAppsForApplication:aApplication childrenClass:aClass 
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   815
    |matchBlock|
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   816
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   817
    matchBlock := [:aSubApplication | aSubApplication class == aClass ].
5026
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   818
    ^ self getAllChildrenAppsForApplication:aApplication matchBlock:matchBlock
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   819
!
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   820
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   821
getAllChildrenAppsForApplication:aApplication matchBlock:aMatchBlock
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   822
    | children |
5026
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   823
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   824
    children := self getAllChildrenByApplication:aApplication.
5026
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   825
    aMatchBlock notNil ifTrue:[
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
   826
        children := children select:[:aChild | aMatchBlock value:(aChild application)]
4716
3df92d455996 *** empty log message ***
penk
parents: 4703
diff changeset
   827
    ].
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   828
    ^ 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
   829
!
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   830
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   831
getAllChildrenByApplication:aApplication
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   832
    | item |
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   833
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   834
    item := self getItemByApplication:aApplication.
4716
3df92d455996 *** empty log message ***
penk
parents: 4703
diff changeset
   835
    item isNil ifTrue:[ ^ #()].
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   836
    ^ item children.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   837
!
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
getApplicationsByClass:aClass
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   840
    | classEntries|
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   841
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   842
    self applicationList isNil ifTrue:[
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   843
        self initialize.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   844
    ].
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   845
    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
   846
    ^ 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
   847
!
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   848
4898
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   849
getItemByApplication:anApplication
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   850
    |item|
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   851
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   852
    self applicationList do:[:anItem |
4898
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
   853
        item := self childrenApplicationItemFor:anApplication fromItem:anItem.
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   854
        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
   855
    ].
5043
4ea8ed8336f4 checkin from browser
penk
parents: 5026
diff changeset
   856
    ^ nil
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   857
!
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   858
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   859
getNameOfApplication:aApplication
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   860
    |item|
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   861
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   862
    self applicationList do:[:anItem |
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   863
        item := self childrenApplicationItemFor:aApplication fromItem:anItem.
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
   864
        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
   865
    ].
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
4893
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   869
installSettingsEntries:aCollection
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   870
    aCollection do:[ :entry| 
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   871
        self installSettingsEntry:entry.
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   872
    ].
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   873
!
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   874
10824
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   875
installSettingsEntries: entries expand: expand
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   876
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   877
    "Installs given settings list. If expand is true,
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   878
     dynamic settings list is expanded"
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   879
    
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   880
    entries do:[ :entry| 
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   881
        self installSettingsEntry:entry expand: expand
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   882
    ].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   883
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   884
    "Created: / 15-10-2011 / 11:45:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   885
!
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   886
4893
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   887
installSettingsEntry:entry
4895
ccc8b0f0b666 *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 4893
diff changeset
   888
    |applName applClassOrNil iconHolderOrNil|
4893
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   889
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   890
    applName := entry at:1.
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   891
    applClassOrNil := entry at:2.
4895
ccc8b0f0b666 *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 4893
diff changeset
   892
    iconHolderOrNil := entry at:3 ifAbsent:nil.
ccc8b0f0b666 *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 4893
diff changeset
   893
    self addApplClass:applClassOrNil withName:applName icon:iconHolderOrNil value
4893
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   894
!
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   895
10824
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   896
installSettingsEntry:entry expand: expand
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   897
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   898
    | applName applClassOrNil iconHolderOrNil cookedList className code classList name nameCode nameBlock nameList|
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   899
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   900
    expand ifFalse:[
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   901
        applName := entry at:1.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   902
        applClassOrNil := entry at:2.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   903
        iconHolderOrNil := entry at:3 ifAbsent:nil.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   904
        self addApplClass:applClassOrNil withName:applName icon:iconHolderOrNil value.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   905
        ^self
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   906
    ].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   907
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   908
    cookedList := OrderedCollection new.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   909
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   910
    className := entry at:2 ifAbsent:nil.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   911
    (className notNil and:[className startsWith:'[']) ifTrue:[
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   912
        code := className copyFrom:2 to:(className size - 1).
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   913
        classList := (Parser evaluate:code) select:[:clsOrNil | clsOrNil notNil].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   914
        name := entry at:1.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   915
        self assert:(name includesString:'[').
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   916
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   917
        nameCode := name copyFrom:(name indexOf:$[)+1 to:(name indexOf:$])-1.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   918
        nameCode := '^ [:each | ' , (nameCode copyReplaceString:'%' withString:'each') ,']'.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   919
        nameBlock := Parser evaluate:nameCode.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   920
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   921
        nameList := classList collect:nameBlock.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   922
        nameList sortWith:classList.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   923
        nameList with:classList do:[:eachName :eachClass |
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   924
            |newEntry|
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   925
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   926
            newEntry := entry copy.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   927
            newEntry at:1 put:(name copyTo:(name indexOf:$[)-1),eachName.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   928
            newEntry at:2 put:eachClass name.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   929
            cookedList add:newEntry.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   930
        ].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   931
    ] ifFalse:[
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   932
        (className isNil "a directory entry"
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   933
        or:[ (Smalltalk at:className) notNil "a valid entry"]) ifTrue:[
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   934
            cookedList add:entry.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   935
        ].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   936
    ].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   937
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   938
    cookedList do:[:eachEntry |
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   939
        |iconCodeOrSelector iconCode iconBlock newEntry|
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   940
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   941
        iconCodeOrSelector := eachEntry at:3 ifAbsent:nil.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   942
        iconCodeOrSelector isNil ifTrue:[
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   943
            newEntry := eachEntry
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   944
        ] ifFalse:[
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   945
            newEntry := eachEntry copy.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   946
            (iconCodeOrSelector startsWith:'[') ifTrue:[
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   947
                iconCode := iconCodeOrSelector copyFrom:(iconCodeOrSelector indexOf:$[)+1 to:(iconCodeOrSelector indexOf:$])-1.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   948
                iconCode := '^ [:each | ' , (iconCode copyReplaceString:'%' withString:'each') ,']'.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   949
                iconBlock := Parser evaluate:iconCode.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   950
                newEntry at:3 put:(iconBlock value:(Smalltalk classNamed:(eachEntry at:2))).
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   951
            ] ifFalse:[
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   952
                newEntry at:3 put:(self perform:iconCodeOrSelector).
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   953
            ].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   954
        ].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   955
        self installSettingsEntry:newEntry expand: false.
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   956
    ].
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   957
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   958
    "
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   959
     self withAllSubclassesDo:[:cls | cls initializeSettingsList ]
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   960
    "
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   961
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   962
    "Modified: / 16-12-2002 / 18:12:50 / penk"
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   963
    "Modified: / 20-04-2011 / 17:03:33 / cg"
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   964
    "Created: / 15-10-2011 / 11:49:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   965
!
b27d09ac800b Added #installEntries:expand:
vrany
parents: 10742
diff changeset
   966
5345
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   967
parentApplicationFor:aApplication
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   968
    |item parent|
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   969
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   970
    item := (self getItemByApplication:aApplication).
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   971
    parent := item parent.
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   972
    parent notNil ifTrue:[
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   973
        ^ parent application.
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   974
    ].
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   975
    ^ nil
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   976
!
66a91b703580 access to parent application
penk
parents: 5253
diff changeset
   977
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   978
remApplClassByName:aName 
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
   979
    "remove an application from the settingsTree"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   980
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
   981
    |item|
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   982
7021197a578f initial checkin
penk
parents:
diff changeset
   983
    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
   984
    self removeItem:item 
4378
7021197a578f initial checkin
penk
parents:
diff changeset
   985
!
7021197a578f initial checkin
penk
parents:
diff changeset
   986
4893
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   987
removeAllApplicationsByClass:aClass
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   988
    |apps|
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   989
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   990
    apps := self getApplicationsByClass:aClass.
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   991
    apps do:[:aApp |
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   992
        self removeByApplication:aApp.
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   993
    ].
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   994
!
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
   995
5050
566eab79b16b checkin from browser
penk
parents: 5043
diff changeset
   996
removeAllSubApplicationsFor:aApp
566eab79b16b checkin from browser
penk
parents: 5043
diff changeset
   997
    |apps|
566eab79b16b checkin from browser
penk
parents: 5043
diff changeset
   998
566eab79b16b checkin from browser
penk
parents: 5043
diff changeset
   999
    apps := self getAllChildrenAppsForApplication:aApp.
566eab79b16b checkin from browser
penk
parents: 5043
diff changeset
  1000
    apps do:[:aApp |
566eab79b16b checkin from browser
penk
parents: 5043
diff changeset
  1001
        self removeByApplication:aApp.
566eab79b16b checkin from browser
penk
parents: 5043
diff changeset
  1002
    ].
566eab79b16b checkin from browser
penk
parents: 5043
diff changeset
  1003
!
566eab79b16b checkin from browser
penk
parents: 5043
diff changeset
  1004
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1005
removeApplicationByClass:aClass
7021197a578f initial checkin
penk
parents:
diff changeset
  1006
    | classEntries|
7021197a578f initial checkin
penk
parents:
diff changeset
  1007
7021197a578f initial checkin
penk
parents:
diff changeset
  1008
    self applicationList isNil ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1009
        self initialize.
7021197a578f initial checkin
penk
parents:
diff changeset
  1010
    ].
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1011
    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
  1012
    classEntries do:[:aItem |
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1013
        self removeItem:aItem.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1014
    ].
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1015
!
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1016
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1017
removeApplicationFromTree:aApplication
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1018
    | classEntries|
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1019
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1020
    self applicationList isNil ifTrue:[
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1021
        self initialize.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1022
    ].
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1023
    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
  1024
    classEntries do:[:aItem |
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1025
        self removeItem:aItem.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1026
    ].
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1027
    self applicationList removeAllFoundIn: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
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1030
removeByApplication:aApplication
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
  1031
    | item |
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1032
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1033
    item := self getItemByApplication:aApplication.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1034
    item notNil ifTrue:[
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1035
        self removeItem:item.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1036
    ]
5058
bfa6a2d39edb *** empty log message ***
penk
parents: 5050
diff changeset
  1037
!
bfa6a2d39edb *** empty log message ***
penk
parents: 5050
diff changeset
  1038
bfa6a2d39edb *** empty log message ***
penk
parents: 5050
diff changeset
  1039
sortSubApplicationsFor:anApplication
5059
a39dd428776c *** empty log message ***
penk
parents: 5058
diff changeset
  1040
    |item|
5058
bfa6a2d39edb *** empty log message ***
penk
parents: 5050
diff changeset
  1041
bfa6a2d39edb *** empty log message ***
penk
parents: 5050
diff changeset
  1042
    item := self getItemByApplication:anApplication.
8268
ad2da5c435b9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8119
diff changeset
  1043
    item sort:[:a :b| a label < b label].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1044
! !
7021197a578f initial checkin
penk
parents:
diff changeset
  1045
6325
0b18b7564248 code cleanup
Claus Gittinger <cg@exept.de>
parents: 6293
diff changeset
  1046
!SettingsDialog methodsFor:'application list access-private'!
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1047
7021197a578f initial checkin
penk
parents:
diff changeset
  1048
addCategoriesFor:aName
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
  1049
    "create all the categories"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1050
5253
193cbf909cef not ifTrue -> ifFalse
Claus Gittinger <cg@exept.de>
parents: 5164
diff changeset
  1051
    (aName includes:$/) ifFalse:[ ^ self].
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1052
    self treeName:aName butLast:1 do:[:currentLabel :currentName| 
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1053
        |length icon|
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1054
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1055
        currentLabel notEmpty ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1056
            icon := self categoryIcons at:currentName ifAbsent:[nil].
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1057
            self createItemName:currentName label:currentLabel icon:icon replaceExisting:true.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1058
        ]
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1059
    ].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1060
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1061
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1062
createItemForApplication:anApplication class:aClass label:aLabel icon:anIcon expandParent:expandParent replaceExisting:doReplaceExisting
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
  1063
    "create an application item in my application list"
4898
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1064
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1065
    | newItem parent locIcon item|
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1066
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1067
    parent := self getItemByApplication:anApplication.
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1068
    parent isNil ifTrue:[
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1069
        ^ nil
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1070
    ].
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1071
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1072
    doReplaceExisting ifTrue:[
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1073
        parent children notNil ifTrue:[
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1074
            (item := parent children detect:[ :anItem | anItem application == anApplication] ifNone:[nil]) notNil ifTrue:[
4898
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1075
                ^ item.
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1076
            ]
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1077
        ]
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1078
    ].
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1079
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1080
    newItem := self class itemClass new.  
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1081
    "/ newItem label:(resources string:aLabel) "allBold".
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1082
    newItem label:aLabel "allBold".
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1083
    newItem nameString:(anApplication itemPathName , aLabel).
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1084
    newItem applicationClass:aClass.
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1085
    locIcon := anIcon.
4898
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1086
    locIcon isNil ifTrue:[ locIcon := self class defaultSettingsAppIcon].
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1087
    newItem icon:locIcon.
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1088
    parent add:newItem.
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1089
    expandParent ifTrue:[
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1090
        parent expand.
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1091
    ].
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1092
    ^ newItem
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1093
!
6205a8c28e30 *** empty log message ***
penk
parents: 4895
diff changeset
  1094
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1095
createItemName:aNameString label:aLabel class:aClass icon:anIcon
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1096
    ^ self createItemName:aNameString label:aLabel class:aClass icon:anIcon expandParent:false
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
  1097
!
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
  1098
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1099
createItemName:aNameString label:aLabel class:aClass icon:anIcon expandParent:expandParent
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1100
    ^ self
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1101
        createItemName:aNameString 
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1102
        label:aLabel 
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1103
        class:aClass 
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1104
        icon:anIcon 
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1105
        expandParent:expandParent
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1106
        replaceExisting:true
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1107
!
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1108
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1109
createItemName:aNameString label:untranslatedLabel class:aClass icon:anIcon expandParent:expandParent replaceExisting:doReplaceExisting
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
  1110
    "create an application item in my application list"
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
  1111
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1112
    |newItem parentsName parent locIcon item|
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1113
5577
adcc748a39b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5465
diff changeset
  1114
    (aNameString includes:$/) ifTrue:[
adcc748a39b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5465
diff changeset
  1115
        parentsName := aNameString copyTo:(aNameString lastIndexOf:$/)-1.
adcc748a39b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5465
diff changeset
  1116
        parent := self getItemForName:parentsName.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1117
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1118
    parent isNil ifTrue:[
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1119
        parent := self rootItem.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1120
    ].
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1121
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1122
    doReplaceExisting ifTrue:[
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1123
        parent children notNil ifTrue:[
5577
adcc748a39b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5465
diff changeset
  1124
            (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
  1125
                ^ item.
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1126
            ]
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1127
        ]
7021197a578f initial checkin
penk
parents:
diff changeset
  1128
    ].
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1129
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1130
    newItem := self class itemClass new.  
4740
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
  1131
    "/ newItem label:(resources string:aLabel) "allBold".
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1132
    newItem label:(resources string:untranslatedLabel) "allBold".
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1133
    newItem nameString:aNameString.
7021197a578f initial checkin
penk
parents:
diff changeset
  1134
    newItem applicationClass:aClass.
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1135
    locIcon := anIcon.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1136
    locIcon isNil ifTrue:[ locIcon := self class defaultSettingsAppIcon].
7021197a578f initial checkin
penk
parents:
diff changeset
  1137
    newItem icon:locIcon.
4384
e16e816f6680 *** empty log message ***
penk
parents: 4378
diff changeset
  1138
    parent add:newItem.
4873
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
  1139
    expandParent ifTrue:[
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
  1140
        parent expand.
3ffb8a8812ec *** empty log message ***
penk
parents: 4844
diff changeset
  1141
    ].
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1142
    ^ newItem
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1143
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1144
    "Modified: / 03-11-2007 / 14:23:32 / cg"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1145
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1146
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1147
createItemName:aNameString label:aLabel icon:anIcon
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
  1148
    "create an application item in my application list"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1149
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1150
    self createItemName:aNameString label:aLabel class:nil icon:anIcon expandParent:false
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1151
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1152
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1153
createItemName:aNameString label:aLabel icon:anIcon replaceExisting:doReplaceExisting
6127
ffab88b8b1e5 beautified
Claus Gittinger <cg@exept.de>
parents: 6126
diff changeset
  1154
    "create an application item in my application list"
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1155
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1156
    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
  1157
!
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1158
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1159
getItemForName:aName
7021197a578f initial checkin
penk
parents:
diff changeset
  1160
    | searchItem|
7021197a578f initial checkin
penk
parents:
diff changeset
  1161
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1162
    searchItem := self rootItem.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1163
    self treeName:aName do:[:currentLabel :currentName|
7021197a578f initial checkin
penk
parents:
diff changeset
  1164
        searchItem children isNil ifTrue:[ ^ nil].
7021197a578f initial checkin
penk
parents:
diff changeset
  1165
        searchItem := searchItem children detect:[: item | item nameString = currentName] ifNone:[nil].
7021197a578f initial checkin
penk
parents:
diff changeset
  1166
        searchItem isNil ifTrue:[ ^ nil].
7021197a578f initial checkin
penk
parents:
diff changeset
  1167
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1168
    ^ searchItem
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1169
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1170
    "Modified: / 03-11-2007 / 14:23:28 / cg"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1171
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1172
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1173
removeItem:anItem 
7895
c658466812c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7880
diff changeset
  1174
    "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
  1175
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1176
    |parent remParent|
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1177
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1178
    anItem application release.
4893
39dec723f6ad *** empty log message ***
penk
parents: 4886
diff changeset
  1179
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1180
    parent := anItem parent.
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1181
    parent isNil ifTrue:[" already removed " ^ self].
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1182
    parent remove:anItem.
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1183
    
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1184
    [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
  1185
        remParent := parent.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1186
        parent := remParent parent.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1187
        parent remove:remParent.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1188
    ].
6505
311c27b13f51 translation of empty (organization-only) items
Claus Gittinger <cg@exept.de>
parents: 6389
diff changeset
  1189
    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
  1190
    self selectedItem value:parent.
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1191
!
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1192
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1193
treeName:aName butLast:last do:aBlock 
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1194
    | tree  length|
7021197a578f initial checkin
penk
parents:
diff changeset
  1195
7021197a578f initial checkin
penk
parents:
diff changeset
  1196
    tree := aName asCollectionOfSubstringsSeparatedBy:$/.
7021197a578f initial checkin
penk
parents:
diff changeset
  1197
    tree from:1 to:(tree size - last) keysAndValuesDo:[:idx :aCategory| | itemName |
7021197a578f initial checkin
penk
parents:
diff changeset
  1198
        length := 0.
7021197a578f initial checkin
penk
parents:
diff changeset
  1199
        tree from:1 to:idx keysAndValuesDo:[:idx2 : el | 
7021197a578f initial checkin
penk
parents:
diff changeset
  1200
            length := length + el size.
7021197a578f initial checkin
penk
parents:
diff changeset
  1201
            idx2 > 1 ifTrue:[length := length + 1].
7021197a578f initial checkin
penk
parents:
diff changeset
  1202
        ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1203
        itemName := aName copyTo:length.
7021197a578f initial checkin
penk
parents:
diff changeset
  1204
        aBlock value:aCategory value:itemName.
7021197a578f initial checkin
penk
parents:
diff changeset
  1205
    ].
4879
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1206
!
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1207
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1208
treeName:aName do:aBlock
0a36635a9193 registration changes
Claus Gittinger <cg@exept.de>
parents: 4873
diff changeset
  1209
    self treeName:aName butLast:0 do:aBlock
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1210
! !
7021197a578f initial checkin
penk
parents:
diff changeset
  1211
7021197a578f initial checkin
penk
parents:
diff changeset
  1212
!SettingsDialog methodsFor:'aspects'!
7021197a578f initial checkin
penk
parents:
diff changeset
  1213
7021197a578f initial checkin
penk
parents:
diff changeset
  1214
applicationList
7021197a578f initial checkin
penk
parents:
diff changeset
  1215
    applicationList isNil ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1216
        applicationList := SettingsDialog::HierarchicalApplicationList new.
7021197a578f initial checkin
penk
parents:
diff changeset
  1217
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1218
    ^ applicationList.
7021197a578f initial checkin
penk
parents:
diff changeset
  1219
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1220
7021197a578f initial checkin
penk
parents:
diff changeset
  1221
enableHelp
7021197a578f initial checkin
penk
parents:
diff changeset
  1222
    enableHelp isNil ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1223
        enableHelp := true asValue.
7021197a578f initial checkin
penk
parents:
diff changeset
  1224
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1225
    ^ enableHelp.
7021197a578f initial checkin
penk
parents:
diff changeset
  1226
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1227
7021197a578f initial checkin
penk
parents:
diff changeset
  1228
enableOK
7021197a578f initial checkin
penk
parents:
diff changeset
  1229
    enableOK isNil ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1230
        enableOK := true asValue.
7021197a578f initial checkin
penk
parents:
diff changeset
  1231
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1232
    ^ enableOK.
7021197a578f initial checkin
penk
parents:
diff changeset
  1233
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1234
7021197a578f initial checkin
penk
parents:
diff changeset
  1235
enableReload
7021197a578f initial checkin
penk
parents:
diff changeset
  1236
    enableReload isNil ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1237
        enableReload := true asValue.
7021197a578f initial checkin
penk
parents:
diff changeset
  1238
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1239
    ^ enableReload.
7021197a578f initial checkin
penk
parents:
diff changeset
  1240
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1241
9021
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1242
loadAndSaveSettingsItemVisible
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1243
    "for now, only show these if I have a requestor 
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1244
     (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
  1245
     settingsDialog. I think this has to be reworked..."
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1246
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1247
    ^ requestor notNil "/ loadAndSaveSettingsItemVisible
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1248
!
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1249
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1250
selectedItem
7021197a578f initial checkin
penk
parents:
diff changeset
  1251
    selectedItem isNil ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1252
        selectedItem := ValueHolder new.
7021197a578f initial checkin
penk
parents:
diff changeset
  1253
        selectedItem addDependent:self.
7021197a578f initial checkin
penk
parents:
diff changeset
  1254
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1255
    ^ selectedItem.
7021197a578f initial checkin
penk
parents:
diff changeset
  1256
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1257
7021197a578f initial checkin
penk
parents:
diff changeset
  1258
subCanvasApplicationHolder
7021197a578f initial checkin
penk
parents:
diff changeset
  1259
    subCanvasApplicationHolder isNil ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1260
        subCanvasApplicationHolder := ValueHolder new.
7021197a578f initial checkin
penk
parents:
diff changeset
  1261
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1262
    ^ subCanvasApplicationHolder.
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1263
!
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1264
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1265
whyDisabledInfoHolder
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1266
    whyDisabledInfoHolder isNil ifTrue:[
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1267
        whyDisabledInfoHolder := '' asValue.
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1268
    ].
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1269
    ^ whyDisabledInfoHolder.
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1270
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1271
    "Created: / 25-01-2007 / 17:13:50 / cg"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1272
! !
7021197a578f initial checkin
penk
parents:
diff changeset
  1273
7021197a578f initial checkin
penk
parents:
diff changeset
  1274
!SettingsDialog methodsFor:'change & update'!
7021197a578f initial checkin
penk
parents:
diff changeset
  1275
7021197a578f initial checkin
penk
parents:
diff changeset
  1276
modifiedChanged
7021197a578f initial checkin
penk
parents:
diff changeset
  1277
    |changedObject|
7021197a578f initial checkin
penk
parents:
diff changeset
  1278
7021197a578f initial checkin
penk
parents:
diff changeset
  1279
    changedObject := self subCanvasApplicationHolder value modifiedChannel.
7021197a578f initial checkin
penk
parents:
diff changeset
  1280
    self enableOK value:(changedObject value).
7021197a578f initial checkin
penk
parents:
diff changeset
  1281
    self enableReload value:(changedObject value).
7021197a578f initial checkin
penk
parents:
diff changeset
  1282
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1283
9617
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1284
selectItemWithClass:aClass
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1285
    |entry|
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1286
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1287
    entry := applicationList root
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1288
                recursiveDetect:[:entry | entry applicationClass = aClass].
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1289
    entry makeVisible.
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1290
    self selectedItem value:entry
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1291
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1292
    "Created: / 29-10-2010 / 11:54:13 / cg"
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1293
!
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1294
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1295
selectionChanged
7613
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1296
    |item oldAppl noApp lbl window app itemLabel|
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1297
4405
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1298
    self selectedItem value == lastSelection  ifTrue:[ ^ self].
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1299
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1300
    oldAppl := self subCanvasApplicationHolder value.
7021197a578f initial checkin
penk
parents:
diff changeset
  1301
    oldAppl notNil ifTrue:[
4405
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1302
        oldAppl saveRequest ifFalse:[
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1303
            lastSelection notNil ifTrue:[
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1304
            self
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1305
                enqueueMessage:#value 
9617
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1306
                for:[ self selectedItem value:lastSelection ]
4405
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1307
                arguments:#().
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1308
            ].
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1309
            ^ self
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1310
        ].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1311
        oldAppl modifiedChannel removeDependent:self.
7021197a578f initial checkin
penk
parents:
diff changeset
  1312
    ].
4435
854d330d659e care for nil selection
Claus Gittinger <cg@exept.de>
parents: 4433
diff changeset
  1313
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1314
    item := self selectedItem value.
4405
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1315
    lastSelection := item.
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1316
    noApp := (item isNil) ifTrue:true ifFalse:[item isCategory].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1317
    self enableOK value:(noApp not).
7021197a578f initial checkin
penk
parents:
diff changeset
  1318
    self enableReload value:(noApp not).
7021197a578f initial checkin
penk
parents:
diff changeset
  1319
    self enableHelp value:(noApp not).
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1320
4435
854d330d659e care for nil selection
Claus Gittinger <cg@exept.de>
parents: 4433
diff changeset
  1321
    window := self window.
854d330d659e care for nil selection
Claus Gittinger <cg@exept.de>
parents: 4433
diff changeset
  1322
    window notNil ifTrue:[
6126
fbe0461cda6b window label handling
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
  1323
        lbl := self rootItemLabel ? 'Settings Dialog'.
4435
854d330d659e care for nil selection
Claus Gittinger <cg@exept.de>
parents: 4433
diff changeset
  1324
        item notNil ifTrue:[
6126
fbe0461cda6b window label handling
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
  1325
            itemLabel := (item label copyReplaceAll:(Character cr) with:(Character space)).
fbe0461cda6b window label handling
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
  1326
            itemLabel ~= lbl ifTrue:[
fbe0461cda6b window label handling
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
  1327
                lbl := lbl , ' [', itemLabel, ']'.
fbe0461cda6b window label handling
Claus Gittinger <cg@exept.de>
parents: 6124
diff changeset
  1328
            ]
4435
854d330d659e care for nil selection
Claus Gittinger <cg@exept.de>
parents: 4433
diff changeset
  1329
        ].
854d330d659e care for nil selection
Claus Gittinger <cg@exept.de>
parents: 4433
diff changeset
  1330
        window label:lbl.
4406
d157f56c5ac9 *** empty log message ***
penk
parents: 4405
diff changeset
  1331
    ].
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1332
7613
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1333
    builder notNil ifTrue:[ |box|
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1334
        "hide the DisabledSettingsBox"
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1335
        box := builder componentAt:#DisabledSettingsBox.
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1336
        box notNil ifTrue:[
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1337
            box beInvisible; lower.
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1338
        ].
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1339
    ].
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1340
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1341
    noApp ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1342
        self subCanvasApplicationHolder value:nil.
7021197a578f initial checkin
penk
parents:
diff changeset
  1343
        ^ self
7021197a578f initial checkin
penk
parents:
diff changeset
  1344
    ].
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1345
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1346
    app := item application.
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1347
    app isNil ifTrue:[
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1348
        app := item applicationClass basicNew.
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1349
        (app isEnabledInSettingsDialog:self) ifFalse:[
7613
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1350
            "raise the DisabledSettingsBox above the settings window"
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1351
            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
  1352
            builder notNil ifTrue:[ |box|
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1353
                box := builder componentAt:#DisabledSettingsBox.
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1354
                box notNil ifTrue:[
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1355
                    box beVisible; raise.
7b59de1f0350 Fix race when changing a selection
Stefan Vogel <sv@exept.de>
parents: 7609
diff changeset
  1356
                ].
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1357
            ].
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1358
            self subCanvasApplicationHolder value:nil.
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1359
            ^ self
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1360
        ].
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1361
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1362
        item application:app.
4703
deb516ae2481 a lot of changes - server is running but there is something left to do
penk
parents: 4659
diff changeset
  1363
        app basicInitialize.
5026
0eae1f1848ba instable state
penk
parents: 4898
diff changeset
  1364
        app settingsDialog:self.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1365
    ].
5164
35a9d096be9b *** empty log message ***
penk
parents: 5146
diff changeset
  1366
    self withWaitCursorDo:[
35a9d096be9b *** empty log message ***
penk
parents: 5146
diff changeset
  1367
        app initialize.
35a9d096be9b *** empty log message ***
penk
parents: 5146
diff changeset
  1368
        app readSettings.
35a9d096be9b *** empty log message ***
penk
parents: 5146
diff changeset
  1369
    ].
4435
854d330d659e care for nil selection
Claus Gittinger <cg@exept.de>
parents: 4433
diff changeset
  1370
    app modifiedChannel addDependent:self.
854d330d659e care for nil selection
Claus Gittinger <cg@exept.de>
parents: 4433
diff changeset
  1371
    self subCanvasApplicationHolder value:app.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1372
    self modifiedChanged.
7609
f9ed6dd88645 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7473
diff changeset
  1373
9617
7c53e41f20cf added: #selectItemWithClass:
Claus Gittinger <cg@exept.de>
parents: 9608
diff changeset
  1374
    "Modified: / 29-10-2010 / 11:51:13 / cg"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1375
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1376
7021197a578f initial checkin
penk
parents:
diff changeset
  1377
update:something with:aParameter from:changedObject
6293
1c16cd8fdb79 stupid comment
Claus Gittinger <cg@exept.de>
parents: 6127
diff changeset
  1378
    |subCanvasApplication|
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1379
7021197a578f initial checkin
penk
parents:
diff changeset
  1380
    changedObject == self selectedItem ifTrue:[
4405
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1381
        super update:something with:aParameter from:changedObject.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1382
        self selectionChanged.
4405
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1383
        ^ self.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1384
    ].
6293
1c16cd8fdb79 stupid comment
Claus Gittinger <cg@exept.de>
parents: 6127
diff changeset
  1385
    subCanvasApplication := self subCanvasApplicationHolder value.
1c16cd8fdb79 stupid comment
Claus Gittinger <cg@exept.de>
parents: 6127
diff changeset
  1386
    (subCanvasApplication notNil 
1c16cd8fdb79 stupid comment
Claus Gittinger <cg@exept.de>
parents: 6127
diff changeset
  1387
    and:[changedObject == subCanvasApplication modifiedChannel]) ifTrue:[
1c16cd8fdb79 stupid comment
Claus Gittinger <cg@exept.de>
parents: 6127
diff changeset
  1388
        self modifiedChanged.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1389
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1390
    super update:something with:aParameter from:changedObject
7021197a578f initial checkin
penk
parents:
diff changeset
  1391
! !
7021197a578f initial checkin
penk
parents:
diff changeset
  1392
7021197a578f initial checkin
penk
parents:
diff changeset
  1393
!SettingsDialog methodsFor:'initialization & release'!
7021197a578f initial checkin
penk
parents:
diff changeset
  1394
7021197a578f initial checkin
penk
parents:
diff changeset
  1395
closeRequest
7021197a578f initial checkin
penk
parents:
diff changeset
  1396
    "This is a hook method generated by the Browser.
7021197a578f initial checkin
penk
parents:
diff changeset
  1397
     It will be invoked when your app/dialog-window is about to be
7021197a578f initial checkin
penk
parents:
diff changeset
  1398
     closed (this method has a chance to suppress the close).
7021197a578f initial checkin
penk
parents:
diff changeset
  1399
     See also #closeDownViews, which is invoked when the close is really done."
7021197a578f initial checkin
penk
parents:
diff changeset
  1400
4400
5b1bf011547f add examples
penk
parents: 4397
diff changeset
  1401
    | req |
6019
001740075800 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5975
diff changeset
  1402
4659
a7f00925e26b some errors fixed
penk
parents: 4639
diff changeset
  1403
    (self sendSaveRequestToCurrent == false) ifTrue:[^ self].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1404
    self destroyAll.
4400
5b1bf011547f add examples
penk
parents: 4397
diff changeset
  1405
5b1bf011547f add examples
penk
parents: 4397
diff changeset
  1406
    req := self requestor.
5b1bf011547f add examples
penk
parents: 4397
diff changeset
  1407
    req notNil ifTrue:[
5b1bf011547f add examples
penk
parents: 4397
diff changeset
  1408
        req settingsClosed.
5b1bf011547f add examples
penk
parents: 4397
diff changeset
  1409
    ].
6635
e20f08617728 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6505
diff changeset
  1410
    super closeRequest
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1411
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1412
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1413
createRootItem
7172
042c3e1278e4 order of setting items
Claus Gittinger <cg@exept.de>
parents: 7100
diff changeset
  1414
    |rootItem lbl|
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1415
7021197a578f initial checkin
penk
parents:
diff changeset
  1416
    resources := AbstractLauncherApplication resources.
7021197a578f initial checkin
penk
parents:
diff changeset
  1417
    rootItem := self class itemClass new.
7172
042c3e1278e4 order of setting items
Claus Gittinger <cg@exept.de>
parents: 7100
diff changeset
  1418
    lbl := resources string:'Settings'.
042c3e1278e4 order of setting items
Claus Gittinger <cg@exept.de>
parents: 7100
diff changeset
  1419
    rootItem label:lbl "allBold".
042c3e1278e4 order of setting items
Claus Gittinger <cg@exept.de>
parents: 7100
diff changeset
  1420
    rootItem nameString:lbl.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1421
    rootItem icon:self class settingsIcon.
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1422
    ^ rootItem
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1423
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1424
    "Created: / 03-11-2007 / 14:22:01 / cg"
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1425
!
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1426
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1427
initialize
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1428
    |rootItem|
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1429
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1430
    rootItem := self createRootItem.
6124
233e703f84a4 access to rootItem & showRoot
Claus Gittinger <cg@exept.de>
parents: 6024
diff changeset
  1431
    self applicationList root:rootItem; showRoot:true "false".
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1432
    self selectedItem value:rootItem.
7021197a578f initial checkin
penk
parents:
diff changeset
  1433
    super initialize.
7880
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
    "Modified: / 03-11-2007 / 14:22:18 / cg"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1436
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1437
7021197a578f initial checkin
penk
parents:
diff changeset
  1438
postBuildSubCanvas:aWidget
7021197a578f initial checkin
penk
parents:
diff changeset
  1439
    aWidget keepClientView:true. 
7021197a578f initial checkin
penk
parents:
diff changeset
  1440
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1441
7021197a578f initial checkin
penk
parents:
diff changeset
  1442
postOpenWith:aBuilder
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1443
    self rootItem expand.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1444
    super postOpenWith:aBuilder.
10742
c6c9b272ac55 changed: #postOpenWith: (pre-select settings if there is only one child of the root)
vrany
parents: 10396
diff changeset
  1445
    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
  1446
        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
  1447
    ]
7880
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1448
c5e6528bd927 provide access to the rootItem
Claus Gittinger <cg@exept.de>
parents: 7873
diff changeset
  1449
    "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
  1450
    "Modified: / 03-10-2011 / 16:27:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1451
! !
7021197a578f initial checkin
penk
parents:
diff changeset
  1452
7021197a578f initial checkin
penk
parents:
diff changeset
  1453
!SettingsDialog methodsFor:'menu actions'!
7021197a578f initial checkin
penk
parents:
diff changeset
  1454
5465
2c1dc7101e03 *** empty log message ***
ca
parents: 5422
diff changeset
  1455
askForFileAndSaveSettings
2c1dc7101e03 *** empty log message ***
ca
parents: 5422
diff changeset
  1456
    self class askForFileAndSaveSettings.
2c1dc7101e03 *** empty log message ***
ca
parents: 5422
diff changeset
  1457
!
2c1dc7101e03 *** empty log message ***
ca
parents: 5422
diff changeset
  1458
4574
bcc59a552bca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4552
diff changeset
  1459
loadSettingsFromFile
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1460
    "restore settings from a settings-file."
7021197a578f initial checkin
penk
parents:
diff changeset
  1461
7021197a578f initial checkin
penk
parents:
diff changeset
  1462
    "a temporary kludge - we need a central systemSettings object for this,
7021197a578f initial checkin
penk
parents:
diff changeset
  1463
     which can be saved/restored with a single store/read."
7021197a578f initial checkin
penk
parents:
diff changeset
  1464
5629
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1465
    |fileName transcript launcher|
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1466
7021197a578f initial checkin
penk
parents:
diff changeset
  1467
    fileName := Dialog 
4740
ecd679058be3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4716
diff changeset
  1468
        requestFileName:(resources string:'Load Settings from File') 
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1469
        default:'settings.stx'
7021197a578f initial checkin
penk
parents:
diff changeset
  1470
        ok:(resources string:'Load') 
7021197a578f initial checkin
penk
parents:
diff changeset
  1471
        abort:(resources string:'Cancel') 
7021197a578f initial checkin
penk
parents:
diff changeset
  1472
        pattern:'*.stx'
7021197a578f initial checkin
penk
parents:
diff changeset
  1473
        fromDirectory:nil.
7021197a578f initial checkin
penk
parents:
diff changeset
  1474
7021197a578f initial checkin
penk
parents:
diff changeset
  1475
    (fileName size == 0) ifTrue:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1476
        "/ canceled
7021197a578f initial checkin
penk
parents:
diff changeset
  1477
        ^ self
7021197a578f initial checkin
penk
parents:
diff changeset
  1478
    ].
7021197a578f initial checkin
penk
parents:
diff changeset
  1479
7021197a578f initial checkin
penk
parents:
diff changeset
  1480
    self withWaitCursorDo:[
7021197a578f initial checkin
penk
parents:
diff changeset
  1481
        Smalltalk fileIn:fileName.
5629
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1482
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1483
        "/ Transcript current topView model reOpen.
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1484
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1485
        transcript := Transcript current.
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1486
        (transcript notNil and:[transcript isExternalStream not]) ifTrue:[
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1487
            launcher := transcript application.
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1488
            launcher notNil ifTrue:[
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1489
                launcher reopenLauncher.
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1490
            ]
2cb05ef96502 care for nonPosStream transcript
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1491
        ].
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1492
        self sendLoadRequestToAll.
7021197a578f initial checkin
penk
parents:
diff changeset
  1493
    ].
7100
e273c6f4602d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6688
diff changeset
  1494
e273c6f4602d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6688
diff changeset
  1495
    "Modified: / 08-09-2006 / 19:23:15 / cg"
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1496
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1497
5465
2c1dc7101e03 *** empty log message ***
ca
parents: 5422
diff changeset
  1498
saveSettingsWithoutAskingForFile
2c1dc7101e03 *** empty log message ***
ca
parents: 5422
diff changeset
  1499
    self class saveSettingsWithoutAskingForFile.
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1500
! !
7021197a578f initial checkin
penk
parents:
diff changeset
  1501
7021197a578f initial checkin
penk
parents:
diff changeset
  1502
!SettingsDialog::HierarchicalApplicationList::ApplicationItem methodsFor:'accessing'!
7021197a578f initial checkin
penk
parents:
diff changeset
  1503
7021197a578f initial checkin
penk
parents:
diff changeset
  1504
application
7021197a578f initial checkin
penk
parents:
diff changeset
  1505
    "return the value of the instance variable 'application' (automatically generated)"
7021197a578f initial checkin
penk
parents:
diff changeset
  1506
7021197a578f initial checkin
penk
parents:
diff changeset
  1507
    ^ application
7021197a578f initial checkin
penk
parents:
diff changeset
  1508
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1509
7021197a578f initial checkin
penk
parents:
diff changeset
  1510
application:something
7021197a578f initial checkin
penk
parents:
diff changeset
  1511
    "set the value of the instance variable 'application' (automatically generated)"
7021197a578f initial checkin
penk
parents:
diff changeset
  1512
7021197a578f initial checkin
penk
parents:
diff changeset
  1513
    application := something.
7021197a578f initial checkin
penk
parents:
diff changeset
  1514
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1515
7021197a578f initial checkin
penk
parents:
diff changeset
  1516
applicationClass
7021197a578f initial checkin
penk
parents:
diff changeset
  1517
    "return the value of the instance variable 'applicationClass' (automatically generated)"
7021197a578f initial checkin
penk
parents:
diff changeset
  1518
7021197a578f initial checkin
penk
parents:
diff changeset
  1519
    ^ applicationClass
7021197a578f initial checkin
penk
parents:
diff changeset
  1520
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1521
7021197a578f initial checkin
penk
parents:
diff changeset
  1522
applicationClass:something
7021197a578f initial checkin
penk
parents:
diff changeset
  1523
    "set the value of the instance variable 'applicationClass' (automatically generated)"
7021197a578f initial checkin
penk
parents:
diff changeset
  1524
7021197a578f initial checkin
penk
parents:
diff changeset
  1525
    applicationClass := something.
7021197a578f initial checkin
penk
parents:
diff changeset
  1526
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1527
9425
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1528
label:something
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1529
    "reset the with in pixels..."
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1530
    width := nil.
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1531
    label := something.
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1532
!
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1533
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1534
nameString
7021197a578f initial checkin
penk
parents:
diff changeset
  1535
    "return the value of the instance variable 'nameString' (automatically generated)"
7021197a578f initial checkin
penk
parents:
diff changeset
  1536
7021197a578f initial checkin
penk
parents:
diff changeset
  1537
    ^ nameString
7021197a578f initial checkin
penk
parents:
diff changeset
  1538
!
7021197a578f initial checkin
penk
parents:
diff changeset
  1539
7021197a578f initial checkin
penk
parents:
diff changeset
  1540
nameString:something
7021197a578f initial checkin
penk
parents:
diff changeset
  1541
    "set the value of the instance variable 'nameString' (automatically generated)"
7021197a578f initial checkin
penk
parents:
diff changeset
  1542
7021197a578f initial checkin
penk
parents:
diff changeset
  1543
    nameString := something.
7021197a578f initial checkin
penk
parents:
diff changeset
  1544
! !
7021197a578f initial checkin
penk
parents:
diff changeset
  1545
5078
9fafc6b058bc new middleButtonMenu for remove service in SettingsDialog
penk
parents: 5059
diff changeset
  1546
!SettingsDialog::HierarchicalApplicationList::ApplicationItem methodsFor:'menu'!
9fafc6b058bc new middleButtonMenu for remove service in SettingsDialog
penk
parents: 5059
diff changeset
  1547
9fafc6b058bc new middleButtonMenu for remove service in SettingsDialog
penk
parents: 5059
diff changeset
  1548
middleButtonMenu
9fafc6b058bc new middleButtonMenu for remove service in SettingsDialog
penk
parents: 5059
diff changeset
  1549
9fafc6b058bc new middleButtonMenu for remove service in SettingsDialog
penk
parents: 5059
diff changeset
  1550
    <resource: #programMenu >
9fafc6b058bc new middleButtonMenu for remove service in SettingsDialog
penk
parents: 5059
diff changeset
  1551
5838
290edc109c4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5629
diff changeset
  1552
    |application|
290edc109c4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5629
diff changeset
  1553
290edc109c4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5629
diff changeset
  1554
    (application := self application) isNil ifTrue:[ ^ nil].
290edc109c4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5629
diff changeset
  1555
    ^ application settingsDialogPopUpMenu
5078
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
4405
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1558
!SettingsDialog::HierarchicalApplicationList::ApplicationItem methodsFor:'printing & storing'!
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1559
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1560
displayString
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1561
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1562
    ^ super printString, ' [', (label isText ifTrue:[label string] ifFalse:[label]) ,']'
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1563
!
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1564
9558
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
  1565
printOn:aStream
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
  1566
    aStream 
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
  1567
        nextPutAll:self class nameWithoutPrefix;
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
  1568
        nextPutAll:' ';
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
  1569
        nextPutAll:self label ? '???'.
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
  1570
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
  1571
    "Created: / 24-08-2010 / 18:36:17 / sr"
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
  1572
!
89e606407c4d changed: #sendLoadRequestToAll
sr
parents: 9425
diff changeset
  1573
4405
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1574
printString
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1575
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1576
    ^ super printString, ' [', (label isText ifTrue:[label string] ifFalse:[label]) ,']'
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1577
! !
8b9a9ee966bf *** empty log message ***
penk
parents: 4401
diff changeset
  1578
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1579
!SettingsDialog::HierarchicalApplicationList::ApplicationItem methodsFor:'queries'!
7021197a578f initial checkin
penk
parents:
diff changeset
  1580
9425
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1581
canCollapse
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1582
    "the rootItem is cannot be collapsed"
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1583
    ^ self isRootItem not
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1584
!
ca49e390fe41 *** empty log message ***
ca
parents: 9275
diff changeset
  1585
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1586
isCategory
7021197a578f initial checkin
penk
parents:
diff changeset
  1587
7021197a578f initial checkin
penk
parents:
diff changeset
  1588
    ^ self applicationClass isNil
7021197a578f initial checkin
penk
parents:
diff changeset
  1589
! !
7021197a578f initial checkin
penk
parents:
diff changeset
  1590
7021197a578f initial checkin
penk
parents:
diff changeset
  1591
!SettingsDialog class methodsFor:'documentation'!
7021197a578f initial checkin
penk
parents:
diff changeset
  1592
7021197a578f initial checkin
penk
parents:
diff changeset
  1593
version
11982
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
  1594
    ^ '$Header: /cvs/stx/stx/libtool/SettingsDialog.st,v 1.99 2012-11-01 13:52:37 cg Exp $'
9021
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1595
!
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1596
7fe0760c4554 added: #loadAndSaveSettingsItemVisible
Claus Gittinger <cg@exept.de>
parents: 8624
diff changeset
  1597
version_CVS
11982
027f2e7a175e added: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 11739
diff changeset
  1598
    ^ '$Header: /cvs/stx/stx/libtool/SettingsDialog.st,v 1.99 2012-11-01 13:52:37 cg Exp $'
10396
1fef9bc97b89 - per-tool preference for CodeView2
vrany
parents: 9859
diff changeset
  1599
!
1fef9bc97b89 - per-tool preference for CodeView2
vrany
parents: 9859
diff changeset
  1600
1fef9bc97b89 - per-tool preference for CodeView2
vrany
parents: 9859
diff changeset
  1601
version_SVN
1fef9bc97b89 - per-tool preference for CodeView2
vrany
parents: 9859
diff changeset
  1602
    ^ '§Id§'
4378
7021197a578f initial checkin
penk
parents:
diff changeset
  1603
! !
4469
27a610981cb5 *** empty log message ***
penk
parents: 4435
diff changeset
  1604
27a610981cb5 *** empty log message ***
penk
parents: 4435
diff changeset
  1605
SettingsDialog initialize!