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