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