author | penk |
Tue, 12 Nov 2002 12:25:24 +0100 | |
changeset 4244 | 64dcb0a42673 |
parent 4243 | 2dc1cbadd5fc |
child 4245 | fe5535df5fb3 |
permissions | -rw-r--r-- |
2195 | 1 |
" |
2 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
||
2689
602cbcd0feb3
Fix comment on oldSpace compress limit
Stefan Vogel <sv@exept.de>
parents:
2621
diff
changeset
|
14 |
"{ Package: 'stx:libtool' }" |
602cbcd0feb3
Fix comment on oldSpace compress limit
Stefan Vogel <sv@exept.de>
parents:
2621
diff
changeset
|
15 |
|
2001 | 16 |
ToolApplicationModel subclass:#AbstractLauncherApplication |
3219
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
17 |
instanceVariableNames:'transcript' |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
18 |
classVariableNames:'NotifyingEmergencyHandler OpenLaunchers RegisteredMenuHandlers' |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
19 |
poolDictionaries:'' |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
20 |
category:'Interface-Smalltalk' |
2001 | 21 |
! |
22 |
||
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
23 |
AbstractSettingsApplication subclass:#KbdMappingSettingsAppl |
4240 | 24 |
instanceVariableNames:'modifiedChannel selectedRawKey macroTextHolder |
25 |
selectedFunctionKey labelTextHolder functionKeyList rawKeyList |
|
26 |
mappings' |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
27 |
classVariableNames:'' |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
28 |
poolDictionaries:'' |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
29 |
privateIn:AbstractLauncherApplication |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
30 |
! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
31 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
32 |
AbstractSettingsApplication subclass:#LanguageSettingsAppl |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
33 |
instanceVariableNames:'modifiedChannel languageHolder languageList listOfLanguages |
4228 | 34 |
translatedLanguages noticeLabelHolder currentLanguageChannel |
35 |
currentLanguageLabel' |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
36 |
classVariableNames:'' |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
37 |
poolDictionaries:'' |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
38 |
privateIn:AbstractLauncherApplication |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
39 |
! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
40 |
|
2001 | 41 |
Object subclass:#LauncherDialogs |
3219
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
42 |
instanceVariableNames:'' |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
43 |
classVariableNames:'' |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
44 |
poolDictionaries:'' |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
45 |
privateIn:AbstractLauncherApplication |
2001 | 46 |
! |
47 |
||
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
48 |
ApplicationModel subclass:#SettingsDialog |
4240 | 49 |
instanceVariableNames:'canvasHolder appList selectionHolder selection requestor |
50 |
colOfInstances' |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
51 |
classVariableNames:'ApplicationList' |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
52 |
poolDictionaries:'' |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
53 |
privateIn:AbstractLauncherApplication |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
54 |
! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
55 |
|
4240 | 56 |
AbstractSettingsApplication subclass:#StyleSettingsAppl |
57 |
instanceVariableNames:'modifiedChannel showStandardStylesOnly styleList selectedStyle |
|
58 |
styleDirectoryContents infoLabelHolder noticeLabelHolder' |
|
59 |
classVariableNames:'' |
|
60 |
poolDictionaries:'' |
|
61 |
privateIn:AbstractLauncherApplication |
|
62 |
! |
|
63 |
||
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
64 |
AbstractSettingsApplication subclass:#ToolsSettingsAppl |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
65 |
instanceVariableNames:'useNewVersionDiffBrowser transcriptBufferSize useNewInspector |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
66 |
showClockInLauncher useNewChangesBrowser useNewFileBrowser |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
67 |
useNewSystemBrowser currentUserPrefs modifiedChannel' |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
68 |
classVariableNames:'' |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
69 |
poolDictionaries:'' |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
70 |
privateIn:AbstractLauncherApplication |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
71 |
! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
72 |
|
2195 | 73 |
!AbstractLauncherApplication class methodsFor:'documentation'! |
74 |
||
75 |
copyright |
|
76 |
" |
|
77 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
78 |
All Rights Reserved |
|
79 |
||
80 |
This software is furnished under a license and may be used |
|
81 |
only in accordance with the terms of that license and with the |
|
82 |
inclusion of the above copyright notice. This software may not |
|
83 |
be provided or otherwise made available to, or used by, any |
|
84 |
other person. No title to or ownership of the software is |
|
85 |
hereby transferred. |
|
86 |
" |
|
87 |
||
88 |
! |
|
89 |
||
90 |
documentation |
|
91 |
" |
|
92 |
This is an abstract class, providing mechanisms and common functionality |
|
93 |
for launcher-type applications. Subclasses may implement their GUI either |
|
94 |
with or without the UIPainter framework, and still use the common functions |
|
95 |
provided here. |
|
96 |
||
97 |
[author:] |
|
98 |
Claus Gittinger, eXept Software AG |
|
99 |
" |
|
100 |
||
101 |
||
102 |
! ! |
|
2001 | 103 |
|
104 |
!AbstractLauncherApplication class methodsFor:'accessing'! |
|
105 |
||
2761 | 106 |
closeAllLaunchers |
107 |
"close all opened launchers" |
|
108 |
||
109 |
self openLaunchers copy do:[:eachLauncher | |
|
110 |
eachLauncher closeRequest |
|
111 |
]. |
|
112 |
||
113 |
" |
|
114 |
self closeAllLaunchers. |
|
115 |
NewLauncher open |
|
116 |
" |
|
117 |
! |
|
118 |
||
2001 | 119 |
current |
120 |
"return the launcher running on the current screen. |
|
121 |
(for access via addMenu/ removeMenu)" |
|
122 |
||
123 |
|currentScreen| |
|
124 |
||
125 |
OpenLaunchers size > 0 ifTrue:[ |
|
2761 | 126 |
currentScreen := Screen current. |
2762 | 127 |
^ OpenLaunchers detect:[:eachLauncher | eachLauncher graphicsDevice == currentScreen] ifNone:nil |
2001 | 128 |
]. |
129 |
^ nil. |
|
130 |
||
131 |
" |
|
2761 | 132 |
NewLauncher current |
2001 | 133 |
" |
134 |
||
135 |
"Modified: / 9.9.1996 / 22:41:36 / stefan" |
|
136 |
"Modified: / 13.10.1998 / 16:09:50 / cg" |
|
137 |
! |
|
138 |
||
139 |
openLaunchers |
|
140 |
"return all opened launchers" |
|
141 |
||
3079 | 142 |
OpenLaunchers isNil ifTrue:[ |
143 |
OpenLaunchers := IdentitySet new |
|
144 |
]. |
|
145 |
^ OpenLaunchers |
|
2001 | 146 |
! ! |
147 |
||
148 |
!AbstractLauncherApplication class methodsFor:'defaults'! |
|
149 |
||
150 |
notifyingEmergencyHandler |
|
151 |
"return a block (used as an emergency handler |
|
152 |
for exceptions), which does errorNotification before going |
|
153 |
into the debugger." |
|
154 |
||
155 |
"Remember the handlerBlock, to be able to determine if the current |
|
156 |
handler is the notifying one." |
|
157 |
||
158 |
NotifyingEmergencyHandler isNil ifTrue:[ |
|
2316
6a46309a5e43
NotifyingEmergencyHandler moved to NoHandlerError
Stefan Vogel <sv@exept.de>
parents:
2314
diff
changeset
|
159 |
NotifyingEmergencyHandler := NoHandlerError notifyingEmergencyHandler |
2001 | 160 |
]. |
161 |
^ NotifyingEmergencyHandler |
|
162 |
||
163 |
"Created: 7.1.1997 / 22:18:19 / cg" |
|
164 |
"Modified: 15.1.1997 / 21:15:38 / cg" |
|
165 |
! ! |
|
166 |
||
2195 | 167 |
!AbstractLauncherApplication class methodsFor:'queries'! |
168 |
||
169 |
isVisualStartable |
|
2845 | 170 |
"return true, if this application can be started via #open. |
171 |
(to allow start of a change browser via double-click in the browser)" |
|
2195 | 172 |
|
2762 | 173 |
"/ assume all my subclasses can |
174 |
^ self ~~ AbstractLauncherApplication |
|
175 |
||
176 |
" |
|
177 |
AbstractLauncherApplication isVisualStartable |
|
178 |
NewLauncher isVisualStartable |
|
179 |
" |
|
2195 | 180 |
! ! |
181 |
||
2001 | 182 |
!AbstractLauncherApplication methodsFor:'private'! |
183 |
||
2696
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
184 |
findApplicationClass:classOrClassName nameSpace:aNameSpace |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
185 |
"find some application, given the classes name. |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
186 |
Look for it in Smalltalk and the given nameSpace" |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
187 |
|
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
188 |
|cls| |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
189 |
|
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
190 |
classOrClassName isBehavior ifTrue:[ |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
191 |
cls := classOrClassName. |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
192 |
] ifFalse:[ |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
193 |
cls := Smalltalk at:classOrClassName asSymbol. |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
194 |
cls isNil ifTrue:[ |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
195 |
"/ look if its in the nameSpace |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
196 |
aNameSpace notNil ifTrue:[ |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
197 |
cls := aNameSpace at:classOrClassName asSymbol |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
198 |
] |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
199 |
]. |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
200 |
cls isNil ifTrue:[ |
3037 | 201 |
self warn:(resources string:'Sorry, the ''%1''-class is not available.' with:classOrClassName). |
2696
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
202 |
^ nil |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
203 |
]. |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
204 |
]. |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
205 |
^ cls |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
206 |
! |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
207 |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
208 |
findWindow:title |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
209 |
"a helper for find & destroy and find & raise operations; |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
210 |
let user choose a view and return it; return nil on cancel" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
211 |
|
2766 | 212 |
^ self findWindow:title windowGroupFilter:nil |
213 |
||
214 |
! |
|
215 |
||
216 |
findWindow:title windowGroupFilter:windowGroupFilterOrNil |
|
217 |
"a helper for find & destroy and find & raise operations; |
|
218 |
let user choose a view and return it; return nil on cancel" |
|
219 |
||
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
220 |
|knownTopViews nameList box| |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
221 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
222 |
knownTopViews := IdentitySet new. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
223 |
Screen allScreens do:[:aScreen | |
2766 | 224 |
aScreen knownViews do:[:aView | |
225 |
|top showIt wg| |
|
226 |
||
227 |
aView notNil ifTrue:[ |
|
228 |
top := aView topView. |
|
229 |
(top isKindOf:DebugView) ifTrue:[ |
|
230 |
"/ although modal, show it. |
|
231 |
showIt := top realized |
|
232 |
] ifFalse:[ |
|
233 |
wg := top windowGroup. |
|
234 |
showIt := (wg notNil and:[wg isModal not]). |
|
235 |
showIt ifTrue:[ |
|
236 |
windowGroupFilterOrNil notNil ifTrue:[ |
|
237 |
showIt := windowGroupFilterOrNil includes:wg |
|
238 |
] |
|
239 |
] |
|
240 |
]. |
|
241 |
showIt ifTrue:[ |
|
242 |
knownTopViews add:top |
|
243 |
] |
|
244 |
] |
|
245 |
] |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
246 |
]. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
247 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
248 |
knownTopViews := knownTopViews asOrderedCollection. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
249 |
knownTopViews sort:[:v1 :v2 | |l1 l2| |
2766 | 250 |
l1 := v1 label ? 'aView'. |
251 |
l2 := v2 label ? 'aView'. |
|
252 |
l1 < l2 |
|
253 |
]. |
|
2041 | 254 |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
255 |
nameList := knownTopViews collect:[:v | |
2766 | 256 |
|isDead wg p l| |
257 |
||
258 |
l := v label ? 'aView'. |
|
259 |
v device == Display ifFalse:[ |
|
260 |
l := l , ' [' , (v device displayName ? '?') , ']' |
|
261 |
]. |
|
262 |
((wg := v windowGroup) notNil |
|
263 |
and:[(p := wg process) notNil |
|
264 |
and:[p state ~~ #dead]]) ifTrue:[ |
|
265 |
l |
|
266 |
] ifFalse:[ |
|
267 |
l , ' (dead ?)' |
|
268 |
] |
|
269 |
]. |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
270 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
271 |
box := ListSelectionBox new. |
2766 | 272 |
box selectionChangeCallback:[:selectionIndex | |v| |
273 |
v := knownTopViews at:box selectionIndex. |
|
274 |
v raise. box raise |
|
275 |
]. |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
276 |
box noEnterField. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
277 |
box list:nameList. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
278 |
box label:(resources string:'view selection'). |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
279 |
box title:(resources string:title) withCRs. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
280 |
box action:[:selection | |
2766 | 281 |
|v| |
282 |
||
283 |
v := knownTopViews at:box selectionIndex. |
|
284 |
box destroy. |
|
285 |
^ v |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
286 |
]. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
287 |
box extent:400@300. |
3293
d7b925f89a7b
dont use explicit showAtPointer
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
288 |
box open. |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
289 |
^ nil |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
290 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
291 |
|
2111
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
292 |
openApplication: classOrClassName |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
293 |
"open an application, given by the classe name." |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
294 |
|
2111
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
295 |
self openApplication:classOrClassName nameSpace:nil |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
296 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
297 |
|
2111
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
298 |
openApplication:classOrClassName nameSpace:aNameSpace |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
299 |
"open some application, given the classes name. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
300 |
Look for it in Smalltalk and the given nameSpace" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
301 |
|
2111
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
302 |
self openApplication:classOrClassName nameSpace:aNameSpace with:#open |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
303 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
304 |
|
2111
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
305 |
openApplication:classOrClassName nameSpace:aNameSpace with:aSelector |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
306 |
"open some application, given the classes name. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
307 |
Look for it in Smalltalk and the given nameSpace" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
308 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
309 |
|cls| |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
310 |
|
2696
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
311 |
cls := self findApplicationClass:classOrClassName nameSpace:aNameSpace. |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
312 |
cls isNil ifTrue:[ |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
313 |
^ self |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
314 |
]. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
315 |
|
2111
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
316 |
Autoload autoloadFailedSignal handle:[:ex | |
2696
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
317 |
self warn:(resources string:'Sorry, the %1 class seems to be not available.' with:cls name) |
2111
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
318 |
] do:[ |
2696
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
319 |
self withWaitCursorDo:[ |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
320 |
cls perform:aSelector |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
321 |
] |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
322 |
] |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
323 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
324 |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
325 |
openSettings |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
326 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
327 |
| builder| |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
328 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
329 |
builder := SettingsDialog open. |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
330 |
builder application requestor:self. |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
331 |
! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
332 |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
333 |
pickAView |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
334 |
"let user pick a view and return it" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
335 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
336 |
|v| |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
337 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
338 |
(Delay forSeconds:1) wait. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
339 |
v := Screen current viewFromUser. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
340 |
v isNil ifTrue:[ |
3219
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
341 |
self warn:'Sorry, this is not a smalltalk view'. |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
342 |
^ nil |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
343 |
]. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
344 |
^ v |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
345 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
346 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
347 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
348 |
saveScreenImage:anImage defaultName:defaultName |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
349 |
"save an image into a file |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
350 |
- ask user for filename using a fileSelectionBox." |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
351 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
352 |
|fileName| |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
353 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
354 |
fileName := Dialog |
3782 | 355 |
requestFileName:(resources string:'Save hardcopy image in:') |
3003
74e2002951dc
edit button in grab-screen area
Claus Gittinger <cg@exept.de>
parents:
2993
diff
changeset
|
356 |
default:(defaultName , '.tiff') |
3782 | 357 |
ok:(resources string:'Save') |
358 |
abort:(resources string:'Cancel') |
|
3003
74e2002951dc
edit button in grab-screen area
Claus Gittinger <cg@exept.de>
parents:
2993
diff
changeset
|
359 |
pattern:'*.tiff' |
74e2002951dc
edit button in grab-screen area
Claus Gittinger <cg@exept.de>
parents:
2993
diff
changeset
|
360 |
fromDirectory:nil |
74e2002951dc
edit button in grab-screen area
Claus Gittinger <cg@exept.de>
parents:
2993
diff
changeset
|
361 |
whenBoxCreatedEvaluate:[:box | |
74e2002951dc
edit button in grab-screen area
Claus Gittinger <cg@exept.de>
parents:
2993
diff
changeset
|
362 |
|editButton| |
4029
32736ebb1068
no extra button for save screenshots for new fileDialog
penk
parents:
3992
diff
changeset
|
363 |
UserPreferences current useNewFileDialog ifFalse:[ |
32736ebb1068
no extra button for save screenshots for new fileDialog
penk
parents:
3992
diff
changeset
|
364 |
editButton := Button label:(resources string:'Edit'). |
32736ebb1068
no extra button for save screenshots for new fileDialog
penk
parents:
3992
diff
changeset
|
365 |
(DialogBox styleSheet at:'dialogBox.okAtLeft' default:false) ifFalse:[ |
32736ebb1068
no extra button for save screenshots for new fileDialog
penk
parents:
3992
diff
changeset
|
366 |
box addButton:editButton before:nil |
32736ebb1068
no extra button for save screenshots for new fileDialog
penk
parents:
3992
diff
changeset
|
367 |
] ifTrue:[ |
32736ebb1068
no extra button for save screenshots for new fileDialog
penk
parents:
3992
diff
changeset
|
368 |
box addButton:editButton after:nil |
3003
74e2002951dc
edit button in grab-screen area
Claus Gittinger <cg@exept.de>
parents:
2993
diff
changeset
|
369 |
]. |
4029
32736ebb1068
no extra button for save screenshots for new fileDialog
penk
parents:
3992
diff
changeset
|
370 |
editButton |
32736ebb1068
no extra button for save screenshots for new fileDialog
penk
parents:
3992
diff
changeset
|
371 |
action:[ |
32736ebb1068
no extra button for save screenshots for new fileDialog
penk
parents:
3992
diff
changeset
|
372 |
box hide; destroy. |
32736ebb1068
no extra button for save screenshots for new fileDialog
penk
parents:
3992
diff
changeset
|
373 |
ImageEditor openOnImage:anImage. |
32736ebb1068
no extra button for save screenshots for new fileDialog
penk
parents:
3992
diff
changeset
|
374 |
]. |
32736ebb1068
no extra button for save screenshots for new fileDialog
penk
parents:
3992
diff
changeset
|
375 |
] |
3003
74e2002951dc
edit button in grab-screen area
Claus Gittinger <cg@exept.de>
parents:
2993
diff
changeset
|
376 |
]. |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
377 |
fileName notNil ifTrue:[ |
3003
74e2002951dc
edit button in grab-screen area
Claus Gittinger <cg@exept.de>
parents:
2993
diff
changeset
|
378 |
anImage saveOn:fileName |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
379 |
]. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
380 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
381 |
"Modified: / 21.2.1996 / 13:09:28 / cg" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
382 |
"Created: / 29.1.1998 / 23:20:36 / cg" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
383 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
384 |
|
2001 | 385 |
showDocumentation:aRelativeDocFilePath |
386 |
"open an HTML browser on some document" |
|
387 |
||
388 |
" |
|
389 |
although that one is not yet finished, |
|
390 |
its better than nothing ... |
|
391 |
" |
|
392 |
HTMLDocumentView notNil ifTrue:[ |
|
3219
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
393 |
self withWaitCursorDo:[ |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
394 |
" |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
395 |
temporary kludge; |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
396 |
not all machines can autoload binaries; |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
397 |
however, on my SGI (which can) we want it |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
398 |
to load automatically. |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
399 |
" |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
400 |
HTMLDocumentView isLoaded ifFalse:[ |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
401 |
ErrorSignal catch:[HTMLDocumentView autoload] |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
402 |
]. |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
403 |
HTMLDocumentView isLoaded ifTrue:[ |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
404 |
HTMLDocumentView openFullOnDocumentationFile:aRelativeDocFilePath. |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
405 |
^ self |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
406 |
]. |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
407 |
] |
2001 | 408 |
]. |
409 |
||
410 |
self warn:'Sorry, the ST/X HTML reader is not |
|
411 |
included in this release. |
|
412 |
||
413 |
Please use Mosaic, netscape, chimera or any |
|
414 |
other HTML viewer to see the documentation. |
|
415 |
||
416 |
The documentation is found in the ''doc/online'' directory.'. |
|
417 |
||
418 |
"Modified: / 25.2.1998 / 21:24:20 / cg" |
|
419 |
! ! |
|
420 |
||
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
421 |
!AbstractLauncherApplication methodsFor:'private - settings callBacks'! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
422 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
423 |
changeViewStyleTo:newStyle |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
424 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
425 |
newStyle notNil ifTrue:[ |
2458
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
426 |
self withWaitCursorDo:[ |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
427 |
(transcript ? Transcript) showCR:'change style to ' , newStyle , ' ...'. |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
428 |
View defaultStyle:newStyle asSymbol. |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
429 |
]. |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
430 |
self reopenLauncher. |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
431 |
DebugView newDebugger. |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
432 |
] |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
433 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
434 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
435 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
436 |
fontBoxForEncoding:encodingMatch |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
437 |
"open a fontBox, showing fonts which match some encoding |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
438 |
(used when changing to japanese ...)" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
439 |
|
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
440 |
^ LauncherDialogs fontBoxForEncoding:encodingMatch |
2047
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
441 |
|
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
442 |
"/ |box y b |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
443 |
"/ labelDef buttonDef listDef menuDef textDef |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
444 |
"/ models labels allOfThem filter| |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
445 |
"/ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
446 |
"/ encodingMatch notNil ifTrue:[ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
447 |
"/ filter := [:f | f encoding notNil |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
448 |
"/ and:[encodingMatch match:f encoding]]. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
449 |
"/ ]. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
450 |
"/ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
451 |
"/ models := OrderedCollection new. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
452 |
"/ labels := OrderedCollection new. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
453 |
"/ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
454 |
"/ models add:(allOfThem := nil asValue). |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
455 |
"/ models add:(labelDef := Label defaultFont asValue). |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
456 |
"/ models add:(buttonDef := Button defaultFont asValue). |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
457 |
"/ models add:(listDef := SelectionInListView defaultFont asValue). |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
458 |
"/ models add:(menuDef := MenuView defaultFont asValue). |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
459 |
"/ models add:(textDef := TextView defaultFont asValue). |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
460 |
"/ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
461 |
"/ box := Dialog new. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
462 |
"/ box label:(resources string:'Font settings'). |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
463 |
"/ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
464 |
"/ models |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
465 |
"/ with:(resources array:#('all' 'labels' 'buttons' 'lists' 'menus' 'edit text')) |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
466 |
"/ do:[:model :title | |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
467 |
"/ |y2 lbl f i| |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
468 |
"/ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
469 |
"/ f := model value. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
470 |
"/ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
471 |
"/ (box addTextLabel:title) adjust:#left. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
472 |
"/ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
473 |
"/ y := box yPosition. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
474 |
"/ b := box addComponent:(Button label:(resources string:'change ...')) tabable:true. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
475 |
"/ b relativeExtent:nil; extent:(b preferredExtent). |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
476 |
"/ y2 := box yPosition. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
477 |
"/ box yPosition:y. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
478 |
"/ i := box leftIndent. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
479 |
"/ box leftIndent:(b widthIncludingBorder + View viewSpacing). |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
480 |
"/ (lbl := box addTextLabel:'') |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
481 |
"/ adjust:#left; |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
482 |
"/ font:(model value); |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
483 |
"/ labelChannel:(BlockValue |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
484 |
"/ with:[:v | |f| |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
485 |
"/ f := v value. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
486 |
"/ f isNil ifTrue:[ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
487 |
"/ '' |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
488 |
"/ ] ifFalse:[ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
489 |
"/ f userFriendlyName |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
490 |
"/ ] |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
491 |
"/ ] |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
492 |
"/ argument:model). |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
493 |
"/ labels add:lbl. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
494 |
"/ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
495 |
"/ box leftIndent:i. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
496 |
"/ box yPosition:(box yPosition max:y2). |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
497 |
"/ box addVerticalSpace. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
498 |
"/ box addHorizontalLine. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
499 |
"/ box addVerticalSpace. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
500 |
"/ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
501 |
"/ b action:[ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
502 |
"/ |f| |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
503 |
"/ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
504 |
"/ f := FontPanel |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
505 |
"/ fontFromUserInitial:(model value) |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
506 |
"/ title:(resources string:'font for %1' with:title) |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
507 |
"/ filter:filter. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
508 |
"/ f notNil ifTrue:[ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
509 |
"/ model == allOfThem ifTrue:[ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
510 |
"/ models do:[:m | m value:f]. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
511 |
"/ labels do:[:l | l font:f] |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
512 |
"/ ] ifFalse:[ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
513 |
"/ model value:f. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
514 |
"/ lbl font:f. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
515 |
"/ ]. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
516 |
"/ ] |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
517 |
"/ ]. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
518 |
"/ model == allOfThem ifTrue:[ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
519 |
"/ box addVerticalSpace |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
520 |
"/ ] |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
521 |
"/ ]. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
522 |
"/ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
523 |
"/ box addAbortButton; addOkButton. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
524 |
"/ (box addButton:(Button label:(resources string:'defaults')) before:nil) |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
525 |
"/ action:[ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
526 |
"/ "/ fetch defaults |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
527 |
"/ View readStyleSheetAndUpdateAllStyleCaches. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
528 |
"/ labelDef value: Label defaultFont. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
529 |
"/ buttonDef value: Button defaultFont. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
530 |
"/ listDef value: SelectionInListView defaultFont. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
531 |
"/ menuDef value: MenuView defaultFont. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
532 |
"/ textDef value: TextView defaultFont. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
533 |
"/ ]. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
534 |
"/ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
535 |
"/ box open. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
536 |
"/ box accepted ifTrue:[ |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
537 |
"/ Label defaultFont:labelDef value. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
538 |
"/ Button defaultFont:buttonDef value. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
539 |
"/ Toggle defaultFont:buttonDef value. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
540 |
"/ SelectionInListView defaultFont:listDef value. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
541 |
"/ MenuView defaultFont:menuDef value. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
542 |
"/ PullDownMenu defaultFont:menuDef value. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
543 |
"/ TextView defaultFont:textDef value. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
544 |
"/ EditTextView defaultFont:textDef value. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
545 |
"/ CodeView defaultFont:textDef value. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
546 |
"/ ]. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
547 |
"/ box destroy. |
bb2070a26bd2
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
2045
diff
changeset
|
548 |
"/ ^ box accepted |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
549 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
550 |
"Modified: / 15.9.1998 / 22:04:56 / cg" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
551 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
552 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
553 |
reopenLauncher |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
554 |
"reopen a new launcher. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
555 |
for now (since style & language settings currently do |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
556 |
not affect living views ...) |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
557 |
WARNING: bad design: Message known in LauncherDialogs" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
558 |
|
2034
b3537f805381
force reopen at same position (fvwm & mwm)
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
559 |
|oldOrigin contents builder newLauncher| |
b3537f805381
force reopen at same position (fvwm & mwm)
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
560 |
|
b3537f805381
force reopen at same position (fvwm & mwm)
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
561 |
oldOrigin := self window origin. |
2458
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
562 |
transcript notNil ifTrue:[contents := transcript endEntry; list]. |
2034
b3537f805381
force reopen at same position (fvwm & mwm)
Claus Gittinger <cg@exept.de>
parents:
2021
diff
changeset
|
563 |
builder := self class openAt:oldOrigin. |
3787 | 564 |
builder window waitUntilVisible; origin:oldOrigin. |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
565 |
newLauncher := builder application. |
2458
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
566 |
transcript notNil ifTrue:[ |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
567 |
newLauncher transcript list:contents; hideCursor; scrollToBottom; cursorToEnd; showCursor. |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
568 |
]. |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
569 |
^ newLauncher |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
570 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
571 |
"Modified: / 4.8.1998 / 17:08:33 / cg" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
572 |
! ! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
573 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
574 |
!AbstractLauncherApplication methodsFor:'queries'! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
575 |
|
3410 | 576 |
bugReporterAvailable |
577 |
^ BugGUI notNil |
|
578 |
! |
|
579 |
||
3120
564ee1530a8e
startPDALauncher item invisible for the normal user
Claus Gittinger <cg@exept.de>
parents:
3100
diff
changeset
|
580 |
hasPDALauncher |
564ee1530a8e
startPDALauncher item invisible for the normal user
Claus Gittinger <cg@exept.de>
parents:
3100
diff
changeset
|
581 |
^ PDALauncher notNil |
564ee1530a8e
startPDALauncher item invisible for the normal user
Claus Gittinger <cg@exept.de>
parents:
3100
diff
changeset
|
582 |
! |
564ee1530a8e
startPDALauncher item invisible for the normal user
Claus Gittinger <cg@exept.de>
parents:
3100
diff
changeset
|
583 |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
584 |
processName |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
585 |
"for monitors only - my name" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
586 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
587 |
^ 'ST/X Launcher' |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
588 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
589 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
590 |
|
3575
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
591 |
remoteImageBrowserAvailable |
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
592 |
^ SmalltalkShareClient notNil and:[RemoteImage notNil] |
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
593 |
! |
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
594 |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
595 |
transcript |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
596 |
"my transcript" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
597 |
|
3079 | 598 |
transcript isNil ifTrue:[ |
599 |
^ Transcript current |
|
600 |
]. |
|
601 |
^ transcript |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
602 |
! ! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
603 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
604 |
!AbstractLauncherApplication methodsFor:'startup / release'! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
605 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
606 |
addTopViewsToCurrentProject |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
607 |
"ignored here - the launcher is always global (i.e. not project private)." |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
608 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
609 |
^ self |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
610 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
611 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
612 |
|
2314
7ac730bdb664
OpenLaunchers as IdentitySet methodes modified add and remove
tm
parents:
2311
diff
changeset
|
613 |
closeDownViews |
7ac730bdb664
OpenLaunchers as IdentitySet methodes modified add and remove
tm
parents:
2311
diff
changeset
|
614 |
OpenLaunchers remove:self ifAbsent:nil. |
7ac730bdb664
OpenLaunchers as IdentitySet methodes modified add and remove
tm
parents:
2311
diff
changeset
|
615 |
super closeDownViews |
7ac730bdb664
OpenLaunchers as IdentitySet methodes modified add and remove
tm
parents:
2311
diff
changeset
|
616 |
! |
7ac730bdb664
OpenLaunchers as IdentitySet methodes modified add and remove
tm
parents:
2311
diff
changeset
|
617 |
|
7ac730bdb664
OpenLaunchers as IdentitySet methodes modified add and remove
tm
parents:
2311
diff
changeset
|
618 |
postBuildWith:aBuilder |
7ac730bdb664
OpenLaunchers as IdentitySet methodes modified add and remove
tm
parents:
2311
diff
changeset
|
619 |
super postBuildWith:aBuilder. |
7ac730bdb664
OpenLaunchers as IdentitySet methodes modified add and remove
tm
parents:
2311
diff
changeset
|
620 |
|
7ac730bdb664
OpenLaunchers as IdentitySet methodes modified add and remove
tm
parents:
2311
diff
changeset
|
621 |
OpenLaunchers isNil ifTrue:[ |
7ac730bdb664
OpenLaunchers as IdentitySet methodes modified add and remove
tm
parents:
2311
diff
changeset
|
622 |
OpenLaunchers := IdentitySet new. |
7ac730bdb664
OpenLaunchers as IdentitySet methodes modified add and remove
tm
parents:
2311
diff
changeset
|
623 |
]. |
7ac730bdb664
OpenLaunchers as IdentitySet methodes modified add and remove
tm
parents:
2311
diff
changeset
|
624 |
OpenLaunchers add:self |
7ac730bdb664
OpenLaunchers as IdentitySet methodes modified add and remove
tm
parents:
2311
diff
changeset
|
625 |
|
7ac730bdb664
OpenLaunchers as IdentitySet methodes modified add and remove
tm
parents:
2311
diff
changeset
|
626 |
! |
7ac730bdb664
OpenLaunchers as IdentitySet methodes modified add and remove
tm
parents:
2311
diff
changeset
|
627 |
|
2040 | 628 |
requestForWindowClose |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
629 |
"close request from windowing system (window close); |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
630 |
confirm and ask if closing of launcher only or |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
631 |
a smalltalk-exit is wanted" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
632 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
633 |
|answer| |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
634 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
635 |
answer := Dialog |
3738 | 636 |
confirmWithCancel:(resources string:'Close %1 only or Exit Smalltalk (Close all) ?' with:self class name) |
2165 | 637 |
labels:(resources array:#('Cancel' 'Close' 'Exit')) |
638 |
default:3. |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
639 |
answer isNil ifTrue:[ |
2165 | 640 |
"/ cancel |
641 |
^ false |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
642 |
]. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
643 |
|
2165 | 644 |
answer == false ifTrue:[ |
645 |
^ true |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
646 |
]. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
647 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
648 |
self exit |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
649 |
|
2160
028c1d5740e5
exit smalltalk is now the default, when closing the launcher.
Claus Gittinger <cg@exept.de>
parents:
2149
diff
changeset
|
650 |
"Modified: / 20.5.1999 / 17:24:47 / cg" |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
651 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
652 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
653 |
saveAndTerminateRequest |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
654 |
"some windowManagers can send this, to shutDown an application |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
655 |
but let it save its state before, for later restart. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
656 |
Although I have not yet encountered such a windowManager, |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
657 |
we are already prepared for this ;-)" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
658 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
659 |
self snapshot. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
660 |
super saveAndTerminateRequest |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
661 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
662 |
! ! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
663 |
|
2001 | 664 |
!AbstractLauncherApplication methodsFor:'user actions - about'! |
665 |
||
666 |
openLicenseConditions |
|
667 |
"open an HTML browser on the 'LICENCE' document" |
|
668 |
||
669 |
self withWaitCursorDo:[ |
|
3219
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
670 |
|lang doc| |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
671 |
|
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
672 |
Smalltalk releaseIdentification = 'ST/X_free_demo_vsn' ifTrue:[ |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
673 |
doc := 'english/LICENCE_DEMO_STX.html' |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
674 |
] ifFalse:[ |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
675 |
((lang := Smalltalk language) = 'de' |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
676 |
or:[lang = 'german']) ifTrue:[ |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
677 |
doc := 'german/LICENCE_STX.html' |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
678 |
] ifFalse:[ |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
679 |
doc := 'english/LICENCE_STX.html' |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
680 |
]. |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
681 |
]. |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
682 |
doc := resources at:'LICENCEFILE' default:doc. |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
683 |
self showDocumentation:('../' , doc) |
2001 | 684 |
] |
685 |
||
686 |
"Created: / 5.2.1998 / 21:43:19 / cg" |
|
687 |
"Modified: / 23.4.1998 / 11:45:53 / cg" |
|
688 |
! ! |
|
689 |
||
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
690 |
!AbstractLauncherApplication methodsFor:'user actions - classes'! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
691 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
692 |
browseAllBreakAndTracePoints |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
693 |
"open a browser showing all breakPointed/traced methods |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
694 |
(but, to get rid of them, there is also a menu itme to remove them all)" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
695 |
|
3140 | 696 |
UserPreferences systemBrowserClass |
2696
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
697 |
browseMethods:(WrappedMethod allInstances) |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
698 |
title:'all breakPointed/traced methods' |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
699 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
700 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
701 |
browseImplementors |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
702 |
"open an implementors- browser after asking for a selector" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
703 |
|
3369
ac3ce702451c
senders/implementors: Tab completion
Claus Gittinger <cg@exept.de>
parents:
3362
diff
changeset
|
704 |
|selector| |
ac3ce702451c
senders/implementors: Tab completion
Claus Gittinger <cg@exept.de>
parents:
3362
diff
changeset
|
705 |
|
ac3ce702451c
senders/implementors: Tab completion
Claus Gittinger <cg@exept.de>
parents:
3362
diff
changeset
|
706 |
selector := Dialog |
ac3ce702451c
senders/implementors: Tab completion
Claus Gittinger <cg@exept.de>
parents:
3362
diff
changeset
|
707 |
requestSelector:(resources at:'Browse implementors of (Tab for completion):') |
3442 | 708 |
okLabel:(resources at:'Browse') |
3369
ac3ce702451c
senders/implementors: Tab completion
Claus Gittinger <cg@exept.de>
parents:
3362
diff
changeset
|
709 |
initialAnswer:''. |
ac3ce702451c
senders/implementors: Tab completion
Claus Gittinger <cg@exept.de>
parents:
3362
diff
changeset
|
710 |
|
ac3ce702451c
senders/implementors: Tab completion
Claus Gittinger <cg@exept.de>
parents:
3362
diff
changeset
|
711 |
selector size > 0 ifTrue:[ |
2696
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
712 |
self withWaitCursorDo:[ |
4155 | 713 |
UserPreferences systemBrowserClass browseImplementorsMatching:selector |
2696
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
714 |
] |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
715 |
]. |
3442 | 716 |
|
717 |
"Modified: / 17.11.2001 / 16:33:28 / cg" |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
718 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
719 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
720 |
browseResources |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
721 |
"open a resource- browser after asking for a resource string" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
722 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
723 |
|box resourceHolder valueHolder component rsrc value t anyString| |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
724 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
725 |
anyString := resources string:'* any *'. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
726 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
727 |
resourceHolder := ValueHolder newString. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
728 |
valueHolder := '*' asValue. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
729 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
730 |
box := DialogBox new. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
731 |
box label:(resources at:'Resource search:'). |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
732 |
component := box addTextLabel:(resources at:'Search for methods which contain a\particular resource specification') withCRs. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
733 |
component adjust:#left. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
734 |
box addVerticalSpace:10. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
735 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
736 |
component := box addTextLabel:(resources at:'Resource symbol (empty for any; no matchPattern allowed):') withCRs. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
737 |
component adjust:#left. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
738 |
component := box addComboBoxOn:resourceHolder tabable:true. |
3014 | 739 |
component list:((Array with:anyString) , #('canvas' 'menu' 'keyboard' 'style' 'image' 'programMenu' '-' 'obsolete' 'needsFix')). |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
740 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
741 |
component := box addTextLabel:(resources at:'Resource value (* for any; matchPattern is allowed):') withCRs. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
742 |
component adjust:#left. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
743 |
box addInputFieldOn:valueHolder tabable:true. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
744 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
745 |
box addVerticalSpace:10. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
746 |
box addHelpButtonFor:'programming/language.html#RESOURCEDEFS'. |
2048 | 747 |
box addAbortAndOkButtons. |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
748 |
|
3293
d7b925f89a7b
dont use explicit showAtPointer
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
749 |
box open. |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
750 |
box destroy. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
751 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
752 |
box accepted ifTrue:[ |
2696
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
753 |
rsrc := resourceHolder value. |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
754 |
value := valueHolder value. |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
755 |
|
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
756 |
(rsrc size == 0 or:[rsrc = '*' or:[rsrc = anyString]]) ifTrue:[ |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
757 |
t := 'methods with any resource'. |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
758 |
rsrc := nil |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
759 |
] ifFalse:[ |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
760 |
t := 'methods with #' , rsrc , '-resource'. |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
761 |
rsrc := rsrc withoutSeparators asSymbol |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
762 |
]. |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
763 |
(value size == 0 or:[value = '*']) ifTrue:[ |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
764 |
t := t , ' and any value'. |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
765 |
value := nil |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
766 |
] ifFalse:[ |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
767 |
t := t , ' and value ' , value. |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
768 |
]. |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
769 |
self withWaitCursorDo:[ |
3140 | 770 |
UserPreferences systemBrowserClass |
2696
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
771 |
browseForResource:rsrc |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
772 |
containing:value |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
773 |
in:(Smalltalk allClasses) |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
774 |
title:t |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
775 |
] |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
776 |
]. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
777 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
778 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
779 |
browseSenders |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
780 |
"open a senders- browser after asking for a selector" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
781 |
|
3369
ac3ce702451c
senders/implementors: Tab completion
Claus Gittinger <cg@exept.de>
parents:
3362
diff
changeset
|
782 |
|selector| |
ac3ce702451c
senders/implementors: Tab completion
Claus Gittinger <cg@exept.de>
parents:
3362
diff
changeset
|
783 |
|
ac3ce702451c
senders/implementors: Tab completion
Claus Gittinger <cg@exept.de>
parents:
3362
diff
changeset
|
784 |
selector := Dialog |
ac3ce702451c
senders/implementors: Tab completion
Claus Gittinger <cg@exept.de>
parents:
3362
diff
changeset
|
785 |
requestSelector:(resources at:'Browse senders of (Tab for completion):') |
3442 | 786 |
okLabel:(resources at:'Browse') |
3369
ac3ce702451c
senders/implementors: Tab completion
Claus Gittinger <cg@exept.de>
parents:
3362
diff
changeset
|
787 |
initialAnswer:''. |
ac3ce702451c
senders/implementors: Tab completion
Claus Gittinger <cg@exept.de>
parents:
3362
diff
changeset
|
788 |
selector size > 0 ifTrue:[ |
2696
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
789 |
self withWaitCursorDo:[ |
3140 | 790 |
UserPreferences systemBrowserClass |
2696
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
791 |
browseAllCallsOn:selector |
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
792 |
] |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
793 |
]. |
3442 | 794 |
|
795 |
"Modified: / 17.11.2001 / 16:33:42 / cg" |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
796 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
797 |
|
4199
f9bc3cbc38f7
added browse refs to unbound globals.
Claus Gittinger <cg@exept.de>
parents:
4155
diff
changeset
|
798 |
browseUnboundGlobals |
f9bc3cbc38f7
added browse refs to unbound globals.
Claus Gittinger <cg@exept.de>
parents:
4155
diff
changeset
|
799 |
"open a browser on methods refering to unbound global variables" |
f9bc3cbc38f7
added browse refs to unbound globals.
Claus Gittinger <cg@exept.de>
parents:
4155
diff
changeset
|
800 |
|
f9bc3cbc38f7
added browse refs to unbound globals.
Claus Gittinger <cg@exept.de>
parents:
4155
diff
changeset
|
801 |
self withWaitCursorDo:[ |
f9bc3cbc38f7
added browse refs to unbound globals.
Claus Gittinger <cg@exept.de>
parents:
4155
diff
changeset
|
802 |
UserPreferences systemBrowserClass |
f9bc3cbc38f7
added browse refs to unbound globals.
Claus Gittinger <cg@exept.de>
parents:
4155
diff
changeset
|
803 |
browseReferendsOfUnboundGlobalsWithTitle:(resources string:'References to unbound global variables') |
f9bc3cbc38f7
added browse refs to unbound globals.
Claus Gittinger <cg@exept.de>
parents:
4155
diff
changeset
|
804 |
warnIfNone:true |
f9bc3cbc38f7
added browse refs to unbound globals.
Claus Gittinger <cg@exept.de>
parents:
4155
diff
changeset
|
805 |
] |
f9bc3cbc38f7
added browse refs to unbound globals.
Claus Gittinger <cg@exept.de>
parents:
4155
diff
changeset
|
806 |
! |
f9bc3cbc38f7
added browse refs to unbound globals.
Claus Gittinger <cg@exept.de>
parents:
4155
diff
changeset
|
807 |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
808 |
browseUndeclared |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
809 |
"open a browser on methods refering to undeclared variables" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
810 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
811 |
self withWaitCursorDo:[ |
3140 | 812 |
UserPreferences systemBrowserClass |
3778 | 813 |
browseReferendsOf:(Smalltalk undeclaredPrefix , '*') |
4199
f9bc3cbc38f7
added browse refs to unbound globals.
Claus Gittinger <cg@exept.de>
parents:
4155
diff
changeset
|
814 |
title:(resources string:'References to undeclared variables') |
2696
bc8ab69f2a56
allow browserClass to be set in preferences
Claus Gittinger <cg@exept.de>
parents:
2689
diff
changeset
|
815 |
warnIfNone:true |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
816 |
] |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
817 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
818 |
|
3778 | 819 |
clearUndeclaredVariables |
820 |
"remove all undeclared variables" |
|
821 |
||
822 |
Smalltalk clearUndeclaredVariables |
|
823 |
! |
|
824 |
||
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
825 |
removeAllBreakAndTracePoints |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
826 |
"remove all break- and trace points" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
827 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
828 |
self withCursor:Cursor execute do:[ MessageTracer cleanup] |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
829 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
830 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
831 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
832 |
startClassBrowser |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
833 |
"open a classBrowser; asks for class" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
834 |
|
3140 | 835 |
UserPreferences systemBrowserClass askThenBrowseClass |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
836 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
837 |
|
3100
8867c882329c
added 'browse changed methods' function.
Claus Gittinger <cg@exept.de>
parents:
3079
diff
changeset
|
838 |
startClassBrowserOnChangedClasses |
2854
ac97ea47bb08
browse changed classes added
Claus Gittinger <cg@exept.de>
parents:
2845
diff
changeset
|
839 |
"open a classBrowser on the changeSet" |
ac97ea47bb08
browse changed classes added
Claus Gittinger <cg@exept.de>
parents:
2845
diff
changeset
|
840 |
|
ac97ea47bb08
browse changed classes added
Claus Gittinger <cg@exept.de>
parents:
2845
diff
changeset
|
841 |
NewSystemBrowser isNil ifTrue:[ |
ac97ea47bb08
browse changed classes added
Claus Gittinger <cg@exept.de>
parents:
2845
diff
changeset
|
842 |
^ self warn:'This needs the NewSystemBrowser to be loaded.' |
ac97ea47bb08
browse changed classes added
Claus Gittinger <cg@exept.de>
parents:
2845
diff
changeset
|
843 |
]. |
ac97ea47bb08
browse changed classes added
Claus Gittinger <cg@exept.de>
parents:
2845
diff
changeset
|
844 |
NewSystemBrowser openOnClassesInChangeSet |
ac97ea47bb08
browse changed classes added
Claus Gittinger <cg@exept.de>
parents:
2845
diff
changeset
|
845 |
! |
ac97ea47bb08
browse changed classes added
Claus Gittinger <cg@exept.de>
parents:
2845
diff
changeset
|
846 |
|
3100
8867c882329c
added 'browse changed methods' function.
Claus Gittinger <cg@exept.de>
parents:
3079
diff
changeset
|
847 |
startClassBrowserOnChangedMethods |
8867c882329c
added 'browse changed methods' function.
Claus Gittinger <cg@exept.de>
parents:
3079
diff
changeset
|
848 |
"open a classBrowser on the changeSet" |
8867c882329c
added 'browse changed methods' function.
Claus Gittinger <cg@exept.de>
parents:
3079
diff
changeset
|
849 |
|
8867c882329c
added 'browse changed methods' function.
Claus Gittinger <cg@exept.de>
parents:
3079
diff
changeset
|
850 |
NewSystemBrowser isNil ifTrue:[ |
8867c882329c
added 'browse changed methods' function.
Claus Gittinger <cg@exept.de>
parents:
3079
diff
changeset
|
851 |
^ self warn:'This needs the NewSystemBrowser to be loaded.' |
8867c882329c
added 'browse changed methods' function.
Claus Gittinger <cg@exept.de>
parents:
3079
diff
changeset
|
852 |
]. |
8867c882329c
added 'browse changed methods' function.
Claus Gittinger <cg@exept.de>
parents:
3079
diff
changeset
|
853 |
NewSystemBrowser openOnMethodsInChangeSet |
8867c882329c
added 'browse changed methods' function.
Claus Gittinger <cg@exept.de>
parents:
3079
diff
changeset
|
854 |
! |
8867c882329c
added 'browse changed methods' function.
Claus Gittinger <cg@exept.de>
parents:
3079
diff
changeset
|
855 |
|
8867c882329c
added 'browse changed methods' function.
Claus Gittinger <cg@exept.de>
parents:
3079
diff
changeset
|
856 |
startClassBrowserOnChanges |
8867c882329c
added 'browse changed methods' function.
Claus Gittinger <cg@exept.de>
parents:
3079
diff
changeset
|
857 |
"open a classBrowser on the changeSet" |
8867c882329c
added 'browse changed methods' function.
Claus Gittinger <cg@exept.de>
parents:
3079
diff
changeset
|
858 |
|
8867c882329c
added 'browse changed methods' function.
Claus Gittinger <cg@exept.de>
parents:
3079
diff
changeset
|
859 |
^ self startClassBrowserOnChangedClasses |
8867c882329c
added 'browse changed methods' function.
Claus Gittinger <cg@exept.de>
parents:
3079
diff
changeset
|
860 |
! |
8867c882329c
added 'browse changed methods' function.
Claus Gittinger <cg@exept.de>
parents:
3079
diff
changeset
|
861 |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
862 |
startClassHierarchyBrowser |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
863 |
"open a classHierarchyBrowser; asks for class" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
864 |
|
3140 | 865 |
UserPreferences systemBrowserClass askThenBrowseClassHierarchy |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
866 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
867 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
868 |
startFullClassBrowser |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
869 |
"open a fullClass systemBrowser; asks for class" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
870 |
|
3140 | 871 |
UserPreferences systemBrowserClass askThenBrowseFullClassProtocol |
3575
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
872 |
! |
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
873 |
|
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
874 |
startRemoteImageBrowser |
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
875 |
"open a remoteImage browser; asks for hostname. |
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
876 |
The remote host must have an st/x running with remote browsing enabled. |
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
877 |
Sorry, for now, only the old browser can be used this way." |
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
878 |
|
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
879 |
|hostName| |
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
880 |
|
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
881 |
hostName := Dialog request:'Remote Host:'. |
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
882 |
SystemBrowser openOnRemoteImageOnHost:hostName port:nil. |
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
883 |
! |
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
884 |
|
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
885 |
startSnapshotImageBrowser |
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
886 |
"open a snapshotImage browser; asks for filename. |
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
887 |
Sorry, for now, only the old browser can be used this way." |
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
888 |
|
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
889 |
|imageFileName| |
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
890 |
|
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
891 |
imageFileName := Dialog requestFileName:'Name of Snapshot Image File:' default:'st.img' pattern:'*.img;*.sav'. |
c35b9ba0092c
snapshotImage and remoteImage browser
Claus Gittinger <cg@exept.de>
parents:
3572
diff
changeset
|
892 |
SystemBrowser openOnSnapShotImage:imageFileName |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
893 |
! ! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
894 |
|
2038 | 895 |
!AbstractLauncherApplication methodsFor:'user actions - demos'! |
896 |
||
3035 | 897 |
startPDALauncher |
898 |
self startRemoteLauncherWithSetup:[:newDisplay | newDisplay bePDA]. |
|
899 |
! |
|
900 |
||
2038 | 901 |
startRemoteLauncher |
3035 | 902 |
self startRemoteLauncherWithSetup:[:newDisplay | ]. |
903 |
! |
|
904 |
||
905 |
startRemoteLauncherWithSetup:aSetupBlock |
|
2754 | 906 |
|host remoteDisplay remoteDisplayClass| |
2038 | 907 |
|
2620 | 908 |
host := Dialog |
909 |
request:(resources string:'Remote Launcher on which display:') |
|
3215 | 910 |
initialAnswer:'{hostName}:0' |
911 |
initialSelection:(1 to:10). |
|
2038 | 912 |
host size > 0 ifTrue:[ |
2359 | 913 |
(host includes:$:) ifFalse:[ |
914 |
host := (host , ':0') |
|
915 |
]. |
|
2754 | 916 |
|
917 |
remoteDisplayClass := XWorkstation. |
|
918 |
||
2755
48769b1546d8
use new utility method to start a remote application
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
919 |
"/ "/ Q: should we allow GL graphics on the remote display |
48769b1546d8
use new utility method to start a remote application
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
920 |
"/ "/ (Problem: the GL library is not threadsafe, when multiple-display connections |
48769b1546d8
use new utility method to start a remote application
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
921 |
"/ "/ are open - leading to mixing output between views ...) |
48769b1546d8
use new utility method to start a remote application
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
922 |
"/ |
48769b1546d8
use new utility method to start a remote application
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
923 |
"/ "/ only simulated GL can be done remote (i.e. not on SGI) |
48769b1546d8
use new utility method to start a remote application
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
924 |
"/ (Screen current supportsGLDrawing |
48769b1546d8
use new utility method to start a remote application
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
925 |
"/ and:[Screen current isTrueGL not]) |
48769b1546d8
use new utility method to start a remote application
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
926 |
"/ ifTrue:[ |
48769b1546d8
use new utility method to start a remote application
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
927 |
"/ remoteDisplayClass := GLXWorkstation. |
48769b1546d8
use new utility method to start a remote application
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
928 |
"/ ]. |
48769b1546d8
use new utility method to start a remote application
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
929 |
|
3664
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
930 |
[ |
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
931 |
remoteDisplay := remoteDisplayClass newDispatchingFor:host. |
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
932 |
] on:Screen deviceOpenErrorSignal do:[:ex| |
2359 | 933 |
self warn:'Could not connect to display: ''' , host , '''.'. |
934 |
^ self |
|
935 |
]. |
|
3035 | 936 |
aSetupBlock value:remoteDisplay. |
2755
48769b1546d8
use new utility method to start a remote application
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
937 |
Screen currentScreenQuerySignal |
48769b1546d8
use new utility method to start a remote application
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
938 |
answer:remoteDisplay |
48769b1546d8
use new utility method to start a remote application
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
939 |
do:[ |
48769b1546d8
use new utility method to start a remote application
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
940 |
self class open. |
48769b1546d8
use new utility method to start a remote application
Claus Gittinger <cg@exept.de>
parents:
2754
diff
changeset
|
941 |
] |
2038 | 942 |
]. |
943 |
||
944 |
"Created: / 10.9.1998 / 11:48:42 / cg" |
|
945 |
! ! |
|
946 |
||
2001 | 947 |
!AbstractLauncherApplication methodsFor:'user actions - file'! |
948 |
||
949 |
objectModuleDialog |
|
950 |
"opens a moduleInfo dialog" |
|
951 |
||
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
952 |
^ LauncherDialogs objectModuleDialog |
2001 | 953 |
|
954 |
"Modified: / 31.7.1998 / 17:33:24 / cg" |
|
955 |
! |
|
956 |
||
2490
924e607d11d8
first version of a package dialog
Claus Gittinger <cg@exept.de>
parents:
2462
diff
changeset
|
957 |
packageDialog |
924e607d11d8
first version of a package dialog
Claus Gittinger <cg@exept.de>
parents:
2462
diff
changeset
|
958 |
"opens a package dialog" |
924e607d11d8
first version of a package dialog
Claus Gittinger <cg@exept.de>
parents:
2462
diff
changeset
|
959 |
|
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
960 |
^ LauncherDialogs packageDialog |
2490
924e607d11d8
first version of a package dialog
Claus Gittinger <cg@exept.de>
parents:
2462
diff
changeset
|
961 |
|
924e607d11d8
first version of a package dialog
Claus Gittinger <cg@exept.de>
parents:
2462
diff
changeset
|
962 |
"Modified: / 31.7.1998 / 17:33:24 / cg" |
924e607d11d8
first version of a package dialog
Claus Gittinger <cg@exept.de>
parents:
2462
diff
changeset
|
963 |
! |
924e607d11d8
first version of a package dialog
Claus Gittinger <cg@exept.de>
parents:
2462
diff
changeset
|
964 |
|
2001 | 965 |
saveImageAs: aFileName |
966 |
"save image in aFilename" |
|
967 |
||
968 |
aFileName notNil ifTrue:[ |
|
2621 | 969 |
self withCursor:Cursor write do:[ |
970 |
(ObjectMemory snapShotOn:aFileName) ifFalse:[ |
|
971 |
self warn:('Failed to save snapshot image (disk full or not writable)'). |
|
972 |
] |
|
973 |
]. |
|
2001 | 974 |
]. |
975 |
! ! |
|
976 |
||
977 |
!AbstractLauncherApplication methodsFor:'user actions - help'! |
|
978 |
||
979 |
showBookPrintDocument |
|
980 |
"open an HTML browser on the 'book'-printing document" |
|
981 |
||
982 |
self showDocumentation:'BOOK.html' |
|
983 |
! |
|
984 |
||
985 |
startClassDocumentation |
|
986 |
"open an HTML browser on the 'classDoc/TOP' document" |
|
987 |
||
988 |
self showDocumentation:'classDoc/TOP.html' |
|
989 |
||
990 |
! |
|
991 |
||
992 |
startDocumentationIndex |
|
993 |
"open an HTML browser on the 'index' document" |
|
994 |
||
995 |
self showDocumentation:'index.html' |
|
996 |
! |
|
997 |
||
998 |
startDocumentationTool |
|
999 |
"open an HTML browser on the 'TOP' document" |
|
1000 |
||
1001 |
self showDocumentation:'TOP.html' |
|
1002 |
||
1003 |
! |
|
1004 |
||
1005 |
startWhatsNewDocumentation |
|
1006 |
"open an HTML browser on the 'whatsNew.html' document" |
|
1007 |
||
1008 |
self showDocumentation:'whatsNew.html' |
|
1009 |
||
2296 | 1010 |
! |
1011 |
||
1012 |
startWhatsNewSTX |
|
1013 |
"open an HTML browser on the 'relNotes.html' document" |
|
1014 |
||
1015 |
self showDocumentation:'newFeatures.html' |
|
1016 |
||
2001 | 1017 |
! ! |
1018 |
||
1019 |
!AbstractLauncherApplication methodsFor:'user actions - settings'! |
|
1020 |
||
2196 | 1021 |
communicationsSettings |
1022 |
"open a dialog on misc other settings" |
|
1023 |
||
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1024 |
self settingsDialog:[:handler | handler communicationsSettings] |
2196 | 1025 |
|
1026 |
"Modified: / 31.7.1998 / 22:46:56 / cg" |
|
1027 |
! |
|
1028 |
||
2001 | 1029 |
compilerSettings |
1030 |
"open a dialog on compiler related settings" |
|
1031 |
||
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1032 |
self settingsDialog:[:handler | handler compilerSettings] |
2001 | 1033 |
! |
1034 |
||
1035 |
displaySettings |
|
1036 |
"open a dialog on display related settings" |
|
1037 |
||
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1038 |
self settingsDialog:[:handler | handler displaySettings] |
2001 | 1039 |
|
1040 |
"Modified: / 31.7.1998 / 22:45:38 / cg" |
|
1041 |
! |
|
1042 |
||
1043 |
editSettings |
|
1044 |
"open a dialog on edit settings" |
|
1045 |
||
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1046 |
self settingsDialog:[:handler | handler editSettings] |
2001 | 1047 |
|
1048 |
"Modified: / 31.7.1998 / 22:46:56 / cg" |
|
1049 |
"Created: / 6.1.1999 / 14:14:48 / cg" |
|
1050 |
! |
|
1051 |
||
1052 |
fontSettings |
|
1053 |
"open a dialog on font related settings" |
|
1054 |
||
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1055 |
self settingsDialog:[:handler | handler fontSettingsFor:self] |
2001 | 1056 |
|
1057 |
"Modified: / 31.7.1998 / 22:45:44 / cg" |
|
1058 |
! |
|
1059 |
||
1060 |
javaSettings |
|
1061 |
"open a dialog on java-subsystem related settings" |
|
1062 |
||
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1063 |
self settingsDialog:[:handler | handler javaSettings] |
2001 | 1064 |
|
1065 |
"Modified: / 31.7.1998 / 22:46:13 / cg" |
|
1066 |
! |
|
1067 |
||
1068 |
keyboardSetting |
|
1069 |
"open a dialog on keyboard related settings" |
|
1070 |
||
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1071 |
self settingsDialog:[:handler | handler keyboardSettings] |
2001 | 1072 |
|
1073 |
"Modified: / 31.7.1998 / 22:45:56 / cg" |
|
1074 |
! |
|
1075 |
||
1076 |
languageSetting |
|
1077 |
"open a dialog on language related settings" |
|
1078 |
||
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1079 |
self settingsDialog:[:handler | handler languageSettingsFor:self] |
2001 | 1080 |
|
1081 |
"Modified: / 31.7.1998 / 22:46:13 / cg" |
|
1082 |
! |
|
1083 |
||
1084 |
loadSettings |
|
1085 |
"restore settings from a settings-file." |
|
1086 |
||
1087 |
"a temporary kludge - we need a central systemSettings object for this, |
|
1088 |
which can be saved/restored with a single store/read." |
|
1089 |
||
1090 |
|fileName| |
|
1091 |
||
1092 |
fileName := Dialog |
|
4052 | 1093 |
requestFileName:(resources string:'Load Settings From:') |
3790 | 1094 |
default:'settings.stx' |
1095 |
ok:(resources string:'Load') |
|
1096 |
abort:(resources string:'Cancel') |
|
1097 |
pattern:'*.stx' |
|
1098 |
fromDirectory:nil. |
|
2021 | 1099 |
|
1100 |
(fileName size == 0) ifTrue:[ |
|
3790 | 1101 |
"/ canceled |
1102 |
^ self |
|
2001 | 1103 |
]. |
1104 |
||
1105 |
self withWaitCursorDo:[ |
|
3790 | 1106 |
Smalltalk fileIn:fileName. |
1107 |
self reOpen |
|
2001 | 1108 |
]. |
1109 |
! |
|
1110 |
||
1111 |
memorySettings |
|
1112 |
"open a dialog on objectMemory related settings" |
|
1113 |
||
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1114 |
self settingsDialog:[:handler | handler memorySettings] |
2001 | 1115 |
|
1116 |
"Modified: / 31.7.1998 / 22:46:33 / cg" |
|
1117 |
! |
|
1118 |
||
1119 |
messageSettings |
|
1120 |
"open a dialog on infoMessage related settings" |
|
1121 |
||
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1122 |
self settingsDialog:[:handler | handler messageSettings] |
2001 | 1123 |
|
1124 |
"Modified: / 31.7.1998 / 22:46:45 / cg" |
|
1125 |
! |
|
1126 |
||
1127 |
miscSettings |
|
1128 |
"open a dialog on misc other settings" |
|
1129 |
||
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1130 |
self settingsDialog:[:handler | handler miscSettings] |
2001 | 1131 |
|
1132 |
"Modified: / 31.7.1998 / 22:46:56 / cg" |
|
1133 |
! |
|
1134 |
||
1135 |
printerSettings |
|
1136 |
"open a dialog on printer related settings" |
|
1137 |
||
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1138 |
self settingsDialog:[:handler | handler printerSettings] |
2001 | 1139 |
|
1140 |
"Modified: / 31.7.1998 / 22:47:05 / cg" |
|
1141 |
! |
|
1142 |
||
1143 |
saveSettings |
|
1144 |
"save settings to a settings-file." |
|
1145 |
||
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1146 |
self settingsDialog:[:handler | handler saveSettings] |
2001 | 1147 |
|
1148 |
"Modified: / 31.7.1998 / 22:48:38 / cg" |
|
1149 |
! |
|
1150 |
||
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1151 |
settingsDialog:symbolOrBlock |
2001 | 1152 |
"open a dialog on viewStyle related settings" |
1153 |
||
2196 | 1154 |
|handler| |
1155 |
||
1156 |
RegisteredMenuHandlers notNil ifTrue:[ |
|
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1157 |
handler := RegisteredMenuHandlers at:symbolOrBlock ifAbsent:nil. |
2196 | 1158 |
]. |
1159 |
handler isNil ifTrue:[ |
|
1160 |
handler := LauncherDialogs |
|
1161 |
]. |
|
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1162 |
symbolOrBlock isBlock ifTrue:[ |
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1163 |
symbolOrBlock value:handler |
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1164 |
] ifFalse:[ |
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1165 |
handler perform:symbolOrBlock with:self. |
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1166 |
] |
2001 | 1167 |
|
1168 |
"Modified: / 31.7.1998 / 22:47:33 / cg" |
|
1169 |
! |
|
1170 |
||
1171 |
sourceAndDebuggerSettings |
|
1172 |
"open a dialog on misc other settings" |
|
1173 |
||
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1174 |
self settingsDialog:[:handler | handler sourceAndDebuggerSettings] |
2001 | 1175 |
|
1176 |
"Modified: / 31.7.1998 / 22:47:21 / cg" |
|
1177 |
! |
|
1178 |
||
1179 |
toolSettings |
|
1180 |
"open a dialog on tool settings" |
|
1181 |
||
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1182 |
self settingsDialog:[:handler | handler toolSettings] |
2001 | 1183 |
|
1184 |
"Modified: / 31.7.1998 / 22:46:56 / cg" |
|
1185 |
"Created: / 13.10.1998 / 15:50:53 / cg" |
|
1186 |
! |
|
1187 |
||
1188 |
viewStyleSetting |
|
1189 |
"open a dialog on viewStyle related settings" |
|
1190 |
||
4062
decb623a8c3d
settings dialogs no longer need a requestor (with few exceptions)
ca
parents:
4052
diff
changeset
|
1191 |
self settingsDialog:[:handler | handler viewStyleSettingsFor:self] |
2001 | 1192 |
|
1193 |
"Modified: / 31.7.1998 / 22:47:33 / cg" |
|
1194 |
! ! |
|
1195 |
||
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1196 |
!AbstractLauncherApplication methodsFor:'user actions - system'! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1197 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1198 |
compressingGarbageCollect |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1199 |
"perform a compressing garbageCollect" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1200 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1201 |
self withWaitCursorDo:[ObjectMemory verboseGarbageCollect] |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1202 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1203 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1204 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1205 |
garbageCollect |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1206 |
"perform a non-compressing garbageCollect" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1207 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1208 |
self withWaitCursorDo:[ObjectMemory reclaimSymbols] |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1209 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1210 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1211 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1212 |
startStopEventTrace |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1213 |
"start/stop event tracing for a particular view" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1214 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1215 |
|v wg| |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1216 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1217 |
v := Screen current viewFromUser. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1218 |
v notNil ifTrue:[ |
3219
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
1219 |
v := v topView. |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
1220 |
wg := v windowGroup. |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
1221 |
wg notNil ifTrue:[ |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
1222 |
"/ |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
1223 |
"/ toggle eventTrace in its windowGroup |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
1224 |
"/ |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
1225 |
wg traceEvents:(wg preEventHook isNil) |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
1226 |
] |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1227 |
] |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1228 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1229 |
! ! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1230 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1231 |
!AbstractLauncherApplication methodsFor:'user actions - tools'! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1232 |
|
2210 | 1233 |
inspectGlobalVariables |
1234 |
"inspect globals" |
|
1235 |
||
1236 |
Smalltalk inspect |
|
1237 |
! |
|
1238 |
||
2207
84d23e553268
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
1239 |
inspectWorkspaceVariables |
2210 | 1240 |
"inspect workspace variables" |
2207
84d23e553268
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
1241 |
|
84d23e553268
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
1242 |
Workspace workspaceVariables inspect |
84d23e553268
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
1243 |
! |
84d23e553268
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
1244 |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1245 |
newProject |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1246 |
"creates a new project & opens a projectView for it" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1247 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1248 |
Project notNil ifTrue: [(ProjectView for: Project new) open] |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1249 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1250 |
|
2111
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1251 |
openTerminal |
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1252 |
self openApplication:#VT100TerminalView |
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1253 |
|
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1254 |
"Created: / 27.7.1998 / 12:48:30 / cg" |
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1255 |
! |
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1256 |
|
3158 | 1257 |
openWorkspace |
1258 |
WorkspaceApplication notNil ifTrue:[ |
|
1259 |
^ WorkspaceApplication open |
|
1260 |
]. |
|
1261 |
^ self openApplication:Workspace |
|
1262 |
! |
|
1263 |
||
2207
84d23e553268
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
1264 |
removeAllWorkspaceVariables |
84d23e553268
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
1265 |
"remove workspace variables" |
84d23e553268
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
1266 |
|
84d23e553268
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
1267 |
Workspace removeAllWorkspaceVariables |
84d23e553268
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
1268 |
! |
84d23e553268
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
2206
diff
changeset
|
1269 |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1270 |
selectProject |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1271 |
"asks for and switch to another project" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1272 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1273 |
|list box| |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1274 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1275 |
Project notNil ifTrue:[ |
2458
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
1276 |
list := Project allInstances. |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
1277 |
box := ListSelectionBox new. |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
1278 |
box list:(list collect:[:p | p name]). |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
1279 |
box title:(resources string:'select a project'). |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
1280 |
box action:[:selection | |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
1281 |
|project| |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
1282 |
|
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
1283 |
project := list detect:[:p | p name = selection] ifNone:[nil]. |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
1284 |
project isNil ifTrue:[ |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
1285 |
transcript notNil ifTrue:[ |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
1286 |
transcript showCR:'no such project.' |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
1287 |
] |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
1288 |
] ifFalse:[ |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
1289 |
project showViews. |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
1290 |
Project current:project |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
1291 |
] |
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
1292 |
]. |
3293
d7b925f89a7b
dont use explicit showAtPointer
Claus Gittinger <cg@exept.de>
parents:
3288
diff
changeset
|
1293 |
box open. |
2458
3c273283bb84
care for transcript being nil.
Claus Gittinger <cg@exept.de>
parents:
2457
diff
changeset
|
1294 |
box destroy |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1295 |
] |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1296 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1297 |
|
3408 | 1298 |
startBugMessages |
1299 |
"open the SUnit test runner" |
|
1300 |
||
1301 |
self openApplication:#BugGUI |
|
1302 |
||
1303 |
"Modified: / 17.10.1998 / 14:38:18 / cg" |
|
1304 |
! |
|
1305 |
||
3362 | 1306 |
startChangeSetBrowser |
1307 |
"open a change Set Browser" |
|
1308 |
||
1309 |
ChangeSetBrowser open |
|
1310 |
||
1311 |
"Created: / 5.11.2001 / 18:04:05 / cg" |
|
1312 |
! |
|
1313 |
||
2111
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1314 |
startChangesBrowser |
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1315 |
"open a changebrowser - either new or old GUI, depending on userPrefs" |
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1316 |
|
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1317 |
self openApplication:(UserPreferences current changesBrowserClass) |
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1318 |
|
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1319 |
"Modified: / 17.10.1998 / 14:38:18 / cg" |
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1320 |
! |
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1321 |
|
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1322 |
startNewChangesBrowser |
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1323 |
"opens the new changeBrowser" |
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1324 |
|
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1325 |
self openApplication:#NewChangesBrowser |
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1326 |
|
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1327 |
"Created: / 6.6.1998 / 19:47:26 / cg" |
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1328 |
! |
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1329 |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1330 |
startNewLauncher |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1331 |
"opens the new launcher" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1332 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1333 |
NewLauncher isNil ifTrue:[ |
3219
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
1334 |
^ self warn:'The NewLauncher is not available in this release.' |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1335 |
]. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1336 |
NewLauncher openAt:(self window origin) |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1337 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1338 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1339 |
|
2111
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1340 |
startOldChangesBrowser |
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1341 |
"opens the old changeBrowser" |
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1342 |
|
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1343 |
self openApplication:#ChangesBrowser |
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1344 |
|
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1345 |
"Created: / 6.6.1998 / 19:47:26 / cg" |
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1346 |
! |
b36bdfb0af38
moved startChangesBrowser from NewLauncher to here.
Claus Gittinger <cg@exept.de>
parents:
2110
diff
changeset
|
1347 |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1348 |
startOldLauncher |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1349 |
"opens the old launcher" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1350 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1351 |
Launcher isNil ifTrue:[ |
3219
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
1352 |
^ self warn:'The (Old)Launcher is not available in this release.' |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1353 |
]. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1354 |
Launcher openAt:(self window origin) |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1355 |
|
2883 | 1356 |
! |
1357 |
||
1358 |
startSUnitTestRunner |
|
1359 |
"open the SUnit test runner" |
|
1360 |
||
3037 | 1361 |
self openApplication:#TestRunner |
2883 | 1362 |
|
1363 |
"Modified: / 17.10.1998 / 14:38:18 / cg" |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1364 |
! ! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1365 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1366 |
!AbstractLauncherApplication methodsFor:'user actions - windows'! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1367 |
|
2765 | 1368 |
askForAnotherDisplay |
1369 |
"ask for some other display" |
|
1370 |
||
3664
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1371 |
|displayName| |
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1372 |
|
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1373 |
displayName := Dialog request:'Display:' initialAnswer:(Screen default displayName). |
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1374 |
displayName size == 0 ifTrue:[^ nil]. |
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1375 |
|
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1376 |
^ XWorkstation newDispatchingFor:displayName. |
2765 | 1377 |
! |
1378 |
||
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1379 |
deIconifyAllWindows |
2144 | 1380 |
|setOfViews currentScreen| |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1381 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1382 |
setOfViews := Project current views asIdentitySet. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1383 |
setOfViews addAll:(Project defaultProject views). |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1384 |
|
2144 | 1385 |
currentScreen := Screen current. |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1386 |
setOfViews do:[:aTopView | |
3219
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
1387 |
aTopView device == currentScreen ifTrue:[ |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
1388 |
aTopView expand |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
1389 |
]. |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1390 |
]. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1391 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1392 |
" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1393 |
Transcript topView application deIconifyAllWindows |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1394 |
" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1395 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1396 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1397 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1398 |
findAndDestroyWindow |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1399 |
"find a window (by name) and destroy it" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1400 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1401 |
|v| |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1402 |
v := self findWindow:'select view to close:'. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1403 |
v notNil ifTrue:[v destroy] |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1404 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1405 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1406 |
|
2759 | 1407 |
findAndMigrateWindow |
1408 |
"find a window (by name) and migrate it to some other display" |
|
1409 |
||
2766 | 1410 |
|possibleGroups v| |
1411 |
||
1412 |
possibleGroups := WindowGroup allInstances select:[:eachGroup | |
|
3014 | 1413 |
eachGroup graphicsDevice == Screen current |
2766 | 1414 |
and:[eachGroup isModal not |
1415 |
and:[eachGroup topViews size > 0]]]. |
|
1416 |
possibleGroups size == 0 ifTrue:[ |
|
1417 |
self information:'No windows found which could be migrated to some other display.'. |
|
1418 |
^ self |
|
1419 |
]. |
|
1420 |
||
1421 |
v := self findWindow:'Select view to migrate:' windowGroupFilter:possibleGroups. |
|
2759 | 1422 |
v notNil ifTrue:[ |
1423 |
self migrateWindow:v topView |
|
1424 |
] |
|
1425 |
! |
|
1426 |
||
2766 | 1427 |
findAndMigrateWindowBack |
1428 |
"find a window (by name) and migrate it back to this display" |
|
1429 |
||
1430 |
|possibleGroups v| |
|
1431 |
||
1432 |
possibleGroups := WindowGroup allInstances select:[:eachGroup | |
|
3014 | 1433 |
eachGroup graphicsDevice ~~ Screen current |
2766 | 1434 |
and:[eachGroup isModal not |
1435 |
and:[eachGroup topViews size > 0]]]. |
|
1436 |
possibleGroups size == 0 ifTrue:[ |
|
1437 |
self information:'No windows are open on any other display.'. |
|
1438 |
^ self |
|
1439 |
]. |
|
1440 |
||
1441 |
v := self findWindow:'Select view to migrate back:' windowGroupFilter:possibleGroups. |
|
1442 |
v notNil ifTrue:[ |
|
1443 |
v windowGroup migrateTo:(Screen current) |
|
1444 |
] |
|
1445 |
! |
|
1446 |
||
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1447 |
findAndRaiseWindow |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1448 |
"find a window (by name) and raise it" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1449 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1450 |
|v| |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1451 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1452 |
v := self findWindow:'select view to raise deiconified:'. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1453 |
v notNil ifTrue:[v raiseDeiconified] |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1454 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1455 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1456 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1457 |
fullScreenHardcopy |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1458 |
"after a second (to allow redraw of views under menu ...), |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1459 |
save the contents of the whole screen." |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1460 |
|
3326 | 1461 |
self window sensor ctrlDown ifTrue:[ |
1462 |
^ self fullScreenHardcopyUngrabbed |
|
1463 |
]. |
|
1464 |
||
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1465 |
Processor |
3326 | 1466 |
addTimedBlock:[ |
1467 |
self |
|
1468 |
saveScreenImage:(Image fromScreen) |
|
1469 |
defaultName:'screen' |
|
1470 |
] |
|
1471 |
afterSeconds:(self window sensor shiftDown ifTrue:5 ifFalse:1) |
|
1472 |
! |
|
1473 |
||
1474 |
fullScreenHardcopyUngrabbed |
|
1475 |
"after a second (to allow redraw of views under menu ...), |
|
1476 |
save the contents of the whole screen." |
|
1477 |
||
1478 |
Processor |
|
1479 |
addTimedBlock:[ |
|
1480 |
|display image| |
|
1481 |
||
1482 |
display := Screen current. |
|
1483 |
image := Image |
|
1484 |
fromScreen:(0@0 corner:(display extent)) |
|
1485 |
on:display |
|
1486 |
grab:false. |
|
1487 |
||
1488 |
self |
|
1489 |
saveScreenImage:image |
|
1490 |
defaultName:'screen' |
|
1491 |
] |
|
1492 |
afterSeconds:(self window sensor shiftDown ifTrue:5 ifFalse:1) |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1493 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1494 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1495 |
iconifyAllWindows |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1496 |
|setOfViews currentScreen| |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1497 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1498 |
setOfViews := Project current views asIdentitySet. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1499 |
setOfViews addAll:(Project defaultProject views). |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1500 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1501 |
currentScreen := Screen current. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1502 |
setOfViews do:[:aTopView | |
3219
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
1503 |
aTopView device == currentScreen ifTrue:[ |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
1504 |
aTopView collapse |
2e32f575524c
removed mouseSettings - useless
Claus Gittinger <cg@exept.de>
parents:
3218
diff
changeset
|
1505 |
] |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1506 |
] |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1507 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1508 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1509 |
|
2765 | 1510 |
migrateAllWindows |
1511 |
"migrate all views to some other display" |
|
1512 |
||
1513 |
|anotherDisplay toMigrate| |
|
1514 |
||
3664
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1515 |
[ |
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1516 |
anotherDisplay := self askForAnotherDisplay. |
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1517 |
anotherDisplay isNil ifTrue:[ |
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1518 |
^ self. |
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1519 |
]. |
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1520 |
] on:Screen deviceOpenErrorSignal do:[:ex| |
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1521 |
^ self warn:'cannot open display: ', ex parameter. |
2765 | 1522 |
]. |
1523 |
||
1524 |
toMigrate := WindowGroup allInstances |
|
3664
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1525 |
select:[:each | each graphicsDevice == Screen current |
2765 | 1526 |
and:[each topViews size > 0 |
1527 |
and:[each isModal not]] |
|
1528 |
]. |
|
1529 |
toMigrate do:[:eachGroup | |
|
1530 |
eachGroup migrateTo:anotherDisplay |
|
1531 |
] |
|
1532 |
! |
|
1533 |
||
2759 | 1534 |
migrateWindow:aWindow |
1535 |
"migrate a view to some other display" |
|
1536 |
||
2778
1e4bf8bf1d37
block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents:
2775
diff
changeset
|
1537 |
aWindow windowGroup isModal ifTrue:[ |
1e4bf8bf1d37
block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents:
2775
diff
changeset
|
1538 |
self warn:'Sorry - I cannot migrate a modalBox; please migrate the owning View.'. |
1e4bf8bf1d37
block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents:
2775
diff
changeset
|
1539 |
^ self |
1e4bf8bf1d37
block migration of a modalBox
Claus Gittinger <cg@exept.de>
parents:
2775
diff
changeset
|
1540 |
]. |
2775 | 1541 |
self migrateWindow:aWindow withBackOption:(self confirm:'Show ''Return Back'' Button on the other display ?') |
1542 |
||
1543 |
! |
|
1544 |
||
1545 |
migrateWindow:aWindow withBackOption:withBackOption |
|
1546 |
"migrate a view to some other display" |
|
1547 |
||
1548 |
|anotherDisplay wg here b| |
|
2765 | 1549 |
|
2766 | 1550 |
aWindow isTopView ifFalse:[ |
1551 |
self information:'Cannto migrate this view'. |
|
1552 |
^ self |
|
1553 |
]. |
|
1554 |
||
3664
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1555 |
[ |
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1556 |
anotherDisplay := self askForAnotherDisplay. |
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1557 |
anotherDisplay isNil ifTrue:[ |
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1558 |
^ self. |
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1559 |
]. |
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1560 |
] on:Screen deviceOpenErrorSignal do:[:ex| |
77fb767b5368
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
3644
diff
changeset
|
1561 |
^ self warn:'cannot open display: ', ex parameter. |
2759 | 1562 |
]. |
1563 |
||
2775 | 1564 |
wg := aWindow windowGroup. |
1565 |
wg migrateTo:anotherDisplay. |
|
1566 |
||
1567 |
withBackOption ifTrue:[ |
|
1568 |
here := Screen current. |
|
1569 |
b := Button onDevice:anotherDisplay. |
|
1570 |
b label:'Return window back to ' , here displayName. |
|
1571 |
b action:[ wg migrateTo:here. b destroy. ]. |
|
1572 |
b origin:0@0. |
|
1573 |
b open. |
|
1574 |
]. |
|
2759 | 1575 |
! |
1576 |
||
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1577 |
screenHardcopy |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1578 |
"after a second (to allow redraw of views under menu ...), |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1579 |
let user specify a rectangular area on the screen |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1580 |
and save its contents." |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1581 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1582 |
|area| |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1583 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1584 |
Processor |
3782 | 1585 |
addTimedBlock:[ |
1586 |
[Screen current leftButtonPressed] whileTrue:[Delay waitForSeconds:0.05]. |
|
1587 |
||
1588 |
area := Rectangle fromUser. |
|
1589 |
(area width > 0 and:[area height > 0]) ifTrue:[ |
|
3856
d2c16db43c66
wait 2 seconds before grabbing
Claus Gittinger <cg@exept.de>
parents:
3826
diff
changeset
|
1590 |
Delay waitForSeconds:2. |
3782 | 1591 |
self saveScreenImage:(Image fromScreen:area) defaultName:'hardcopy' |
1592 |
] |
|
1593 |
] |
|
1594 |
afterSeconds:(self window sensor shiftDown ifTrue:5 ifFalse:1) |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1595 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1596 |
"Modified: / 18.8.1998 / 15:00:42 / cg" |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1597 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1598 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1599 |
startWindowTreeView |
2371
7ce8ba08aca1
added windowTree on all views on all screens
Claus Gittinger <cg@exept.de>
parents:
2359
diff
changeset
|
1600 |
"open a windowTree (on a picked topView)" |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1601 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1602 |
|v| |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1603 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1604 |
WindowTreeView isNil ifTrue:[ |
2371
7ce8ba08aca1
added windowTree on all views on all screens
Claus Gittinger <cg@exept.de>
parents:
2359
diff
changeset
|
1605 |
^ self warn:'The WindowTreeView is not available in this release.' |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1606 |
]. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1607 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1608 |
v := self pickAView. |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1609 |
v notNil ifTrue:[ |
2371
7ce8ba08aca1
added windowTree on all views on all screens
Claus Gittinger <cg@exept.de>
parents:
2359
diff
changeset
|
1610 |
WindowTreeView openOn:v topView |
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1611 |
] |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1612 |
|
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1613 |
! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1614 |
|
2371
7ce8ba08aca1
added windowTree on all views on all screens
Claus Gittinger <cg@exept.de>
parents:
2359
diff
changeset
|
1615 |
startWindowTreeViewForAll |
7ce8ba08aca1
added windowTree on all views on all screens
Claus Gittinger <cg@exept.de>
parents:
2359
diff
changeset
|
1616 |
"open a windowTree on all views in the system" |
7ce8ba08aca1
added windowTree on all views on all screens
Claus Gittinger <cg@exept.de>
parents:
2359
diff
changeset
|
1617 |
|
4243 | 1618 |
|v| |
1619 |
||
2371
7ce8ba08aca1
added windowTree on all views on all screens
Claus Gittinger <cg@exept.de>
parents:
2359
diff
changeset
|
1620 |
WindowTreeView isNil ifTrue:[ |
7ce8ba08aca1
added windowTree on all views on all screens
Claus Gittinger <cg@exept.de>
parents:
2359
diff
changeset
|
1621 |
^ self warn:'The WindowTreeView is not available in this release.' |
7ce8ba08aca1
added windowTree on all views on all screens
Claus Gittinger <cg@exept.de>
parents:
2359
diff
changeset
|
1622 |
]. |
7ce8ba08aca1
added windowTree on all views on all screens
Claus Gittinger <cg@exept.de>
parents:
2359
diff
changeset
|
1623 |
|
7ce8ba08aca1
added windowTree on all views on all screens
Claus Gittinger <cg@exept.de>
parents:
2359
diff
changeset
|
1624 |
WindowTreeView openOnAll |
7ce8ba08aca1
added windowTree on all views on all screens
Claus Gittinger <cg@exept.de>
parents:
2359
diff
changeset
|
1625 |
|
7ce8ba08aca1
added windowTree on all views on all screens
Claus Gittinger <cg@exept.de>
parents:
2359
diff
changeset
|
1626 |
! |
7ce8ba08aca1
added windowTree on all views on all screens
Claus Gittinger <cg@exept.de>
parents:
2359
diff
changeset
|
1627 |
|
4244 | 1628 |
viewDestroy |
1629 |
"let user pick a view and destroy it. |
|
1630 |
Even allow destroying non-smalltalk views |
|
1631 |
(also for views which I forgot due to some error)" |
|
1632 |
||
1633 |
|device v id i c| |
|
1634 |
||
1635 |
(Delay forSeconds:1) wait. |
|
1636 |
||
1637 |
device := Screen current. |
|
1638 |
i := Image fromFile:'bitmaps/xpmBitmaps/cursors/cross2.xpm'. |
|
1639 |
i isNil ifTrue:[ |
|
1640 |
c := Cursor crossHair |
|
1641 |
] ifFalse:[ |
|
1642 |
c := Cursor fromImage:i |
|
1643 |
]. |
|
1644 |
id := device viewIdFromPoint:(device pointFromUserShowing:c). |
|
1645 |
(v := device viewFromId:id) notNil ifTrue:[ |
|
1646 |
v topView destroy. |
|
1647 |
^ self |
|
1648 |
]. |
|
1649 |
id = device rootView id ifTrue:[ |
|
1650 |
^ self |
|
1651 |
]. |
|
1652 |
(Dialog confirm:'mhmh, this may not a be smalltalk view\(Or I somehow forgot about it).\Destroy anyway ?' withCRs) |
|
1653 |
ifTrue:[ |
|
1654 |
device destroyView:nil withId:id |
|
1655 |
]. |
|
1656 |
||
1657 |
||
1658 |
! |
|
1659 |
||
1660 |
viewHardcopy |
|
1661 |
"after a second (to allow redraw of views under menu ...), |
|
1662 |
let user specify a view and save its contents." |
|
1663 |
||
1664 |
Processor |
|
1665 |
addTimedBlock:[ |
|
1666 |
|v| |
|
1667 |
(v := Screen current viewFromUser) notNil ifTrue:[ |
|
1668 |
self saveScreenImage:(Image fromView:(v topView)) defaultName:'hardcopy' |
|
1669 |
] |
|
1670 |
] |
|
1671 |
afterSeconds:(self window sensor shiftDown ifTrue:5 ifFalse:1) |
|
1672 |
! |
|
1673 |
||
1674 |
viewInspect |
|
1675 |
"let user pick a view and inspect it. Only smalltalk views are allowed" |
|
1676 |
||
1677 |
|v| |
|
1678 |
||
1679 |
(v := self pickAView) notNil ifTrue:[ |
|
1680 |
v inspect |
|
1681 |
] |
|
1682 |
||
1683 |
! |
|
1684 |
||
1685 |
viewMigrate |
|
1686 |
"let user pick a view and migrate it to some other display" |
|
1687 |
||
1688 |
|v| |
|
1689 |
||
1690 |
(v := self pickAView) notNil ifTrue:[ |
|
1691 |
self migrateWindow:v topView |
|
1692 |
] |
|
2005
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1693 |
! ! |
c227faa4616b
more refactoring (NewLauncher <-> Launcher)
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
1694 |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
1695 |
!AbstractLauncherApplication::KbdMappingSettingsAppl class methodsFor:'interface specs'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
1696 |
|
4244 | 1697 |
windowSpec |
1698 |
"This resource specification was automatically generated |
|
1699 |
by the UIPainter of ST/X." |
|
1700 |
||
1701 |
"Do not manually edit this!! If it is corrupted, |
|
1702 |
the UIPainter may not be able to read the specification." |
|
1703 |
||
1704 |
" |
|
1705 |
UIPainter new openOnClass:AbstractLauncherApplication::KbdMappingSettingsAppl andSelector:#windowSpec |
|
1706 |
AbstractLauncherApplication::KbdMappingSettingsAppl new openInterface:#windowSpec |
|
1707 |
AbstractLauncherApplication::KbdMappingSettingsAppl open |
|
1708 |
" |
|
1709 |
||
1710 |
<resource: #canvas> |
|
1711 |
||
1712 |
^ |
|
1713 |
#(#FullSpec |
|
1714 |
#name: #windowSpec |
|
1715 |
#window: |
|
1716 |
#(#WindowSpec |
|
1717 |
#label: 'Keyboard Mappings' |
|
1718 |
#name: 'Keyboard Mappings' |
|
1719 |
#min: #(#Point 10 10) |
|
1720 |
#max: #(#Point 1024 768) |
|
1721 |
#bounds: #(#Rectangle 16 42 491 620) |
|
1722 |
) |
|
1723 |
#component: |
|
1724 |
#(#SpecCollection |
|
1725 |
#collection: #( |
|
1726 |
#(#VariableVerticalPanelSpec |
|
1727 |
#name: 'VariableVerticalPanel1' |
|
1728 |
#layout: #(#LayoutFrame 0 0.0 60 0 0 1.0 -34 1) |
|
1729 |
#component: |
|
1730 |
#(#SpecCollection |
|
1731 |
#collection: #( |
|
1732 |
#(#VariableHorizontalPanelSpec |
|
1733 |
#name: 'VariableHorizontalPanel1' |
|
1734 |
#component: |
|
1735 |
#(#SpecCollection |
|
1736 |
#collection: #( |
|
1737 |
#(#SequenceViewSpec |
|
1738 |
#name: 'RawKeyList' |
|
1739 |
#model: #selectedRawKey |
|
1740 |
#hasHorizontalScrollBar: true |
|
1741 |
#hasVerticalScrollBar: true |
|
1742 |
#useIndex: false |
|
1743 |
#sequenceList: #rawKeyList |
|
1744 |
) |
|
1745 |
#(#SequenceViewSpec |
|
1746 |
#name: 'FunctionKeyList' |
|
1747 |
#model: #selectedFunctionKey |
|
1748 |
#hasHorizontalScrollBar: true |
|
1749 |
#hasVerticalScrollBar: true |
|
1750 |
#useIndex: false |
|
1751 |
#sequenceList: #functionKeyList |
|
1752 |
) |
|
1753 |
) |
|
1754 |
||
1755 |
) |
|
1756 |
#handles: #(#Any 0.5 1.0) |
|
1757 |
) |
|
1758 |
#(#ViewSpec |
|
1759 |
#name: 'Box1' |
|
1760 |
#component: |
|
1761 |
#(#SpecCollection |
|
1762 |
#collection: #( |
|
1763 |
#(#TextEditorSpec |
|
1764 |
#name: 'MacroText' |
|
1765 |
#layout: #(#LayoutFrame 0 0.0 20 0 0 1.0 0 1.0) |
|
1766 |
#model: #macroTextHolder |
|
1767 |
#hasHorizontalScrollBar: true |
|
1768 |
#hasVerticalScrollBar: true |
|
1769 |
#isReadOnly: true |
|
1770 |
) |
|
1771 |
#(#LabelSpec |
|
1772 |
#label: 'Macro text (if any):' |
|
1773 |
#name: 'MacroTextLabel' |
|
1774 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 20 0) |
|
1775 |
#translateLabel: true |
|
1776 |
#adjust: #left |
|
1777 |
) |
|
1778 |
) |
|
1779 |
||
1780 |
) |
|
1781 |
) |
|
1782 |
) |
|
1783 |
||
1784 |
) |
|
1785 |
#handles: #(#Any 0.5 1.0) |
|
1786 |
) |
|
1787 |
#(#HorizontalPanelViewSpec |
|
1788 |
#name: 'HorizontalPanel1' |
|
1789 |
#layout: #(#LayoutFrame 0 0.0 -34 1 0 1.0 0 1) |
|
1790 |
#horizontalLayout: #center |
|
1791 |
#verticalLayout: #center |
|
1792 |
#horizontalSpace: 3 |
|
1793 |
#verticalSpace: 3 |
|
1794 |
#component: |
|
1795 |
#(#SpecCollection |
|
1796 |
#collection: #( |
|
1797 |
#(#ActionButtonSpec |
|
1798 |
#label: 'Close' |
|
1799 |
#name: 'Cancel' |
|
1800 |
#visibilityChannel: #isNotPartOfSettinsDialog |
|
1801 |
#translateLabel: true |
|
1802 |
#model: #doCancel |
|
1803 |
#extent: #(#Point 125 22) |
|
1804 |
) |
|
1805 |
#(#ActionButtonSpec |
|
1806 |
#label: 'Help' |
|
1807 |
#name: 'Help' |
|
1808 |
#translateLabel: true |
|
1809 |
#model: #help |
|
1810 |
#extent: #(#Point 125 22) |
|
1811 |
) |
|
1812 |
) |
|
1813 |
||
1814 |
) |
|
1815 |
) |
|
1816 |
#(#LabelSpec |
|
1817 |
#label: 'NoticeText' |
|
1818 |
#name: 'Text' |
|
1819 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 60 0) |
|
1820 |
#translateLabel: true |
|
1821 |
#labelChannel: #labelTextHolder |
|
1822 |
#resizeForLabel: true |
|
1823 |
#adjust: #left |
|
1824 |
) |
|
1825 |
) |
|
1826 |
||
1827 |
) |
|
1828 |
) |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
1829 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
1830 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
1831 |
!AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'actions'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
1832 |
|
4244 | 1833 |
doCancel |
1834 |
||
1835 |
self isPartOfSettinsDialog ifTrue:[ |
|
1836 |
self loadRequest. |
|
1837 |
]. |
|
1838 |
self closeRequest. |
|
1839 |
! |
|
1840 |
||
1841 |
evaluateModified |
|
1842 |
||
1843 |
self modifiedChannel value:(self hasUnsavedChanges). |
|
1844 |
! |
|
1845 |
||
1846 |
help |
|
1847 |
||
1848 |
self withWaitCursorDo:[HTMLDocumentView openFullOnHelpFile:'Launcher/keyboardSetting.html']. |
|
1849 |
! |
|
1850 |
||
1851 |
loadRequest |
|
1852 |
||
1853 |
self modifiedChannel value:false. |
|
1854 |
! |
|
1855 |
||
1856 |
saveRequest |
|
1857 |
| result | |
|
1858 |
||
1859 |
(self hasUnsavedChanges) ifTrue:[ |
|
1860 |
result := self confirmWithCancel:(resources string:'Save changed Tool Settings ?'). |
|
1861 |
result isNil ifTrue:[ ^ false]. |
|
1862 |
result ifTrue:[ |
|
1863 |
self saveSettings. |
|
1864 |
] |
|
1865 |
]. |
|
1866 |
^ true |
|
1867 |
! |
|
1868 |
||
1869 |
saveSettings |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
1870 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
1871 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
1872 |
!AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'aspects'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
1873 |
|
4244 | 1874 |
functionKeyList |
1875 |
"automatically generated by UIPainter ..." |
|
1876 |
||
1877 |
"*** the code below creates a default model when invoked." |
|
1878 |
"*** (which may not be the one you wanted)" |
|
1879 |
"*** Please change as required and accept it in the browser." |
|
1880 |
"*** (and replace this comment by something more useful ;-)" |
|
1881 |
||
1882 |
functionKeyList isNil ifTrue:[ |
|
1883 |
functionKeyList := ValueHolder new. |
|
1884 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
1885 |
"/ functionKeyList addDependent:self. |
|
1886 |
"/ functionKeyList onChangeSend:#functionKeyListChanged to:self. |
|
1887 |
]. |
|
1888 |
^ functionKeyList. |
|
1889 |
! |
|
1890 |
||
1891 |
labelTextHolder |
|
1892 |
"automatically generated by UIPainter ..." |
|
1893 |
||
1894 |
"*** the code below creates a default model when invoked." |
|
1895 |
"*** (which may not be the one you wanted)" |
|
1896 |
"*** Please change as required and accept it in the browser." |
|
1897 |
"*** (and replace this comment by something more useful ;-)" |
|
1898 |
||
1899 |
labelTextHolder isNil ifTrue:[ |
|
1900 |
labelTextHolder := ValueHolder new. |
|
1901 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
1902 |
"/ labelTextHolder addDependent:self. |
|
1903 |
"/ labelTextHolder onChangeSend:#labelTextHolderChanged to:self. |
|
1904 |
]. |
|
1905 |
^ labelTextHolder. |
|
1906 |
! |
|
1907 |
||
1908 |
macroTextHolder |
|
1909 |
"automatically generated by UIPainter ..." |
|
1910 |
||
1911 |
"*** the code below creates a default model when invoked." |
|
1912 |
"*** (which may not be the one you wanted)" |
|
1913 |
"*** Please change as required and accept it in the browser." |
|
1914 |
"*** (and replace this comment by something more useful ;-)" |
|
1915 |
||
1916 |
macroTextHolder isNil ifTrue:[ |
|
1917 |
macroTextHolder := ValueHolder new. |
|
1918 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
1919 |
"/ macroTextHolder addDependent:self. |
|
1920 |
"/ macroTextHolder onChangeSend:#macroTextHolderChanged to:self. |
|
1921 |
]. |
|
1922 |
^ macroTextHolder. |
|
1923 |
! |
|
1924 |
||
1925 |
modifiedChannel |
|
1926 |
||
1927 |
modifiedChannel isNil ifTrue:[ |
|
1928 |
modifiedChannel := false asValue. |
|
1929 |
]. |
|
1930 |
^ modifiedChannel |
|
1931 |
! |
|
1932 |
||
1933 |
rawKeyList |
|
1934 |
"automatically generated by UIPainter ..." |
|
1935 |
||
1936 |
"*** the code below creates a default model when invoked." |
|
1937 |
"*** (which may not be the one you wanted)" |
|
1938 |
"*** Please change as required and accept it in the browser." |
|
1939 |
"*** (and replace this comment by something more useful ;-)" |
|
1940 |
||
1941 |
rawKeyList isNil ifTrue:[ |
|
1942 |
rawKeyList := List new. |
|
1943 |
]. |
|
1944 |
^ rawKeyList. |
|
1945 |
! |
|
1946 |
||
1947 |
selectedFunctionKey |
|
1948 |
||
1949 |
selectedFunctionKey isNil ifTrue:[ |
|
1950 |
selectedFunctionKey := ValueHolder new. |
|
1951 |
selectedFunctionKey addDependent:self. |
|
1952 |
]. |
|
1953 |
^ selectedFunctionKey. |
|
1954 |
! |
|
1955 |
||
1956 |
selectedRawKey |
|
1957 |
||
1958 |
selectedRawKey isNil ifTrue:[ |
|
1959 |
selectedRawKey := ValueHolder new. |
|
1960 |
selectedRawKey addDependent:self. |
|
1961 |
]. |
|
1962 |
^ selectedRawKey. |
|
4240 | 1963 |
! ! |
1964 |
||
1965 |
!AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'change & update'! |
|
1966 |
||
4244 | 1967 |
changeFunctionKeySelection |
1968 |
||
1969 |
|raw| |
|
1970 |
raw := self selectedRawKey value. |
|
1971 |
self selectedFunctionKey value:(mappings at:raw asSymbol) asString. |
|
1972 |
! |
|
1973 |
||
1974 |
changeMacroText |
|
1975 |
||
1976 |
|f macro indent| |
|
1977 |
||
1978 |
f := self selectedFunctionKey value. |
|
1979 |
(f startsWith:'Cmd') ifTrue:[ |
|
1980 |
f := f copyFrom:4 |
|
1981 |
]. |
|
1982 |
macro := UserPreferences current functionKeySequences |
|
1983 |
at:(f asSymbol) ifAbsent:nil. |
|
1984 |
macro notNil ifTrue:[ |
|
1985 |
macro := macro asStringCollection. |
|
1986 |
indent := macro |
|
1987 |
inject:99999 into:[:min :element | |
|
1988 |
|stripped| |
|
1989 |
||
1990 |
stripped := element withoutLeadingSeparators. |
|
1991 |
stripped size == 0 ifTrue:[ |
|
1992 |
min |
|
1993 |
] ifFalse:[ |
|
1994 |
min min:(element size - stripped size) |
|
1995 |
] |
|
1996 |
]. |
|
1997 |
indent ~~ 0 ifTrue:[ |
|
1998 |
macro := macro collect:[:line | |
|
1999 |
line size > indent ifTrue:[ |
|
2000 |
line copyFrom:indent+1 |
|
2001 |
] ifFalse:[ |
|
2002 |
line |
|
2003 |
]. |
|
2004 |
] |
|
2005 |
]. |
|
2006 |
]. |
|
2007 |
macroTextHolder value:macro. |
|
2008 |
! |
|
2009 |
||
2010 |
changeRawKeySelection |
|
2011 |
|f raw| |
|
2012 |
||
2013 |
f := self selectedFunctionKey value. |
|
2014 |
raw := mappings keyAtValue:f asString. |
|
2015 |
raw isNil ifTrue:[ |
|
2016 |
raw := mappings keyAtValue:f first. |
|
2017 |
raw isNil ifTrue:[ |
|
2018 |
raw := mappings keyAtValue:f asSymbol. |
|
2019 |
] |
|
2020 |
]. |
|
2021 |
self selectedRawKey value:raw. |
|
2022 |
! |
|
2023 |
||
2024 |
update:something with:aParameter from:changedObject |
|
2025 |
"Invoked when an object that I depend upon sends a change notification." |
|
2026 |
||
2027 |
"stub code automatically generated - please change as required" |
|
2028 |
||
2029 |
changedObject == self selectedFunctionKey ifTrue:[ |
|
2030 |
self changeRawKeySelection. |
|
2031 |
self changeMacroText. |
|
2032 |
^ self |
|
2033 |
]. |
|
2034 |
changedObject == self selectedRawKey ifTrue:[ |
|
2035 |
self changeFunctionKeySelection. |
|
2036 |
^ self |
|
2037 |
]. |
|
2038 |
super update:something with:aParameter from:changedObject |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2039 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2040 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2041 |
!AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'initialization & release'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2042 |
|
4244 | 2043 |
closeDownViews |
2044 |
"This is a hook method generated by the Browser. |
|
2045 |
It will be invoked when your app/dialog-window is really closed. |
|
2046 |
See also #closeDownViews, which is invoked before and may suppress the close |
|
2047 |
or ask the user for confirmation." |
|
2048 |
||
2049 |
"/ change the code below as required ... |
|
2050 |
"/ This should cleanup any leftover resources |
|
2051 |
"/ (for example, temporary files) |
|
2052 |
"/ super closeRequest will initiate the closeDown |
|
2053 |
||
2054 |
"/ add your code here |
|
2055 |
||
2056 |
"/ do not remove the one below ... |
|
2057 |
^ super closeDownViews |
|
2058 |
! |
|
2059 |
||
2060 |
closeRequest |
|
2061 |
||
2062 |
self saveRequest ifFalse:[ |
|
2063 |
^ self |
|
2064 |
]. |
|
2065 |
||
2066 |
^ super closeRequest. |
|
2067 |
! |
|
2068 |
||
2069 |
initialize |
|
2070 |
||
2071 |
resources := self class owningClass classResources. |
|
2072 |
||
2073 |
mappings := Screen current keyboardMap. |
|
2074 |
||
2075 |
rawKeyList := (mappings keys asArray collect:[:key | key asString]) sort. |
|
2076 |
functionKeyList := (mappings values asSet asArray collect:[:key | key asString]) sort. |
|
2077 |
||
2078 |
self labelTextHolder value:(resources at:'KEY_MSG2' default:'keyboard mapping:') withCRs. |
|
2079 |
super initialize |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2080 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2081 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2082 |
!AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'queries'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2083 |
|
4244 | 2084 |
hasUnsavedChanges |
2085 |
||
2086 |
^ false |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2087 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2088 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2089 |
!AbstractLauncherApplication::LanguageSettingsAppl class methodsFor:'interface specs'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2090 |
|
4244 | 2091 |
windowSpec |
2092 |
"This resource specification was automatically generated |
|
2093 |
by the UIPainter of ST/X." |
|
2094 |
||
2095 |
"Do not manually edit this!! If it is corrupted, |
|
2096 |
the UIPainter may not be able to read the specification." |
|
2097 |
||
2098 |
" |
|
2099 |
UIPainter new openOnClass:AbstractLauncherApplication::LanguageSettingsAppl andSelector:#windowSpec |
|
2100 |
AbstractLauncherApplication::LanguageSettingsAppl new openInterface:#windowSpec |
|
2101 |
AbstractLauncherApplication::LanguageSettingsAppl open |
|
2102 |
" |
|
2103 |
||
2104 |
<resource: #canvas> |
|
2105 |
||
2106 |
^ |
|
2107 |
#(#FullSpec |
|
2108 |
#name: #windowSpec |
|
2109 |
#window: |
|
2110 |
#(#WindowSpec |
|
2111 |
#label: 'Language Settings' |
|
2112 |
#name: 'Language Settings' |
|
2113 |
#min: #(#Point 10 10) |
|
2114 |
#max: #(#Point 1024 768) |
|
2115 |
#bounds: #(#Rectangle 16 42 491 713) |
|
2116 |
) |
|
2117 |
#component: |
|
2118 |
#(#SpecCollection |
|
2119 |
#collection: #( |
|
2120 |
#(#InputFieldSpec |
|
2121 |
#name: 'EntryField1' |
|
2122 |
#layout: #(#LayoutFrame 0 0.0 105 0 0 1.0 125 0) |
|
2123 |
#model: #languageHolder |
|
2124 |
#acceptOnReturn: true |
|
2125 |
#acceptOnTab: true |
|
2126 |
#acceptOnLostFocus: true |
|
2127 |
#acceptOnPointerLeave: false |
|
2128 |
) |
|
2129 |
#(#SequenceViewSpec |
|
2130 |
#name: 'List1' |
|
2131 |
#layout: #(#LayoutFrame 0 0.0 125 0 0 1.0 -34 1) |
|
2132 |
#model: #languageHolder |
|
2133 |
#hasHorizontalScrollBar: true |
|
2134 |
#hasVerticalScrollBar: true |
|
2135 |
#doubleClickSelector: #doubleClick: |
|
2136 |
#useIndex: false |
|
2137 |
#sequenceList: #languageList |
|
2138 |
) |
|
2139 |
#(#HorizontalPanelViewSpec |
|
2140 |
#name: 'HorizontalPanel1' |
|
2141 |
#layout: #(#LayoutFrame 0 0.0 -34 1 0 1.0 0 1.0) |
|
2142 |
#horizontalLayout: #center |
|
2143 |
#verticalLayout: #center |
|
2144 |
#horizontalSpace: 3 |
|
2145 |
#verticalSpace: 3 |
|
2146 |
#component: |
|
2147 |
#(#SpecCollection |
|
2148 |
#collection: #( |
|
2149 |
#(#ActionButtonSpec |
|
2150 |
#label: 'OK' |
|
2151 |
#name: 'OK' |
|
2152 |
#translateLabel: true |
|
2153 |
#model: #saveSettings |
|
2154 |
#enableChannel: #modifiedChannel |
|
2155 |
#extent: #(#Point 125 22) |
|
2156 |
) |
|
2157 |
#(#ActionButtonSpec |
|
2158 |
#label: 'Cancel' |
|
2159 |
#name: 'Cancel' |
|
2160 |
#translateLabel: true |
|
2161 |
#model: #doCancel |
|
2162 |
#extent: #(#Point 125 22) |
|
2163 |
) |
|
2164 |
#(#ActionButtonSpec |
|
2165 |
#label: 'Help' |
|
2166 |
#name: 'Help' |
|
2167 |
#translateLabel: true |
|
2168 |
#model: #help |
|
2169 |
#extent: #(#Point 125 22) |
|
2170 |
) |
|
2171 |
) |
|
2172 |
||
2173 |
) |
|
2174 |
) |
|
2175 |
#(#LabelSpec |
|
2176 |
#label: 'Notice:' |
|
2177 |
#name: 'Notice' |
|
2178 |
#layout: #(#LayoutFrame 0 0 0 0 0 1.0 105 0) |
|
2179 |
#translateLabel: true |
|
2180 |
#labelChannel: #noticeLabelHolder |
|
2181 |
#adjust: #left |
|
2182 |
) |
|
2183 |
#(#LabelSpec |
|
2184 |
#label: 'Label' |
|
2185 |
#name: 'CurrentLang' |
|
2186 |
#layout: #(#LayoutFrame -150 1 0 0 0 1 20 0) |
|
2187 |
#style: #(#FontDescription #helvetica #bold #roman 12) |
|
2188 |
#translateLabel: true |
|
2189 |
#labelChannel: #currentLanguageChannel |
|
2190 |
#adjust: #left |
|
2191 |
) |
|
2192 |
#(#LabelSpec |
|
2193 |
#label: 'Current Language:' |
|
2194 |
#name: 'Label1' |
|
2195 |
#layout: #(#LayoutFrame 190 0 0 0 -150 1 20 0) |
|
2196 |
#translateLabel: true |
|
2197 |
#labelChannel: #currentLanguageLabel |
|
2198 |
#adjust: #right |
|
2199 |
) |
|
2200 |
) |
|
2201 |
||
2202 |
) |
|
2203 |
) |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2204 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2205 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2206 |
!AbstractLauncherApplication::LanguageSettingsAppl methodsFor:'accessing'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2207 |
|
4244 | 2208 |
languageList |
2209 |
"return the value of the instance variable 'languageList' (automatically generated)" |
|
2210 |
||
2211 |
^ languageList |
|
2212 |
! |
|
2213 |
||
2214 |
requestor |
|
2215 |
"return the value of the instance variable 'requestor' (automatically generated)" |
|
2216 |
||
2217 |
| masterApplication | |
|
2218 |
masterApplication := self masterApplication. |
|
2219 |
masterApplication notNil ifTrue:[ |
|
2220 |
^ masterApplication requestor. |
|
2221 |
]. |
|
2222 |
^ nil |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2223 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2224 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2225 |
!AbstractLauncherApplication::LanguageSettingsAppl methodsFor:'actions'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2226 |
|
4244 | 2227 |
doCancel |
2228 |
||
2229 |
self isPartOfSettinsDialog ifTrue:[ |
|
2230 |
self loadRequest. |
|
2231 |
]. |
|
2232 |
self closeRequest. |
|
2233 |
! |
|
2234 |
||
2235 |
doubleClick:aEntry |
|
2236 |
||
2237 |
self saveSettings. |
|
2238 |
! |
|
2239 |
||
2240 |
evaluateModified |
|
2241 |
||
2242 |
self modifiedChannel value:(self hasUnsavedChanges). |
|
2243 |
! |
|
2244 |
||
2245 |
help |
|
2246 |
||
2247 |
self withWaitCursorDo:[HTMLDocumentView openFullOnHelpFile:'Launcher/languageSetting.html']. |
|
2248 |
! |
|
2249 |
||
2250 |
loadRequest |
|
2251 |
||
2252 |
self languageHolder value:self currentLanguage. |
|
2253 |
self currentLanguageChannel value:self currentLanguage. |
|
2254 |
self modifiedChannel value:false. |
|
2255 |
! |
|
2256 |
||
2257 |
saveRequest |
|
2258 |
| result | |
|
2259 |
||
2260 |
(self hasUnsavedChanges) ifTrue:[ |
|
2261 |
result := self confirmWithCancel:(resources string:'Save changed Language Settings ?'). |
|
2262 |
result isNil ifTrue:[ ^ false]. |
|
2263 |
result ifTrue:[ |
|
2264 |
self saveSettings. |
|
2265 |
] |
|
2266 |
]. |
|
2267 |
^ true |
|
2268 |
! |
|
2269 |
||
2270 |
saveSettings |
|
2271 |
||
2272 |
|fontPref idx language oldLanguage territory enc |
|
2273 |
answer matchingFonts l screen newLanguage switch| |
|
2274 |
||
2275 |
newLanguage := self languageHolder value. |
|
2276 |
self withWaitCursorDo:[ |
|
2277 |
idx := translatedLanguages indexOf:newLanguage. |
|
2278 |
idx ~~ 0 ifTrue:[ |
|
2279 |
language := listOfLanguages at:idx |
|
2280 |
] ifFalse:[ |
|
2281 |
language := newLanguage |
|
2282 |
]. |
|
2283 |
(language includes:$-) ifTrue:[ |
|
2284 |
l := language asCollectionOfSubstringsSeparatedBy:$-. |
|
2285 |
language := l at:1. |
|
2286 |
territory := l at:2. |
|
2287 |
]. |
|
2288 |
territory isNil ifTrue:[ |
|
2289 |
territory := language copyTo:2 |
|
2290 |
]. |
|
2291 |
||
2292 |
"/ check if the new language needs a differently encoded font; |
|
2293 |
"/ ask user to switch font and allow cancellation. |
|
2294 |
"/ Otherwise, you are left with unreadable menu & button items ... |
|
2295 |
||
2296 |
oldLanguage := Smalltalk language. |
|
2297 |
Smalltalk language:language asSymbol. |
|
2298 |
ResourcePack flushCachedResourcePacks. |
|
2299 |
"/ refetch resources ... |
|
2300 |
resources := AbstractLauncherApplication classResources. |
|
2301 |
fontPref := resources at:'PREFERRED_FONT_ENCODING' default:'iso8859*'. |
|
2302 |
fontPref := fontPref asLowercase. |
|
2303 |
Smalltalk language:oldLanguage. |
|
2304 |
||
2305 |
switch := true. |
|
2306 |
enc := MenuView defaultFont encoding. |
|
2307 |
(fontPref match:enc asLowercase) ifFalse:[ |
|
2308 |
"/ look if there is one at all. |
|
2309 |
screen := Screen current. |
|
2310 |
matchingFonts := screen listOfAvailableFonts select:[:f | fontPref match:f encoding asLowercase]. |
|
2311 |
matchingFonts size == 0 ifTrue:[ |
|
2312 |
"/ flush and try again - just in case, the font path has changed. |
|
2313 |
screen flushListOfAvailableFonts. |
|
2314 |
matchingFonts := screen listOfAvailableFonts select:[:f | fontPref match:f encoding asLowercase]. |
|
2315 |
]. |
|
2316 |
matchingFonts size == 0 ifTrue:[ |
|
2317 |
(Dialog |
|
2318 |
confirm:(resources |
|
2319 |
string:'Your display does not offer any %1-encoded font.\\Change the language anyway ?\ (texts will probably be unreadable then)' |
|
2320 |
with:fontPref) withCRs) |
|
2321 |
ifFalse:[ |
|
2322 |
switch := false |
|
2323 |
] |
|
2324 |
] ifFalse:[ |
|
2325 |
answer := Dialog |
|
2326 |
confirmWithCancel:(resources |
|
2327 |
string:'menu font is not %1-encoded.\\Change it ?' |
|
2328 |
with:fontPref) withCRs |
|
2329 |
labels:(resources |
|
2330 |
array:#('cancel' 'no' 'yes')) |
|
2331 |
default:3. |
|
2332 |
answer isNil ifTrue:[ |
|
2333 |
switch := false |
|
2334 |
] ifFalse:[ |
|
2335 |
answer ifTrue:[ |
|
2336 |
switch := ( self requestor fontBoxForEncoding:fontPref) |
|
2337 |
] |
|
2338 |
]. |
|
2339 |
]. |
|
2340 |
]. |
|
2341 |
||
2342 |
switch ifTrue:[ |
|
2343 |
Transcript showCR:'change language to ' , newLanguage , ' ...'. |
|
2344 |
Smalltalk language:language asSymbol. |
|
2345 |
Smalltalk languageTerritory:territory asSymbol. |
|
2346 |
"/ ResourcePack flushCachedResourcePacks - already done by language-change |
|
2347 |
]. |
|
2348 |
]. |
|
2349 |
switch ifTrue:[ |
|
2350 |
self requestor notNil ifTrue:[ |
|
2351 |
self requestor reopenLauncher. |
|
2352 |
]. |
|
2353 |
DebugView newDebugger. |
|
2354 |
]. |
|
2355 |
self currentLanguageChannel value:self currentLanguage. |
|
2356 |
self modifiedChannel value:false. |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2357 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2358 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2359 |
!AbstractLauncherApplication::LanguageSettingsAppl methodsFor:'aspects'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2360 |
|
4244 | 2361 |
currentLanguageChannel |
2362 |
||
2363 |
currentLanguageChannel isNil ifTrue:[ |
|
2364 |
currentLanguageChannel := self currentLanguage asValue. |
|
2365 |
]. |
|
2366 |
^ currentLanguageChannel. |
|
2367 |
! |
|
2368 |
||
2369 |
currentLanguageLabel |
|
2370 |
||
2371 |
currentLanguageLabel isNil ifTrue:[ |
|
2372 |
currentLanguageLabel := (resources string:'Current Language:') asValue. |
|
2373 |
]. |
|
2374 |
^ currentLanguageLabel. |
|
2375 |
! |
|
2376 |
||
2377 |
languageHolder |
|
2378 |
||
2379 |
languageHolder isNil ifTrue:[ |
|
2380 |
languageHolder := self currentLanguage asValue. |
|
2381 |
languageHolder onChangeSend:#evaluateModified to:self. |
|
2382 |
]. |
|
2383 |
^ languageHolder. |
|
2384 |
! |
|
2385 |
||
2386 |
modifiedChannel |
|
2387 |
||
2388 |
modifiedChannel isNil ifTrue:[ |
|
2389 |
modifiedChannel := false asValue. |
|
2390 |
]. |
|
2391 |
^ modifiedChannel |
|
2392 |
! |
|
2393 |
||
2394 |
noticeLabelHolder |
|
2395 |
||
2396 |
noticeLabelHolder isNil ifTrue:[ |
|
2397 |
noticeLabelHolder := ((resources at:'LANG_MSG' default:'Select a Language') withCRs) asValue. |
|
2398 |
]. |
|
2399 |
^ noticeLabelHolder. |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2400 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2401 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2402 |
!AbstractLauncherApplication::LanguageSettingsAppl methodsFor:'initialization & release'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2403 |
|
4244 | 2404 |
closeDownViews |
2405 |
"This is a hook method generated by the Browser. |
|
2406 |
It will be invoked when your app/dialog-window is really closed. |
|
2407 |
See also #closeDownViews, which is invoked before and may suppress the close |
|
2408 |
or ask the user for confirmation." |
|
2409 |
||
2410 |
"/ change the code below as required ... |
|
2411 |
"/ This should cleanup any leftover resources |
|
2412 |
"/ (for example, temporary files) |
|
2413 |
"/ super closeRequest will initiate the closeDown |
|
2414 |
||
2415 |
"/ add your code here |
|
2416 |
||
2417 |
"/ do not remove the one below ... |
|
2418 |
^ super closeDownViews |
|
2419 |
! |
|
2420 |
||
2421 |
closeRequest |
|
2422 |
||
2423 |
self saveRequest ifFalse:[ |
|
2424 |
^ self |
|
2425 |
]. |
|
2426 |
||
2427 |
^ super closeRequest. |
|
2428 |
! |
|
2429 |
||
2430 |
initialize |
|
2431 |
||
2432 |
|flags| |
|
2433 |
||
2434 |
resources := self class owningClass classResources. |
|
2435 |
listOfLanguages := resources at:'LIST_OF_OFFERED_LANGUAGES' default:#('default'). |
|
2436 |
listOfLanguages := listOfLanguages asOrderedCollection. |
|
2437 |
translatedLanguages := listOfLanguages collect:[:lang | |item| |
|
2438 |
item := resources at:lang. |
|
2439 |
item isString ifTrue:[ |
|
2440 |
item |
|
2441 |
] ifFalse:[ |
|
2442 |
item at:1 |
|
2443 |
] |
|
2444 |
]. |
|
2445 |
flags := listOfLanguages collect:[:lang | |item| |
|
2446 |
item := resources at:lang. |
|
2447 |
item isArray ifTrue:[ |
|
2448 |
item at:2 |
|
2449 |
] ifFalse:[ |
|
2450 |
nil |
|
2451 |
] |
|
2452 |
]. |
|
2453 |
flags := flags collect:[:nm | |img d| nm notNil ifTrue:[ |
|
2454 |
img := Image fromFile:nm. |
|
2455 |
img isNil ifTrue:[ |
|
2456 |
d := Smalltalk getPackageDirectoryForPackage:'stx:goodies'. |
|
2457 |
img := Image fromFile:(d construct:nm). |
|
2458 |
]. |
|
2459 |
] ifFalse:[ |
|
2460 |
nil |
|
2461 |
] |
|
2462 |
]. |
|
2463 |
listOfLanguages := listOfLanguages collect:[:nm | nm copyFrom:'LANG_' size + 1]. |
|
2464 |
languageList := translatedLanguages with:flags collect:[:lang :flag | LabelAndIcon icon:flag string:lang.]. |
|
2465 |
super initialize |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2466 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2467 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2468 |
!AbstractLauncherApplication::LanguageSettingsAppl methodsFor:'queries'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2469 |
|
4244 | 2470 |
currentLanguage |
2471 |
||
2472 |
| lang | |
|
2473 |
||
2474 |
lang := Language ~= LanguageTerritory ifTrue:[ |
|
2475 |
Language , '-' , LanguageTerritory |
|
2476 |
] ifFalse:[ |
|
2477 |
Language |
|
2478 |
]. |
|
2479 |
^ languageList at:(listOfLanguages indexOf:lang) |
|
2480 |
! |
|
2481 |
||
2482 |
hasUnsavedChanges |
|
2483 |
||
2484 |
^ (self languageHolder value) ~= (self currentLanguage) |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2485 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
2486 |
|
2001 | 2487 |
!AbstractLauncherApplication::LauncherDialogs class methodsFor:'dialogs'! |
2488 |
||
4244 | 2489 |
communicationsSettings |
2490 |
"open a dialog on communications settings" |
|
2491 |
||
2492 |
|box check in resources y acceptChannel |
|
2493 |
hasRDoitServer rDoitServerPort |
|
2494 |
rDoitsEnabled rDoitLogging rDoitErrorLogging rDoitErrorDebugging |
|
2495 |
org_rDoitsEnabled org_rDoitLogging org_rDoitErrorLogging org_rDoitErrorDebugging org_rDoitServerPort |
|
2496 |
||
2497 |
hasRemoteBrowsingSupport remoteBrowsingEnabled org_remoteBrowsingEnabled |
|
2498 |
||
2499 |
hasWindowMigrationServer windowMigrationAuthenticate windowMigrationPassword |
|
2500 |
windowMigrationEnabled |
|
2501 |
org_windowMigrationEnabled org_windowMigrationAuthenticate org_windowMigrationPassword |
|
2502 |
||
2503 |
hasHTTPServer httpServerRunning httpServerFileRoot httpServerHomeURL |
|
2504 |
httpServerPort httpServerLogFile hasSwiki swikiEnabled swikiRoot |
|
2505 |
allowEmbedded hasSoap soapEnabled |
|
2506 |
org_httpServerRunning org_httpServerFileRoot org_httpServerHomeURL |
|
2507 |
org_httpServerPort org_swikiRoot org_swikiEnabled org_httpServerLogFile |
|
2508 |
org_allowEmbedded org_soapEnabled |
|
2509 |
||
2510 |
osiACSEPresent osiROSEPresent osiCMISEPresent |
|
2511 |
osiACSEErrorLogging osiACSEConnectionLogging osiACSEDataLogging |
|
2512 |
osiROSEErrorLogging osiROSEResponseLogging osiROSEInvokationLogging |
|
2513 |
osiCMISEErrorLogging osiCMISEMessageLogging |
|
2514 |
| |
|
2515 |
||
2516 |
acceptChannel := false asValue. |
|
2517 |
||
2518 |
resources := self owningClass classResources. |
|
2519 |
||
2520 |
"/ |
|
2521 |
"/ extract relevant remoteBrowsing settings ... |
|
2522 |
"/ |
|
2523 |
remoteBrowsingEnabled := false. |
|
2524 |
(hasRemoteBrowsingSupport := SmalltalkShareServer notNil) ifTrue:[ |
|
2525 |
SmalltalkShareServer isLoaded ifTrue:[ |
|
2526 |
remoteBrowsingEnabled := SmalltalkShareServer serverRunning. |
|
2527 |
]. |
|
2528 |
]. |
|
2529 |
org_remoteBrowsingEnabled := remoteBrowsingEnabled. |
|
2530 |
remoteBrowsingEnabled := remoteBrowsingEnabled asValue. |
|
2531 |
||
2532 |
"/ |
|
2533 |
"/ extract relevant windowMigration settings ... |
|
2534 |
"/ |
|
2535 |
windowMigrationEnabled := windowMigrationAuthenticate := false. |
|
2536 |
(hasWindowMigrationServer := WindowMigrationServer notNil) ifTrue:[ |
|
2537 |
WindowMigrationServer isLoaded ifTrue:[ |
|
2538 |
windowMigrationEnabled := WindowMigrationServer serverRunning. |
|
2539 |
]. |
|
2540 |
windowMigrationPassword := WindowMigrationServer password. |
|
2541 |
windowMigrationAuthenticate := windowMigrationPassword notNil. |
|
2542 |
]. |
|
2543 |
org_windowMigrationEnabled := windowMigrationEnabled. |
|
2544 |
windowMigrationEnabled := windowMigrationEnabled asValue. |
|
2545 |
org_windowMigrationAuthenticate := windowMigrationAuthenticate. |
|
2546 |
windowMigrationAuthenticate := windowMigrationAuthenticate asValue. |
|
2547 |
org_windowMigrationPassword := windowMigrationPassword. |
|
2548 |
windowMigrationPassword := windowMigrationPassword asValue. |
|
2549 |
||
2550 |
"/ |
|
2551 |
"/ extract relevant rdoit settings ... |
|
2552 |
"/ |
|
2553 |
rDoitsEnabled := rDoitLogging := rDoitErrorLogging := false. |
|
2554 |
(hasRDoitServer := RDoItServer notNil) ifTrue:[ |
|
2555 |
RDoItServer isLoaded ifTrue:[ |
|
2556 |
rDoitsEnabled := RDoItServer serverRunning. |
|
2557 |
rDoitLogging := RDoItServer isLogging. |
|
2558 |
rDoitErrorLogging := RDoItServer isErrorLogging. |
|
2559 |
rDoitErrorDebugging := RDoItServer isErrorCatching not. |
|
2560 |
rDoitServerPort := RDoItServer defaultPortNumber. |
|
2561 |
] |
|
2562 |
]. |
|
2563 |
org_rDoitsEnabled := rDoitsEnabled. |
|
2564 |
org_rDoitLogging := rDoitLogging. |
|
2565 |
org_rDoitErrorLogging := rDoitErrorLogging. |
|
2566 |
org_rDoitErrorDebugging := rDoitErrorDebugging. |
|
2567 |
org_rDoitServerPort := rDoitServerPort. |
|
2568 |
||
2569 |
rDoitServerPort := rDoitServerPort asValue. |
|
2570 |
rDoitsEnabled := rDoitsEnabled asValue. |
|
2571 |
rDoitLogging := rDoitLogging asValue. |
|
2572 |
rDoitErrorLogging := rDoitErrorLogging asValue. |
|
2573 |
rDoitErrorDebugging := rDoitErrorDebugging asValue. |
|
2574 |
||
2575 |
"/ |
|
2576 |
"/ extract http-server settings |
|
2577 |
"/ |
|
2578 |
hasHTTPServer := httpServerRunning := false. |
|
2579 |
(hasHTTPServer := HTTPServer notNil) ifTrue:[ |
|
2580 |
HTTPServer isLoaded ifTrue:[ |
|
2581 |
httpServerRunning := HTTPServer isRunning. |
|
2582 |
httpServerFileRoot := HTTPServer fileRoot. |
|
2583 |
httpServerHomeURL := HTTPServer homeURL. |
|
2584 |
httpServerPort := HTTPServer defaultPort. |
|
2585 |
httpServerLogFile := HTTPServer defaultLogFile. |
|
2586 |
]. |
|
2587 |
]. |
|
2588 |
org_httpServerRunning := httpServerRunning. |
|
2589 |
httpServerRunning := httpServerRunning asValue. |
|
2590 |
org_httpServerFileRoot := httpServerFileRoot. |
|
2591 |
httpServerFileRoot := httpServerFileRoot asValue. |
|
2592 |
org_httpServerHomeURL := httpServerHomeURL. |
|
2593 |
httpServerHomeURL := httpServerHomeURL asValue. |
|
2594 |
org_httpServerPort := httpServerPort. |
|
2595 |
httpServerPort := httpServerPort asValue. |
|
2596 |
org_httpServerLogFile := httpServerLogFile. |
|
2597 |
httpServerLogFile := httpServerLogFile asValue. |
|
2598 |
||
2599 |
httpServerRunning |
|
2600 |
onChangeEvaluate:[ |
|
2601 |
httpServerFileRoot value:(HTTPServer fileRoot). |
|
2602 |
httpServerHomeURL value:(HTTPServer homeURL). |
|
2603 |
httpServerPort value:(HTTPServer defaultPort). |
|
2604 |
httpServerLogFile value:(HTTPServer defaultLogFile) |
|
2605 |
]. |
|
2606 |
||
2607 |
hasSwiki := false. |
|
2608 |
swikiEnabled := false. |
|
2609 |
soapEnabled := false. |
|
2610 |
||
2611 |
(hasSwiki := PWS::SwikiAction notNil) ifTrue:[ |
|
2612 |
PWS::SwikiAction isLoaded ifTrue:[ |
|
2613 |
(HTTPServer notNil and:[HTTPServer isLoaded]) ifTrue:[ |
|
2614 |
swikiEnabled := HTTPServer hasMySwikiConfigured. |
|
2615 |
swikiRoot := PWS::SwikiAction serverDirectory. |
|
2616 |
] |
|
2617 |
]. |
|
2618 |
]. |
|
2619 |
(hasSoap := SOAP::SoapHttpModule notNil) ifTrue:[ |
|
2620 |
SOAP::SoapHttpModule isLoaded ifTrue:[ |
|
2621 |
(HTTPServer notNil and:[HTTPServer isLoaded]) ifTrue:[ |
|
2622 |
soapEnabled := HTTPServer hasSoapEnabled. |
|
2623 |
] |
|
2624 |
]. |
|
2625 |
]. |
|
2626 |
||
2627 |
org_swikiRoot := swikiRoot. |
|
2628 |
org_swikiEnabled := swikiEnabled. |
|
2629 |
org_soapEnabled := soapEnabled. |
|
2630 |
swikiRoot := swikiRoot asValue. |
|
2631 |
swikiEnabled := swikiEnabled asValue. |
|
2632 |
soapEnabled := soapEnabled asValue. |
|
2633 |
||
2634 |
swikiEnabled |
|
2635 |
onChangeEvaluate:[ |
|
2636 |
swikiRoot value:(PWS::SwikiAction serverDirectory). |
|
2637 |
]. |
|
2638 |
||
2639 |
allowEmbedded := HTTPServer isLoaded and:[HTTPServer enableEmbeddedSmalltalk]. |
|
2640 |
org_allowEmbedded := allowEmbedded. |
|
2641 |
allowEmbedded := allowEmbedded asValue. |
|
2642 |
||
2643 |
"/ |
|
2644 |
"/ osi settings ... |
|
2645 |
"/ |
|
2646 |
osiACSEPresent := OSI::ACSE notNil and:[OSI::ACSE isLoaded]. |
|
2647 |
osiROSEPresent := OSI::ROSE notNil and:[OSI::ROSE isLoaded]. |
|
2648 |
osiCMISEPresent := OSI::CMISE notNil and:[OSI::CMISE isLoaded]. |
|
2649 |
||
2650 |
osiACSEPresent ifTrue:[ |
|
2651 |
osiACSEErrorLogging := OSI::ACSE errorLogging asValue. |
|
2652 |
osiACSEConnectionLogging := OSI::ACSE connectionLogging asValue. |
|
2653 |
osiACSEDataLogging := OSI::ACSE dataLogging asValue. |
|
2654 |
]. |
|
2655 |
osiROSEPresent ifTrue:[ |
|
2656 |
osiROSEErrorLogging := OSI::ROSE errorLogging asValue. |
|
2657 |
osiROSEInvokationLogging := OSI::ROSE invocationLogging asValue. |
|
2658 |
osiROSEResponseLogging := OSI::ROSE responseLogging asValue. |
|
2659 |
]. |
|
2660 |
osiCMISEPresent ifTrue:[ |
|
2661 |
osiCMISEErrorLogging := OSI::CMISE errorLogging asValue. |
|
2662 |
osiCMISEMessageLogging := OSI::CMISE messageLogging asValue. |
|
2663 |
]. |
|
2664 |
||
2665 |
"/ |
|
2666 |
"/ create a box on those values ... |
|
2667 |
"/ |
|
2668 |
box := DialogBox new. |
|
2669 |
box label:(resources string:'Communication settings'). |
|
2670 |
||
2671 |
box addTextLabel:(resources string:'Remote browsing'). |
|
2672 |
||
2673 |
check := box addCheckBox:(resources string:'Remote browsing enabled') on:remoteBrowsingEnabled. |
|
2674 |
hasRemoteBrowsingSupport ifFalse:[ |
|
2675 |
check disable |
|
2676 |
]. |
|
2677 |
box addHorizontalLine. |
|
2678 |
||
2679 |
box addTextLabel:(resources string:'Window migration'). |
|
2680 |
||
2681 |
check := box addCheckBox:(resources string:'Window migration enabled') on:windowMigrationEnabled. |
|
2682 |
hasWindowMigrationServer ifFalse:[ |
|
2683 |
check disable |
|
2684 |
]. |
|
2685 |
check := box addCheckBox:(resources string:'Password check') on:windowMigrationAuthenticate. |
|
2686 |
check enableChannel:windowMigrationEnabled. |
|
2687 |
hasWindowMigrationServer ifFalse:[ |
|
2688 |
check disable |
|
2689 |
]. |
|
2690 |
box leftIndent:20. |
|
2691 |
in := box |
|
2692 |
addLabelledInputField:(resources string:'Password:') |
|
2693 |
adjust:#right |
|
2694 |
on:nil |
|
2695 |
tabable:true |
|
2696 |
separateAtX:0.3. |
|
2697 |
in passwordCharacter:$*. |
|
2698 |
in model:windowMigrationPassword. |
|
2699 |
in acceptChannel:acceptChannel. |
|
2700 |
in enableChannel:windowMigrationAuthenticate. |
|
2701 |
box leftIndent:0. |
|
2702 |
||
2703 |
box addHorizontalLine. |
|
2704 |
||
2705 |
box addTextLabel:'RDoIt Server'. |
|
2706 |
||
2707 |
check := box addCheckBox:(resources string:'Remote doits enabled') on:rDoitsEnabled. |
|
2708 |
hasRDoitServer ifFalse:[ |
|
2709 |
check disable |
|
2710 |
]. |
|
2711 |
box leftIndent:20. |
|
2712 |
rDoitsEnabled onChangeEvaluate:[ rDoitsEnabled value ifTrue:[ |
|
2713 |
rDoitServerPort value isNil ifTrue:[ |
|
2714 |
rDoitServerPort value:(RDoItServer defaultPortNumber). |
|
2715 |
] |
|
2716 |
] |
|
2717 |
]. |
|
2718 |
||
2719 |
in := box |
|
2720 |
addLabelledInputField:(resources string:'Port:') |
|
2721 |
adjust:#right |
|
2722 |
on:nil |
|
2723 |
tabable:true |
|
2724 |
separateAtX:0.3. |
|
2725 |
in converter:(PrintConverter new initForNumber). |
|
2726 |
in model:rDoitServerPort. |
|
2727 |
in acceptChannel:acceptChannel. |
|
2728 |
in enableChannel:rDoitsEnabled. |
|
2729 |
||
2730 |
y := box yPosition. |
|
2731 |
check := box addCheckBox:(resources string:'Log errors') on:rDoitErrorLogging. |
|
2732 |
check width:0.4. |
|
2733 |
check enableChannel:rDoitsEnabled. |
|
2734 |
hasRDoitServer ifFalse:[ |
|
2735 |
check disable |
|
2736 |
]. |
|
2737 |
box yPosition:y. |
|
2738 |
check := box addCheckBox:(resources string:'Log requests') on:rDoitLogging. |
|
2739 |
check left:0.4; width:0.4. |
|
2740 |
check enableChannel:rDoitsEnabled. |
|
2741 |
hasRDoitServer ifFalse:[ |
|
2742 |
check disable |
|
2743 |
]. |
|
2744 |
check := box addCheckBox:(resources string:'Debug errors') on:rDoitErrorDebugging. |
|
2745 |
check width:0.4. |
|
2746 |
check enableChannel:rDoitsEnabled. |
|
2747 |
hasRDoitServer ifFalse:[ |
|
2748 |
check disable |
|
2749 |
]. |
|
2750 |
box leftIndent:0. |
|
2751 |
||
2752 |
box addHorizontalLine. |
|
2753 |
||
2754 |
box addTextLabel:'HTTP Server'. |
|
2755 |
||
2756 |
check := box addCheckBox:(resources string:'Serving HTTP Requests') on:httpServerRunning. |
|
2757 |
hasHTTPServer ifFalse:[ |
|
2758 |
check disable |
|
2759 |
]. |
|
2760 |
box leftIndent:20. |
|
2761 |
in := box |
|
2762 |
addLabelledInputField:(resources string:'Port:') |
|
2763 |
adjust:#right |
|
2764 |
on:nil |
|
2765 |
tabable:true |
|
2766 |
separateAtX:0.3. |
|
2767 |
in converter:(PrintConverter new initForNumber). |
|
2768 |
in model:httpServerPort. |
|
2769 |
in acceptChannel:acceptChannel. |
|
2770 |
in enableChannel:httpServerRunning. |
|
2771 |
||
2772 |
in := box |
|
2773 |
addLabelledInputField:(resources string:'Log File:') |
|
2774 |
adjust:#right |
|
2775 |
on:httpServerLogFile |
|
2776 |
tabable:true |
|
2777 |
separateAtX:0.3. |
|
2778 |
in acceptChannel:acceptChannel. |
|
2779 |
in enableChannel:httpServerRunning. |
|
2780 |
||
2781 |
in := box |
|
2782 |
addLabelledInputField:(resources string:'File Root:') |
|
2783 |
adjust:#right |
|
2784 |
on:httpServerFileRoot |
|
2785 |
tabable:true |
|
2786 |
separateAtX:0.3. |
|
2787 |
in acceptChannel:acceptChannel. |
|
2788 |
in enableChannel:httpServerRunning. |
|
2789 |
||
2790 |
in := box |
|
2791 |
addLabelledInputField:(resources string:'Home URL:') |
|
2792 |
adjust:#right |
|
2793 |
on:httpServerHomeURL |
|
2794 |
tabable:true |
|
2795 |
separateAtX:0.3. |
|
2796 |
in acceptChannel:acceptChannel. |
|
2797 |
in enableChannel:httpServerRunning. |
|
2798 |
||
2799 |
check := box addCheckBox:(resources string:'Swiki enabled') on:swikiEnabled. |
|
2800 |
hasHTTPServer ifFalse:[ |
|
2801 |
check disable |
|
2802 |
]. |
|
2803 |
check enableChannel:httpServerRunning. |
|
2804 |
||
2805 |
"/ box leftIndent:40. |
|
2806 |
||
2807 |
in := box |
|
2808 |
addLabelledInputField:(resources string:'SwikiRoot:') |
|
2809 |
adjust:#right |
|
2810 |
on:swikiRoot |
|
2811 |
tabable:true |
|
2812 |
separateAtX:0.3. |
|
2813 |
in acceptChannel:acceptChannel. |
|
2814 |
in enableChannel:(BlockValue forLogical:httpServerRunning and:swikiEnabled). |
|
2815 |
||
2816 |
check := box addCheckBox:(resources string:'Allow embedded ST applications') on:allowEmbedded. |
|
2817 |
hasHTTPServer ifFalse:[ |
|
2818 |
check disable |
|
2819 |
]. |
|
2820 |
check enableChannel:httpServerRunning. |
|
2821 |
||
2822 |
check := box addCheckBox:(resources string:'Soap enabled') on:soapEnabled. |
|
2823 |
hasHTTPServer ifFalse:[ |
|
2824 |
check disable |
|
2825 |
]. |
|
2826 |
check enableChannel:httpServerRunning. |
|
2827 |
||
2828 |
box leftIndent:0. |
|
2829 |
box addHorizontalLine. |
|
2830 |
||
2831 |
box addTextLabel:(resources string:'OSI Protocols (addOn package)'). |
|
2832 |
||
2833 |
y := box yPosition. |
|
2834 |
check := box addCheckBox:(resources string:'Log %1 Errors' with:'ACSE') on:osiACSEErrorLogging. |
|
2835 |
check width:0.33. |
|
2836 |
osiACSEPresent ifFalse:[ |
|
2837 |
check disable |
|
2838 |
]. |
|
2839 |
||
2840 |
box yPosition:y. |
|
2841 |
check := box addCheckBox:(resources string:'Connections') on:osiACSEConnectionLogging. |
|
2842 |
osiACSEPresent ifFalse:[ |
|
2843 |
check disable |
|
2844 |
]. |
|
2845 |
check left:0.33; width:0.33. |
|
2846 |
||
2847 |
box yPosition:y. |
|
2848 |
check := box addCheckBox:(resources string:'Data Xfer') on:osiACSEDataLogging. |
|
2849 |
osiACSEPresent ifFalse:[ |
|
2850 |
check disable |
|
2851 |
]. |
|
2852 |
check left:0.66; width:0.34. |
|
2853 |
||
2854 |
||
2855 |
box addVerticalSpace. |
|
2856 |
||
2857 |
y := box yPosition. |
|
2858 |
check := box addCheckBox:(resources string:'Log %1 Errors' with:'ROSE') on:osiROSEErrorLogging. |
|
2859 |
osiROSEPresent ifFalse:[ |
|
2860 |
check disable |
|
2861 |
]. |
|
2862 |
check width:0.33. |
|
2863 |
||
2864 |
box yPosition:y. |
|
2865 |
check := box addCheckBox:(resources string:'Invoactions') on:osiROSEInvokationLogging. |
|
2866 |
osiROSEPresent ifFalse:[ |
|
2867 |
check disable |
|
2868 |
]. |
|
2869 |
check left:0.33; width:0.33. |
|
2870 |
||
2871 |
box yPosition:y. |
|
2872 |
check := box addCheckBox:(resources string:'Responses') on:osiROSEResponseLogging. |
|
2873 |
osiROSEPresent ifFalse:[ |
|
2874 |
check disable |
|
2875 |
]. |
|
2876 |
check left:0.66; width:0.34. |
|
2877 |
||
2878 |
box addVerticalSpace. |
|
2879 |
||
2880 |
y := box yPosition. |
|
2881 |
check := box addCheckBox:(resources string:'Log %1 Errors' with:'CMISE') on:osiCMISEErrorLogging. |
|
2882 |
osiCMISEPresent ifFalse:[ |
|
2883 |
check disable |
|
2884 |
]. |
|
2885 |
check width:0.33. |
|
2886 |
||
2887 |
box yPosition:y. |
|
2888 |
check := box addCheckBox:(resources string:'Messages') on:osiCMISEMessageLogging. |
|
2889 |
osiCMISEPresent ifFalse:[ |
|
2890 |
check disable |
|
2891 |
]. |
|
2892 |
check left:0.33; width:0.33. |
|
2893 |
||
2894 |
||
2895 |
box addHorizontalLine. |
|
2896 |
box |
|
2897 |
addHelpButtonFor:'Launcher/communicationsSettings.html'; |
|
2898 |
addAbortAndOkButtons. |
|
2899 |
||
2900 |
"/ |
|
2901 |
"/ show the box ... |
|
2902 |
"/ |
|
2903 |
box open. |
|
2904 |
||
2905 |
"/ |
|
2906 |
"/ update system settings |
|
2907 |
"/ |
|
2908 |
box accepted ifTrue:[ |
|
2909 |
acceptChannel value:false; value:true. |
|
2910 |
||
2911 |
hasRemoteBrowsingSupport ifTrue:[ |
|
2912 |
remoteBrowsingEnabled := remoteBrowsingEnabled value. |
|
2913 |
(remoteBrowsingEnabled ~~ org_remoteBrowsingEnabled) ifTrue:[ |
|
2914 |
remoteBrowsingEnabled ~~ SmalltalkShareServer serverRunning ifTrue:[ |
|
2915 |
remoteBrowsingEnabled ifFalse:[ |
|
2916 |
SmalltalkShareServer killAll |
|
2917 |
] ifTrue:[ |
|
2918 |
SmalltalkShareServer start. |
|
2919 |
"/ must wait a bit; give it a chance to |
|
2920 |
"/ really start (before checking) |
|
2921 |
Delay waitForSeconds:0.5. |
|
2922 |
SmalltalkShareServer serverRunning ifFalse:[ |
|
2923 |
self warn:'SmalltalkShareServer startup failed (see stderr).' |
|
2924 |
] |
|
2925 |
] |
|
2926 |
]. |
|
2927 |
] |
|
2928 |
]. |
|
2929 |
||
2930 |
hasWindowMigrationServer ifTrue:[ |
|
2931 |
windowMigrationEnabled := windowMigrationEnabled value. |
|
2932 |
windowMigrationAuthenticate := windowMigrationAuthenticate value. |
|
2933 |
windowMigrationPassword := windowMigrationPassword value. |
|
2934 |
(windowMigrationEnabled ~~ org_windowMigrationEnabled |
|
2935 |
or:[windowMigrationAuthenticate ~~ org_windowMigrationAuthenticate |
|
2936 |
or:[windowMigrationPassword ~~ org_windowMigrationPassword]]) ifTrue:[ |
|
2937 |
windowMigrationAuthenticate ~~ org_windowMigrationAuthenticate ifTrue:[ |
|
2938 |
windowMigrationAuthenticate ifFalse:[ |
|
2939 |
WindowMigrationServer password:nil |
|
2940 |
] ifTrue:[ |
|
2941 |
WindowMigrationServer password:windowMigrationPassword |
|
2942 |
]. |
|
2943 |
]. |
|
2944 |
windowMigrationEnabled ~~ WindowMigrationServer serverRunning ifTrue:[ |
|
2945 |
windowMigrationEnabled ifFalse:[ |
|
2946 |
WindowMigrationServer stop |
|
2947 |
] ifTrue:[ |
|
2948 |
WindowMigrationServer start. |
|
2949 |
"/ must wait a bit; give it a chance to |
|
2950 |
"/ really start (before checking) |
|
2951 |
Delay waitForSeconds:0.5. |
|
2952 |
WindowMigrationServer serverRunning ifFalse:[ |
|
2953 |
self warn:'WindowMigrationServer startup failed (see stderr).' |
|
2954 |
] |
|
2955 |
] |
|
2956 |
]. |
|
2957 |
] |
|
2958 |
]. |
|
2959 |
||
2960 |
hasRDoitServer ifTrue:[ |
|
2961 |
(rDoitLogging value ~~ org_rDoitLogging |
|
2962 |
or:[rDoitErrorDebugging value ~~ org_rDoitErrorDebugging |
|
2963 |
or:[rDoitErrorLogging value ~~ org_rDoitErrorLogging |
|
2964 |
or:[rDoitsEnabled value ~~ org_rDoitsEnabled |
|
2965 |
or:[rDoitServerPort value ~~ org_rDoitServerPort]]]]) ifTrue:[ |
|
2966 |
RDoItServer autoload. |
|
2967 |
RDoItServer defaultPortNumber:rDoitServerPort value. |
|
2968 |
RDoItServer logging:(rDoitLogging value). |
|
2969 |
RDoItServer errorLogging:(rDoitErrorLogging value). |
|
2970 |
RDoItServer errorCatching:(rDoitErrorDebugging value not). |
|
2971 |
rDoitsEnabled := rDoitsEnabled value. |
|
2972 |
rDoitsEnabled ~~ RDoItServer serverRunning ifTrue:[ |
|
2973 |
rDoitsEnabled ifFalse:[ |
|
2974 |
RDoItServer stop |
|
2975 |
] ifTrue:[ |
|
2976 |
RDoItServer start. |
|
2977 |
"/ must wait a bit; give it a chance to |
|
2978 |
"/ really start (before checking) |
|
2979 |
Delay waitForSeconds:0.5. |
|
2980 |
RDoItServer serverRunning ifFalse:[ |
|
2981 |
self warn:'RDoit startup failed (see stderr).' |
|
2982 |
] |
|
2983 |
] |
|
2984 |
]. |
|
2985 |
]. |
|
2986 |
]. |
|
2987 |
||
2988 |
(hasHTTPServer and:[HTTPServer isLoaded]) ifTrue:[ |
|
2989 |
httpServerPort := httpServerPort value. |
|
2990 |
org_httpServerPort ~= httpServerPort ifTrue:[ |
|
2991 |
HTTPServer defaultPort:httpServerPort. |
|
2992 |
]. |
|
2993 |
||
2994 |
httpServerFileRoot := httpServerFileRoot value. |
|
2995 |
httpServerFileRoot size == 0 ifTrue:[ |
|
2996 |
httpServerFileRoot := nil |
|
2997 |
]. |
|
2998 |
org_httpServerFileRoot ~= httpServerFileRoot ifTrue:[ |
|
2999 |
HTTPServer fileRoot:httpServerFileRoot. |
|
3000 |
]. |
|
3001 |
||
3002 |
httpServerLogFile := httpServerLogFile value. |
|
3003 |
httpServerLogFile size == 0 ifTrue:[ |
|
3004 |
httpServerLogFile := nil |
|
3005 |
]. |
|
3006 |
org_httpServerLogFile ~= httpServerLogFile ifTrue:[ |
|
3007 |
HTTPServer defaultLogFile:httpServerLogFile. |
|
3008 |
]. |
|
3009 |
||
3010 |
httpServerHomeURL := httpServerHomeURL value. |
|
3011 |
httpServerHomeURL size == 0 ifTrue:[ |
|
3012 |
httpServerHomeURL := nil |
|
3013 |
]. |
|
3014 |
org_httpServerHomeURL ~= httpServerHomeURL ifTrue:[ |
|
3015 |
HTTPServer homeURL:httpServerHomeURL. |
|
3016 |
]. |
|
3017 |
||
3018 |
httpServerRunning value ~~ org_httpServerRunning ifTrue:[ |
|
3019 |
httpServerRunning value ifTrue:[ |
|
3020 |
HTTPServer startServer |
|
3021 |
] ifFalse:[ |
|
3022 |
HTTPServer stopServer |
|
3023 |
] |
|
3024 |
]. |
|
3025 |
]. |
|
3026 |
||
3027 |
hasSwiki ifTrue:[ |
|
3028 |
swikiRoot := swikiRoot value. |
|
3029 |
swikiRoot size == 0 ifTrue:[ |
|
3030 |
swikiRoot := nil |
|
3031 |
]. |
|
3032 |
org_swikiRoot ~= swikiRoot ifTrue:[ |
|
3033 |
PWS::ServerAction serverDirectory:swikiRoot. |
|
3034 |
]. |
|
3035 |
||
3036 |
swikiEnabled value ~~ org_swikiEnabled ifTrue:[ |
|
3037 |
swikiEnabled value ifTrue:[ |
|
3038 |
HTTPServer setupMySwiki |
|
3039 |
] ifFalse:[ |
|
3040 |
HTTPServer disableMySwiki |
|
3041 |
] |
|
3042 |
]. |
|
3043 |
allowEmbedded value ~~ org_allowEmbedded ifTrue:[ |
|
3044 |
HTTPServer enableEmbeddedSmalltalk:allowEmbedded value |
|
3045 |
]. |
|
3046 |
]. |
|
3047 |
hasSoap ifTrue:[ |
|
3048 |
soapEnabled value ~~ org_soapEnabled ifTrue:[ |
|
3049 |
soapEnabled value ifTrue:[ |
|
3050 |
HTTPServer setupSoap |
|
3051 |
] ifFalse:[ |
|
3052 |
HTTPServer disableSoap |
|
3053 |
] |
|
3054 |
]. |
|
3055 |
]. |
|
3056 |
||
3057 |
osiACSEPresent ifTrue:[ |
|
3058 |
OSI::ACSE errorLogging:osiACSEErrorLogging value. |
|
3059 |
OSI::ACSE connectionLogging:osiACSEConnectionLogging value. |
|
3060 |
OSI::ACSE dataLogging:osiACSEDataLogging value. |
|
3061 |
]. |
|
3062 |
osiROSEPresent ifTrue:[ |
|
3063 |
OSI::ROSE errorLogging:osiROSEErrorLogging value. |
|
3064 |
OSI::ROSE invocationLogging:osiROSEInvokationLogging value. |
|
3065 |
OSI::ROSE responseLogging:osiROSEResponseLogging value. |
|
3066 |
]. |
|
3067 |
osiCMISEPresent ifTrue:[ |
|
3068 |
OSI::CMISE errorLogging:osiCMISEErrorLogging value. |
|
3069 |
OSI::CMISE messageLogging:osiCMISEMessageLogging value. |
|
3070 |
]. |
|
3071 |
]. |
|
3072 |
box destroy |
|
3073 |
||
3074 |
"Modified: / 28.6.1999 / 15:44:35 / stefan" |
|
3075 |
"Modified: / 20.1.2000 / 19:14:18 / cg" |
|
3076 |
! |
|
3077 |
||
3078 |
compilerSettings |
|
3079 |
"open a dialog on compiler related settings" |
|
3080 |
||
3081 |
|box warnings warnSTX warnUnderscore warnDollar warnOldStyle warnUnusedVars |
|
3082 |
allowDollar allowUnderscore allowSqueakExtensions allowQualifiedNames |
|
3083 |
allowDolphinExtensions allowOldStyleAssignment allowReservedWordsAsSelectors |
|
3084 |
immutableArrays |
|
3085 |
warnSTXBox warnUnderscoreBox warnOldStyleBox warnCommonMistakes warnCommonMistakesBox |
|
3086 |
warnCompatibility warnCompatibilityBox warnDollarBox warnUnusedVarsBox |
|
3087 |
stcCompilation compilationList stcCompilationOptions |
|
3088 |
historyLines fullHistoryUpdate |
|
3089 |
catchMethodRedefs catchClassRedefs keepSourceOptions keepSource |
|
3090 |
constantFoldingOptions constantFolding justInTimeCompilation |
|
3091 |
warnEnabler check component oldIndent supportsJustInTimeCompilation y |
|
3092 |
y2 fullDebugSupport yMax |
|
3093 |
compileLazy loadBinaries canLoadBinaries strings idx thisIsADemoVersion |
|
3094 |
resources stcSetupButt| |
|
3095 |
||
3096 |
resources := self owningClass classResources. |
|
3097 |
||
3098 |
canLoadBinaries := ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles]. |
|
3099 |
loadBinaries := Smalltalk loadBinaries asValue. |
|
3100 |
compileLazy := Autoload compileLazy asValue. |
|
3101 |
||
3102 |
warnings := Compiler warnings asValue. |
|
3103 |
||
3104 |
warnSTX := Compiler warnSTXSpecials asValue. |
|
3105 |
warnUnderscore := Compiler warnUnderscoreInIdentifier asValue. |
|
3106 |
warnDollar := Compiler warnDollarInIdentifier asValue. |
|
3107 |
warnOldStyle := Compiler warnOldStyleAssignment asValue. |
|
3108 |
warnCommonMistakes := Compiler warnCommonMistakes asValue. |
|
3109 |
warnCompatibility := Compiler warnPossibleIncompatibilities asValue. |
|
3110 |
warnUnusedVars := Compiler warnUnusedVars asValue. |
|
3111 |
allowUnderscore := Compiler allowUnderscoreInIdentifier asValue. |
|
3112 |
allowDollar := Compiler allowDollarInIdentifier asValue. |
|
3113 |
allowSqueakExtensions := Compiler allowSqueakExtensions asValue. |
|
3114 |
allowDolphinExtensions := Compiler allowDolphinExtensions asValue. |
|
3115 |
allowQualifiedNames := Compiler allowQualifiedNames asValue. |
|
3116 |
allowOldStyleAssignment := Compiler allowOldStyleAssignment asValue. |
|
3117 |
allowReservedWordsAsSelectors := Compiler allowReservedWordsAsSelectors asValue. |
|
3118 |
immutableArrays := Compiler arraysAreImmutable asValue. |
|
3119 |
||
3120 |
constantFoldingOptions := #( nil #level1 #level2 #full ). |
|
3121 |
constantFolding := SelectionInList new list:(resources array:#('disabled' 'level1 (always safe)' 'level2 (usually safe)' 'full')). |
|
3122 |
constantFolding selectionIndex:3. |
|
3123 |
||
3124 |
thisIsADemoVersion := (Smalltalk releaseIdentification = 'ST/X_free_demo_vsn'). |
|
3125 |
thisIsADemoVersion ifTrue:[ |
|
3126 |
stcCompilationOptions := #( never). |
|
3127 |
strings := #('never'). |
|
3128 |
idx := 1. |
|
3129 |
] ifFalse:[ |
|
3130 |
stcCompilationOptions := #( always default never). |
|
3131 |
strings := #('always' 'primitive code only' 'never'). |
|
3132 |
idx := 2. |
|
3133 |
]. |
|
3134 |
||
3135 |
stcCompilation := SelectionInList new list:(resources array:strings). |
|
3136 |
stcCompilation selectionIndex:idx. |
|
3137 |
||
3138 |
(supportsJustInTimeCompilation := ObjectMemory supportsJustInTimeCompilation) |
|
3139 |
ifTrue:[ |
|
3140 |
justInTimeCompilation := ObjectMemory justInTimeCompilation. |
|
3141 |
fullDebugSupport := ObjectMemory fullSingleStepSupport. |
|
3142 |
] ifFalse:[ |
|
3143 |
justInTimeCompilation := false. |
|
3144 |
fullDebugSupport := (Compiler lineNumberInfo == #full) asValue. |
|
3145 |
]. |
|
3146 |
justInTimeCompilation := justInTimeCompilation asValue. |
|
3147 |
fullDebugSupport := fullDebugSupport asValue. |
|
3148 |
||
3149 |
catchMethodRedefs := Class catchMethodRedefinitions asValue. |
|
3150 |
catchClassRedefs := Class catchClassRedefinitions asValue. |
|
3151 |
historyLines := HistoryManager notNil and:[HistoryManager isLoaded and:[HistoryManager isActive]]. |
|
3152 |
historyLines ifFalse:[ |
|
3153 |
fullHistoryUpdate := false asValue |
|
3154 |
] ifTrue:[ |
|
3155 |
fullHistoryUpdate := HistoryManager fullHistoryUpdate asValue. |
|
3156 |
]. |
|
3157 |
historyLines := historyLines asValue. |
|
3158 |
||
3159 |
keepSourceOptions := #( keep reference absReference sourceReference discard ). |
|
3160 |
keepSource := SelectionInList new |
|
3161 |
list:(resources array:#('Keep as String' 'Reference to Filename' 'Reference to Full Path' 'Append and Ref in `st.src''' 'Discard' )). |
|
3162 |
keepSource selectionIndex:1. |
|
3163 |
||
3164 |
warnEnabler := [ |
|
3165 |
warnings value ifTrue:[ |
|
3166 |
warnSTXBox enable. |
|
3167 |
warnOldStyleBox enable. |
|
3168 |
warnCommonMistakesBox enable. |
|
3169 |
warnCompatibilityBox enable. |
|
3170 |
warnUnusedVarsBox enable. |
|
3171 |
allowUnderscore value ifTrue:[ |
|
3172 |
warnUnderscoreBox enable. |
|
3173 |
] ifFalse:[ |
|
3174 |
warnUnderscoreBox disable. |
|
3175 |
]. |
|
3176 |
allowDollar value ifTrue:[ |
|
3177 |
warnDollarBox enable. |
|
3178 |
] ifFalse:[ |
|
3179 |
warnDollarBox disable. |
|
3180 |
]. |
|
3181 |
] ifFalse:[ |
|
3182 |
warnSTXBox disable. |
|
3183 |
warnUnderscoreBox disable. |
|
3184 |
warnDollarBox disable. |
|
3185 |
warnOldStyleBox disable. |
|
3186 |
warnCommonMistakesBox disable. |
|
3187 |
warnCompatibilityBox disable. |
|
3188 |
warnUnusedVarsBox disable. |
|
3189 |
]]. |
|
3190 |
||
3191 |
warnings onChangeEvaluate:warnEnabler. |
|
3192 |
allowUnderscore onChangeEvaluate:warnEnabler. |
|
3193 |
allowDollar onChangeEvaluate:warnEnabler. |
|
3194 |
"/ allowSqueakExtensions onChangeEvaluate:warnEnabler. |
|
3195 |
"/ allowQualifiedNames onChangeEvaluate:warnEnabler. |
|
3196 |
||
3197 |
box := DialogBox new. |
|
3198 |
box label:(resources string:'Compiler Settings'). |
|
3199 |
||
3200 |
y := box yPosition. |
|
3201 |
check := box addCheckBox:(resources string:'Catch Method Redefinitions') on:catchMethodRedefs. |
|
3202 |
check width:0.5. |
|
3203 |
||
3204 |
box yPosition:y. |
|
3205 |
check := box addCheckBox:(resources string:'Catch Class Redefinitions') on:catchClassRedefs. |
|
3206 |
check left:0.5; width:0.5. |
|
3207 |
||
3208 |
y := box yPosition. |
|
3209 |
check := box addCheckBox:(resources string:'Keep History Line in Methods') on:historyLines. |
|
3210 |
check width:0.5. |
|
3211 |
HistoryManager isNil ifTrue:[check disable]. |
|
3212 |
box yPosition:y. |
|
3213 |
check := box addCheckBox:(resources string:'Keep Full Class History') on:fullHistoryUpdate. |
|
3214 |
check left:0.5; width:0.5. |
|
3215 |
HistoryManager isNil ifTrue:[check disable] ifFalse:[check enableChannel:historyLines]. |
|
3216 |
||
3217 |
box addPopUpList:(resources string:'FileIn Source Mode:') on:keepSource. |
|
3218 |
keepSource selectionIndex:( keepSourceOptions indexOf:(ClassCategoryReader sourceMode) ifAbsent:1). |
|
3219 |
||
3220 |
box addHorizontalLine. |
|
3221 |
||
3222 |
box addCheckBox:(resources string:'Lazy Compilation when Autoloading') on:compileLazy. |
|
3223 |
check := box addCheckBox:(resources string:'If Present, Load Binary Objects when Autoloading') on:loadBinaries. |
|
3224 |
canLoadBinaries ifFalse:[ |
|
3225 |
loadBinaries value:false. |
|
3226 |
check disable |
|
3227 |
]. |
|
3228 |
supportsJustInTimeCompilation ifTrue:[ |
|
3229 |
component := box |
|
3230 |
addCheckBox:(resources string:'Just in Time Compilation to Machine Code') |
|
3231 |
on:justInTimeCompilation. |
|
3232 |
]. |
|
3233 |
||
3234 |
box addHorizontalLine. |
|
3235 |
||
3236 |
ObjectFileLoader notNil ifTrue:[ |
|
3237 |
compilationList := box addPopUpList:(resources string:'Stc Compilation to Machine Code') on:stcCompilation. |
|
3238 |
||
3239 |
thisIsADemoVersion ifFalse:[ |
|
3240 |
stcCompilation selectionIndex:( stcCompilationOptions indexOf:(Compiler stcCompilation) ifAbsent:2). |
|
3241 |
||
3242 |
stcSetupButt := box addComponent:(Button label:(resources string:'Stc Compilation Parameters...') |
|
3243 |
action:[|manager| |
|
3244 |
||
3245 |
self stcCompilerSettings. |
|
3246 |
]). |
|
3247 |
]. |
|
3248 |
||
3249 |
box addHorizontalLine. |
|
3250 |
||
3251 |
"/ if there is no compiler around, |
|
3252 |
"/ change to compile nothing, and disable the checkBoxes |
|
3253 |
Compiler canCreateMachineCode ifFalse:[ |
|
3254 |
stcCompilation selectionIndex:(3 min:stcCompilationOptions size). |
|
3255 |
compilationList disable. |
|
3256 |
]. |
|
3257 |
]. |
|
3258 |
||
3259 |
y := box yPosition. |
|
3260 |
||
3261 |
component := box addCheckBox:(resources string:'Allow Underscore in Identifiers') on:allowUnderscore. |
|
3262 |
component width:0.4. |
|
3263 |
||
3264 |
component := box addCheckBox:(resources string:'Allow Dollar in Identifiers') on:allowDollar. |
|
3265 |
component width:0.4. |
|
3266 |
||
3267 |
component := box addCheckBox:(resources string:'Allow VW3 QualifiedNames') on:allowQualifiedNames. |
|
3268 |
component width:0.4. |
|
3269 |
||
3270 |
component := box addCheckBox:(resources string:'Allow Squeak Extensions') on:allowSqueakExtensions. |
|
3271 |
component width:0.4. |
|
3272 |
||
3273 |
component := box addCheckBox:(resources string:'Allow Dolphin Extensions') on:allowDolphinExtensions. |
|
3274 |
component width:0.4. |
|
3275 |
||
3276 |
y2 := box yPosition. |
|
3277 |
||
3278 |
box yPosition:y. |
|
3279 |
box leftIndent:0. |
|
3280 |
||
3281 |
component :=box addPopUpList:(resources string:'Constant Folding:') on:constantFolding. |
|
3282 |
component superView left:0.5; width:0.5. |
|
3283 |
constantFolding selectionIndex:( constantFoldingOptions indexOf:(Compiler foldConstants) ifAbsent:1). |
|
3284 |
||
3285 |
component := box addCheckBox:(resources string:'Allow OldStyle Assignment (_)') on:allowOldStyleAssignment. |
|
3286 |
component left:0.5; width:0.4. |
|
3287 |
||
3288 |
component := box addCheckBox:(resources string:'Allow Reserved Words as Selector (self)') on:allowReservedWordsAsSelectors. |
|
3289 |
component left:0.5; width:0.4. |
|
3290 |
||
3291 |
component := box addCheckBox:(resources string:'Full Debug Info') on:fullDebugSupport. |
|
3292 |
component left:0.5; width:0.4. |
|
3293 |
||
3294 |
component := box addCheckBox:(resources string:'Literal Arrays are Immutable') on:immutableArrays. |
|
3295 |
component left:0.5; width:0.4. |
|
3296 |
||
3297 |
box yPosition:(box yPosition max:y2). |
|
3298 |
||
3299 |
||
3300 |
box addHorizontalLine. |
|
3301 |
||
3302 |
box addCheckBox:(resources string:'Warnings') on:warnings. |
|
3303 |
"/ box addVerticalSpace. |
|
3304 |
oldIndent := box leftIndent. |
|
3305 |
box leftIndent:30. |
|
3306 |
||
3307 |
y := box yPosition. |
|
3308 |
||
3309 |
warnSTXBox := box addCheckBox:(resources string:'ST/X Extensions') on:warnSTX. |
|
3310 |
warnSTXBox width:0.4. |
|
3311 |
||
3312 |
warnUnderscoreBox := box addCheckBox:(resources string:'Underscores in Identifiers') on:warnUnderscore. |
|
3313 |
warnUnderscoreBox width:0.4. |
|
3314 |
||
3315 |
warnDollarBox := box addCheckBox:(resources string:'Dollars in Identifiers') on:warnDollar. |
|
3316 |
warnDollarBox width:0.4. |
|
3317 |
||
3318 |
warnUnusedVarsBox := box addCheckBox:(resources string:'Unused Method Variables') on:warnUnusedVars. |
|
3319 |
warnUnusedVarsBox width:0.4. |
|
3320 |
||
3321 |
yMax := box yPosition. |
|
3322 |
||
3323 |
box yPosition:y. |
|
3324 |
box leftIndent:0. |
|
3325 |
warnOldStyleBox := box addCheckBox:(resources string:'OldStyle Assignment') on:warnOldStyle. |
|
3326 |
warnOldStyleBox left:0.5; width:0.4. |
|
3327 |
||
3328 |
warnCommonMistakesBox := box addCheckBox:(resources string:'Common Mistakes') on:warnCommonMistakes. |
|
3329 |
warnCommonMistakesBox left:0.5; width:0.4. |
|
3330 |
||
3331 |
warnCompatibilityBox := box addCheckBox:(resources string:'Possible Incompatibilities') on:warnCompatibility. |
|
3332 |
warnCompatibilityBox left:0.5; width:0.4. |
|
3333 |
||
3334 |
box leftIndent:oldIndent. |
|
3335 |
box yPosition:(yMax max: box yPosition). |
|
3336 |
||
3337 |
box addHorizontalLine. |
|
3338 |
box |
|
3339 |
addHelpButtonFor:'Launcher/compilerSettings.html'; |
|
3340 |
addAbortAndOkButtons. |
|
3341 |
||
3342 |
warnEnabler value. |
|
3343 |
box open. |
|
3344 |
||
3345 |
box accepted ifTrue:[ |
|
3346 |
HistoryManager notNil ifTrue:[ |
|
3347 |
HistoryManager fullHistoryUpdate:fullHistoryUpdate value. |
|
3348 |
historyLines value ifTrue:[ |
|
3349 |
HistoryManager activate |
|
3350 |
] ifFalse:[ |
|
3351 |
HistoryManager deactivate |
|
3352 |
]. |
|
3353 |
]. |
|
3354 |
Class catchMethodRedefinitions:catchMethodRedefs value. |
|
3355 |
Class catchClassRedefinitions:catchClassRedefs value. |
|
3356 |
ClassCategoryReader sourceMode:(keepSourceOptions at:keepSource selectionIndex). |
|
3357 |
Compiler warnings:warnings value. |
|
3358 |
Compiler warnSTXSpecials:warnSTX value. |
|
3359 |
Compiler warnOldStyleAssignment:warnOldStyle value. |
|
3360 |
Compiler warnUnderscoreInIdentifier:warnUnderscore value. |
|
3361 |
Compiler warnDollarInIdentifier:warnDollar value. |
|
3362 |
Compiler warnCommonMistakes:warnCommonMistakes value. |
|
3363 |
Compiler warnPossibleIncompatibilities:warnCompatibility value. |
|
3364 |
Compiler warnUnusedVars:warnUnusedVars value. |
|
3365 |
Compiler allowUnderscoreInIdentifier:allowUnderscore value. |
|
3366 |
Compiler allowDollarInIdentifier:allowDollar value. |
|
3367 |
Compiler allowSqueakExtensions:allowSqueakExtensions value. |
|
3368 |
Compiler allowDolphinExtensions:allowDolphinExtensions value. |
|
3369 |
Compiler allowQualifiedNames:allowQualifiedNames value. |
|
3370 |
Compiler allowOldStyleAssignment:allowOldStyleAssignment value. |
|
3371 |
Compiler allowReservedWordsAsSelectors:allowReservedWordsAsSelectors value. |
|
3372 |
||
3373 |
Compiler arraysAreImmutable:immutableArrays value. |
|
3374 |
fullDebugSupport value ifTrue:[ |
|
3375 |
Compiler lineNumberInfo:#full. |
|
3376 |
] ifFalse:[ |
|
3377 |
Compiler lineNumberInfo:true |
|
3378 |
]. |
|
3379 |
||
3380 |
Compiler stcCompilation:(stcCompilationOptions at:stcCompilation selectionIndex). |
|
3381 |
Compiler foldConstants:(constantFoldingOptions at:constantFolding selectionIndex). |
|
3382 |
||
3383 |
supportsJustInTimeCompilation ifTrue:[ |
|
3384 |
justInTimeCompilation := justInTimeCompilation value. |
|
3385 |
justInTimeCompilation ifTrue:[ |
|
3386 |
Method allInstancesDo:[:m | m checked:false]. |
|
3387 |
]. |
|
3388 |
ObjectMemory justInTimeCompilation:justInTimeCompilation. |
|
3389 |
ObjectMemory fullSingleStepSupport:fullDebugSupport value. |
|
3390 |
]. |
|
3391 |
Autoload compileLazy:compileLazy value. |
|
3392 |
Smalltalk loadBinaries:loadBinaries value. |
|
3393 |
]. |
|
3394 |
box destroy |
|
3395 |
||
3396 |
"Modified: / 10.9.1995 / 19:19:18 / claus" |
|
3397 |
"Modified: / 9.9.1996 / 22:42:47 / stefan" |
|
3398 |
"Modified: / 5.11.1998 / 14:25:59 / cg" |
|
3399 |
! |
|
3400 |
||
3401 |
displaySettings |
|
3402 |
"open a dialog on display related settings" |
|
3403 |
||
3404 |
|box listOfSizes sizeInfos |
|
3405 |
sizes sizeNames sizeList sizeX sizeY deepIcons |
|
3406 |
isColorMonitor useFixPalette useFixGrayPalette idx ditherStyles ditherSyms ditherList |
|
3407 |
y component screen visual clipEncodings clipEncodingSyms clipEncodingList resources |
|
3408 |
| |
|
3409 |
||
3410 |
resources := self owningClass classResources. |
|
3411 |
||
3412 |
listOfSizes := resources at:'LIST_OF_OFFERED_SCREEN_SIZES' default:#default. |
|
3413 |
listOfSizes == #default ifTrue:[ |
|
3414 |
"/ nothing in resource file; offer at least some. |
|
3415 |
sizeInfos := #( |
|
3416 |
( '11.3'' (235mm x 175mm) LCD' (235 175) ) |
|
3417 |
( '17'' (325mm x 245mm)' (325 245) ) |
|
3418 |
( '19'' (340mm x 270mm)' (340 270) ) |
|
3419 |
( '20'' (350mm x 280mm)' (350 280) ) |
|
3420 |
( '21'' (365mm x 285mm)' (365 285) ) |
|
3421 |
). |
|
3422 |
] ifFalse:[ |
|
3423 |
sizeInfos := resources array:listOfSizes. |
|
3424 |
]. |
|
3425 |
sizeNames := sizeInfos collect:[:entry | entry at:1]. |
|
3426 |
sizes := sizeInfos collect:[:entry | entry at:2]. |
|
3427 |
||
3428 |
screen := Screen current. |
|
3429 |
visual := screen visualType. |
|
3430 |
||
3431 |
isColorMonitor := screen hasColors asValue. |
|
3432 |
deepIcons := screen supportsDeepIcons asValue. |
|
3433 |
useFixPalette := screen fixColors notNil asValue. |
|
3434 |
useFixGrayPalette := screen fixGrayColors notNil asValue. |
|
3435 |
||
3436 |
sizeList := SelectionInList with:sizeNames. |
|
3437 |
sizeX := screen widthInMillimeter asValue. |
|
3438 |
sizeY := screen heightInMillimeter asValue. |
|
3439 |
||
3440 |
clipEncodingSyms := #(nil #iso8859 #jis #jis7 #sjis #euc #big5). |
|
3441 |
clipEncodings := resources array:#('untranslated' 'iso8859' 'jis' 'jis7' 'shift-JIS' 'EUC' 'big5'). |
|
3442 |
clipEncodingList := SelectionInList new. |
|
3443 |
clipEncodingList list:clipEncodings. |
|
3444 |
clipEncodingList selectionIndex:(clipEncodingSyms indexOf:screen clipBoardEncoding ifAbsent:1). |
|
3445 |
||
3446 |
ditherList := SelectionInList new. |
|
3447 |
||
3448 |
(visual == #StaticGray or:[visual == #GrayScale]) ifTrue:[ |
|
3449 |
ditherStyles := #('threshold' 'ordered dither' 'error diffusion'). |
|
3450 |
ditherSyms := #(threshold ordered floydSteinberg). |
|
3451 |
] ifFalse:[ |
|
3452 |
visual ~~ #TrueColor ifTrue:[ |
|
3453 |
ditherStyles := #('nearest color' 'error diffusion'). |
|
3454 |
ditherSyms := #(ordered floydSteinberg). |
|
3455 |
] |
|
3456 |
]. |
|
3457 |
ditherSyms notNil ifTrue:[ |
|
3458 |
ditherList list:ditherStyles. |
|
3459 |
ditherList selectionIndex:(ditherSyms indexOf:(Image ditherAlgorithm) ifAbsent:#threshold). |
|
3460 |
]. |
|
3461 |
||
3462 |
box := DialogBox new. |
|
3463 |
box label:(resources string:'Display Screen Settings'). |
|
3464 |
||
3465 |
(box addTextLabel:(resources string:'Actual Visible Screen Area:')) |
|
3466 |
adjust:#left. |
|
3467 |
||
3468 |
(box addPopUpList:(resources string:'Common Sizes:') on:sizeList) |
|
3469 |
label:'monitor size'. |
|
3470 |
||
3471 |
idx := sizes findFirst:[:entry | |
|
3472 |
((entry at:1) = sizeX value) |
|
3473 |
and:[((entry at:2) = sizeY value)] |
|
3474 |
]. |
|
3475 |
idx ~~ 0 ifTrue:[ |
|
3476 |
sizeList selectionIndex:idx |
|
3477 |
]. |
|
3478 |
||
3479 |
sizeList onChangeEvaluate:[ |
|
3480 |
|idx| |
|
3481 |
||
3482 |
idx := sizeList selectionIndex. |
|
3483 |
sizeX value:((sizes at:idx) at:1). |
|
3484 |
sizeY value:((sizes at:idx) at:2). |
|
3485 |
]. |
|
3486 |
||
3487 |
y := box yPosition. |
|
3488 |
component := box addTextLabel:(resources string:'Screen Size:'). |
|
3489 |
component width:0.3; adjust:#right; borderWidth:0. |
|
3490 |
||
3491 |
box yPosition:y. |
|
3492 |
component := box addInputFieldOn:nil tabable:true. |
|
3493 |
component width:0.25; left:0.3; |
|
3494 |
immediateAccept:false; acceptOnLeave:false; |
|
3495 |
cursorMovementWhenUpdating:#beginOfLine; |
|
3496 |
converter:(PrintConverter new initForInteger); |
|
3497 |
model:sizeX. |
|
3498 |
||
3499 |
box yPosition:y. |
|
3500 |
component := box addTextLabel:(' x '). |
|
3501 |
component width:0.1; left:0.55; adjust:#center; borderWidth:0. |
|
3502 |
||
3503 |
box yPosition:y. |
|
3504 |
component := box addInputFieldOn:nil tabable:true. |
|
3505 |
component width:0.25; left:0.65; |
|
3506 |
immediateAccept:false; acceptOnLeave:false; |
|
3507 |
cursorMovementWhenUpdating:#beginOfLine; |
|
3508 |
converter:(PrintConverter new initForInteger); |
|
3509 |
model:sizeY. |
|
3510 |
||
3511 |
box yPosition:y. |
|
3512 |
component := box addTextLabel:('(mm)'). |
|
3513 |
component width:0.1; left:0.9; adjust:#center; borderWidth:0. |
|
3514 |
||
3515 |
box addVerticalSpace; addHorizontalLine; addVerticalSpace. |
|
3516 |
||
3517 |
(box addTextLabel:(resources string:'Screen: Depth: %1 Visual: %2 (%3)' |
|
3518 |
with:screen depth printString |
|
3519 |
with:screen visualType |
|
3520 |
with:screen serverVendor)) |
|
3521 |
adjust:#left. |
|
3522 |
||
3523 |
box addVerticalSpace; addHorizontalLine; addVerticalSpace. |
|
3524 |
||
3525 |
box addCheckBox:(resources string:'Color Monitor') on:isColorMonitor. |
|
3526 |
||
3527 |
visual == #PseudoColor ifTrue:[ |
|
3528 |
box addVerticalSpace. |
|
3529 |
component := box addCheckBox:(resources string:'Use Fix Color Palette %1' with:'(4x8x4)') on:useFixPalette. |
|
3530 |
||
3531 |
box addVerticalSpace. |
|
3532 |
component := box addCheckBox:(resources string:'Use Fix Gray Color Palette %1' with:'(32)') on:useFixGrayPalette. |
|
3533 |
]. |
|
3534 |
||
3535 |
ditherSyms notNil ifTrue:[ |
|
3536 |
box addVerticalSpace. |
|
3537 |
component := box addPopUpList:(resources string:'Image Display:') on:ditherList. |
|
3538 |
component defaultLabel:'image display'. |
|
3539 |
component superView horizontalLayout:#leftSpace. |
|
3540 |
]. |
|
3541 |
||
3542 |
box addVerticalSpace. |
|
3543 |
box addCheckBox:(resources string:'Allow Colored/Grayscale Icons') on:deepIcons. |
|
3544 |
||
3545 |
box addVerticalSpace; addHorizontalLine; addVerticalSpace. |
|
3546 |
||
3547 |
component := box addPopUpList:(resources string:'ClipBoard Encoding:') on:clipEncodingList. |
|
3548 |
component superView horizontalLayout:#leftSpace. |
|
3549 |
||
3550 |
box addHorizontalLine. |
|
3551 |
box |
|
3552 |
addHelpButtonFor:'Launcher/screenSettings.html'; |
|
3553 |
addAbortAndOkButtons. |
|
3554 |
box open. |
|
3555 |
||
3556 |
box accepted ifTrue:[ |
|
3557 |
Image flushDeviceImages. |
|
3558 |
||
3559 |
screen visualType == #PseudoColor ifTrue:[ |
|
3560 |
useFixPalette value ifTrue:[ |
|
3561 |
Color colorAllocationFailSignal handle:[:ex | |
|
3562 |
self warn:'Could not allocate colors.'. |
|
3563 |
] do:[ |
|
3564 |
Color getColorsRed:4 green:8 blue:4 on:screen |
|
3565 |
] |
|
3566 |
] ifFalse:[ |
|
3567 |
screen releaseFixColors |
|
3568 |
]. |
|
3569 |
||
3570 |
useFixGrayPalette value ifTrue:[ |
|
3571 |
Color colorAllocationFailSignal handle:[:ex | |
|
3572 |
self warn:'Could not allocate colors.'. |
|
3573 |
] do:[ |
|
3574 |
Color getGrayColors:32 on:screen |
|
3575 |
] |
|
3576 |
] ifFalse:[ |
|
3577 |
screen releaseFixGrayColors |
|
3578 |
] |
|
3579 |
]. |
|
3580 |
screen hasColors:isColorMonitor value. |
|
3581 |
screen widthInMillimeter:sizeX value. |
|
3582 |
screen heightInMillimeter:sizeY value. |
|
3583 |
||
3584 |
screen supportsDeepIcons:deepIcons value. |
|
3585 |
ditherSyms notNil ifTrue:[ |
|
3586 |
Image ditherAlgorithm:(ditherSyms at:ditherList selectionIndex). |
|
3587 |
]. |
|
3588 |
||
3589 |
WindowGroup activeGroup withWaitCursorDo:[ |
|
3590 |
View defaultStyle:(View defaultStyle). |
|
3591 |
]. |
|
3592 |
||
3593 |
screen clipBoardEncoding:(clipEncodingSyms at:clipEncodingList selectionIndex). |
|
3594 |
]. |
|
3595 |
box destroy |
|
3596 |
||
3597 |
"Modified: / 9.9.1996 / 22:43:04 / stefan" |
|
3598 |
"Modified: / 20.5.1999 / 18:35:21 / cg" |
|
3599 |
! |
|
3600 |
||
3601 |
editSettings |
|
3602 |
"open a dialog on edit settings" |
|
3603 |
||
3604 |
|box st80EditingMode st80DoubleClickSelectMode resources |
|
3605 |
tabsIs4 prevTabsIs4 searchDialogIsModal startTextDragWithControl| |
|
3606 |
||
3607 |
resources := self owningClass classResources. |
|
3608 |
||
3609 |
"/ |
|
3610 |
"/ extract relevant system settings ... |
|
3611 |
"/ |
|
3612 |
st80EditingMode := UserPreferences current st80EditMode asValue. |
|
3613 |
st80DoubleClickSelectMode := TextView st80SelectMode asValue. |
|
3614 |
prevTabsIs4 := (ListView userDefaultTabPositions = ListView tab4Positions). |
|
3615 |
tabsIs4 := prevTabsIs4 asValue. |
|
3616 |
searchDialogIsModal := UserPreferences current searchDialogIsModal asValue. |
|
3617 |
startTextDragWithControl := UserPreferences current startTextDragWithControl asValue. |
|
3618 |
||
3619 |
"/ |
|
3620 |
"/ create a box on those values ... |
|
3621 |
"/ |
|
3622 |
box := DialogBox new. |
|
3623 |
box label:(resources string:'Edit settings'). |
|
3624 |
||
3625 |
box addCheckBox:(resources string:'Cursor has ST80 Line-end Behavior') on:st80EditingMode. |
|
3626 |
box addCheckBox:(resources string:'Double Click Select Behavior as in ST80') on:st80DoubleClickSelectMode. |
|
3627 |
box addCheckBox:(resources string:'Tab Stops in Multiples of 4') on:tabsIs4. |
|
3628 |
box addCheckBox:(resources string:'SearchBox is Modal') on:searchDialogIsModal. |
|
3629 |
box addCheckBox:(resources string:'CTRL-Key to Start TextDrag') on:startTextDragWithControl. |
|
3630 |
||
3631 |
box addHorizontalLine. |
|
3632 |
||
3633 |
box |
|
3634 |
addHelpButtonFor:'Launcher/editSettings.html'; |
|
3635 |
addAbortAndOkButtons. |
|
3636 |
||
3637 |
"/ |
|
3638 |
"/ show the box ... |
|
3639 |
"/ |
|
3640 |
box open. |
|
3641 |
||
3642 |
"/ |
|
3643 |
"/ update system settings |
|
3644 |
"/ |
|
3645 |
box accepted ifTrue:[ |
|
3646 |
UserPreferences current st80EditMode:(st80EditingMode value). |
|
3647 |
TextView st80SelectMode:(st80DoubleClickSelectMode value). |
|
3648 |
tabsIs4 value ~~ prevTabsIs4 ifTrue:[ |
|
3649 |
ListView userDefaultTabPositions:(tabsIs4 value ifTrue:[ListView tab4Positions] ifFalse:[ListView tab8Positions]). |
|
3650 |
ListView allSubInstancesDo:[:eachKindOfListView | |
|
3651 |
tabsIs4 value ifTrue:[eachKindOfListView setTab4] ifFalse:[eachKindOfListView setTab8] |
|
3652 |
]. |
|
3653 |
]. |
|
3654 |
UserPreferences current searchDialogIsModal:searchDialogIsModal value. |
|
3655 |
UserPreferences current startTextDragWithControl:startTextDragWithControl value. |
|
3656 |
]. |
|
3657 |
box destroy |
|
3658 |
||
3659 |
"Created: / 6.1.1999 / 14:12:09 / cg" |
|
3660 |
"Modified: / 6.1.1999 / 14:17:51 / cg" |
|
3661 |
! |
|
3662 |
||
3663 |
fontSettingsFor:requestor |
|
3664 |
"open a dialog on font related settings" |
|
3665 |
||
3666 |
(self fontBoxForEncoding:nil) ifTrue:[ |
|
3667 |
requestor reopenLauncher. |
|
3741
a9d08a1b0d7d
Fix save settings dialog when called with Filename arg
Stefan Vogel <sv@exept.de>
parents:
3738
diff
changeset
|
3668 |
] |
4244 | 3669 |
|
3670 |
"Created: 26.2.1996 / 22:52:51 / cg" |
|
3671 |
"Modified: 8.1.1997 / 14:52:49 / cg" |
|
3672 |
! |
|
3673 |
||
3674 |
javaSettings |
|
3675 |
"open a dialog on settings related to the java subsystem" |
|
3676 |
||
3677 |
|box audio javaHome classPath oldJavaHome oldClassPath resources component |
|
3678 |
extraFileSecurityChecks extraSocketSecurityChecks |
|
3679 |
supportsJustInTimeCompilation |
|
3680 |
javaJustInTimeCompilation javaNativeCodeOptimization |
|
3681 |
showJavaByteCode exceptionDebug nullPointerExceptionDebug pathSep| |
|
3682 |
||
3683 |
resources := self owningClass classResources. |
|
3684 |
||
3685 |
audio := JavaVM audioEnabled asValue. |
|
3686 |
extraFileSecurityChecks := JavaVM fileOpenConfirmation asValue. |
|
3687 |
extraSocketSecurityChecks := JavaVM socketConnectConfirmation asValue. |
|
3688 |
(supportsJustInTimeCompilation := ObjectMemory supportsJustInTimeCompilation) ifTrue:[ |
|
3689 |
javaJustInTimeCompilation := ObjectMemory javaJustInTimeCompilation asValue. |
|
3690 |
javaNativeCodeOptimization := ObjectMemory javaNativeCodeOptimization asValue. |
|
3691 |
] ifFalse:[ |
|
3692 |
javaJustInTimeCompilation := javaNativeCodeOptimization := false |
|
3693 |
]. |
|
3694 |
showJavaByteCode := JavaMethod forceByteCodeDisplay asValue. |
|
3695 |
exceptionDebug := JavaVM exceptionDebug asValue. |
|
3696 |
nullPointerExceptionDebug := JavaVM nullPointerExceptionDebug asValue. |
|
3697 |
||
3698 |
classPath := (Java classPath ? ''). |
|
3699 |
OperatingSystem isUNIXlike ifTrue:[ |
|
3700 |
pathSep := $;. |
|
3701 |
] ifFalse:[ |
|
3702 |
pathSep := $:. |
|
3703 |
]. |
|
3704 |
classPath := (classPath asStringWith:pathSep) asValue. |
|
3705 |
oldClassPath := classPath copy. |
|
3706 |
classPath := classPath asValue. |
|
3707 |
||
3708 |
javaHome := (Java javaHome ? ''). |
|
3709 |
oldJavaHome := javaHome copy. |
|
3710 |
javaHome := javaHome asValue. |
|
3711 |
||
3712 |
box := DialogBox new. |
|
3713 |
box label:(resources string:'Java'). |
|
3714 |
||
3715 |
box addCheckBox:(resources string:'Audio Enabled') on:audio. |
|
3716 |
box addCheckBox:(resources string:'Confirm file open for write') on:extraFileSecurityChecks. |
|
3717 |
box addCheckBox:(resources string:'Confirm socket connect') on:extraSocketSecurityChecks. |
|
3718 |
box addCheckBox:(resources string:'Debug Exceptions') on:exceptionDebug. |
|
3719 |
box addCheckBox:(resources string:'Debug Null Pointer Exceptions') on:nullPointerExceptionDebug. |
|
3720 |
box addHorizontalLine. |
|
3721 |
supportsJustInTimeCompilation ifTrue:[ |
|
3722 |
box |
|
3723 |
addCheckBox:(resources string:'java just in time compilation to machine code') |
|
3724 |
on:javaJustInTimeCompilation. |
|
3725 |
box |
|
3726 |
addCheckBox:(resources string:'optimize native code') |
|
3727 |
on:javaNativeCodeOptimization. |
|
3728 |
]. |
|
3729 |
box addHorizontalLine. |
|
3730 |
box addCheckBox:(resources string:'Display java byteCode (i.e. not source)') on:showJavaByteCode. |
|
3731 |
box addHorizontalLine. |
|
3732 |
component := box |
|
3733 |
addLabelledInputField:(resources string:'classPath:') |
|
3734 |
adjust:#right |
|
3735 |
on:classPath |
|
3736 |
tabable:true |
|
3737 |
separateAtX:0.3. |
|
3738 |
component acceptOnLeave:false. |
|
3739 |
component := box |
|
3740 |
addLabelledInputField:(resources string:'java home:') |
|
3741 |
adjust:#right |
|
3742 |
on:javaHome |
|
3743 |
tabable:true |
|
3744 |
separateAtX:0.3. |
|
3745 |
component acceptOnLeave:false. |
|
3746 |
||
3747 |
box addVerticalSpace. |
|
3748 |
box addComponent:(Button |
|
3749 |
label:(resources string:'Reinit VM now') |
|
3750 |
action:[ |
|
3751 |
box windowGroup withWaitCursorDo:[ |
|
3752 |
"/ Java classPath size == 0 ifTrue:[ |
|
3753 |
"/ Java initialize. |
|
3754 |
"/ ]. |
|
3755 |
"/ Java classPath size == 0 ifTrue:[ |
|
3756 |
"/ self warn:'No JDK found'. |
|
3757 |
"/ ] ifFalse:[ |
|
3758 |
JavaVM initializeVM |
|
3759 |
"/ ] |
|
3760 |
] |
|
3761 |
]). |
|
3762 |
||
3763 |
box addComponent:(Button |
|
3764 |
label:(resources string:'Remove all Java classes now') |
|
3765 |
action:[ |
|
3766 |
box windowGroup withWaitCursorDo:[ |
|
3767 |
Java flushAllJavaResources |
|
3768 |
] |
|
3769 |
]). |
|
3770 |
||
3771 |
"/ box addHorizontalLine. |
|
3772 |
||
3773 |
"/ box addHelpButtonFor:'Launcher/javaSettings.html'. |
|
3774 |
box addAbortAndOkButtons. |
|
3775 |
box open. |
|
3776 |
||
3777 |
box accepted ifTrue:[ |
|
3778 |
classPath value ~= oldClassPath ifTrue:[ |
|
3779 |
OperatingSystem isUNIXlike ifTrue:[ |
|
3780 |
classPath := (classPath value asCollectionOfSubstringsSeparatedBy:$:) |
|
3781 |
] ifFalse:[ |
|
3782 |
classPath := (classPath value asCollectionOfSubstringsSeparatedBy:$;) |
|
3783 |
]. |
|
3784 |
Java classPath:classPath |
|
3785 |
]. |
|
3786 |
Java javaHome:javaHome value. |
|
3787 |
||
3788 |
JavaMethod forceByteCodeDisplay:showJavaByteCode value. |
|
3789 |
JavaVM audioEnabled:audio value. |
|
3790 |
JavaVM exceptionDebug:exceptionDebug value. |
|
3791 |
JavaVM nullPointerExceptionDebug:nullPointerExceptionDebug value. |
|
3792 |
JavaVM fileOpenConfirmation: extraFileSecurityChecks value. |
|
3793 |
JavaVM socketConnectConfirmation: extraSocketSecurityChecks value. |
|
3794 |
||
3795 |
javaJustInTimeCompilation value ~~ ObjectMemory javaJustInTimeCompilation ifTrue:[ |
|
3796 |
ObjectMemory javaJustInTimeCompilation:javaJustInTimeCompilation value. |
|
3797 |
javaJustInTimeCompilation value ifTrue:[ |
|
3798 |
JavaMethod allSubInstancesDo:[:m | m checked:false]. |
|
3799 |
]. |
|
3800 |
]. |
|
3801 |
javaNativeCodeOptimization value ~~ ObjectMemory javaNativeCodeOptimization ifTrue:[ |
|
3802 |
ObjectMemory javaNativeCodeOptimization:javaNativeCodeOptimization value. |
|
3803 |
]. |
|
3804 |
]. |
|
3805 |
box destroy |
|
3806 |
||
3807 |
"Created: / 18.7.1998 / 22:32:58 / cg" |
|
3808 |
"Modified: / 27.1.1999 / 20:16:03 / cg" |
|
3809 |
! |
|
3810 |
||
3811 |
keyboardSettings |
|
3812 |
"open a dialog on keyboard related settings" |
|
3813 |
||
3814 |
|mappings listOfRawKeys listOfFunctions |
|
3815 |
box l |
|
3816 |
list1 list2 listView1 listView2 |
|
3817 |
frame selectionForwarder macroForwarder macroTextView y resources| |
|
3818 |
||
3819 |
resources := self owningClass classResources. |
|
3820 |
||
3821 |
mappings := Screen current keyboardMap. |
|
3822 |
||
3823 |
listOfRawKeys := (mappings keys asArray collect:[:key | key asString]) sort. |
|
3824 |
listOfFunctions := (mappings values asSet asArray collect:[:key | key asString]) sort. |
|
3825 |
||
3826 |
selectionForwarder := Plug new. |
|
3827 |
selectionForwarder respondTo:#showFunction |
|
3828 |
with:[ |
|
3829 |
|raw| |
|
3830 |
raw := list1 selection. |
|
3831 |
list2 retractInterestsFor:selectionForwarder. |
|
3832 |
list2 selection:(mappings at:raw asSymbol) asString. |
|
3833 |
list2 onChangeSend:#showRawKey to:selectionForwarder. |
|
3834 |
]. |
|
3835 |
selectionForwarder respondTo:#showRawKey |
|
3836 |
with:[ |
|
3837 |
|f raw| |
|
3838 |
||
3839 |
f := list2 selection. |
|
3840 |
list1 retractInterestsFor:selectionForwarder. |
|
3841 |
raw := mappings keyAtValue:f asString. |
|
3842 |
raw isNil ifTrue:[ |
|
3843 |
raw := mappings keyAtValue:f first. |
|
3844 |
raw isNil ifTrue:[ |
|
3845 |
raw := mappings keyAtValue:f asSymbol. |
|
3846 |
] |
|
3847 |
]. |
|
3848 |
list1 selection:raw. |
|
3849 |
list1 onChangeSend:#showFunction to:selectionForwarder. |
|
3850 |
]. |
|
3851 |
||
3852 |
macroForwarder := [ |
|
3853 |
|f macro indent| |
|
3854 |
f := list2 selection. |
|
3855 |
(f startsWith:'Cmd') ifTrue:[ |
|
3856 |
f := f copyFrom:4 |
|
3857 |
]. |
|
3858 |
macro := UserPreferences current functionKeySequences |
|
3859 |
at:(f asSymbol) ifAbsent:nil. |
|
3860 |
macro notNil ifTrue:[ |
|
3861 |
macro := macro asStringCollection. |
|
3862 |
indent := macro |
|
3863 |
inject:99999 into:[:min :element | |
|
3864 |
|stripped| |
|
3865 |
||
3866 |
stripped := element withoutLeadingSeparators. |
|
3867 |
stripped size == 0 ifTrue:[ |
|
3868 |
min |
|
3869 |
] ifFalse:[ |
|
3870 |
min min:(element size - stripped size) |
|
3871 |
] |
|
3872 |
]. |
|
3873 |
indent ~~ 0 ifTrue:[ |
|
3874 |
macro := macro collect:[:line | |
|
3875 |
line size > indent ifTrue:[ |
|
3876 |
line copyFrom:indent+1 |
|
3877 |
] ifFalse:[ |
|
3878 |
line |
|
3879 |
]. |
|
3880 |
] |
|
3881 |
]. |
|
3882 |
]. |
|
3883 |
macroTextView contents:macro. |
|
3884 |
]. |
|
3885 |
||
3886 |
list1 := SelectionInList with:listOfRawKeys. |
|
3887 |
list1 onChangeSend:#showFunction to:selectionForwarder. |
|
3888 |
||
3889 |
list2 := SelectionInList with:listOfFunctions. |
|
3890 |
list2 onChangeSend:#showRawKey to:selectionForwarder. |
|
3891 |
list2 onChangeEvaluate:macroForwarder. |
|
3892 |
||
3893 |
box := Dialog new. |
|
3894 |
box label:(resources string:'Keyboard Mappings'). |
|
3895 |
||
3896 |
l := box addTextLabel:(resources at:'KEY_MSG' default:'keyboard mapping:') withCRs. |
|
3897 |
l adjust:#left; borderWidth:0. |
|
3898 |
||
3899 |
frame := View new. |
|
3900 |
frame extent:300 @ 300. |
|
3901 |
frame borderWidth:0. |
|
3902 |
||
3903 |
listView1 := ScrollableView for:SelectionInListView in:frame. |
|
3904 |
listView1 model:list1. |
|
3905 |
listView1 origin:0.0@0.0 corner:0.5@1.0; inset:2. |
|
3906 |
||
3907 |
listView2 := ScrollableView for:SelectionInListView in:frame. |
|
3908 |
listView2 model:list2. |
|
3909 |
listView2 origin:0.5@0.0 corner:1.0@1.0; inset:2. |
|
3910 |
||
3911 |
frame topInset:box yPosition. |
|
3912 |
box addComponent:frame withExtent:350@200. |
|
3913 |
box makeTabable:listView1. |
|
3914 |
box makeTabable:listView2. |
|
3915 |
frame origin:0.0@0.0 corner:1.0@0.6. |
|
3916 |
||
3917 |
box addVerticalSpace. |
|
3918 |
||
3919 |
l := box addTextLabel:(resources string:'Macro text (if any):') withCRs. |
|
3920 |
l adjust:#left; borderWidth:0. |
|
3921 |
l origin:0.0@0.6 corner:1.0@0.6. |
|
3922 |
l topInset:(View viewSpacing). |
|
3923 |
l bottomInset:(l preferredExtent y negated - View viewSpacing). |
|
3924 |
||
3925 |
macroTextView := HVScrollableView for:TextView miniScroller:true. |
|
3926 |
box addComponent:macroTextView tabable:true. |
|
3927 |
macroTextView origin:0.0@0.6 corner:1.0@1.0. |
|
3928 |
y := box yPosition. |
|
3929 |
||
3930 |
box |
|
3931 |
addHelpButtonFor:'Launcher/keyboardSetting.html'; |
|
3932 |
"addAbortButton;" |
|
3933 |
addOkButtonLabelled:(resources string:'Close' "'Dismiss'"). |
|
3934 |
||
3935 |
macroTextView topInset:(l preferredExtent y + 5). |
|
3936 |
macroTextView bottomInset:(box preferredExtent y - y). |
|
3937 |
||
3938 |
box open. |
|
3939 |
||
3940 |
box accepted ifTrue:[ |
|
3941 |
"no action yet ..." |
|
3942 |
]. |
|
3943 |
box destroy |
|
3944 |
||
3945 |
"Modified: / 9.9.1996 / 22:43:17 / stefan" |
|
3946 |
"Modified: / 4.5.1998 / 12:40:02 / cg" |
|
3947 |
! |
|
3948 |
||
3949 |
languageSettings |
|
3950 |
self languageSettingsFor:nil |
|
3951 |
! |
|
3952 |
||
3953 |
languageSettingsFor:requestor |
|
3954 |
"open a dialog on language related settings" |
|
3955 |
||
3956 |
|listOfLanguages translatedLanguages switch box languageList flags resources| |
|
3957 |
||
3958 |
resources := self owningClass classResources. |
|
3959 |
||
3960 |
" |
|
3961 |
get list of supported languages from the launchers resources ... |
|
3962 |
" |
|
3963 |
||
3964 |
listOfLanguages := resources at:'LIST_OF_OFFERED_LANGUAGES' default:#('default'). |
|
3965 |
listOfLanguages := listOfLanguages asOrderedCollection. |
|
3966 |
||
3967 |
translatedLanguages := listOfLanguages collect:[:lang | |item| |
|
3968 |
item := resources at:lang. |
|
3969 |
item isString ifTrue:[ |
|
3970 |
item |
|
3971 |
] ifFalse:[ |
|
3972 |
item at:1 |
|
3973 |
] |
|
3974 |
]. |
|
3975 |
flags := listOfLanguages collect:[:lang | |item| |
|
3976 |
item := resources at:lang. |
|
3977 |
item isArray ifTrue:[ |
|
3978 |
item at:2 |
|
3979 |
] ifFalse:[ |
|
3980 |
nil |
|
3981 |
] |
|
3982 |
]. |
|
3983 |
flags := flags collect:[:nm | |img d| nm notNil ifTrue:[ |
|
3984 |
img := Image fromFile:nm. |
|
3985 |
img isNil ifTrue:[ |
|
3986 |
d := Smalltalk getPackageDirectoryForPackage:'stx:goodies'. |
|
3987 |
img := Image fromFile:(d construct:nm). |
|
3988 |
]. |
|
3989 |
] ifFalse:[ |
|
3990 |
nil |
|
3991 |
] |
|
3992 |
]. |
|
3993 |
listOfLanguages := listOfLanguages collect:[:nm | nm copyFrom:'LANG_' size + 1]. |
|
3994 |
languageList := translatedLanguages with:flags collect:[:lang :flag | LabelAndIcon icon:flag string:lang.]. |
|
3995 |
||
3996 |
box := ListSelectionBox title:(resources at:'LANG_MSG' default:'Select a Language') withCRs. |
|
3997 |
box label:(resources string:'Language Selection'). |
|
3998 |
box list:languageList. |
|
3999 |
box initialText:(Language , '-' , LanguageTerritory). |
|
4000 |
box action:[:newLanguage | |
|
4001 |
WindowGroup activeGroup withWaitCursorDo:[ |
|
4002 |
|fontPref idx language oldLanguage territory enc |
|
4003 |
answer matchingFonts l screen| |
|
4004 |
||
4005 |
idx := translatedLanguages indexOf:newLanguage withoutSeparators. |
|
4006 |
idx ~~ 0 ifTrue:[ |
|
4007 |
language := listOfLanguages at:idx |
|
4008 |
] ifFalse:[ |
|
4009 |
language := newLanguage |
|
4010 |
]. |
|
4011 |
(language includes:$-) ifTrue:[ |
|
4012 |
l := language asCollectionOfSubstringsSeparatedBy:$-. |
|
4013 |
language := l at:1. |
|
4014 |
territory := l at:2. |
|
4015 |
]. |
|
4016 |
territory isNil ifTrue:[ |
|
4017 |
territory := language copyTo:2 |
|
4018 |
]. |
|
4019 |
||
4020 |
"/ check if the new language needs a differently encoded font; |
|
4021 |
"/ ask user to switch font and allow cancellation. |
|
4022 |
"/ Otherwise, you are left with unreadable menu & button items ... |
|
4023 |
||
4024 |
oldLanguage := Smalltalk language. |
|
4025 |
Smalltalk language:language asSymbol. |
|
4026 |
ResourcePack flushCachedResourcePacks. |
|
4027 |
"/ refetch resources ... |
|
4028 |
resources := self owningClass classResources. |
|
4029 |
fontPref := resources at:'PREFERRED_FONT_ENCODING' default:'iso8859*'. |
|
4030 |
fontPref := fontPref asLowercase. |
|
4031 |
Smalltalk language:oldLanguage. |
|
4032 |
||
4033 |
switch := true. |
|
4034 |
enc := MenuView defaultFont encoding. |
|
4035 |
(fontPref match:enc asLowercase) ifFalse:[ |
|
4036 |
"/ look if there is one at all. |
|
4037 |
screen := Screen current. |
|
4038 |
matchingFonts := screen listOfAvailableFonts select:[:f | fontPref match:f encoding asLowercase]. |
|
4039 |
matchingFonts size == 0 ifTrue:[ |
|
4040 |
"/ flush and try again - just in case, the font path has changed. |
|
4041 |
screen flushListOfAvailableFonts. |
|
4042 |
matchingFonts := screen listOfAvailableFonts select:[:f | fontPref match:f encoding asLowercase]. |
|
4043 |
]. |
|
4044 |
matchingFonts size == 0 ifTrue:[ |
|
4045 |
(Dialog |
|
4046 |
confirm:(resources |
|
4047 |
string:'Your display does not offer any %1-encoded font.\\Change the language anyway ?\ (texts will probably be unreadable then)' |
|
4048 |
with:fontPref) withCRs) |
|
4049 |
ifFalse:[ |
|
4050 |
switch := false |
|
4051 |
] |
|
4052 |
] ifFalse:[ |
|
4053 |
answer := Dialog |
|
4054 |
confirmWithCancel:(resources |
|
4055 |
string:'menu font is not %1-encoded.\\Change it ?' |
|
4056 |
with:fontPref) withCRs |
|
4057 |
labels:(resources |
|
4058 |
array:#('cancel' 'no' 'yes')) |
|
4059 |
default:3. |
|
4060 |
answer isNil ifTrue:[ |
|
4061 |
switch := false |
|
4062 |
] ifFalse:[ |
|
4063 |
answer ifTrue:[ |
|
4064 |
switch := (requestor fontBoxForEncoding:fontPref) |
|
4065 |
] |
|
4066 |
]. |
|
4067 |
]. |
|
4068 |
]. |
|
4069 |
||
4070 |
switch ifTrue:[ |
|
4071 |
Transcript showCR:'change language to ' , newLanguage , ' ...'. |
|
4072 |
Smalltalk language:language asSymbol. |
|
4073 |
Smalltalk languageTerritory:territory asSymbol. |
|
4074 |
"/ ResourcePack flushCachedResourcePacks - already done by language-change |
|
4075 |
]. |
|
4076 |
]. |
|
4077 |
switch ifTrue:[ |
|
4078 |
requestor reopenLauncher. |
|
4079 |
DebugView newDebugger. |
|
4080 |
] |
|
4081 |
]. |
|
4082 |
box |
|
4083 |
addHelpButtonFor:'Launcher/languageSetting.html'. |
|
4084 |
box open. |
|
4085 |
box destroy |
|
4086 |
||
4087 |
"Modified: / 9.9.1996 / 22:43:27 / stefan" |
|
4088 |
"Modified: / 16.11.2001 / 11:51:35 / cg" |
|
4089 |
! |
|
4090 |
||
4091 |
memorySettings |
|
4092 |
"open a dialog on objectMemory related settings" |
|
4093 |
||
4094 |
|box igcLimit igcFreeLimit igcFreeAmount newSpaceSize |
|
4095 |
compressLimit |
|
4096 |
oldIncr component fields codeLimit codeTrigger stackLimit resources |
|
4097 |
fastMoreLimit maxOldSpace models info acceptChannel| |
|
4098 |
||
4099 |
acceptChannel := false asValue. |
|
4100 |
||
4101 |
resources := self owningClass classResources. |
|
4102 |
||
4103 |
"/ |
|
4104 |
"/ extract relevant system settings ... |
|
4105 |
"/ |
|
4106 |
igcLimit := ObjectMemory incrementalGCLimit asValue. |
|
4107 |
igcFreeLimit := ObjectMemory freeSpaceGCLimit asValue. |
|
4108 |
igcFreeAmount := ObjectMemory freeSpaceGCAmount asValue. |
|
4109 |
newSpaceSize := ObjectMemory newSpaceSize asValue. |
|
4110 |
oldIncr := ObjectMemory oldSpaceIncrement asValue. |
|
4111 |
compressLimit := ObjectMemory oldSpaceCompressLimit asValue. |
|
4112 |
codeLimit := ObjectMemory dynamicCodeLimit asValue. |
|
4113 |
codeTrigger := ObjectMemory dynamicCodeGCTrigger asValue. |
|
4114 |
stackLimit := Process defaultMaximumStackSize asValue. |
|
4115 |
fastMoreLimit := (ObjectMemory fastMoreOldSpaceLimit:-1) asValue. |
|
4116 |
maxOldSpace := ObjectMemory maxOldSpace asValue. |
|
4117 |
||
4118 |
models := OrderedCollection new. |
|
4119 |
info := OrderedCollection new. |
|
4120 |
models add:newSpaceSize. info add:#(number 'Size of newSpace where objects are created' 'Size of NewSpace:' ). |
|
4121 |
models add:fastMoreLimit. info add:#(number 'Quickly allocate more memory (suppress GC) up to this limit' 'Quick Allocation Limit:'). |
|
4122 |
models add:maxOldSpace. info add:#(number 'Never allocate more than this amount of memory' 'Maximum Memory Limit:'). |
|
4123 |
models add:igcLimit. info add:#(number 'Start IGC whenever this amount has been allocated' 'Incremental GC Allocation Trigger:'). |
|
4124 |
models add:igcFreeLimit. info add:#(number 'Start IGC whenever freespace drops below this' 'Incremental GC Freespace Trigger:'). |
|
4125 |
models add:igcFreeAmount. info add:#(number 'Try to keep this amount for peak requests' 'Incremental GC Amount:'). |
|
4126 |
models add:oldIncr. info add:#(number 'Increase oldSpace in chunks of this size' 'Oldspace Increment:'). |
|
4127 |
models add:compressLimit. info add:#(number 'Use 2-pass compressing GC if > 0 and more memory is in use' 'Oldspace Compress Limit:'). |
|
4128 |
models add:stackLimit. info add:#(number 'Trigger recursionInterrupt if more stack is used by a process' 'Stack Limit:'). |
|
4129 |
models add:codeLimit. info add:#(numberOrNil 'Flush dynamic compiled code to stay within this limit' 'Dynamic code Limit:'). |
|
4130 |
models add:codeTrigger. info add:#(numberOrNil 'Start incremental GC whenever this amount of code has been allocated' 'Dynamic Code GC Trigger:'). |
|
4131 |
||
4132 |
"/ |
|
4133 |
"/ create a box on those values ... |
|
4134 |
"/ |
|
4135 |
fields := OrderedCollection new. |
|
4136 |
||
4137 |
box := DialogBox new. |
|
4138 |
box label:(resources string:'Memory Manager Settings'). |
|
4139 |
||
4140 |
(box addTextLabel:'Warning - invalid settings may result in failures or poor performance |
|
4141 |
' , 'You have been warned' allBold , '.') adjust:#left. |
|
4142 |
box addHorizontalLine. |
|
4143 |
||
4144 |
models with:info do:[:m :i | |
|
4145 |
|lbl descr conv| |
|
4146 |
||
4147 |
conv := i at:1. |
|
4148 |
lbl := i at:3. |
|
4149 |
descr := i at:2. |
|
4150 |
||
4151 |
component := box |
|
4152 |
addLabelledInputField:(resources string:lbl) |
|
4153 |
adjust:#right |
|
4154 |
on:nil "/ newSpaceSize |
|
4155 |
tabable:true |
|
4156 |
separateAtX:0.7. |
|
4157 |
component acceptOnLeave:false. |
|
4158 |
"/ component converter:(PrintConverter new perform:conv). |
|
4159 |
component model:((TypeConverter on:m) perform:conv). |
|
4160 |
component acceptChannel:acceptChannel. |
|
4161 |
fields add:component. |
|
4162 |
||
4163 |
(box addTextLabel:descr) adjust:#left. |
|
4164 |
box addHorizontalLine. |
|
4165 |
]. |
|
4166 |
||
4167 |
ObjectMemory supportsJustInTimeCompilation ifFalse:[ |
|
4168 |
(fields at:9) disable. |
|
4169 |
(fields at:10) disable. |
|
4170 |
]. |
|
4171 |
||
4172 |
box addAbortAndOkButtons. |
|
4173 |
box |
|
4174 |
addHelpButtonFor:'Launcher/memorySettings.html'. |
|
4175 |
||
4176 |
"/ |
|
4177 |
"/ show the box ... |
|
4178 |
"/ |
|
4179 |
box open. |
|
4180 |
||
4181 |
"/ |
|
4182 |
"/ update system settings |
|
4183 |
"/ |
|
4184 |
box accepted ifTrue:[ |
|
4185 |
acceptChannel value:true. |
|
4186 |
||
4187 |
igcFreeAmount value ~~ ObjectMemory freeSpaceGCAmount ifTrue:[ |
|
4188 |
ObjectMemory freeSpaceGCAmount:igcFreeAmount value. |
|
4189 |
]. |
|
4190 |
igcFreeLimit value ~~ ObjectMemory freeSpaceGCLimit ifTrue:[ |
|
4191 |
ObjectMemory freeSpaceGCLimit:igcFreeLimit value. |
|
4192 |
]. |
|
4193 |
igcLimit value ~~ ObjectMemory incrementalGCLimit ifTrue:[ |
|
4194 |
ObjectMemory incrementalGCLimit:igcLimit value. |
|
4195 |
]. |
|
4196 |
newSpaceSize value ~~ ObjectMemory newSpaceSize ifTrue:[ |
|
4197 |
ObjectMemory newSpaceSize:newSpaceSize value. |
|
4198 |
]. |
|
4199 |
oldIncr value ~~ ObjectMemory oldSpaceIncrement ifTrue:[ |
|
4200 |
ObjectMemory oldSpaceIncrement:oldIncr value. |
|
4201 |
]. |
|
4202 |
stackLimit value ~~ Process defaultMaximumStackSize ifTrue:[ |
|
4203 |
Process defaultMaximumStackSize:stackLimit value. |
|
4204 |
]. |
|
4205 |
fastMoreLimit value ~~ (ObjectMemory fastMoreOldSpaceLimit:-1) ifTrue:[ |
|
4206 |
ObjectMemory fastMoreOldSpaceLimit:fastMoreLimit value. |
|
4207 |
]. |
|
4208 |
maxOldSpace value ~~ ObjectMemory maxOldSpace ifTrue:[ |
|
4209 |
ObjectMemory maxOldSpace:maxOldSpace value. |
|
4210 |
]. |
|
4211 |
ObjectMemory oldSpaceCompressLimit:compressLimit value. |
|
4212 |
ObjectMemory dynamicCodeLimit:codeLimit value. |
|
4213 |
ObjectMemory dynamicCodeGCTrigger:codeTrigger value. |
|
4214 |
]. |
|
4215 |
box destroy |
|
4216 |
||
4217 |
"Modified: 27.2.1997 / 16:50:12 / cg" |
|
4218 |
! |
|
4219 |
||
4220 |
messageSettings |
|
4221 |
"open a dialog on infoMessage related settings" |
|
4222 |
||
4223 |
|box vmInfo vmErrors displayErrors classInfos resources| |
|
4224 |
||
4225 |
resources := self owningClass classResources. |
|
4226 |
||
4227 |
vmInfo := ObjectMemory infoPrinting asValue. |
|
4228 |
vmErrors := ObjectMemory debugPrinting asValue. |
|
4229 |
classInfos := Object infoPrinting asValue. |
|
4230 |
displayErrors := DeviceWorkstation errorPrinting asValue. |
|
4231 |
||
4232 |
box := DialogBox new. |
|
4233 |
box label:(resources string:'Messages'). |
|
4234 |
||
4235 |
box addCheckBox:(resources string:'VM Info Messages') on:vmInfo. |
|
4236 |
box addCheckBox:(resources string:'VM Error Messages') on:vmErrors. |
|
4237 |
box addHorizontalLine. |
|
4238 |
||
4239 |
box addCheckBox:(resources string:'Display Error Messages (Xlib, Xtlib, WinAPI ...)') on:displayErrors. |
|
4240 |
box addCheckBox:(resources string:'Other Info Messages') on:classInfos. |
|
4241 |
box addHorizontalLine. |
|
4242 |
||
4243 |
box addHelpButtonFor:'Launcher/messageSettings.html'. |
|
4244 |
box addAbortAndOkButtons. |
|
4245 |
box open. |
|
4246 |
||
4247 |
box accepted ifTrue:[ |
|
4248 |
ObjectMemory infoPrinting:vmInfo value. |
|
4249 |
ObjectMemory debugPrinting:vmErrors value. |
|
4250 |
Object infoPrinting:classInfos value. |
|
4251 |
DeviceWorkstation errorPrinting:displayErrors value. |
|
4252 |
]. |
|
4253 |
box destroy |
|
4254 |
||
4255 |
"Modified: 27.1.1997 / 17:46:01 / cg" |
|
4256 |
! |
|
4257 |
||
4258 |
miscSettings |
|
4259 |
"open a dialog on misc other settings" |
|
4260 |
||
4261 |
|box pos pos2 check butt shadows takeFocus focusFollowsMouse returnFocus |
|
4262 |
hostNameInLabel showAccelerators |
|
4263 |
preemptive dynamicPrios hostNameInLabelHolder resources |
|
4264 |
activateOnClick opaqueVariablePanelResize opaqueTableColumnResize currentUserPrefs |
|
4265 |
beepEnabled newWindowLabelFormat| |
|
4266 |
||
4267 |
resources := self owningClass classResources. |
|
4268 |
currentUserPrefs := UserPreferences current. |
|
4269 |
||
4270 |
"/ |
|
4271 |
"/ extract relevant system settings ... |
|
4272 |
"/ |
|
4273 |
shadows := PopUpView shadows asValue. |
|
4274 |
beepEnabled := currentUserPrefs beepEnabled asValue. |
|
4275 |
||
4276 |
hostNameInLabel := StandardSystemView includeHostNameInLabel. |
|
4277 |
hostNameInLabelHolder := hostNameInLabel asValue. |
|
4278 |
returnFocus := StandardSystemView returnFocusWhenClosingModalBoxes asValue. |
|
4279 |
takeFocus := StandardSystemView takeFocusWhenMapped asValue. |
|
4280 |
focusFollowsMouse := (currentUserPrefs focusFollowsMouse ? true) asValue. |
|
4281 |
activateOnClick := (Display activateOnClick:nil) asValue. |
|
4282 |
opaqueVariablePanelResize := currentUserPrefs opaqueVariablePanelResizing asValue. |
|
4283 |
opaqueTableColumnResize := currentUserPrefs opaqueTableColumnResizing asValue. |
|
4284 |
||
4285 |
showAccelerators := MenuView showAcceleratorKeys asValue. |
|
4286 |
preemptive := Processor isTimeSlicing asValue. |
|
4287 |
dynamicPrios := Processor supportDynamicPriorities asValue. |
|
4288 |
||
4289 |
"/ |
|
4290 |
"/ create a box on those values ... |
|
4291 |
"/ |
|
4292 |
box := DialogBox new. |
|
4293 |
box label:(resources string:'Other settings'). |
|
4294 |
||
4295 |
box addCheckBox:(resources string:'Shadows under PopUp Views') on:shadows. |
|
4296 |
box addCheckBox:(resources string:'Beeper enabled') on:beepEnabled. |
|
4297 |
box addCheckBox:(resources string:'Boxes Return Focus to Previously Active View') on:returnFocus. |
|
4298 |
box addCheckBox:(resources string:'Views Catch Focus when Mapped') on:takeFocus. |
|
4299 |
pos := box yPosition. |
|
4300 |
check := box addCheckBox:(resources string:'Hostname in Window Labels') on:hostNameInLabelHolder. |
|
4301 |
check width:0.6. |
|
4302 |
pos2 := box yPosition. |
|
4303 |
box yPosition:pos. |
|
4304 |
butt := box addComponent:(Button label:(resources string:'Format...') |
|
4305 |
action:[ |
|
4306 |
|newFormat| |
|
4307 |
||
4308 |
newFormat := Dialog request: |
|
4309 |
'Define the Format of Window Labels:\\ %1 - Label\ %2 - Hostname\ %3 - Username\ %4 - ProcessId\' |
|
4310 |
withCRs initialAnswer:StandardSystemView windowLabelFormat. |
|
4311 |
||
4312 |
newFormat size > 0 ifTrue:[ |
|
4313 |
newWindowLabelFormat := newFormat |
|
4314 |
]. |
|
4315 |
]). |
|
4316 |
box makeTabable:butt. |
|
4317 |
butt left:0.6; width:0.4. |
|
4318 |
box yPosition:(box yPosition max:pos2). |
|
4319 |
||
4320 |
box addCheckBox:(resources string:'Show Accelerator Keys in Menus') on:showAccelerators. |
|
4321 |
box addCheckBox:(resources string:'Raise & Activate Windows on Click') on:activateOnClick. |
|
4322 |
box addCheckBox:(resources string:'Focus Follows Mouse') on:focusFollowsMouse. |
|
4323 |
box addCheckBox:(resources string:'Opaque Variable Panel Resizing') on:opaqueVariablePanelResize. |
|
4324 |
box addCheckBox:(resources string:'Opaque Table Column Resizing') on:opaqueTableColumnResize. |
|
4325 |
||
4326 |
box addHorizontalLine. |
|
4327 |
||
4328 |
box addCheckBox:(resources string:'Preemptive Scheduling') on:preemptive. |
|
4329 |
box leftIndent:20. |
|
4330 |
check := box addCheckBox:(resources string:'Dynamic Priorities') on:dynamicPrios. |
|
4331 |
check enableChannel:preemptive. |
|
4332 |
box leftIndent:0. |
|
4333 |
||
4334 |
box addHorizontalLine. |
|
4335 |
box |
|
4336 |
addHelpButtonFor:'Launcher/miscSettings.html'; |
|
4337 |
addAbortAndOkButtons. |
|
4338 |
||
4339 |
"/ |
|
4340 |
"/ show the box ... |
|
4341 |
"/ |
|
4342 |
box open. |
|
4343 |
||
4344 |
"/ |
|
4345 |
"/ update system settings |
|
4346 |
"/ |
|
4347 |
box accepted ifTrue:[ |
|
4348 |
PopUpView shadows:shadows value. |
|
4349 |
(hostNameInLabelHolder value ~= hostNameInLabel |
|
4350 |
or:[newWindowLabelFormat ~= StandardSystemView windowLabelFormat]) ifTrue:[ |
|
4351 |
StandardSystemView includeHostNameInLabel:hostNameInLabelHolder value. |
|
4352 |
newWindowLabelFormat notNil ifTrue:[ |
|
4353 |
StandardSystemView windowLabelFormat:newWindowLabelFormat |
|
4354 |
]. |
|
4355 |
||
4356 |
Screen allScreens do:[:aDisplay | |
|
4357 |
aDisplay allViewsDo:[:aView | |
|
4358 |
|l| |
|
4359 |
||
4360 |
aView isTopView ifTrue:[ |
|
4361 |
l := aView label. |
|
4362 |
l notNil ifTrue:[ |
|
4363 |
aView label:(l , ' '); label:l. "/ force a change |
|
4364 |
] |
|
4365 |
] |
|
4366 |
] |
|
4367 |
] |
|
4368 |
]. |
|
4369 |
||
4370 |
currentUserPrefs opaqueVariablePanelResizing:opaqueVariablePanelResize value. |
|
4371 |
currentUserPrefs opaqueTableColumnResizing:opaqueTableColumnResize value. |
|
4372 |
||
4373 |
currentUserPrefs beepEnabled:beepEnabled value. |
|
4374 |
||
4375 |
StandardSystemView returnFocusWhenClosingModalBoxes:returnFocus value. |
|
4376 |
StandardSystemView takeFocusWhenMapped:takeFocus value. |
|
4377 |
currentUserPrefs focusFollowsMouse:focusFollowsMouse value. |
|
4378 |
Screen current activateOnClick:(activateOnClick value). |
|
4379 |
||
4380 |
MenuView showAcceleratorKeys:showAccelerators value. |
|
4381 |
Processor isTimeSlicing ~~ preemptive value ifTrue:[ |
|
4382 |
preemptive value ifTrue:[ |
|
4383 |
Processor startTimeSlicing |
|
4384 |
] ifFalse:[ |
|
4385 |
Processor stopTimeSlicing |
|
4386 |
] |
|
4387 |
]. |
|
4388 |
Processor supportDynamicPriorities ~~ dynamicPrios value ifTrue:[ |
|
4389 |
Processor supportDynamicPriorities:dynamicPrios value |
|
4390 |
]. |
|
4391 |
]. |
|
4392 |
box destroy |
|
4393 |
||
4394 |
"Modified: / 9.9.1996 / 22:43:36 / stefan" |
|
4395 |
"Modified: / 20.5.1999 / 18:33:55 / cg" |
|
4396 |
"Modified: / 3.12.1999 / 17:11:38 / ps" |
|
4397 |
! |
|
4398 |
||
4399 |
printerSettings |
|
4400 |
"open a dialog on printer related settings; returns true if accepted" |
|
4401 |
||
4402 |
|box accepted |
|
4403 |
possiblePrinters possibleTypes printerType printCommand |
|
4404 |
pageFormat landscape updater |
|
4405 |
formatLabel formatComponent landscapeLabel landscapeComponent |
|
4406 |
topMargin leftMargin rightMargin bottomMargin unitList unit |
|
4407 |
topMarginComponent leftMarginComponent |
|
4408 |
rightMarginComponent |
|
4409 |
bottomMarginComponent supportsColor supportsColorComponent |
|
4410 |
y y1 commandListPop component commandList row resources| |
|
4411 |
||
4412 |
resources := self owningClass classResources. |
|
4413 |
||
4414 |
possiblePrinters := PrinterStream withAllSubclasses asArray. |
|
4415 |
possibleTypes := possiblePrinters collect:[:cls | cls printerTypeName]. |
|
4416 |
||
4417 |
printerType := SelectionInList new list:(resources array:possibleTypes). |
|
4418 |
printerType selectionIndex:(possiblePrinters identityIndexOf:Printer). |
|
4419 |
printCommand := Printer printCommand asValue. |
|
4420 |
||
4421 |
pageFormat := SelectionInList new list:(Printer defaultPageFormats). |
|
4422 |
pageFormat selection:(Printer pageFormat). |
|
4423 |
landscape := Printer landscape asValue. |
|
4424 |
||
4425 |
topMargin := Printer topMargin asValue. |
|
4426 |
leftMargin := Printer leftMargin asValue. |
|
4427 |
rightMargin := Printer rightMargin asValue. |
|
4428 |
bottomMargin := Printer bottomMargin asValue. |
|
4429 |
supportsColor := Printer supportsColor asValue. |
|
4430 |
||
4431 |
box := DialogBox new. |
|
4432 |
box label:(resources string:'Printer Settings'). |
|
4433 |
||
4434 |
"/ either use a popUpList ... |
|
4435 |
"/ box addPopUpList:(resources string:'printer type:') on:printerType. |
|
4436 |
||
4437 |
"/ or a comboList; |
|
4438 |
"/ which one looks better ? |
|
4439 |
y := box yPosition. |
|
4440 |
component := box addTextLabel:(resources string:'Printer Type:'). |
|
4441 |
component width:0.25; adjust:#right; borderWidth:0. |
|
4442 |
box yPosition:y. |
|
4443 |
component := box addComboListOn:printerType tabable:true. |
|
4444 |
component aspect:#selectionIndex; changeMessage:#selectionIndex:; useIndex:true. |
|
4445 |
component width:0.75; left:0.25. |
|
4446 |
"/ end of question |
|
4447 |
||
4448 |
y := box yPosition. |
|
4449 |
component := box addTextLabel:(resources string:'Print Command:'). |
|
4450 |
component width:0.25; adjust:#right; borderWidth:0. |
|
4451 |
box yPosition:y. |
|
4452 |
commandListPop := box addComboBoxOn:printCommand tabable:true. |
|
4453 |
"/ commandListPop := box addInputFieldOn:printCommand tabable:true. |
|
4454 |
commandListPop width:0.75; left:0.25; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
4455 |
"/ some common print commands ... |
|
4456 |
||
4457 |
commandList := resources at:'PRINT_COMMANDS' ifAbsent:nil. |
|
4458 |
commandList isNil ifTrue:[ |
|
4459 |
commandList := PrinterStream defaultCommands. |
|
4460 |
commandList isNil ifTrue:[ |
|
4461 |
commandList := #('lpr' |
|
4462 |
'lp' |
|
4463 |
). |
|
4464 |
] |
|
4465 |
]. |
|
4466 |
||
4467 |
commandListPop list:commandList. |
|
4468 |
||
4469 |
box addVerticalSpace; addHorizontalLine; addVerticalSpace. |
|
4470 |
||
4471 |
row := OrderedCollection new. |
|
4472 |
row add:(formatLabel := Label label:(resources string:'Page Format:')). |
|
4473 |
formatLabel borderWidth:0. |
|
4474 |
row add:(formatComponent := PopUpList on:pageFormat). |
|
4475 |
formatComponent label:'unknown'. |
|
4476 |
||
4477 |
row add:(landscapeLabel := Label label:(resources string:'Landscape:')). |
|
4478 |
landscapeLabel borderWidth:0. |
|
4479 |
row add:(landscapeComponent := CheckToggle on:landscape). |
|
4480 |
||
4481 |
y := box yPosition. |
|
4482 |
box |
|
4483 |
addRow:(1 to:2) |
|
4484 |
fromX:0 |
|
4485 |
toX:0.5 |
|
4486 |
collect:[:idx | row at:idx] |
|
4487 |
tabable:false |
|
4488 |
horizontalLayout:#leftSpace |
|
4489 |
verticalLayout:#center. |
|
4490 |
y1 := box yPosition. |
|
4491 |
box yPosition:y. |
|
4492 |
||
4493 |
box |
|
4494 |
addRow:(3 to:4) |
|
4495 |
fromX:0.5 |
|
4496 |
toX:1.0 |
|
4497 |
collect:[:idx | row at:idx] |
|
4498 |
tabable:false |
|
4499 |
horizontalLayout:#leftSpace |
|
4500 |
verticalLayout:#center. |
|
4501 |
||
4502 |
box yPosition:(box yPosition max:y1). |
|
4503 |
||
4504 |
box makeTabable:(formatComponent). |
|
4505 |
box makeTabable:(landscapeComponent). |
|
4506 |
||
4507 |
box addVerticalSpace; addHorizontalLine; addVerticalSpace. |
|
4508 |
||
4509 |
y := box yPosition. |
|
4510 |
||
4511 |
topMarginComponent := box |
|
4512 |
addLabelledInputField:(resources string:'Top Margin:') |
|
4513 |
adjust:#right |
|
4514 |
on:nil "/ topMargin |
|
4515 |
tabable:true |
|
4516 |
from:0.0 to:0.5 |
|
4517 |
separateAtX:0.6. |
|
4518 |
topMarginComponent converter:(PrintConverter new initForNumber). |
|
4519 |
topMarginComponent model:topMargin. |
|
4520 |
y1 := box yPosition. |
|
4521 |
||
4522 |
box yPosition:y. |
|
4523 |
unitList := SelectionInList with:#('inch' 'mm'). |
|
4524 |
unitList selectionIndex:1. |
|
4525 |
||
4526 |
component := box addComponent:(PopUpList on:unitList). |
|
4527 |
component |
|
4528 |
left:0.6; |
|
4529 |
width:0.3. |
|
4530 |
||
4531 |
box yPosition:y1. |
|
4532 |
||
4533 |
leftMarginComponent := box |
|
4534 |
addLabelledInputField:(resources string:'Left Margin:') |
|
4535 |
adjust:#right |
|
4536 |
on:nil "/ leftMargin |
|
4537 |
tabable:true |
|
4538 |
from:0.0 to:0.5 |
|
4539 |
separateAtX:0.6. |
|
4540 |
leftMarginComponent converter:(PrintConverter new initForNumber). |
|
4541 |
leftMarginComponent model:leftMargin. |
|
4542 |
||
4543 |
rightMarginComponent := box |
|
4544 |
addLabelledInputField:(resources string:'Right Margin:') |
|
4545 |
adjust:#right |
|
4546 |
on:nil "/ rightMargin |
|
4547 |
tabable:true |
|
4548 |
from:0.0 to:0.5 |
|
4549 |
separateAtX:0.6. |
|
4550 |
rightMarginComponent converter:(PrintConverter new initForNumber). |
|
4551 |
rightMarginComponent model:rightMargin. |
|
4552 |
||
4553 |
bottomMarginComponent := box |
|
4554 |
addLabelledInputField:(resources string:'Bottom Margin:') |
|
4555 |
adjust:#right |
|
4556 |
on:nil "/ bottomMargin |
|
4557 |
tabable:true |
|
4558 |
from:0.0 to:0.5 |
|
4559 |
separateAtX:0.6. |
|
4560 |
bottomMarginComponent converter:(PrintConverter new initForNumber). |
|
4561 |
bottomMarginComponent model:bottomMargin. |
|
4562 |
||
4563 |
box addHorizontalLine. |
|
4564 |
supportsColorComponent := box addCheckBox:(resources string:'Color Printer') on:supportsColor. |
|
4565 |
box addVerticalSpace. |
|
4566 |
||
4567 |
updater := [ |p fg hasPageSize hasMargins| |
|
4568 |
||
4569 |
printerType selectionIndex ~~ 0 ifTrue:[ |
|
4570 |
p := possiblePrinters at:(printerType selectionIndex). |
|
4571 |
hasPageSize := p supportsPageSizes. |
|
4572 |
hasMargins := p supportsMargins. |
|
4573 |
] ifFalse:[ |
|
4574 |
hasPageSize := false. |
|
4575 |
hasMargins := false. |
|
4576 |
]. |
|
4577 |
hasPageSize ifTrue:[ |
|
4578 |
fg := Button new foregroundColor. |
|
4579 |
formatComponent enable. |
|
4580 |
landscapeComponent enable. |
|
4581 |
||
4582 |
formatComponent label:p pageFormat. |
|
4583 |
pageFormat value:(p pageFormat). |
|
4584 |
landscape value:(p landscape). |
|
4585 |
] ifFalse:[ |
|
4586 |
fg := Button new disabledForegroundColor. |
|
4587 |
formatComponent disable. |
|
4588 |
landscapeComponent disable. |
|
4589 |
||
4590 |
formatComponent label:'unknown'. |
|
4591 |
landscape value:nil. |
|
4592 |
]. |
|
4593 |
hasMargins ifTrue:[ |
|
4594 |
unitList selectionIndex == 2 ifTrue:[ |
|
4595 |
unit := #mm |
|
4596 |
] ifFalse:[ |
|
4597 |
unit := #inch |
|
4598 |
]. |
|
4599 |
||
4600 |
topMargin value:(UnitConverter convert:p topMargin from:#inch to:unit). |
|
4601 |
leftMargin value:(UnitConverter convert:p leftMargin from:#inch to:unit). |
|
4602 |
rightMargin value:(UnitConverter convert:p rightMargin from:#inch to:unit). |
|
4603 |
bottomMargin value:(UnitConverter convert:p bottomMargin from:#inch to:unit). |
|
4604 |
||
4605 |
topMarginComponent enable. |
|
4606 |
leftMarginComponent enable. |
|
4607 |
rightMarginComponent enable. |
|
4608 |
bottomMarginComponent enable. |
|
4609 |
] ifFalse:[ |
|
4610 |
topMarginComponent disable. |
|
4611 |
leftMarginComponent disable. |
|
4612 |
rightMarginComponent disable. |
|
4613 |
bottomMarginComponent disable. |
|
4614 |
]. |
|
4615 |
formatLabel foregroundColor:fg. |
|
4616 |
landscapeLabel foregroundColor:fg. |
|
4617 |
||
4618 |
p notNil ifTrue:[ |
|
4619 |
commandList := p defaultCommands. |
|
4620 |
commandList notNil ifTrue:[ |
|
4621 |
commandListPop list:commandList |
|
4622 |
]. |
|
4623 |
||
4624 |
printCommand value:(p printCommand). |
|
4625 |
]. |
|
4626 |
p supportsPostscript ifFalse:[ |
|
4627 |
supportsColorComponent disable. |
|
4628 |
supportsColor value:false |
|
4629 |
] ifTrue:[ |
|
4630 |
supportsColorComponent enable. |
|
4631 |
supportsColor value:(Printer supportsColor). |
|
4632 |
] |
|
4633 |
]. |
|
4634 |
unitList onChangeEvaluate:updater. |
|
4635 |
printerType onChangeEvaluate:updater. |
|
4636 |
updater value. |
|
4637 |
||
4638 |
box addHorizontalLine. |
|
4639 |
box addVerticalSpace; |
|
4640 |
addHelpButtonFor:'Launcher/printerSettings.html'; |
|
4641 |
addAbortAndOkButtons. |
|
4642 |
box open. |
|
4643 |
||
4644 |
(accepted := box accepted) ifTrue:[ |
|
4645 |
Printer := possiblePrinters at:(printerType selectionIndex). |
|
4646 |
Printer printCommand:printCommand value. |
|
4647 |
||
4648 |
Printer supportsPageSizes ifTrue:[ |
|
4649 |
Printer pageFormat:(pageFormat selection). |
|
4650 |
Printer landscape:(landscape value). |
|
4651 |
]. |
|
4652 |
Printer supportsMargins ifTrue:[ |
|
4653 |
unitList selectionIndex == 2 ifTrue:[ |
|
4654 |
unit := #mm |
|
4655 |
] ifFalse:[ |
|
4656 |
unit := #inch |
|
4657 |
]. |
|
4658 |
Printer topMargin:(UnitConverter convert:topMargin value from:unit to:#inch). |
|
4659 |
Printer leftMargin:(UnitConverter convert:leftMargin value from:unit to:#inch). |
|
4660 |
Printer rightMargin:(UnitConverter convert:rightMargin value from:unit to:#inch). |
|
4661 |
Printer bottomMargin:(UnitConverter convert:bottomMargin value from:unit to:#inch). |
|
4662 |
]. |
|
4663 |
Printer supportsPostscript ifTrue:[ |
|
4664 |
Printer supportsColor:supportsColor value. |
|
4665 |
]. |
|
4666 |
]. |
|
4667 |
box destroy. |
|
4668 |
^ accepted |
|
4669 |
||
4670 |
"Modified: 9.9.1996 / 22:43:51 / stefan" |
|
4671 |
"Modified: 28.2.1997 / 14:00:13 / cg" |
|
4672 |
! |
|
4673 |
||
4674 |
restoreSettings |
|
4675 |
"restore settings from a settings-file." |
|
4676 |
||
4677 |
"a temporary kludge - we need a central systemSettings object for this, |
|
4678 |
which can be saved/restored with a single store/read. |
|
4679 |
Will move entries over to UserPreferences over time; |
|
4680 |
new items should always go there." |
|
4681 |
||
4682 |
|fileName resources| |
|
4683 |
||
4684 |
resources := self owningClass classResources. |
|
4685 |
||
4686 |
fileName := Dialog |
|
4687 |
requestFileName:(resources string:'restore settings from:') |
|
4688 |
default:'settings.stx' |
|
4689 |
ok:(resources string:'restore') |
|
4690 |
abort:(resources string:'cancel') |
|
4691 |
pattern:'*.stx' |
|
4692 |
fromDirectory:nil. |
|
4693 |
||
4694 |
(fileName size == 0) ifTrue:[ |
|
4695 |
"/ canceled |
|
4696 |
^ self |
|
4697 |
]. |
|
4698 |
||
4699 |
self withWaitCursorDo:[ |
|
4700 |
Smalltalk fileIn:fileName. |
|
4701 |
||
4702 |
self reopenLauncher. |
|
4703 |
]. |
|
4704 |
||
4705 |
"Modified: / 21.7.1998 / 11:37:54 / cg" |
|
4706 |
! |
|
4707 |
||
4708 |
saveSettings |
|
4709 |
"save settings to a settings-file." |
|
4710 |
||
4711 |
"a temporary kludge - we need a central systemSettings object for this, |
|
4712 |
which can be saved/restored with a single store/read. |
|
4713 |
Will move entries over to UserPreferences over time; |
|
4714 |
new items should always go there." |
|
4715 |
||
4716 |
|fileName resources| |
|
4717 |
||
4718 |
resources := self owningClass classResources. |
|
4719 |
||
4720 |
fileName := Dialog |
|
4721 |
requestFileName:(resources string:'Save settings in:') |
|
4722 |
default:'settings.stx' |
|
4723 |
ok:(resources string:'Save') |
|
4724 |
abort:(resources string:'Cancel') |
|
4725 |
pattern:'*.stx' |
|
4726 |
fromDirectory:'.'. |
|
4727 |
||
4728 |
fileName size ~~ 0 ifTrue:[ |
|
4729 |
"not canceled" |
|
4730 |
self saveSettingsIn:fileName. |
|
4731 |
] |
|
4732 |
! |
|
4733 |
||
4734 |
saveSettingsIn:fileName |
|
4735 |
"save settings to a settings-file." |
|
4736 |
||
4737 |
"a temporary kludge - we need a central systemSettings object for this, |
|
4738 |
which can be saved/restored with a single store/read. |
|
4739 |
Will move entries over to UserPreferences over time; |
|
4740 |
new items should always go there." |
|
4741 |
||
4742 |
|resources s screen currentUserPrefs| |
|
4743 |
||
4744 |
resources := self owningClass classResources. |
|
4745 |
||
4746 |
s := fileName asFilename writeStream. |
|
4747 |
s isNil ifTrue:[ |
|
4748 |
self warn:(resources string:'Cannot write the %1 file !!' with:fileName). |
|
4749 |
^ self |
|
4750 |
]. |
|
4751 |
||
4752 |
currentUserPrefs := UserPreferences current. |
|
4753 |
screen := Screen current. |
|
4754 |
||
4755 |
s nextPutLine:'"/ ST/X saved settings'; |
|
4756 |
nextPutLine:'"/ DO NOT MODIFY MANUALLY'; |
|
4757 |
nextPutLine:'"/ (modifications would be lost with next save-settings)'; |
|
4758 |
nextPutLine:'"/'; |
|
4759 |
nextPutLine:'"/ this file was automatically generated by the'; |
|
4760 |
nextPutLine:'"/ ''save settings'' function of the Launcher'; |
|
4761 |
nextPutLine:'"/'. |
|
4762 |
s cr. |
|
4763 |
||
4764 |
s nextPutLine:'"/'. |
|
4765 |
s nextPutLine:'"/ saved by ' , OperatingSystem getLoginName , '@' , OperatingSystem getHostName , ' at ' , AbsoluteTime now printString. |
|
4766 |
s nextPutLine:'"/'. |
|
4767 |
s cr. |
|
4768 |
||
4769 |
s nextPutLine:'"/'. |
|
4770 |
s nextPutLine:'"/ Display settings:'. |
|
4771 |
s nextPutLine:'"/'. |
|
4772 |
s nextPutLine:'"/ only restore the display settings, if on the same Display ...'. |
|
4773 |
s nextPutLine:'Display notNil ifTrue:['. |
|
4774 |
s nextPutLine:' Display displayName = ' , (screen displayName storeString) , ' ifTrue:['. |
|
4775 |
screen fixColors notNil ifTrue:[ |
|
4776 |
s nextPutLine:' Image flushDeviceImages.'. |
|
4777 |
s nextPutLine:' Color colorAllocationFailSignal catch:['. |
|
4778 |
s nextPutLine:' Color getColorsRed:6 green:6 blue:4 on:Display'. |
|
4779 |
s nextPutLine:' ].'. |
|
4780 |
] ifFalse:[ |
|
4781 |
s nextPutLine:' Display releaseFixColors.'. |
|
4782 |
]. |
|
4783 |
s nextPutLine:' Display hasColors: ' , (screen hasColors storeString) , '.'. |
|
4784 |
s nextPutLine:' Display widthInMillimeter: ' , (screen widthInMillimeter storeString) , '.'. |
|
4785 |
s nextPutLine:' Display heightInMillimeter: ' , (screen heightInMillimeter storeString) , '.'. |
|
4786 |
s nextPutLine:' Display supportsDeepIcons: ' , (screen supportsDeepIcons storeString) , '.'. |
|
4787 |
s nextPutLine:' Image ditherAlgorithm: ' , (Image ditherAlgorithm storeString) , '.'. |
|
4788 |
s nextPutLine:' View defaultStyle:' , View defaultStyle storeString , '.'. |
|
4789 |
s nextPutLine:' ].'. |
|
4790 |
s nextPutLine:'].'. |
|
4791 |
s cr. |
|
4792 |
||
4793 |
s nextPutLine:'"/'. |
|
4794 |
s nextPutLine:'"/ Compiler settings:'. |
|
4795 |
s nextPutLine:'"/'. |
|
4796 |
s nextPutLine:'Compiler warnSTXSpecials: ' , (Compiler warnSTXSpecials storeString) , '.'; |
|
4797 |
nextPutLine:'Compiler warnUnderscoreInIdentifier: ' , (Compiler warnUnderscoreInIdentifier storeString) , '.'; |
|
4798 |
nextPutLine:'Compiler warnOldStyleAssignment: ' , (Compiler warnOldStyleAssignment storeString) , '.'; |
|
4799 |
nextPutLine:'Compiler warnCommonMistakes: ' , (Compiler warnCommonMistakes storeString) , '.'; |
|
4800 |
nextPutLine:'Compiler warnPossibleIncompatibilities: ' , (Compiler warnPossibleIncompatibilities storeString) , '.'; |
|
4801 |
nextPutLine:'Compiler allowUnderscoreInIdentifier: ' , (Compiler allowUnderscoreInIdentifier storeString) , '.'; |
|
4802 |
nextPutLine:'Compiler allowSqueakExtensions: ' , (Compiler allowSqueakExtensions storeString) , '.'; |
|
4803 |
nextPutLine:'Compiler allowDolphinExtensions: ' , (Compiler allowDolphinExtensions storeString) , '.'; |
|
4804 |
nextPutLine:'Compiler arraysAreImmutable: ' , (Compiler arraysAreImmutable storeString) , '.'; |
|
4805 |
nextPutLine:'Compiler lineNumberInfo: ' , (Compiler lineNumberInfo storeString) , '.'; |
|
4806 |
||
4807 |
nextPutLine:'Compiler foldConstants: ' , (Compiler foldConstants storeString) , '.'; |
|
4808 |
nextPutLine:'Compiler stcCompilation: ' , (Compiler stcCompilation storeString) , '.'; |
|
4809 |
nextPutLine:'OperatingSystem getOSType = ' , (OperatingSystem getOSType storeString) , ' ifTrue:['; |
|
4810 |
nextPutLine:' Compiler stcCompilationIncludes: ' , (Compiler stcCompilationIncludes storeString) , '.'; |
|
4811 |
nextPutLine:' Compiler stcCompilationDefines: ' , (Compiler stcCompilationDefines storeString) , '.'; |
|
4812 |
nextPutLine:' Compiler stcCompilationOptions: ' , (Compiler stcCompilationOptions storeString) , '.'; |
|
4813 |
nextPutLine:' ' , (Compiler stcModulePath storeString) , ' asFilename exists ifTrue:['; |
|
4814 |
nextPutLine:' Compiler stcModulePath: ' , (Compiler stcModulePath storeString) , '.'; |
|
4815 |
nextPutLine:' ].'; |
|
4816 |
nextPutLine:' Compiler stcPath: ' , (Compiler stcPath storeString) , '.'; |
|
4817 |
nextPutLine:' Compiler ccCompilationOptions: ' , (Compiler ccCompilationOptions storeString) , '.'; |
|
4818 |
nextPutLine:' Compiler ccPath: ' , (Compiler ccPath storeString) , '.'; |
|
4819 |
nextPutLine:' ObjectFileLoader linkArgs: ' , (ObjectFileLoader linkArgs storeString) , '.'; |
|
4820 |
nextPutLine:' ObjectFileLoader linkCommand: ' , (ObjectFileLoader linkCommand storeString) , '.'; |
|
4821 |
nextPutLine:' ObjectFileLoader libPath: ' , (ObjectFileLoader libPath storeString) , '.'; |
|
4822 |
nextPutLine:' ObjectFileLoader searchedLibraries: ' , (ObjectFileLoader searchedLibraries storeString) , '.'; |
|
4823 |
nextPutLine:'].'; |
|
4824 |
||
4825 |
nextPutLine:'ObjectMemory justInTimeCompilation: ' , (ObjectMemory justInTimeCompilation storeString) , '.'; |
|
4826 |
nextPutLine:'ObjectMemory fullSingleStepSupport: ' , (ObjectMemory fullSingleStepSupport storeString) , '.'. |
|
4827 |
||
4828 |
HistoryManager notNil ifTrue:[ |
|
4829 |
HistoryManager isActive ifTrue:[ |
|
4830 |
s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager activate].'. |
|
4831 |
s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager fullHistoryUpdate:' , HistoryManager fullHistoryUpdate storeString , '].'. |
|
4832 |
] ifFalse:[ |
|
4833 |
s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager deactivate].'. |
|
4834 |
]. |
|
4835 |
]. |
|
4836 |
||
4837 |
ObjectFileLoader notNil ifTrue:[ |
|
4838 |
s nextPutLine:'ObjectFileLoader searchedLibraries: ' , (ObjectFileLoader searchedLibraries storeString) , '.'. |
|
4839 |
s nextPutLine:'ObjectFileLoader libPath: ' , (ObjectFileLoader libPath storeString) , '.'. |
|
4840 |
]. |
|
4841 |
||
4842 |
s nextPutLine:'Class catchMethodRedefinitions: ' , (Class catchMethodRedefinitions storeString) , '.'. |
|
4843 |
s nextPutLine:'ClassCategoryReader sourceMode: ' , (ClassCategoryReader sourceMode storeString) , '.'. |
|
4844 |
||
4845 |
s cr. |
|
4846 |
s nextPutLine:'"/'. |
|
4847 |
s nextPutLine:'"/ Info & Debug Messages:'. |
|
4848 |
s nextPutLine:'"/'. |
|
4849 |
s nextPutLine:'ObjectMemory infoPrinting: ' , (ObjectMemory infoPrinting storeString) , '.'; |
|
4850 |
nextPutLine:'ObjectMemory debugPrinting: ' , (ObjectMemory debugPrinting storeString) , '.'; |
|
4851 |
nextPutLine:'Object infoPrinting: ' , (Object infoPrinting storeString) , '.'; |
|
4852 |
nextPutLine:'DeviceWorkstation errorPrinting: ' , (DeviceWorkstation errorPrinting storeString) , '.'. |
|
4853 |
||
4854 |
FlyByHelp isActive ifTrue:[ |
|
4855 |
s nextPutLine:'FlyByHelp start.' |
|
4856 |
]. |
|
4857 |
||
4858 |
s cr. |
|
4859 |
s nextPutLine:'"/'. |
|
4860 |
s nextPutLine:'"/ Edit settings:'. |
|
4861 |
s nextPutLine:'"/'. |
|
4862 |
"/ s nextPutLine:'EditTextView st80Mode: ' , (EditTextView st80Mode storeString) , '.'. |
|
4863 |
s nextPutLine:'TextView st80SelectMode: ' , (TextView st80SelectMode storeString) , '.'. |
|
4864 |
s nextPutLine:'UserPreferences current syntaxColoring: ' , (currentUserPrefs syntaxColoring storeString) , '.'. |
|
4865 |
(ListView userDefaultTabPositions = ListView tab4Positions) ifTrue:[ |
|
4866 |
s nextPutLine:'ListView userDefaultTabPositions:(ListView tab4Positions).'. |
|
4867 |
] ifFalse:[ |
|
4868 |
s nextPutLine:'ListView userDefaultTabPositions:(ListView tab8Positions).'. |
|
4869 |
]. |
|
4870 |
||
4871 |
s nextPutLine:'"/'. |
|
4872 |
s nextPutLine:'"/ User preference values:'. |
|
4873 |
s nextPutLine:'"/'. |
|
4874 |
currentUserPrefs keysAndValuesDo:[:k :v | |
|
4875 |
(UserPreferences includesSelector:(k , ':') asSymbol) ifTrue:[ |
|
4876 |
s nextPutLine:'UserPreferences current ' , k , ':' , v storeString , '.'. |
|
4877 |
] ifFalse:[ |
|
4878 |
s nextPutLine:'UserPreferences current at:' , k storeString , ' put:' , v storeString , '.'. |
|
4879 |
] |
|
4880 |
]. |
|
4881 |
||
4882 |
s cr. |
|
4883 |
s nextPutLine:'"/'. |
|
4884 |
s nextPutLine:'"/ Misc settings:'. |
|
4885 |
s nextPutLine:'"/'. |
|
4886 |
s nextPutLine:'Class keepMethodHistory: ' , (Class methodHistory notNil storeString) , '.'; |
|
4887 |
nextPutLine:'Smalltalk logDoits: ' , (Smalltalk logDoits storeString) , '.'; |
|
4888 |
nextPutLine:'Autoload compileLazy: ' , (Autoload compileLazy storeString) , '.'; |
|
4889 |
nextPutLine:'Smalltalk loadBinaries: ' , (Smalltalk loadBinaries storeString) , '.'; |
|
4890 |
nextPutLine:'StandardSystemView includeHostNameInLabel: ' , (StandardSystemView includeHostNameInLabel storeString) , '.'; |
|
4891 |
||
4892 |
"/ claus - I dont think its a good idea to save those ... |
|
4893 |
nextPutLine:'"/ Class updateChanges: ' , (Class updatingChanges storeString) , '.'; |
|
4894 |
nextPutLine:'"/ ObjectMemory nameForChanges: ' , (ObjectMemory nameForChanges storeString) , '.'; |
|
4895 |
||
4896 |
nextPutLine:'StandardSystemView returnFocusWhenClosingModalBoxes: ' , (StandardSystemView returnFocusWhenClosingModalBoxes storeString) , '.'; |
|
4897 |
nextPutLine:'StandardSystemView takeFocusWhenMapped: ' , (StandardSystemView takeFocusWhenMapped storeString) , '.'; |
|
4898 |
nextPutLine:'Display notNil ifTrue:['; |
|
4899 |
nextPutLine:' Display activateOnClick: ' , ((screen activateOnClick:nil) storeString) , '.'; |
|
4900 |
nextPutLine:'].'; |
|
4901 |
nextPutLine:'MenuView showAcceleratorKeys: ' , (MenuView showAcceleratorKeys storeString) , '.'; |
|
4902 |
nextPutLine:'Class tryLocalSourceFirst: ' , (Class tryLocalSourceFirst storeString) , '.'. |
|
4903 |
(Exception emergencyHandler == AbstractLauncherApplication notifyingEmergencyHandler) ifTrue:[ |
|
4904 |
s nextPutLine:'Exception emergencyHandler:(AbstractLauncherApplication notifyingEmergencyHandler).'. |
|
4905 |
]. |
|
4906 |
Processor isTimeSlicing ifTrue:[ |
|
4907 |
s nextPutLine:'Processor startTimeSlicing.'. |
|
4908 |
s nextPutLine:('Processor supportDynamicPriorities:' , (Processor supportDynamicPriorities ? false) storeString , '.'). |
|
4909 |
] ifFalse:[ |
|
4910 |
s nextPutLine:'Processor stopTimeSlicing.'. |
|
4911 |
]. |
|
4912 |
||
4913 |
s cr. |
|
4914 |
s nextPutLine:'"/'. |
|
4915 |
s nextPutLine:'"/ Printer settings:'. |
|
4916 |
s nextPutLine:'"/'. |
|
4917 |
s nextPutLine:'Printer := ' , (Printer name) , '.'; |
|
4918 |
nextPutLine:'Printer printCommand: ' , (Printer printCommand storeString) , '.'. |
|
4919 |
||
4920 |
Printer supportsPageSizes ifTrue:[ |
|
4921 |
s nextPutLine:'Printer pageFormat: ' , (Printer pageFormat storeString) , '.'. |
|
4922 |
s nextPutLine:'Printer landscape: ' , (Printer landscape storeString) , '.'. |
|
4923 |
]. |
|
4924 |
Printer supportsMargins ifTrue:[ |
|
4925 |
s nextPutLine:'Printer topMargin: ' , (Printer topMargin storeString) , '.'. |
|
4926 |
s nextPutLine:'Printer leftMargin: ' , (Printer leftMargin storeString) , '.'. |
|
4927 |
s nextPutLine:'Printer rightMargin: ' , (Printer rightMargin storeString) , '.'. |
|
4928 |
s nextPutLine:'Printer bottomMargin: ' , (Printer bottomMargin storeString) , '.'. |
|
4929 |
]. |
|
4930 |
Printer supportsPostscript ifTrue:[ |
|
4931 |
s nextPutLine:'Printer supportsColor: ' , (Printer supportsColor storeString) , '.'. |
|
4932 |
]. |
|
4933 |
||
4934 |
s cr. |
|
4935 |
s nextPutLine:'"/'. |
|
4936 |
s nextPutLine:'"/ Font settings:'. |
|
4937 |
s nextPutLine:'"/ (only restored, if image is restarted on the same display)'. |
|
4938 |
s nextPutLine:'"/'. |
|
4939 |
s nextPutLine:'Display notNil ifTrue:['. |
|
4940 |
s nextPutLine:' Display displayName = ' , (screen displayName storeString) , ' ifTrue:['. |
|
4941 |
s nextPutLine:' View defaultFont: ' , (View defaultFont storeString) , '.'. |
|
4942 |
s nextPutLine:' Label defaultFont: ' , (Label defaultFont storeString) , '.'. |
|
4943 |
s nextPutLine:' Button defaultFont: ' , (Button defaultFont storeString) , '.'. |
|
4944 |
s nextPutLine:' Toggle defaultFont: ' , (Toggle defaultFont storeString) , '.'. |
|
4945 |
s nextPutLine:' SelectionInListView defaultFont: ' , (SelectionInListView defaultFont storeString) , '.'. |
|
4946 |
s nextPutLine:' MenuView defaultFont: ' , (MenuView defaultFont storeString) , '.'. |
|
4947 |
s nextPutLine:' PullDownMenu defaultFont: ' , (PullDownMenu defaultFont storeString) , '.'. |
|
4948 |
s nextPutLine:' TextView defaultFont: ' , (TextView defaultFont storeString) , '.'. |
|
4949 |
s nextPutLine:' EditTextView defaultFont: ' , (EditTextView defaultFont storeString) , '.'. |
|
4950 |
s nextPutLine:' CodeView defaultFont: ' , (CodeView defaultFont storeString) , '.'. |
|
4951 |
s nextPutLine:' ].'. |
|
4952 |
s nextPutLine:'].'. |
|
4953 |
||
4954 |
s cr. |
|
4955 |
s nextPutLine:'"/'. |
|
4956 |
s nextPutLine:'"/ Language setting:'. |
|
4957 |
s nextPutLine:'"/'. |
|
4958 |
s nextPutLine:'Smalltalk language: ' , (Smalltalk language storeString) , '.'. |
|
4959 |
s nextPutLine:'Smalltalk languageTerritory: ' , (Smalltalk languageTerritory storeString) , '.'. |
|
4960 |
||
4961 |
s cr. |
|
4962 |
s nextPutLine:'"/'. |
|
4963 |
s nextPutLine:'"/ SourceCodeManager settings:'. |
|
4964 |
s nextPutLine:'"/ (only restored, if image is restarted on the same host)'. |
|
4965 |
s nextPutLine:'"/'. |
|
4966 |
s nextPutLine:'OperatingSystem getHostName = ' , (OperatingSystem getHostName storeString) , ' ifTrue:['. |
|
4967 |
s nextPutLine:' Class tryLocalSourceFirst:' , Class tryLocalSourceFirst storeString , '.'. |
|
4968 |
(Smalltalk at:#SourceCodeManager) == CVSSourceCodeManager ifTrue:[ |
|
4969 |
s nextPutLine:' Smalltalk at:#SourceCodeManager put: CVSSourceCodeManager.'. |
|
4970 |
s nextPutLine:' AbstractSourceCodeManager cacheDirectoryName:' , AbstractSourceCodeManager cacheDirectoryName storeString , '.'. |
|
4971 |
s nextPutLine:' CVSSourceCodeManager cvsBinDirectory:' , CVSSourceCodeManager cvsBinDirectory storeString , '.'. |
|
4972 |
s nextPutLine:' CVSSourceCodeManager repositoryNamesPerModule:' , CVSSourceCodeManager repositoryNamesPerModule storeString , '.'. |
|
4973 |
s nextPutLine:' CVSSourceCodeManager initializeForRepository:' , CVSSourceCodeManager repositoryName storeString , '.'. |
|
4974 |
]. |
|
4975 |
s nextPutLine:'].'. |
|
4976 |
||
4977 |
s close. |
|
4978 |
||
4979 |
" |
|
4980 |
Transcript topView application saveSettings |
|
4981 |
" |
|
4982 |
||
4983 |
"Modified: / 6.1.1999 / 14:24:16 / cg" |
|
4984 |
! |
|
4985 |
||
4986 |
sourceAndDebuggerSettings |
|
4987 |
"open a dialog on source&debugger other settings" |
|
4988 |
||
4989 |
|box check butt setupButt logDoits updChanges changeFileName |
|
4990 |
useManager hasManager cvsIsSetup |
|
4991 |
repository repositoryHolder localSourceFirst |
|
4992 |
sourceCacheDir cacheEntry |
|
4993 |
component localCheck oldIndent nm fn manager |
|
4994 |
showErrorNotifier showVerboseStack |
|
4995 |
syntaxColoring fullSelectorCheck autoFormat |
|
4996 |
resources pos currentUserPrefs checkClassesWhenCheckingIn checkClassesBox| |
|
4997 |
||
4998 |
currentUserPrefs := UserPreferences current. |
|
4999 |
||
5000 |
resources := self owningClass classResources. |
|
5001 |
||
5002 |
"/ |
|
5003 |
"/ extract relevant system settings ... |
|
5004 |
"/ |
|
5005 |
logDoits := Smalltalk logDoits asValue. |
|
5006 |
updChanges := Class updatingChanges asValue. |
|
5007 |
changeFileName := ObjectMemory nameForChanges asValue. |
|
5008 |
||
5009 |
(AbstractSourceCodeManager notNil |
|
5010 |
and:[AbstractSourceCodeManager isLoaded not]) ifTrue:[ |
|
5011 |
AbstractSourceCodeManager autoload. |
|
5012 |
]. |
|
5013 |
||
5014 |
hasManager := AbstractSourceCodeManager notNil |
|
5015 |
and:[AbstractSourceCodeManager isLoaded]. |
|
5016 |
||
5017 |
repositoryHolder := '' asValue. |
|
5018 |
hasManager ifTrue:[ |
|
5019 |
useManager := (manager := Smalltalk at:#SourceCodeManager) notNil asValue. |
|
5020 |
localSourceFirst := Class tryLocalSourceFirst asValue. |
|
5021 |
manager notNil ifTrue:[ |
|
5022 |
manager forgetDisabledModules. |
|
5023 |
repository := manager repositoryName. |
|
5024 |
repository notNil ifTrue:[ |
|
5025 |
repositoryHolder := repository asValue. |
|
5026 |
] ifFalse:[ |
|
5027 |
repositoryHolder := '' asValue. |
|
5028 |
]. |
|
5029 |
]. |
|
5030 |
cvsIsSetup := true. |
|
5031 |
] ifFalse:[ |
|
5032 |
useManager := false. |
|
5033 |
localSourceFirst := false. |
|
5034 |
cvsIsSetup := false. |
|
5035 |
]. |
|
5036 |
cvsIsSetup := cvsIsSetup asValue. |
|
5037 |
showErrorNotifier := (Exception emergencyHandler == AbstractLauncherApplication notifyingEmergencyHandler) asValue. |
|
5038 |
showVerboseStack := (DebugView defaultVerboseBacktrace ? false) asValue. |
|
5039 |
syntaxColoring := currentUserPrefs syntaxColoring asValue. |
|
5040 |
fullSelectorCheck := currentUserPrefs fullSelectorCheck asValue. |
|
5041 |
autoFormat := currentUserPrefs autoFormatting asValue. |
|
5042 |
||
5043 |
sourceCacheDir := nil asValue. |
|
5044 |
checkClassesWhenCheckingIn := (currentUserPrefs at:#checkClassesWhenCheckingIn ifAbsent:true) asValue. |
|
5045 |
||
5046 |
"/ |
|
5047 |
"/ create a box on those values ... |
|
5048 |
"/ |
|
5049 |
box := DialogBox new. |
|
5050 |
box label:(resources string:'Source & Debugger Settings'). |
|
5051 |
||
5052 |
box addCheckBox:(resources string:'Log compiles in Changefile') on:updChanges. |
|
5053 |
box addCheckBox:(resources string:'Log doIts in Changefile') on:logDoits. |
|
5054 |
||
5055 |
component := box |
|
5056 |
addLabelledInputField:(resources string:'Changefile Name:') |
|
5057 |
adjust:#right |
|
5058 |
on:changeFileName |
|
5059 |
tabable:true |
|
5060 |
separateAtX:0.4. |
|
5061 |
component immediateAccept:true; acceptOnLeave:false. |
|
5062 |
||
5063 |
"/ y := box yPosition. |
|
5064 |
"/ component := box addTextLabel:(resources string:'change file name:'). |
|
5065 |
"/ component width:0.5; adjust:#right; borderWidth:0. |
|
5066 |
"/ box yPosition:y. |
|
5067 |
"/ component := box addInputFieldOn:changeFileName tabable:true. |
|
5068 |
"/ component width:0.5; left:0.5; immediateAccept:true; acceptOnLeave:false. |
|
5069 |
||
5070 |
box addHorizontalLine. |
|
5071 |
||
5072 |
hasManager ifTrue:[ |
|
5073 |
pos := box yPosition. |
|
5074 |
check := box addCheckBox:(resources string:'Sourcecode Management') on:useManager. |
|
5075 |
check enableChannel:cvsIsSetup. |
|
5076 |
box makeTabable:check. |
|
5077 |
||
5078 |
CVSSourceCodeManager notNil ifTrue:[ |
|
5079 |
check width:0.6. |
|
5080 |
box yPosition:pos. |
|
5081 |
setupButt := box addComponent:(Button label:(resources string:'Setup...') |
|
5082 |
action:[|manager| |
|
5083 |
||
5084 |
self cvsConfigurationDialog. |
|
5085 |
manager := (Smalltalk at:#SourceCodeManager). |
|
5086 |
cvsIsSetup value:manager notNil. |
|
5087 |
manager notNil ifTrue:[ |
|
5088 |
repositoryHolder value: manager repositoryName. |
|
5089 |
sourceCacheDir value:(AbstractSourceCodeManager cacheDirectoryName). |
|
5090 |
]. |
|
5091 |
]). |
|
5092 |
setupButt enableChannel:useManager. |
|
5093 |
box makeTabable:setupButt. |
|
5094 |
setupButt left:0.6; width:0.4. |
|
5095 |
]. |
|
5096 |
oldIndent := box leftIndent. |
|
5097 |
box leftIndent:30. |
|
5098 |
||
5099 |
box addVerticalSpace:10. |
|
5100 |
"/ component := box |
|
5101 |
"/ addLabelledInputField:(resources string:'CVS repository:') |
|
5102 |
"/ adjust:#right |
|
5103 |
"/ on:repositoryHolder |
|
5104 |
"/ tabable:true |
|
5105 |
"/ separateAtX:0.5. |
|
5106 |
"/ component immediateAccept:true; acceptOnLeave:false. |
|
5107 |
"/ component enableChannel:useManager. |
|
5108 |
"/ component readOnly:true. |
|
5109 |
"/ |
|
5110 |
cacheEntry := box |
|
5111 |
addLabelledInputField:(resources string:'Source Cache Dir:') |
|
5112 |
adjust:#right |
|
5113 |
on:sourceCacheDir |
|
5114 |
tabable:true |
|
5115 |
separateAtX:0.5. |
|
5116 |
cacheEntry immediateAccept:true; acceptOnLeave:false. |
|
5117 |
cacheEntry enableChannel:useManager. |
|
5118 |
||
5119 |
pos := box yPosition. |
|
5120 |
butt := Button label:(resources string:'Flush Cache now'). |
|
5121 |
butt action:[ box withWaitCursorDo:[ AbstractSourceCodeManager flushSourceCache ] ]. |
|
5122 |
box addComponent:butt tabable:true. |
|
5123 |
butt left:0.6; width:0.4; leftInset:0. |
|
5124 |
butt enableChannel:useManager. |
|
5125 |
||
5126 |
butt := Button label:(resources string:'Condense Cache now'). |
|
5127 |
butt action:[ box withWaitCursorDo:[ AbstractSourceCodeManager condenseSourceCache ] ]. |
|
5128 |
box addComponent:butt tabable:true. |
|
5129 |
butt left:0.6; width:0.4; leftInset:0. |
|
5130 |
butt enableChannel:useManager. |
|
5131 |
||
5132 |
localCheck := box addCheckBox:(resources string:'If Present, Use Local Source (Suppress Checkout)') on:localSourceFirst. |
|
5133 |
localCheck enableChannel:useManager. |
|
5134 |
||
5135 |
checkClassesBox := box addCheckBox:(resources string:'Check for halt/error-Sends when Checking in') on:checkClassesWhenCheckingIn. |
|
5136 |
checkClassesBox enableChannel:useManager. |
|
5137 |
||
5138 |
box leftIndent:oldIndent. |
|
5139 |
||
5140 |
(AbstractSourceCodeManager isNil |
|
5141 |
or:[AbstractSourceCodeManager defaultManager isNil]) ifTrue:[ |
|
5142 |
useManager value:false. |
|
5143 |
"/ cacheEntry disable. |
|
5144 |
"/ localCheck enable. |
|
5145 |
] ifFalse:[ |
|
5146 |
sourceCacheDir value:(AbstractSourceCodeManager cacheDirectoryName). |
|
5147 |
]. |
|
5148 |
box addHorizontalLine. |
|
5149 |
]. |
|
5150 |
||
5151 |
pos := box yPosition. |
|
5152 |
check := box addCheckBox:(resources string:'Syntax Coloring') on:syntaxColoring. |
|
5153 |
check width:0.6. |
|
5154 |
box yPosition:pos. |
|
5155 |
butt := box addComponent:(Button label:(resources string:'Configure...') action:[self syntaxColorConfigurationDialog]). |
|
5156 |
box makeTabable:butt. |
|
5157 |
butt enableChannel:syntaxColoring. |
|
5158 |
butt left:0.6; width:0.4. |
|
5159 |
||
5160 |
check := box addCheckBox:(resources string:'Immediate Selector Check') on:fullSelectorCheck. |
|
5161 |
check enableChannel:syntaxColoring. |
|
5162 |
||
5163 |
pos := box yPosition. |
|
5164 |
check := box addCheckBox:(resources string:'Auto Format') on:autoFormat. |
|
5165 |
check width:0.6. |
|
5166 |
box yPosition:pos. |
|
5167 |
butt := box addComponent:(Button label:(resources string:'Configure...') action:[self formattingConfigurationDialog]). |
|
5168 |
box makeTabable:butt. |
|
5169 |
butt left:0.6; width:0.4. |
|
5170 |
||
5171 |
box addHorizontalLine. |
|
5172 |
||
5173 |
||
5174 |
box addCheckBox:(resources string:'Show Error Notifier before Opening Debugger') on:showErrorNotifier. |
|
5175 |
box addCheckBox:(resources string:'Verbose Backtrace by Default in Debugger') on:showVerboseStack. |
|
5176 |
||
5177 |
box addHorizontalLine. |
|
5178 |
box |
|
5179 |
addHelpButtonFor:'Launcher/sourceSettings.html'; |
|
5180 |
addAbortAndOkButtons. |
|
5181 |
||
5182 |
box maxExtent:1000@600. |
|
5183 |
||
5184 |
"/ |
|
5185 |
"/ show the box ... |
|
5186 |
"/ |
|
5187 |
box open. |
|
5188 |
||
5189 |
"/ |
|
5190 |
"/ update system settings |
|
5191 |
"/ |
|
5192 |
box accepted ifTrue:[ |
|
5193 |
Smalltalk logDoits:logDoits value. |
|
5194 |
Class updateChanges:updChanges value. |
|
5195 |
ObjectMemory nameForChanges:changeFileName value. |
|
5196 |
||
5197 |
(hasManager and:[useManager value]) ifTrue:[ |
|
5198 |
manager isNil ifTrue:[ |
|
5199 |
Smalltalk at:#SourceCodeManager put:(AbstractSourceCodeManager defaultManager). |
|
5200 |
manager := Smalltalk at:#SourceCodeManager. |
|
5201 |
]. |
|
5202 |
Class tryLocalSourceFirst:(localSourceFirst value). |
|
5203 |
||
5204 |
manager notNil ifTrue:[ |
|
5205 |
"/ localSourceFirst value ifFalse:[ |
|
5206 |
||
5207 |
nm := sourceCacheDir value. |
|
5208 |
nm size > 0 ifTrue:[ |
|
5209 |
(fn := nm asFilename) exists ifFalse:[ |
|
5210 |
(self confirm:('CVS cache directory ''' , nm , ''' does not exists\create ?' withCRs)) ifTrue:[ |
|
5211 |
fn makeDirectory; |
|
5212 |
makeReadableForAll; |
|
5213 |
makeWritableForAll; |
|
5214 |
makeExecutableForAll. |
|
5215 |
] |
|
5216 |
]. |
|
5217 |
(fn exists |
|
5218 |
and:[fn isDirectory |
|
5219 |
and:[fn isReadable |
|
5220 |
and:[fn isWritable]]]) ifTrue:[ |
|
5221 |
AbstractSourceCodeManager cacheDirectoryName:(sourceCacheDir value). |
|
5222 |
] ifFalse:[ |
|
5223 |
self warn:'Invalid sourceCache directory.' |
|
5224 |
] |
|
5225 |
] |
|
5226 |
"/ ] |
|
5227 |
]. |
|
5228 |
||
5229 |
repositoryHolder notNil ifTrue:[ |
|
5230 |
repositoryHolder value size > 0 ifTrue:[ |
|
5231 |
manager notNil ifTrue:[ |
|
5232 |
manager initializeForRepository:repositoryHolder value. |
|
5233 |
] |
|
5234 |
]. |
|
5235 |
]. |
|
5236 |
] ifFalse:[ |
|
5237 |
Smalltalk at:#SourceCodeManager put:nil |
|
5238 |
]. |
|
5239 |
||
5240 |
showErrorNotifier value ifFalse:[ |
|
5241 |
Exception emergencyHandler:nil |
|
5242 |
] ifTrue:[ |
|
5243 |
Exception emergencyHandler:(AbstractLauncherApplication notifyingEmergencyHandler) |
|
5244 |
]. |
|
5245 |
DebugView defaultVerboseBacktrace:(showVerboseStack value). |
|
5246 |
currentUserPrefs syntaxColoring:syntaxColoring value. |
|
5247 |
currentUserPrefs at:#fullSelectorCheck put:fullSelectorCheck value. |
|
5248 |
currentUserPrefs autoFormatting:autoFormat value. |
|
5249 |
||
5250 |
UserPreferences current at:#checkClassesWhenCheckingIn put:checkClassesWhenCheckingIn value. |
|
5251 |
]. |
|
5252 |
box destroy |
|
5253 |
||
5254 |
"Modified: / 9.9.1996 / 22:43:36 / stefan" |
|
5255 |
"Created: / 17.1.1997 / 17:39:33 / cg" |
|
5256 |
"Modified: / 16.4.1998 / 17:18:47 / ca" |
|
5257 |
"Modified: / 13.10.1998 / 15:47:31 / cg" |
|
5258 |
! |
|
5259 |
||
5260 |
stcCompilerSettings |
|
5261 |
"open an extra dialog on stc-compiler related settings" |
|
5262 |
||
5263 |
|box |
|
5264 |
stcIncludes stcDefines stcOptions |
|
5265 |
stcLibraries stcLibraryPath cc stc ccOptions |
|
5266 |
linkCommand linkArgs |
|
5267 |
component t |
|
5268 |
canLoadBinaries thisIsADemoVersion |
|
5269 |
resources| |
|
5270 |
||
5271 |
resources := self owningClass classResources. |
|
5272 |
||
5273 |
canLoadBinaries := ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles]. |
|
5274 |
||
5275 |
stcIncludes := Compiler stcCompilationIncludes asValue. |
|
5276 |
stcDefines := Compiler stcCompilationDefines asValue. |
|
5277 |
stcOptions := Compiler stcCompilationOptions asValue. |
|
5278 |
ccOptions := Compiler ccCompilationOptions asValue. |
|
5279 |
||
5280 |
cc := Compiler ccPath asValue. |
|
5281 |
stc := Compiler stcPath asValue. |
|
5282 |
linkCommand := ObjectFileLoader linkCommand asValue. |
|
5283 |
linkArgs := ObjectFileLoader linkArgs asValue. |
|
5284 |
||
5285 |
ObjectFileLoader notNil ifTrue:[ |
|
5286 |
(t := ObjectFileLoader searchedLibraries) notNil ifTrue:[ |
|
5287 |
stcLibraries := (String fromStringCollection:t separatedBy:' ') asValue. |
|
5288 |
]. |
|
5289 |
(t := ObjectFileLoader libPath) notNil ifTrue:[ |
|
5290 |
stcLibraryPath := t asValue. |
|
5291 |
] |
|
5292 |
]. |
|
5293 |
||
5294 |
box := DialogBox new. |
|
5295 |
box label:(resources string:'STC Compilation Settings'). |
|
5296 |
||
5297 |
thisIsADemoVersion := (Smalltalk releaseIdentification = 'ST/X_free_demo_vsn'). |
|
5298 |
ObjectFileLoader notNil ifTrue:[ |
|
5299 |
thisIsADemoVersion ifFalse:[ |
|
5300 |
||
5301 |
component := box |
|
5302 |
addLabelledInputField:(resources string:'stc Command:') |
|
5303 |
adjust:#right |
|
5304 |
on:stc |
|
5305 |
tabable:true |
|
5306 |
separateAtX:0.3. |
|
5307 |
component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5308 |
component preferredExtent:(100 @ component preferredExtent y). |
|
5309 |
canLoadBinaries ifFalse:[component disable]. |
|
5310 |
||
5311 |
component := box |
|
5312 |
addLabelledInputField:(resources string:'stc Options:') |
|
5313 |
adjust:#right |
|
5314 |
on:stcOptions |
|
5315 |
tabable:true |
|
5316 |
separateAtX:0.3. |
|
5317 |
component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5318 |
component preferredExtent:(250 @ component preferredExtent y). |
|
5319 |
canLoadBinaries ifFalse:[component disable]. |
|
5320 |
||
5321 |
component := box |
|
5322 |
addLabelledInputField:(resources string:'cc Command:') |
|
5323 |
adjust:#right |
|
5324 |
on:cc |
|
5325 |
tabable:true |
|
5326 |
separateAtX:0.3. |
|
5327 |
component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5328 |
component preferredExtent:(150 @ component preferredExtent y). |
|
5329 |
canLoadBinaries ifFalse:[component disable]. |
|
5330 |
||
5331 |
component := box |
|
5332 |
addLabelledInputField:(resources string:'cc Options:') |
|
5333 |
adjust:#right |
|
5334 |
on:ccOptions |
|
5335 |
tabable:true |
|
5336 |
separateAtX:0.3. |
|
5337 |
component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5338 |
component preferredExtent:(250 @ component preferredExtent y). |
|
5339 |
canLoadBinaries ifFalse:[component disable]. |
|
5340 |
||
5341 |
component := box |
|
5342 |
addLabelledInputField:(resources string:'Include Directories:') |
|
5343 |
adjust:#right |
|
5344 |
on:stcIncludes |
|
5345 |
tabable:true |
|
5346 |
separateAtX:0.3. |
|
5347 |
component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5348 |
component preferredExtent:(250 @ component preferredExtent y). |
|
5349 |
canLoadBinaries ifFalse:[component disable]. |
|
5350 |
||
5351 |
"/ box addVerticalSpace. |
|
5352 |
||
5353 |
component := box |
|
5354 |
addLabelledInputField:(resources string:'Defines:') |
|
5355 |
adjust:#right |
|
5356 |
on:stcDefines |
|
5357 |
tabable:true |
|
5358 |
separateAtX:0.3. |
|
5359 |
component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5360 |
component preferredExtent:(250 @ component preferredExtent y). |
|
5361 |
canLoadBinaries ifFalse:[component disable]. |
|
5362 |
||
5363 |
"/ box addVerticalSpace. |
|
5364 |
||
5365 |
"/ box addVerticalSpace. |
|
5366 |
||
5367 |
component := box |
|
5368 |
addLabelledInputField:(resources string:'Link Command:') |
|
5369 |
adjust:#right |
|
5370 |
on:linkCommand |
|
5371 |
tabable:true |
|
5372 |
separateAtX:0.3. |
|
5373 |
component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5374 |
component preferredExtent:(250 @ component preferredExtent y). |
|
5375 |
canLoadBinaries ifFalse:[component disable]. |
|
5376 |
||
5377 |
component := box |
|
5378 |
addLabelledInputField:(resources string:'Link Args:') |
|
5379 |
adjust:#right |
|
5380 |
on:linkArgs |
|
5381 |
tabable:true |
|
5382 |
separateAtX:0.3. |
|
5383 |
component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5384 |
component preferredExtent:(250 @ component preferredExtent y). |
|
5385 |
canLoadBinaries ifFalse:[component disable]. |
|
5386 |
||
5387 |
stcLibraries notNil ifTrue:[ |
|
5388 |
"/ box addVerticalSpace. |
|
5389 |
||
5390 |
component := box |
|
5391 |
addLabelledInputField:(resources string:'C-libraries:') |
|
5392 |
adjust:#right |
|
5393 |
on:stcLibraries |
|
5394 |
tabable:true |
|
5395 |
separateAtX:0.3. |
|
5396 |
component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5397 |
component preferredExtent:(250 @ component preferredExtent y). |
|
5398 |
canLoadBinaries ifFalse:[component disable]. |
|
5399 |
]. |
|
5400 |
||
5401 |
stcLibraryPath notNil ifTrue:[ |
|
5402 |
"/ box addVerticalSpace. |
|
5403 |
||
5404 |
component := box |
|
5405 |
addLabelledInputField:(resources string:'stc LibPath:') |
|
5406 |
adjust:#right |
|
5407 |
on:stcLibraryPath |
|
5408 |
tabable:true |
|
5409 |
separateAtX:0.3. |
|
5410 |
component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine. |
|
5411 |
component preferredExtent:(250 @ component preferredExtent y). |
|
5412 |
canLoadBinaries ifFalse:[component disable]. |
|
5413 |
]. |
|
5414 |
]. |
|
5415 |
]. |
|
5416 |
||
5417 |
box |
|
5418 |
addHelpButtonFor:'Launcher/compilerSettings.html'; |
|
5419 |
addAbortAndOkButtons. |
|
5420 |
||
5421 |
box open. |
|
5422 |
||
5423 |
box accepted ifTrue:[ |
|
5424 |
thisIsADemoVersion ifFalse:[ |
|
5425 |
Compiler stcCompilationIncludes:stcIncludes value. |
|
5426 |
Compiler stcCompilationDefines:stcDefines value. |
|
5427 |
Compiler stcCompilationOptions:stcOptions value. |
|
5428 |
Compiler ccCompilationOptions:ccOptions value. |
|
5429 |
Compiler ccPath:cc value. |
|
5430 |
stc value ~= Compiler stcPath ifTrue:[ |
|
5431 |
Compiler stcPath:stc value |
|
5432 |
]. |
|
5433 |
ObjectFileLoader linkCommand:linkCommand value. |
|
5434 |
ObjectFileLoader linkArgs:linkArgs value. |
|
5435 |
]. |
|
5436 |
||
5437 |
ObjectFileLoader notNil ifTrue:[ |
|
5438 |
stcLibraries notNil ifTrue:[ |
|
5439 |
ObjectFileLoader searchedLibraries:(stcLibraries value asCollectionOfWords). |
|
5440 |
]. |
|
5441 |
stcLibraryPath notNil ifTrue:[ |
|
5442 |
ObjectFileLoader libPath:(stcLibraryPath value). |
|
5443 |
] |
|
5444 |
]. |
|
5445 |
]. |
|
5446 |
box destroy |
|
5447 |
||
5448 |
"Modified: / 10.9.1995 / 19:19:18 / claus" |
|
5449 |
"Modified: / 9.9.1996 / 22:42:47 / stefan" |
|
5450 |
"Created: / 2.10.1998 / 16:27:49 / cg" |
|
5451 |
"Modified: / 21.10.1998 / 19:15:10 / cg" |
|
5452 |
! |
|
5453 |
||
5454 |
toolSettings |
|
5455 |
"open a dialog on tool settings" |
|
5456 |
||
5457 |
|box resources currentUserPrefs in acceptChannel |
|
5458 |
useNewInspector useNewChangesBrowser useNewSystemBrowser useNewVersionDiffBrowser |
|
5459 |
useNewFileBrowser showClockInLauncher showClock launcher transcriptBufferSize | |
|
5460 |
||
5461 |
currentUserPrefs := UserPreferences current. |
|
5462 |
||
5463 |
resources := self owningClass classResources. |
|
5464 |
||
5465 |
"/ |
|
5466 |
"/ extract relevant system settings ... |
|
5467 |
"/ |
|
5468 |
useNewInspector := currentUserPrefs useNewInspector asValue. |
|
5469 |
useNewChangesBrowser := currentUserPrefs useNewChangesBrowser asValue. |
|
5470 |
useNewSystemBrowser := currentUserPrefs useNewSystemBrowser asValue. |
|
5471 |
showClockInLauncher := currentUserPrefs showClockInLauncher asValue. |
|
5472 |
useNewVersionDiffBrowser := currentUserPrefs useNewVersionDiffBrowser asValue. |
|
5473 |
useNewFileBrowser := currentUserPrefs useNewFileBrowser asValue. |
|
5474 |
transcriptBufferSize := Transcript current lineLimit printString asValue. |
|
5475 |
||
5476 |
acceptChannel := false asValue. |
|
5477 |
||
5478 |
"/ |
|
5479 |
"/ create a box on those values ... |
|
5480 |
"/ |
|
5481 |
box := DialogBox new. |
|
5482 |
box label:(resources string:'Tool Settings'). |
|
5483 |
||
5484 |
||
5485 |
box addCheckBox:(resources string:'Use the New Changes Browser') on:useNewChangesBrowser. |
|
5486 |
box addHorizontalLine. |
|
5487 |
box addCheckBox:(resources string:'Use the New System Browser') on:useNewSystemBrowser. |
|
5488 |
box addHorizontalLine. |
|
5489 |
box addCheckBox:(resources string:'Use the New VersionDiff Browser') on:useNewVersionDiffBrowser. |
|
5490 |
box addHorizontalLine. |
|
5491 |
(Smalltalk at:#FileBrowserV2) isBehavior ifTrue:[ |
|
5492 |
box addCheckBox:(resources string:'Use the New File Browser') on:useNewFileBrowser. |
|
5493 |
box addHorizontalLine. |
|
5494 |
]. |
|
5495 |
box addCheckBox:(resources string:'Use Hierarchical Inspector') on:useNewInspector. |
|
5496 |
box addHorizontalLine. |
|
5497 |
box addCheckBox:(resources string:'Show Clock in Launcher') on:showClockInLauncher. |
|
5498 |
box addHorizontalLine. |
|
5499 |
in := box |
|
5500 |
addLabelledInputField:(resources string:'Transcripts Buffer Size:') |
|
5501 |
adjust:#right |
|
5502 |
on:transcriptBufferSize |
|
5503 |
tabable:true |
|
5504 |
separateAtX:0.6. |
|
5505 |
in acceptChannel:acceptChannel. |
|
5506 |
box addHorizontalLine. |
|
5507 |
||
5508 |
box |
|
5509 |
addHelpButtonFor:'Launcher/toolSettings.html'; |
|
5510 |
addAbortAndOkButtons. |
|
5511 |
||
5512 |
"/ |
|
5513 |
"/ show the box ... |
|
5514 |
"/ |
|
5515 |
box open. |
|
5516 |
||
5517 |
"/ |
|
5518 |
"/ update system settings |
|
5519 |
"/ |
|
5520 |
box accepted ifTrue:[ |
|
5521 |
acceptChannel value:false; value:true. |
|
5522 |
||
5523 |
currentUserPrefs useNewInspector:useNewInspector value. |
|
5524 |
currentUserPrefs useNewChangesBrowser:useNewChangesBrowser value. |
|
5525 |
currentUserPrefs useNewSystemBrowser:useNewSystemBrowser value. |
|
5526 |
currentUserPrefs useNewVersionDiffBrowser:useNewVersionDiffBrowser value. |
|
5527 |
currentUserPrefs useNewFileBrowser:useNewFileBrowser value. |
|
5528 |
(Smalltalk at:#FileBrowserV2) isBehavior ifTrue:[ |
|
5529 |
useNewFileBrowser value ifTrue:[ |
|
5530 |
FileBrowserV2 installInLauncher. |
|
5531 |
] ifFalse:[ |
|
5532 |
FileBrowserV2 isLoaded ifTrue:[ |
|
5533 |
FileBrowserV2 removeFromLauncher. |
|
5534 |
] |
|
5535 |
]. |
|
5536 |
]. |
|
5537 |
showClock := showClockInLauncher value. |
|
5538 |
currentUserPrefs showClockInLauncher ~= showClock ifTrue:[ |
|
5539 |
currentUserPrefs showClockInLauncher:showClock. |
|
5540 |
launcher := Transcript application. |
|
5541 |
(launcher isKindOf:ToolApplicationModel) ifTrue:[ |
|
5542 |
showClock ifTrue:[ |
|
5543 |
launcher startClock |
|
5544 |
] ifFalse:[ |
|
5545 |
launcher stopClock |
|
5546 |
] |
|
5547 |
] |
|
5548 |
]. |
|
5549 |
||
5550 |
Inspector := currentUserPrefs inspectorClassSetting. |
|
5551 |
||
5552 |
transcriptBufferSize := Integer readFrom:transcriptBufferSize value onError:Transcript current lineLimit. |
|
5553 |
Transcript current lineLimit:transcriptBufferSize. |
|
5554 |
||
5555 |
]. |
|
5556 |
box destroy |
|
5557 |
||
5558 |
"Modified: / 9.9.1996 / 22:43:36 / stefan" |
|
5559 |
"Modified: / 16.4.1998 / 17:18:47 / ca" |
|
5560 |
"Created: / 13.10.1998 / 15:44:36 / cg" |
|
5561 |
"Modified: / 12.11.2001 / 15:48:54 / cg" |
|
5562 |
! |
|
5563 |
||
5564 |
viewStyleSettings |
|
5565 |
self viewStyleSettingsFor:nil |
|
5566 |
! |
|
5567 |
||
5568 |
viewStyleSettingsFor:requestor |
|
5569 |
"open a dialog on viewStyle related settings" |
|
5570 |
||
5571 |
|resourceDir dir box |
|
5572 |
list listView scrView infoLabel infoForwarder newStyle |
|
5573 |
someRsrcFile didApply resources listUpdater showStandardStylesOnly standardStyles| |
|
5574 |
||
5575 |
showStandardStylesOnly := true asValue. |
|
5576 |
standardStyles := #( |
|
5577 |
'decWindows' |
|
5578 |
'iris' |
|
5579 |
'motif' |
|
5580 |
'mswindows95' |
|
5581 |
'next' |
|
5582 |
'normal' |
|
5583 |
'os2' |
|
5584 |
'st80' |
|
5585 |
). |
|
5586 |
||
5587 |
resources := self owningClass classResources. |
|
5588 |
||
5589 |
" |
|
5590 |
search resources directory for a list of .style files ... |
|
5591 |
" |
|
5592 |
someRsrcFile := Smalltalk getSystemFileName:('resources' asFilename constructString:'normal.style'). |
|
5593 |
someRsrcFile isNil ifTrue:[ |
|
5594 |
someRsrcFile := Smalltalk getResourceFileName:'normal.style' forPackage:'stx:libview'. |
|
5595 |
someRsrcFile isNil ifTrue:[ |
|
5596 |
someRsrcFile := Smalltalk getResourceFileName:'styles/normal.style' forPackage:'stx:libview'. |
|
5597 |
]. |
|
5598 |
]. |
|
5599 |
someRsrcFile notNil ifTrue:[ |
|
5600 |
resourceDir := someRsrcFile asFilename directoryName |
|
5601 |
] ifFalse:[ |
|
5602 |
resourceDir := Smalltalk getSystemFileName:'resources'. |
|
5603 |
]. |
|
5604 |
||
5605 |
resourceDir isNil ifTrue:[ |
|
5606 |
self warn:'no styles found (missing ''resources'' directory)'. |
|
5607 |
^ self |
|
5608 |
]. |
|
5609 |
dir := resourceDir asFilename directoryContents. |
|
5610 |
||
5611 |
list := SelectionInList new. |
|
5612 |
||
5613 |
listUpdater := [ |
|
5614 |
|listOfStyles lastSelection| |
|
5615 |
||
5616 |
lastSelection := list selection. |
|
5617 |
listOfStyles := dir select:[:aFileName | aFileName asFilename hasSuffix:'style']. |
|
5618 |
listOfStyles := listOfStyles collect:[:aFileName | aFileName asFilename withoutSuffix name]. |
|
5619 |
Filename isCaseSensitive ifFalse:[ |
|
5620 |
listOfStyles := listOfStyles collect:[:aStyleName | aStyleName asLowercase]. |
|
5621 |
]. |
|
5622 |
listOfStyles remove:'generic' ifAbsent:nil; remove:'mswindows3' ifAbsent:nil. |
|
5623 |
showStandardStylesOnly value ifTrue:[ |
|
5624 |
listOfStyles := listOfStyles select:[:aStyleName | standardStyles includes:aStyleName]. |
|
5625 |
]. |
|
5626 |
||
5627 |
listOfStyles sort. |
|
5628 |
list list:listOfStyles. |
|
5629 |
list selection:lastSelection. |
|
5630 |
]. |
|
5631 |
listUpdater value. |
|
5632 |
||
5633 |
showStandardStylesOnly onChangeEvaluate:listUpdater. |
|
5634 |
||
5635 |
infoForwarder := [ |
|
5636 |
|nm sheet comment| |
|
5637 |
||
5638 |
comment := ''. |
|
5639 |
nm := list selection. |
|
5640 |
nm notNil ifTrue:[ |
|
5641 |
sheet := ViewStyle fromFile:(nm , '.style'). |
|
5642 |
comment := (sheet at:#comment ifAbsent:'') withoutSeparators. |
|
5643 |
]. |
|
5644 |
comment := comment withCRs asStringCollection. |
|
5645 |
comment size == 1 ifTrue:[ |
|
5646 |
comment := comment first |
|
5647 |
]. |
|
5648 |
infoLabel label:comment |
|
5649 |
]. |
|
5650 |
||
5651 |
list onChangeEvaluate:infoForwarder. |
|
5652 |
||
5653 |
box := Dialog new. |
|
5654 |
box label:(resources string:'Style Selection'). |
|
5655 |
||
5656 |
(box addTextLabel:(resources at:'STYLE_MSG' default:'Select a Style') withCRs) adjust:#left. |
|
5657 |
listView := SelectionInListView on:list. |
|
5658 |
listView doubleClickAction:[:sel | box acceptChannel value:true. box hide]. |
|
5659 |
box addCheckBox:(resources string:'standard styles only') on:showStandardStylesOnly. |
|
5660 |
scrView := box addComponent:(ScrollableView forView:listView) tabable:true. |
|
5661 |
||
5662 |
box addVerticalSpace. |
|
5663 |
||
5664 |
(infoLabel := box addTextLabel:'\\' withCRs) adjust:#centerLeft. |
|
5665 |
||
5666 |
box addAbortAndOkButtons. |
|
5667 |
"/ mhmh - the newLauncher does not yet handle apply (without close) correctly |
|
5668 |
"/ b := box addButton:(Button label:(resources string:'apply')). |
|
5669 |
"/ b action:[didApply := true. requestor changeViewStyleTo:(list selection)]. |
|
5670 |
||
5671 |
(standardStyles includes:View defaultStyle) ifFalse:[ |
|
5672 |
showStandardStylesOnly value:false |
|
5673 |
]. |
|
5674 |
list selection:(View defaultStyle). |
|
5675 |
||
5676 |
box stickAtBottomWithVariableHeight:scrView. |
|
5677 |
box stickAtBottomWithFixHeight:infoLabel. |
|
5678 |
didApply := false. |
|
5679 |
box open. |
|
5680 |
||
5681 |
box destroy. |
|
5682 |
box accepted ifTrue:[ |
|
5683 |
((newStyle := list selection) ~= View defaultStyle |
|
5684 |
or:[didApply ~~ true]) ifTrue:[ |
|
5685 |
requestor notNil ifTrue:[requestor changeViewStyleTo:newStyle]. |
|
5686 |
]. |
|
5687 |
]. |
|
5688 |
||
5689 |
" |
|
5690 |
self viewStyleSettingsFor:nil |
|
5691 |
" |
|
5692 |
||
5693 |
"Modified: / 14.9.1998 / 20:33:59 / cg" |
|
2001 | 5694 |
! ! |
5695 |
||
5696 |
!AbstractLauncherApplication::LauncherDialogs class methodsFor:'dialogs - file'! |
|
5697 |
||
4244 | 5698 |
objectModuleDialog |
5699 |
"opens a moduleInfo dialog" |
|
5700 |
||
5701 |
<resource: #programMenu > |
|
5702 |
||
5703 |
|allModules moduleNames |
|
5704 |
allObjects methodObjects methodNames |
|
5705 |
cObjects cObjectNames |
|
5706 |
otherObjects otherObjectNames |
|
5707 |
box l handles unloadButton unloadAndRemoveButton |
|
5708 |
list1 list2 listView1 listView2 |
|
5709 |
y panel |
|
5710 |
showBuiltIn showModules showMethods showCObjects showOthers |
|
5711 |
moduleListUpdater check canDoIt menu |
|
5712 |
resources middleLabel| |
|
5713 |
||
5714 |
resources := self owningClass classResources. |
|
5715 |
||
5716 |
showBuiltIn := true asValue. |
|
5717 |
canDoIt := ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles]. |
|
5718 |
||
5719 |
showModules := canDoIt asValue. |
|
5720 |
showMethods := canDoIt asValue. |
|
5721 |
showCObjects := canDoIt asValue. |
|
5722 |
showOthers := canDoIt asValue. |
|
5723 |
||
5724 |
list1 := SelectionInList new. |
|
5725 |
list2 := SelectionInList new. |
|
5726 |
||
5727 |
moduleListUpdater := [ |
|
5728 |
|l| |
|
5729 |
||
5730 |
list2 list:nil. |
|
5731 |
||
5732 |
l := Array new. |
|
5733 |
handles := Array new. |
|
5734 |
||
5735 |
(showModules value or:[showBuiltIn value]) ifTrue:[ |
|
5736 |
allModules := ObjectMemory binaryModuleInfo asOrderedCollection. |
|
5737 |
(showBuiltIn value and:[showModules value]) ifFalse:[ |
|
5738 |
allModules := allModules select:[:i | |
|
5739 |
|wantToSee| |
|
5740 |
||
5741 |
wantToSee := i dynamic. |
|
5742 |
showBuiltIn value ifTrue:[ |
|
5743 |
wantToSee := wantToSee not |
|
5744 |
]. |
|
5745 |
wantToSee |
|
5746 |
] |
|
5747 |
]. |
|
5748 |
||
5749 |
"/ sorting by reverse id brings newest ones to the top (a side effect) |
|
5750 |
allModules sort:[:a :b | (a id) > (b id)]. |
|
5751 |
moduleNames := allModules collect:[:entry | entry name]. |
|
5752 |
l := l , moduleNames. |
|
5753 |
handles := handles , allModules. |
|
5754 |
]. |
|
5755 |
||
5756 |
showMethods value ifTrue:[ |
|
5757 |
allObjects := ObjectFileLoader loadedObjectHandles. |
|
5758 |
methodObjects := (allObjects select:[:h | h isMethodHandle]) asArray. |
|
5759 |
methodNames := methodObjects collect:[:mH | mH method isNil ifTrue:[ |
|
5760 |
'compiled method - removed' " , ' (in ' , mH pathName , ')' " |
|
5761 |
] ifFalse:[ |
|
5762 |
'compiled method ' , mH method whoString " , ' (in ' , mH pathName , ')' " |
|
5763 |
]. |
|
5764 |
]. |
|
5765 |
l := l , methodNames. |
|
5766 |
handles := handles , methodObjects. |
|
5767 |
]. |
|
5768 |
||
5769 |
showCObjects value ifTrue:[ |
|
5770 |
allObjects := ObjectFileLoader loadedObjectHandles. |
|
5771 |
cObjects := (allObjects select:[:h | h isFunctionObjectHandle]) asArray. |
|
5772 |
cObjectNames := cObjects collect:[:entry | entry pathName]. |
|
5773 |
l := l , cObjectNames. |
|
5774 |
handles := handles , cObjects. |
|
5775 |
]. |
|
5776 |
||
5777 |
showOthers value ifTrue:[ |
|
5778 |
allObjects := ObjectFileLoader loadedObjectHandles. |
|
5779 |
otherObjects := (allObjects select:[:h | (h isFunctionObjectHandle |
|
5780 |
or:[h isMethodHandle |
|
5781 |
or:[h isClassLibHandle]]) not]) asArray. |
|
5782 |
otherObjectNames := otherObjects collect:[:entry | entry pathName]. |
|
5783 |
l := l , otherObjectNames. |
|
5784 |
handles := handles , otherObjects. |
|
5785 |
]. |
|
5786 |
||
5787 |
showBuiltIn value ifTrue:[ |
|
5788 |
l := #('VM') , l. |
|
5789 |
handles := #(VM) , handles. |
|
5790 |
allModules := #(VM) , allModules. |
|
5791 |
]. |
|
5792 |
||
5793 |
list1 list:l. |
|
5794 |
unloadButton disable. |
|
5795 |
unloadAndRemoveButton disable. |
|
5796 |
]. |
|
5797 |
||
5798 |
showBuiltIn onChangeEvaluate:moduleListUpdater. |
|
5799 |
showModules onChangeEvaluate:moduleListUpdater. |
|
5800 |
showMethods onChangeEvaluate:moduleListUpdater. |
|
5801 |
showCObjects onChangeEvaluate:moduleListUpdater. |
|
5802 |
showOthers onChangeEvaluate:moduleListUpdater. |
|
5803 |
||
5804 |
box := Dialog new. |
|
5805 |
box label:(resources string:'ST/X & Module Version information'). |
|
5806 |
||
5807 |
listView1 := HVScrollableView for:SelectionInListView miniScrollerH:true. |
|
5808 |
listView1 model:list1. |
|
5809 |
listView1 origin:0.0@0.0 corner:1.0@0.4. "/ ; inset:2. |
|
5810 |
listView1 action:[:sel | |
|
5811 |
|info classNames tabs module| |
|
5812 |
||
5813 |
listView1 middleButtonMenu:nil. |
|
5814 |
||
5815 |
box withWaitCursorDo:[ |
|
5816 |
|nm fileName addr entry1 entry2 entry3 method l| |
|
5817 |
||
5818 |
tabs := TabulatorSpecification unit:#inch positions:#(0 2.6 3.5). |
|
5819 |
||
5820 |
(showModules value or:[showBuiltIn value]) ifTrue:[ |
|
5821 |
info := allModules at:sel ifAbsent:nil. |
|
5822 |
]. |
|
5823 |
info isNil ifTrue:[ |
|
5824 |
"/ selected a method, cObject or unknown |
|
5825 |
||
5826 |
module := handles at:sel. |
|
5827 |
fileName := module pathName. |
|
5828 |
||
5829 |
module isMethodHandle ifTrue:[ |
|
5830 |
middleLabel label:'contains method:'. |
|
5831 |
||
5832 |
(method := module method) isNil ifTrue:[ |
|
5833 |
nm := '** removed **'. |
|
5834 |
] ifFalse:[ |
|
5835 |
menu := PopUpMenu |
|
5836 |
labels:#('inspect' 'browse') |
|
5837 |
selectors:#(inspect browse). |
|
5838 |
menu actionAt:#inspect put:[ method inspect ]. |
|
5839 |
menu actionAt:#browse put:[ |who| |
|
5840 |
who := method who. |
|
5841 |
UserPreferences systemBrowserClass |
|
5842 |
openInClass:(who methodClass) |
|
5843 |
selector:(who methodSelector) |
|
5844 |
]. |
|
5845 |
listView1 middleButtonMenu:menu. |
|
5846 |
||
5847 |
nm := (method whoString) asText emphasizeAllWith:(#color->Color blue). |
|
5848 |
]. |
|
5849 |
entry1 := MultiColListEntry new:2 tabulatorSpecification:tabs. |
|
5850 |
entry1 colAt:1 put:'compiled method'; colAt:2 put:nm. |
|
5851 |
||
5852 |
entry2 := MultiColListEntry new:2 tabulatorSpecification:tabs. |
|
5853 |
entry2 colAt:1 put:'path'; colAt:2 put:fileName. |
|
5854 |
||
5855 |
entry3 := MultiColListEntry new:2 tabulatorSpecification:tabs. |
|
5856 |
entry3 colAt:1 put:'address'; colAt:2 put:('(16r) ' , (method code address hexPrintString leftPaddedTo:8 with:$0)). |
|
5857 |
||
5858 |
list2 list:(Array with:entry1 with:entry2 with:entry3). |
|
5859 |
] ifFalse:[ |
|
5860 |
(module isFunctionObjectHandle |
|
5861 |
and:[module functions notEmpty]) ifTrue:[ |
|
5862 |
middleLabel label:'contains function:'. |
|
5863 |
||
5864 |
menu := PopUpMenu |
|
5865 |
labels:#('inspect') |
|
5866 |
selectors:#(inspect). |
|
5867 |
menu actionAt:#inspect put:[ module functions inspect ]. |
|
5868 |
listView1 middleButtonMenu:menu. |
|
5869 |
||
5870 |
list2 list:((module functions select:[:f | f notNil]) |
|
5871 |
collect:[:f | |entry| |
|
5872 |
entry := MultiColListEntry new:2 tabulatorSpecification:tabs. |
|
5873 |
entry colAt:1 put:(f name asText emphasizeAllWith:(#color->Color blue)). |
|
5874 |
entry colAt:2 put:('address: (16r) ' , (f code address hexPrintString leftPaddedTo:8 with:$0)). |
|
5875 |
entry |
|
5876 |
]). |
|
5877 |
] ifFalse:[ |
|
5878 |
list2 list:#('nothing known about contents (no functions have been extracted)'). |
|
5879 |
] |
|
5880 |
]. |
|
5881 |
||
5882 |
unloadButton enable. |
|
5883 |
unloadAndRemoveButton disable. |
|
5884 |
] ifFalse:[ |
|
5885 |
info == #VM ifTrue:[ |
|
5886 |
"/ dummy entry for VM; |
|
5887 |
"/ show file versions in lower view. |
|
5888 |
||
5889 |
middleLabel label:'contains modules:'. |
|
5890 |
l := (ObjectMemory getVMIdentificationStrings). |
|
5891 |
l := l select:[:entry | entry includesString:'$Header']. |
|
5892 |
l := l select:[:entry | entry includesString:',v']. |
|
5893 |
l := l collect:[:entry | |
|
5894 |
|i1 i2 file revision date listEntry| |
|
5895 |
||
5896 |
listEntry := MultiColListEntry new:3 tabulatorSpecification:tabs. |
|
5897 |
||
5898 |
i1 := entry indexOfSubCollection:'librun'. |
|
5899 |
i1 ~~ 0 ifTrue:[ |
|
5900 |
i2 := entry indexOfSubCollection:',v' startingAt:i1. |
|
5901 |
i2 ~~ 0 ifTrue:[ |
|
5902 |
file := entry copyFrom:i1+7 to:(i2-1). |
|
5903 |
listEntry colAt:1 put:file. |
|
5904 |
||
5905 |
i1 := i2+3. |
|
5906 |
i2 := entry indexOfSeparatorStartingAt:i1. |
|
5907 |
revision := entry copyFrom:i1 to:(i2-1). |
|
5908 |
listEntry colAt:2 put:revision. |
|
5909 |
||
5910 |
i1 := i2+1. |
|
5911 |
i2 := entry indexOfSeparatorStartingAt:i1. |
|
5912 |
date := entry copyFrom:i1 to:(i2-1). |
|
5913 |
listEntry colAt:3 put:date. |
|
5914 |
]. |
|
5915 |
]. |
|
5916 |
listEntry. |
|
5917 |
"/ entry |
|
5918 |
]. |
|
5919 |
list2 list:l. |
|
5920 |
||
5921 |
unloadButton disable. |
|
5922 |
unloadAndRemoveButton disable. |
|
5923 |
] ifFalse:[ |
|
5924 |
"/ selected a package |
|
5925 |
||
5926 |
"/ fill bottom list with class-info |
|
5927 |
||
5928 |
middleLabel label:'contains classes:'. |
|
5929 |
classNames := info classNames asSortedCollection. |
|
5930 |
classNames := classNames select:[:cName | |
|
5931 |
|cls| |
|
5932 |
||
5933 |
cls := Smalltalk classNamed:cName. |
|
5934 |
cls isNil ifTrue:[ |
|
5935 |
true "a removed class" |
|
5936 |
] ifFalse:[ |
|
5937 |
cls isPrivate not |
|
5938 |
]. |
|
5939 |
]. |
|
5940 |
||
5941 |
classNames := classNames collect:[:cName | |
|
5942 |
|cls entry rev listEntry| |
|
5943 |
||
5944 |
listEntry := MultiColListEntry new:2 tabulatorSpecification:tabs. |
|
5945 |
listEntry colAt:1 put:cName. |
|
5946 |
||
5947 |
cls := Smalltalk classNamed:cName. |
|
5948 |
cls isNil ifTrue:[ |
|
5949 |
listEntry colAt:2 put:'(class removed)'. |
|
5950 |
] ifFalse:[ |
|
5951 |
rev := cls binaryRevision. |
|
5952 |
rev notNil ifTrue:[ |
|
5953 |
cls isLoaded ifFalse:[ |
|
5954 |
entry := '(stub for: ' , rev. |
|
5955 |
] ifTrue:[ |
|
5956 |
entry :='(bin: ' , rev. |
|
5957 |
]. |
|
5958 |
cls revision ~= rev ifTrue:[ |
|
5959 |
entry := entry , ' / src: ' , (cls revision printString) |
|
5960 |
]. |
|
5961 |
listEntry colAt:2 put:entry , ')' |
|
5962 |
] ifFalse:[ |
|
5963 |
cls revision notNil ifTrue:[ |
|
5964 |
listEntry colAt:2 put:'(overloaded by: ' , cls revision , ')' |
|
5965 |
] |
|
5966 |
] |
|
5967 |
]. |
|
5968 |
listEntry |
|
5969 |
]. |
|
5970 |
list2 list:classNames. |
|
5971 |
info dynamic ifTrue:[ |
|
5972 |
unloadButton enable. |
|
5973 |
unloadAndRemoveButton enable. |
|
5974 |
] ifFalse:[ |
|
5975 |
unloadButton disable. |
|
5976 |
unloadAndRemoveButton disable. |
|
5977 |
]. |
|
5978 |
]. |
|
5979 |
] |
|
5980 |
] |
|
5981 |
]. |
|
5982 |
||
5983 |
||
5984 |
panel := HorizontalPanelView new. |
|
5985 |
||
5986 |
panel add:(l := Label label:'show:'). |
|
5987 |
l adjust:#left; borderWidth:0. |
|
5988 |
panel add:(check := CheckBox label:'builtin' model:showBuiltIn). |
|
5989 |
box makeTabable:check. |
|
5990 |
panel add:(check := CheckBox label:'classLibs' model:showModules). |
|
5991 |
canDoIt ifFalse:[ |
|
5992 |
check disable |
|
5993 |
] ifTrue:[ |
|
5994 |
box makeTabable:check. |
|
5995 |
]. |
|
5996 |
panel add:(check := CheckBox label:'methods' model:showMethods). |
|
5997 |
canDoIt ifFalse:[ |
|
5998 |
check disable |
|
5999 |
] ifTrue:[ |
|
6000 |
box makeTabable:check. |
|
6001 |
]. |
|
6002 |
panel add:(check := CheckBox label:'c-objects' model:showCObjects). |
|
6003 |
canDoIt ifFalse:[ |
|
6004 |
check disable |
|
6005 |
] ifTrue:[ |
|
6006 |
box makeTabable:check. |
|
6007 |
]. |
|
6008 |
panel add:(check := CheckBox label:'others' model:showOthers). |
|
6009 |
canDoIt ifFalse:[ |
|
6010 |
check disable |
|
6011 |
] ifTrue:[ |
|
6012 |
box makeTabable:check. |
|
6013 |
]. |
|
6014 |
||
6015 |
panel horizontalLayout:#fitSpace. |
|
6016 |
"/ panel horizontalLayout:#leftSpace. |
|
6017 |
||
6018 |
box addComponent:panel tabable:false. |
|
6019 |
||
6020 |
box addVerticalSpace. |
|
6021 |
box addComponent:listView1 tabable:true. |
|
6022 |
listView1 topInset:(View viewSpacing + panel preferredExtent y). |
|
6023 |
listView1 origin:0.0@0.0 corner:1.0@0.4. "/ ; inset:2. |
|
6024 |
||
6025 |
l := box addTextLabel:(resources string:'contains:'). |
|
6026 |
l adjust:#left; borderWidth:0. |
|
6027 |
l origin:0.0@0.4 corner:1.0@0.4. |
|
6028 |
l topInset:(View viewSpacing). |
|
6029 |
l bottomInset:((l preferredExtent y) negated - View viewSpacing). |
|
6030 |
middleLabel := l. |
|
6031 |
||
6032 |
listView2 := HVScrollableView for:SelectionInListView miniScrollerH:true. |
|
6033 |
listView2 model:list2; printItems:false. |
|
6034 |
box addComponent:listView2 tabable:true. |
|
6035 |
listView2 origin:0.0@0.4 corner:1.0@1.0. "/ ; inset:2. |
|
6036 |
listView2 disable. |
|
6037 |
||
6038 |
unloadButton := Button label:(resources string:'unload'). |
|
6039 |
unloadButton action:[ |
|
6040 |
box withWaitCursorDo:[ |
|
6041 |
|info idx pathName| |
|
6042 |
||
6043 |
idx := list1 selectionIndex. |
|
6044 |
info := allModules at:idx ifAbsent:nil. |
|
6045 |
||
6046 |
list1 selectionIndex:nil. |
|
6047 |
||
6048 |
info isNil ifTrue:[ |
|
6049 |
"/ selected a method |
|
6050 |
"/ idx := idx - allModules size. |
|
6051 |
pathName := (handles at:idx) pathName. |
|
6052 |
||
6053 |
] ifFalse:[ |
|
6054 |
"/ selected a package |
|
6055 |
pathName := info pathName. |
|
6056 |
]. |
|
6057 |
ObjectFileLoader unloadObjectFile:pathName. |
|
6058 |
moduleListUpdater value. |
|
6059 |
unloadButton disable. |
|
6060 |
] |
|
6061 |
]. |
|
6062 |
||
6063 |
unloadAndRemoveButton := Button label:(resources string:'remove classes & unload'). |
|
6064 |
unloadAndRemoveButton action:[ |
|
6065 |
box withWaitCursorDo:[ |
|
6066 |
|info idx pathName| |
|
6067 |
||
6068 |
idx := list1 selectionIndex. |
|
6069 |
info := allModules at:idx ifAbsent:nil. |
|
6070 |
||
6071 |
list1 selectionIndex:nil. |
|
6072 |
||
6073 |
info isNil ifTrue:[ |
|
6074 |
"/ selected a method |
|
6075 |
"/ idx := idx - allModules size. |
|
6076 |
pathName := (handles at:idx) pathName. |
|
6077 |
||
6078 |
] ifFalse:[ |
|
6079 |
"/ selected a package |
|
6080 |
pathName := info pathName. |
|
6081 |
]. |
|
6082 |
ObjectFileLoader unloadObjectFileAndRemoveClasses:pathName. |
|
6083 |
moduleListUpdater value. |
|
6084 |
unloadAndRemoveButton disable. |
|
6085 |
] |
|
6086 |
]. |
|
6087 |
||
6088 |
moduleListUpdater value. |
|
6089 |
||
6090 |
box addButton:unloadButton. |
|
6091 |
box addButton:unloadAndRemoveButton. |
|
6092 |
box addAbortButtonLabelled:(resources string:'dismiss'). |
|
6093 |
||
6094 |
y := box yPosition. |
|
6095 |
listView2 topInset:(l preferredExtent y + 5). |
|
6096 |
listView2 bottomInset:(box preferredExtent y - y). |
|
6097 |
||
6098 |
box width:(400 min:(box device width * 2 // 3)); |
|
6099 |
height:(450 min:(box device height - 50)). |
|
6100 |
||
6101 |
"/ box sizeFixed:true. |
|
6102 |
box openWithExtent:(600 min:(box device width * 2 // 3)) |
|
6103 |
@ |
|
6104 |
(500 min:(box device height - 50)) . |
|
6105 |
||
6106 |
box destroy. |
|
6107 |
||
6108 |
"Modified: / 17.9.1995 / 16:47:50 / claus" |
|
6109 |
"Created: / 31.7.1998 / 15:49:45 / cg" |
|
6110 |
"Modified: / 10.8.1998 / 11:33:22 / cg" |
|
6111 |
! |
|
6112 |
||
6113 |
packageDialog |
|
6114 |
"opens a package dialog" |
|
6115 |
||
6116 |
|allPackages packageList packageUpdater |
|
6117 |
box listView tabs |
|
6118 |
menu resources selectedPackage| |
|
6119 |
||
6120 |
resources := self owningClass classResources. |
|
6121 |
||
6122 |
box := Dialog new. |
|
6123 |
box label:(resources string:'Packages'). |
|
6124 |
||
6125 |
allPackages := Set new. |
|
6126 |
allPackages addAll:(Smalltalk knownPackages). |
|
6127 |
||
6128 |
Project knownProjects do:[:package | |
|
6129 |
allPackages add:(package name) |
|
6130 |
]. |
|
6131 |
Project loadedProjects do:[:package | |
|
6132 |
allPackages add:(package name) |
|
6133 |
]. |
|
6134 |
allPackages := allPackages asOrderedCollection sort. |
|
6135 |
||
6136 |
packageUpdater := [ |
|
6137 |
tabs := TabulatorSpecification unit:#inch positions:#(0 4). |
|
6138 |
packageList := allPackages collect:[:pName | |pkg entry| |
|
6139 |
entry := MultiColListEntry new:2 tabulatorSpecification:tabs. |
|
6140 |
pkg := Project projectWithId:pName asSymbol. |
|
6141 |
(pkg notNil and:[pkg isLoaded]) ifTrue:[ |
|
6142 |
entry colAt:1 put:pName allBold. |
|
6143 |
entry colAt:2 put:'loaded'. |
|
6144 |
] ifFalse:[ |
|
6145 |
entry colAt:1 put:pName. |
|
6146 |
||
6147 |
(Smalltalk allClasses |
|
6148 |
contains:[:cls | cls package = pName and:[cls isLoaded not]]) |
|
6149 |
ifTrue:[ |
|
6150 |
(Smalltalk allClasses |
|
6151 |
contains:[:cls | cls package = pName and:[cls isLoaded]]) |
|
6152 |
ifTrue:[ |
|
6153 |
entry colAt:2 put:'loaded/autoloaded'. |
|
6154 |
] ifFalse:[ |
|
6155 |
entry colAt:2 put:'autoloaded'. |
|
6156 |
] |
|
6157 |
] |
|
6158 |
]. |
|
6159 |
entry |
|
6160 |
]. |
|
6161 |
]. |
|
6162 |
packageUpdater value. |
|
6163 |
||
6164 |
listView := HVScrollableView for:SelectionInListView miniScrollerH:true. |
|
6165 |
listView list:packageList. |
|
6166 |
||
6167 |
box addComponent:listView tabable:true. |
|
6168 |
listView origin:0.0@0.0 corner:1.0@1.0. |
|
6169 |
listView bottomInset:40. |
|
6170 |
listView action:[:selIndex | |pkg| |
|
6171 |
selectedPackage := (allPackages at:selIndex) asSymbol. |
|
6172 |
||
6173 |
pkg := Project projectWithId:selectedPackage. |
|
6174 |
(pkg notNil and:[pkg isLoaded]) ifTrue:[ |
|
6175 |
menu disable:#load. |
|
6176 |
"/ menu enable:#unload. |
|
6177 |
] ifFalse:[ |
|
6178 |
"/ menu disable:#unload. |
|
6179 |
menu enable:#load. |
|
6180 |
] |
|
6181 |
]. |
|
6182 |
||
6183 |
menu := PopUpMenu |
|
6184 |
itemList:#( |
|
6185 |
('load...' load ) |
|
6186 |
"/ ('-' nil ) |
|
6187 |
"/ ('unload...' unload) |
|
6188 |
) |
|
6189 |
resources:resources. |
|
6190 |
listView middleButtonMenu:menu. |
|
6191 |
menu actionAt:#load put:[ |
|
6192 |
box withWaitCursorDo:[ |
|
6193 |
Smalltalk loadPackage:selectedPackage. |
|
6194 |
packageUpdater value. |
|
6195 |
] |
|
6196 |
]. |
|
6197 |
"/ menu actionAt:#unload put:[ |
|
6198 |
"/ box withWaitCursorDo:[ |
|
6199 |
"/ Smalltalk unloadPackage:selectedPackage. |
|
6200 |
"/ packageUpdater value. |
|
6201 |
"/ ]. |
|
6202 |
"/ ]. |
|
6203 |
menu disable:#load. |
|
6204 |
"/ menu disable:#unload. |
|
6205 |
||
6206 |
box addAbortButtonLabelled:(resources string:'dismiss'). |
|
6207 |
||
6208 |
box width:(400 min:(box device width * 2 // 3)); |
|
6209 |
height:(450 min:(box device height - 50)). |
|
6210 |
||
6211 |
box openWithExtent:(600 min:(box device width * 2 // 3)) |
|
6212 |
@ |
|
6213 |
(500 min:(box device height - 50)) . |
|
6214 |
||
6215 |
box destroy. |
|
2001 | 6216 |
! ! |
6217 |
||
2884
587baa691c68
fixes & adds for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents:
2883
diff
changeset
|
6218 |
!AbstractLauncherApplication::LauncherDialogs class methodsFor:'dialogs - private'! |
2001 | 6219 |
|
4244 | 6220 |
cvsConfigurationDialog |
6221 |
|cvsRootHolder resources defaultsList bindings dialog |
|
6222 |
listOfModules selectedPerModuleRoot rootsPerModule acceptChannel |
|
6223 |
removeEnabled cvsBinDirectoryHolder| |
|
6224 |
||
6225 |
resources := self owningClass classResources. |
|
6226 |
||
6227 |
OperatingSystem isUNIXlike ifTrue:[ |
|
6228 |
defaultsList := #( |
|
6229 |
'/files/CVS' |
|
6230 |
'/CVS' |
|
6231 |
'host:/files/CVS' |
|
6232 |
'host:/CVS' |
|
6233 |
':pserver:user@host:/files/CVS' |
|
6234 |
). |
|
6235 |
] ifFalse:[ |
|
6236 |
OperatingSystem isMSDOSlike ifTrue:[ |
|
6237 |
defaultsList := #( |
|
6238 |
':local:c:\files\CVS' |
|
6239 |
':local:c:\CVS' |
|
6240 |
'host:/files/CVS' |
|
6241 |
'host:/CVS' |
|
6242 |
':pserver:user@host:/files/CVS' |
|
6243 |
). |
|
6244 |
] ifFalse:[ |
|
6245 |
defaultsList := #('host:/files/CVS' 'host:/CVS' ':pserver:user@host:/files/CVS'). |
|
6246 |
] |
|
6247 |
]. |
|
6248 |
||
6249 |
cvsRootHolder := CVSSourceCodeManager repositoryName ? '/files/CVS'. |
|
6250 |
cvsRootHolder := cvsRootHolder asValue. |
|
6251 |
rootsPerModule := Dictionary new declareAllFrom:(CVSSourceCodeManager repositoryNamesPerModule). |
|
6252 |
cvsBinDirectoryHolder := CVSSourceCodeManager cvsBinDirectory asValue. |
|
6253 |
||
6254 |
bindings := IdentityDictionary new. |
|
6255 |
bindings at:#acceptChannel put:(acceptChannel := TriggerValue new). |
|
6256 |
||
6257 |
bindings at:#cvsRootPrototypeList put:defaultsList. |
|
6258 |
bindings at:#cvsRootHolder put:cvsRootHolder. |
|
6259 |
bindings at:#perModuleRootModule put:nil asValue. |
|
6260 |
bindings at:#perModuleRoot put:nil asValue. |
|
6261 |
bindings at:#removeEnabled put:(removeEnabled := false asValue). |
|
6262 |
bindings at:#listOfModules put:(listOfModules := rootsPerModule keys asList). |
|
6263 |
bindings at:#cvsBinDirectoryHolder put:cvsBinDirectoryHolder. |
|
6264 |
listOfModules sort. |
|
6265 |
||
6266 |
bindings at:#selectedPerModuleRoot put:(selectedPerModuleRoot := nil asValue). |
|
6267 |
selectedPerModuleRoot |
|
6268 |
onChangeEvaluate:[ |
|
6269 |
|module cvsRoot| |
|
6270 |
||
6271 |
acceptChannel value:true. |
|
6272 |
module := selectedPerModuleRoot value. |
|
6273 |
removeEnabled value:true. |
|
6274 |
cvsRoot := rootsPerModule at:module ifAbsent:''. |
|
6275 |
(bindings at:#perModuleRootModule) value:module. |
|
6276 |
(bindings at:#perModuleRoot) value:cvsRoot. |
|
6277 |
]. |
|
6278 |
||
6279 |
bindings at:#help put:[ |
|
6280 |
WindowGroup activeGroup withWaitCursorDo:[ |
|
6281 |
HTMLDocumentView openFullOnHelpFile:'Launcher/cvsSetup.html' |
|
6282 |
] |
|
6283 |
]. |
|
6284 |
||
6285 |
bindings at:#addPerModuleRoot put:[ |
|
6286 |
|module cvsRoot| |
|
6287 |
||
6288 |
acceptChannel value:true. |
|
6289 |
module := (bindings at:#perModuleRootModule) value. |
|
6290 |
cvsRoot := (bindings at:#perModuleRoot) value. |
|
6291 |
(listOfModules includes:module) ifFalse:[ |
|
6292 |
listOfModules add:module. |
|
6293 |
listOfModules sort. |
|
6294 |
]. |
|
6295 |
cvsRoot size > 0 ifTrue:[ |
|
6296 |
rootsPerModule at:module put:cvsRoot. |
|
6297 |
]. |
|
6298 |
]. |
|
6299 |
bindings at:#removePerModuleRoot put:[ |
|
6300 |
|module| |
|
6301 |
||
6302 |
acceptChannel value:true. |
|
6303 |
module := (bindings at:#perModuleRootModule) value. |
|
6304 |
listOfModules remove:module ifAbsent:nil. |
|
6305 |
rootsPerModule removeKey:module ifAbsent:nil. |
|
6306 |
(bindings at:#perModuleRootModule) value:nil. |
|
6307 |
(bindings at:#perModuleRoot) value:nil. |
|
6308 |
]. |
|
6309 |
||
6310 |
dialog := SimpleDialog new. |
|
6311 |
dialog resources:resources. |
|
6312 |
(dialog openSpec:(self cvsSetupSpec) withBindings:bindings) ifFalse:[ |
|
6313 |
^ self |
|
6314 |
]. |
|
6315 |
||
6316 |
acceptChannel value. |
|
6317 |
||
6318 |
"/ |
|
6319 |
"/ update system settings |
|
6320 |
"/ |
|
6321 |
CVSSourceCodeManager cvsBinDirectory:cvsBinDirectoryHolder value. |
|
6322 |
CVSSourceCodeManager initializeForRepository:cvsRootHolder value. |
|
6323 |
CVSSourceCodeManager repositoryNamesPerModule:rootsPerModule. |
|
6324 |
! |
|
6325 |
||
6326 |
fontBoxForEncoding:encodingMatch |
|
6327 |
"open a fontBox, showing fonts which match some encoding |
|
6328 |
(used when changing to japanese ...)" |
|
6329 |
||
6330 |
|box y b |
|
6331 |
labelDef buttonDef listDef menuDef textDef |
|
6332 |
models labels allOfThem filter resources defaultButton| |
|
6333 |
||
6334 |
resources := self owningClass classResources. |
|
6335 |
||
6336 |
encodingMatch notNil ifTrue:[ |
|
6337 |
filter := [:f | f encoding notNil |
|
6338 |
and:[encodingMatch match:f encoding]]. |
|
6339 |
]. |
|
6340 |
||
6341 |
models := OrderedCollection new. |
|
6342 |
labels := OrderedCollection new. |
|
6343 |
||
6344 |
models add:(allOfThem := nil asValue). |
|
6345 |
models add:(labelDef := Label defaultFont asValue). |
|
6346 |
models add:(buttonDef := Button defaultFont asValue). |
|
6347 |
models add:(listDef := SelectionInListView defaultFont asValue). |
|
6348 |
models add:(menuDef := MenuView defaultFont asValue). |
|
6349 |
models add:(textDef := TextView defaultFont asValue). |
|
6350 |
||
6351 |
box := Dialog new. |
|
6352 |
box label:(resources string:'Font Settings'). |
|
6353 |
||
6354 |
models |
|
6355 |
with:(resources array:#('All' 'Labels' 'Buttons' 'Lists' 'Menus' 'Edited Text')) |
|
6356 |
do:[:model :title | |
|
6357 |
|y2 lbl f i| |
|
6358 |
||
6359 |
f := model value. |
|
6360 |
||
6361 |
(box addTextLabel:title) adjust:#left. |
|
6362 |
||
6363 |
y := box yPosition. |
|
6364 |
b := box addComponent:(Button label:(resources string:'Change ...')) tabable:true. |
|
6365 |
b relativeExtent:nil; extent:(b preferredExtent). |
|
6366 |
y2 := box yPosition. |
|
6367 |
box yPosition:y. |
|
6368 |
i := box leftIndent. |
|
6369 |
box leftIndent:(b widthIncludingBorder + View viewSpacing). |
|
6370 |
(lbl := box addTextLabel:'') |
|
6371 |
adjust:#left; |
|
6372 |
font:(model value); |
|
6373 |
labelChannel:(BlockValue |
|
6374 |
with:[:v | |f| |
|
6375 |
f := v value. |
|
6376 |
f isNil ifTrue:[ |
|
6377 |
'' |
|
6378 |
] ifFalse:[ |
|
6379 |
f userFriendlyName |
|
6380 |
] |
|
6381 |
] |
|
6382 |
argument:model). |
|
6383 |
labels add:lbl. |
|
6384 |
||
6385 |
box leftIndent:i. |
|
6386 |
box yPosition:(box yPosition max:y2). |
|
6387 |
||
6388 |
box addVerticalSpace; addHorizontalLine; addVerticalSpace. |
|
6389 |
||
6390 |
b action:[ |
|
6391 |
|f| |
|
6392 |
||
6393 |
f := FontPanel |
|
6394 |
fontFromUserInitial:(model value) |
|
6395 |
title:(resources string:'Font for %1' with:title) |
|
6396 |
filter:filter. |
|
6397 |
f notNil ifTrue:[ |
|
6398 |
model == allOfThem ifTrue:[ |
|
6399 |
models do:[:m | m value:f]. |
|
6400 |
labels do:[:l | l font:f] |
|
6401 |
] ifFalse:[ |
|
6402 |
model value:f. |
|
6403 |
lbl font:f. |
|
6404 |
]. |
|
6405 |
] |
|
6406 |
]. |
|
6407 |
model == allOfThem ifTrue:[ |
|
6408 |
box addVerticalSpace |
|
6409 |
] |
|
6410 |
]. |
|
6411 |
||
6412 |
box addAbortAndOkButtons. |
|
6413 |
defaultButton := Button label:(resources string:'Defaults'). |
|
6414 |
||
6415 |
(DialogBox styleSheet at:'dialogBox.okAtLeft') ifTrue:[ |
|
6416 |
box addButton:defaultButton after:nil. |
|
6417 |
] ifFalse:[ |
|
6418 |
box addButton:defaultButton before:nil. |
|
6419 |
]. |
|
6420 |
defaultButton |
|
6421 |
action:[ |
|
6422 |
"/ fetch defaults |
|
6423 |
View readStyleSheetAndUpdateAllStyleCaches. |
|
6424 |
labelDef value: Label defaultFont. |
|
6425 |
buttonDef value: Button defaultFont. |
|
6426 |
listDef value: SelectionInListView defaultFont. |
|
6427 |
menuDef value: MenuView defaultFont. |
|
6428 |
textDef value: TextView defaultFont. |
|
6429 |
]. |
|
6430 |
||
6431 |
box open. |
|
6432 |
box accepted ifTrue:[ |
|
6433 |
Label defaultFont:labelDef value. |
|
6434 |
Button defaultFont:buttonDef value. |
|
6435 |
Toggle defaultFont:buttonDef value. |
|
6436 |
TextView withAllSubclasses do:[:cls | cls defaultFont:textDef value]. |
|
6437 |
SelectionInListView withAllSubclasses do:[:cls | cls defaultFont:listDef value]. |
|
6438 |
MenuView defaultFont:menuDef value. |
|
6439 |
PullDownMenu defaultFont:menuDef value. |
|
6440 |
]. |
|
6441 |
box destroy. |
|
6442 |
^ box accepted |
|
6443 |
||
6444 |
"Created: / 27.2.1996 / 01:44:16 / cg" |
|
6445 |
"Modified: / 17.6.1996 / 13:38:48 / stefan" |
|
6446 |
"Modified: / 15.9.1998 / 22:04:51 / cg" |
|
6447 |
! |
|
6448 |
||
6449 |
formattingConfigurationDialog |
|
6450 |
|dialog |
|
6451 |
resources exampleText formattedText reformatAction |
|
6452 |
reformatLocked |
|
6453 |
oldUserPreferences |
|
6454 |
currentUserPrefs |
|
6455 |
tabIndent |
|
6456 |
spaceAroundTemporaries emptyLineAfterTemporaries |
|
6457 |
spaceAfterReturnToken spaceAfterKeywordSelector cStyleBlocks |
|
6458 |
blockArgumentsOnNewLine |
|
6459 |
maxLengthForSingleLineBlocks resetValue bindings| |
|
6460 |
||
6461 |
RBFormatter isNil ifTrue:[ |
|
6462 |
^ self warn:'Sorry, no RBFormatter class'. |
|
6463 |
]. |
|
6464 |
||
6465 |
RBFormatter isLoaded ifFalse:[ |
|
6466 |
WindowGroup activeGroup withWaitCursorDo:[ |
|
6467 |
RBFormatter autoload |
|
6468 |
] |
|
6469 |
]. |
|
6470 |
||
6471 |
resources := self owningClass classResources. |
|
6472 |
currentUserPrefs := UserPreferences current. |
|
6473 |
||
6474 |
exampleText := |
|
6475 |
'methodSelector:methodArg |
|
6476 |
"method comment: |
|
6477 |
some stupid code to show the current settings" |
|
6478 |
||
6479 |
|index| |
|
6480 |
||
6481 |
"/ another comment ... |
|
6482 |
self at:index. "/ a message |
|
6483 |
self at:index put:methodArg. "/ a two arg message |
|
6484 |
self from:1 to:index put:methodArg. "/ a three arg message |
|
6485 |
methodArg ifTrue:[ |
|
6486 |
Transcript showCR:''hello''. "/ condition |
|
6487 |
]. |
|
6488 |
methodArg ifTrue:[ |
|
6489 |
Transcript showCR:''hello''. "/ condition |
|
6490 |
] ifFalse:[ |
|
6491 |
Transcript showCR:''world''. |
|
6492 |
]. |
|
6493 |
[methodArg] whileTrue:[ |
|
6494 |
Transcript showCR:''hello''. "/ looping |
|
6495 |
]. |
|
6496 |
[self aVeryLongConditionBlock and:[self toMakeBlockLonger]] whileTrue:[ |
|
6497 |
Transcript showCR:''hello''. "/ long blocks |
|
6498 |
]. |
|
6499 |
methodArg do:[:element | |
|
6500 |
Transcript showCR:''hello''. "/ looping |
|
6501 |
]. |
|
6502 |
1 to:methodArg size do:[:index | |
|
6503 |
Transcript showCR:''hello''. "/ looping |
|
6504 |
]. |
|
6505 |
methodArg keysAndValuesDo:[:index | |
|
6506 |
Transcript showCR:''hello''. "/ looping |
|
6507 |
]. |
|
6508 |
Object errorSignal handle:[:ex | |
|
6509 |
ex return |
|
6510 |
] do:[ "/ exception handling |
|
6511 |
self someAction "/ blocks |
|
6512 |
]. |
|
6513 |
^ self. |
|
6514 |
'. |
|
6515 |
||
6516 |
formattedText := '' asValue. |
|
6517 |
reformatLocked := false. |
|
6518 |
||
6519 |
reformatAction := [ |tree |
|
6520 |
s_tabIndent s_spaceAroundTemporaries s_emptyLineAfterTemporaries |
|
6521 |
s_spaceAfterReturnToken s_spaceAfterKeywordSelector s_cStyleBlocks |
|
6522 |
s_maxLengthForSingleLineBlocks s_blockArgumentsOnNewLine| |
|
6523 |
||
6524 |
reformatLocked ifFalse:[ |
|
6525 |
"/ |
|
6526 |
"/ temporary change the RBFormatters settings ... |
|
6527 |
"/ |
|
6528 |
s_tabIndent := RBFormatter tabIndent. |
|
6529 |
s_spaceAroundTemporaries := RBFormatter spaceAroundTemporaries. |
|
6530 |
s_emptyLineAfterTemporaries := RBFormatter emptyLineAfterTemporaries. |
|
6531 |
s_spaceAfterReturnToken := RBFormatter spaceAfterReturnToken. |
|
6532 |
s_spaceAfterKeywordSelector := RBFormatter spaceAfterKeywordSelector. |
|
6533 |
s_cStyleBlocks := RBFormatter cStyleBlocks. |
|
6534 |
s_blockArgumentsOnNewLine := RBFormatter blockArgumentsOnNewLine. |
|
6535 |
s_maxLengthForSingleLineBlocks := RBFormatter maxLengthForSingleLineBlocks. |
|
6536 |
||
6537 |
RBFormatter |
|
6538 |
tabIndent:tabIndent value; |
|
6539 |
spaceAroundTemporaries:spaceAroundTemporaries value; |
|
6540 |
emptyLineAfterTemporaries:emptyLineAfterTemporaries value; |
|
6541 |
spaceAfterReturnToken:spaceAfterReturnToken value; |
|
6542 |
spaceAfterKeywordSelector:spaceAfterKeywordSelector value; |
|
6543 |
cStyleBlocks:cStyleBlocks value; |
|
6544 |
blockArgumentsOnNewLine:blockArgumentsOnNewLine value; |
|
6545 |
maxLengthForSingleLineBlocks:maxLengthForSingleLineBlocks value. |
|
6546 |
||
6547 |
tree := RBParser |
|
6548 |
parseMethod:exampleText |
|
6549 |
onError: [:aString :position | nil]. |
|
6550 |
tree do:[:node | |
|
6551 |
(node ~~ tree and:[node parent isNil]) ifTrue:[ |
|
6552 |
self error:'No parent for node'. |
|
6553 |
] |
|
6554 |
]. |
|
6555 |
formattedText value:tree printString. |
|
6556 |
||
6557 |
RBFormatter |
|
6558 |
tabIndent:s_tabIndent; |
|
6559 |
spaceAroundTemporaries:s_spaceAroundTemporaries; |
|
6560 |
emptyLineAfterTemporaries:s_emptyLineAfterTemporaries; |
|
6561 |
spaceAfterReturnToken:s_spaceAfterReturnToken; |
|
6562 |
spaceAfterKeywordSelector:s_spaceAfterKeywordSelector; |
|
6563 |
cStyleBlocks:s_cStyleBlocks; |
|
6564 |
blockArgumentsOnNewLine:s_blockArgumentsOnNewLine; |
|
6565 |
maxLengthForSingleLineBlocks:s_maxLengthForSingleLineBlocks. |
|
6566 |
]. |
|
6567 |
]. |
|
6568 |
||
6569 |
bindings := IdentityDictionary new. |
|
6570 |
bindings at:#formattedText put:formattedText. |
|
6571 |
||
6572 |
oldUserPreferences := currentUserPrefs copy. |
|
6573 |
||
6574 |
tabIndent := RBFormatter tabIndent asValue. |
|
6575 |
tabIndent onChangeEvaluate:reformatAction. |
|
6576 |
bindings at:#tabIndent put:tabIndent. |
|
6577 |
||
6578 |
spaceAroundTemporaries := RBFormatter spaceAroundTemporaries asValue. |
|
6579 |
spaceAroundTemporaries onChangeEvaluate:reformatAction. |
|
6580 |
bindings at:#spaceAroundTemporaries put:spaceAroundTemporaries. |
|
6581 |
||
6582 |
emptyLineAfterTemporaries := RBFormatter emptyLineAfterTemporaries asValue. |
|
6583 |
emptyLineAfterTemporaries onChangeEvaluate:reformatAction. |
|
6584 |
bindings at:#emptyLineAfterTemporaries put:emptyLineAfterTemporaries. |
|
6585 |
||
6586 |
spaceAfterReturnToken := RBFormatter spaceAfterReturnToken asValue. |
|
6587 |
spaceAfterReturnToken onChangeEvaluate:reformatAction. |
|
6588 |
bindings at:#spaceAfterReturnToken put:spaceAfterReturnToken. |
|
6589 |
||
6590 |
spaceAfterKeywordSelector := RBFormatter spaceAfterKeywordSelector asValue. |
|
6591 |
spaceAfterKeywordSelector onChangeEvaluate:reformatAction. |
|
6592 |
bindings at:#spaceAfterKeywordSelector put:spaceAfterKeywordSelector. |
|
6593 |
||
6594 |
cStyleBlocks := RBFormatter cStyleBlocks asValue. |
|
6595 |
cStyleBlocks onChangeEvaluate:reformatAction. |
|
6596 |
bindings at:#cStyleBlocks put:cStyleBlocks. |
|
6597 |
||
6598 |
blockArgumentsOnNewLine := RBFormatter blockArgumentsOnNewLine asValue. |
|
6599 |
blockArgumentsOnNewLine onChangeEvaluate:reformatAction. |
|
6600 |
bindings at:#blockArgumentsOnNewLine put:blockArgumentsOnNewLine. |
|
6601 |
||
6602 |
maxLengthForSingleLineBlocks := RBFormatter maxLengthForSingleLineBlocks asValue. |
|
6603 |
maxLengthForSingleLineBlocks onChangeEvaluate:reformatAction. |
|
6604 |
bindings at:#maxLengthForSingleLineBlocks put:maxLengthForSingleLineBlocks. |
|
6605 |
||
6606 |
bindings at:#resetList put:#( 'ST/X default' 'RB default' ). |
|
6607 |
bindings at:#resetValue put:(resetValue := nil asValue). |
|
6608 |
resetValue onChangeEvaluate: |
|
6609 |
[ |
|
6610 |
resetValue value == 1 ifTrue:[ |
|
6611 |
"/ ST/X defaults |
|
6612 |
reformatLocked := true. |
|
6613 |
tabIndent value: 4. |
|
6614 |
spaceAfterReturnToken value: true. |
|
6615 |
spaceAfterKeywordSelector value: false. |
|
6616 |
spaceAroundTemporaries value: false. |
|
6617 |
emptyLineAfterTemporaries value: true. |
|
6618 |
cStyleBlocks value: true. |
|
6619 |
blockArgumentsOnNewLine value:false. |
|
6620 |
maxLengthForSingleLineBlocks value: 20. |
|
6621 |
reformatLocked := false. |
|
6622 |
reformatAction value. |
|
6623 |
]. |
|
6624 |
resetValue value == 2 ifTrue:[ |
|
6625 |
"/ RBParser defaults |
|
6626 |
reformatLocked := true. |
|
6627 |
tabIndent value: 8. |
|
6628 |
spaceAfterReturnToken value: false. |
|
6629 |
spaceAfterKeywordSelector value: true. |
|
6630 |
spaceAroundTemporaries value: true. |
|
6631 |
emptyLineAfterTemporaries value: false. |
|
6632 |
cStyleBlocks value: false. |
|
6633 |
blockArgumentsOnNewLine value:false. |
|
6634 |
maxLengthForSingleLineBlocks value: 20. |
|
6635 |
reformatLocked := false. |
|
6636 |
reformatAction value. |
|
6637 |
]. |
|
6638 |
resetValue value:nil. "/ to force default label |
|
6639 |
]. |
|
6640 |
||
6641 |
reformatAction value. |
|
6642 |
||
6643 |
"/ |
|
6644 |
"/ create a box on those ... |
|
6645 |
"/ |
|
6646 |
dialog := SimpleDialog new. |
|
6647 |
dialog postBuildBlock:[:builder | |
|
6648 |
(builder componentAt:#sampleTextView) |
|
6649 |
cursorMovementWhenUpdating:nil; |
|
6650 |
scrollWhenUpdating:nil. |
|
6651 |
]. |
|
6652 |
(dialog openFor:nil |
|
6653 |
spec:(self formatterDialogSpec) |
|
6654 |
withBindings:bindings) |
|
6655 |
ifTrue:[ |
|
6656 |
currentUserPrefs at:#'formatter.tabIndent' put:tabIndent value. |
|
6657 |
currentUserPrefs at:#'formatter.spaceAroundTemporaries' put:spaceAroundTemporaries value. |
|
6658 |
currentUserPrefs at:#'formatter.emptyLineAfterTemporaries' put:emptyLineAfterTemporaries value. |
|
6659 |
currentUserPrefs at:#'formatter.spaceAfterReturnToken' put:spaceAfterReturnToken value. |
|
6660 |
currentUserPrefs at:#'formatter.spaceAfterKeywordSelector' put:spaceAfterKeywordSelector value. |
|
6661 |
currentUserPrefs at:#'formatter.cStyleBlocks' put:cStyleBlocks value. |
|
6662 |
currentUserPrefs at:#'formatter.blockArgumentsOnNewLine' put:blockArgumentsOnNewLine value. |
|
6663 |
currentUserPrefs at:#'formatter.maxLengthForSingleLineBlocks' put:maxLengthForSingleLineBlocks value. |
|
6664 |
RBFormatter |
|
6665 |
tabIndent:tabIndent value; |
|
6666 |
spaceAroundTemporaries:spaceAroundTemporaries value; |
|
6667 |
emptyLineAfterTemporaries:emptyLineAfterTemporaries value; |
|
6668 |
spaceAfterReturnToken:spaceAfterReturnToken value; |
|
6669 |
spaceAfterKeywordSelector:spaceAfterKeywordSelector value; |
|
6670 |
cStyleBlocks:cStyleBlocks value; |
|
6671 |
blockArgumentsOnNewLine:blockArgumentsOnNewLine value; |
|
6672 |
maxLengthForSingleLineBlocks:maxLengthForSingleLineBlocks value. |
|
6673 |
] ifFalse: [ |
|
6674 |
(UserPreferences reset; current) declareAllFrom: oldUserPreferences |
|
6675 |
]. |
|
6676 |
! |
|
6677 |
||
6678 |
syntaxColorConfigurationDialog |
|
6679 |
|box frame exampleView y |
|
6680 |
resources exampleText coloredText recolorAction |
|
6681 |
syntaxColor syntaxColors colorMenu oldUserPreferences |
|
6682 |
syntaxEmphasises syntaxColorSelector syntaxEmphasisSelector syntaxColoringBox |
|
6683 |
syntaxEmphasisesBox syntaxColoringResetButton b resetList |
|
6684 |
resetListBox currentUserPrefs| |
|
6685 |
||
6686 |
resources := self owningClass classResources. |
|
6687 |
currentUserPrefs := UserPreferences current. |
|
6688 |
||
6689 |
exampleText := |
|
6690 |
'methodSelector:methodArg |
|
6691 |
"method comment: |
|
6692 |
some stupid code to show the current settings" |
|
6693 |
||
6694 |
|methodVar| |
|
6695 |
||
6696 |
"/ another comment ... |
|
6697 |
self at:methodArg. "/ a message |
|
6698 |
self fooBarBaz:methodVar. "/ a bad message |
|
6699 |
methodVar := Array new:1. |
|
6700 |
unknonVar := 1. "/ a bad variable |
|
6701 |
UnknonVar := 1. "/ another bad variable |
|
6702 |
"self bar:methodVar. detect commented code easily" |
|
6703 |
1 to:5 do:[:i | self at:i + 1]. |
|
6704 |
Transcript showCR:''some string'' , #someSymbol. |
|
6705 |
^ self. |
|
6706 |
'. |
|
6707 |
||
6708 |
coloredText := '' asValue. |
|
6709 |
recolorAction := [ coloredText value:(SyntaxHighlighter formatMethod:exampleText in:nil) ]. |
|
6710 |
recolorAction value. |
|
6711 |
||
6712 |
"/ |
|
6713 |
"/ create a box on those values ... |
|
6714 |
"/ |
|
6715 |
box := DialogBox new. |
|
6716 |
box label:(resources string:'Syntax Colors'). |
|
6717 |
||
6718 |
frame := View new. |
|
6719 |
frame extent:1.0 @ 200. |
|
6720 |
frame borderWidth:0. |
|
6721 |
||
6722 |
exampleView := HVScrollableView for:TextView in:frame. |
|
6723 |
exampleView model:coloredText. |
|
6724 |
exampleView origin:0.0@0.0 corner:1.0@1.0; inset:2. |
|
6725 |
||
6726 |
frame topInset:box yPosition. |
|
6727 |
box addComponent:frame withExtent:1.0@200. |
|
6728 |
box makeTabable:exampleView. |
|
6729 |
frame width:1.0. |
|
6730 |
||
6731 |
box addVerticalSpace. |
|
6732 |
||
6733 |
oldUserPreferences := currentUserPrefs copy. |
|
6734 |
||
6735 |
syntaxColoringBox := box addComboListOn: (syntaxColors := SelectionInList with:UserPreferences syntaxColorNames initialSelection:1). |
|
6736 |
syntaxColorSelector := [(syntaxColors selection replChar:$ withString: '') asLowercaseFirst asSymbol]. |
|
6737 |
syntaxEmphasisSelector := [((syntaxColorSelector value readStream upToAll: 'Color'), 'Emphasis') asLowercaseFirst asSymbol]. |
|
6738 |
syntaxColor := (currentUserPrefs perform: syntaxColorSelector value) asValue. |
|
6739 |
colorMenu := ColorMenu new. |
|
6740 |
colorMenu model: syntaxColor. |
|
6741 |
syntaxColor onChangeEvaluate: |
|
6742 |
[currentUserPrefs at: syntaxColorSelector value put: syntaxColor value. |
|
6743 |
recolorAction value.]. |
|
6744 |
syntaxColors onChangeEvaluate: |
|
6745 |
[|eVal| |
|
6746 |
syntaxColor value: (currentUserPrefs perform:syntaxColorSelector value). |
|
6747 |
eVal := currentUserPrefs perform: syntaxEmphasisSelector value. |
|
6748 |
eVal isArray ifTrue:[ |
|
6749 |
eVal = (Array with:#underwave with:#underlineColor->(Color red:100.0 green:0.0 blue:0.0)) ifTrue:[ |
|
6750 |
eVal := #'red underwave' |
|
6751 |
]. |
|
6752 |
eVal = (Array with:#bold with:#underwave with:#underlineColor->(Color red:100.0 green:0.0 blue:0.0)) ifTrue:[ |
|
6753 |
eVal := #'bold+red underwave' |
|
6754 |
]. |
|
6755 |
eVal = (Array with:#bold with:#underlineColor->(Color red:100.0 green:0.0 blue:0.0)) ifTrue:[ |
|
6756 |
eVal := #'bold+red underline' |
|
6757 |
]. |
|
6758 |
eVal = (Array with:#italic with:#underwave with:#underlineColor->(Color red:100.0 green:0.0 blue:0.0)) ifTrue:[ |
|
6759 |
eVal := #'italic+red underwave' |
|
6760 |
]. |
|
6761 |
eVal = (Array with:#italic with:#underlineColor->(Color red:100.0 green:0.0 blue:0.0)) ifTrue:[ |
|
6762 |
eVal := #'italic+red underline' |
|
6763 |
]. |
|
6764 |
]. |
|
6765 |
syntaxEmphasises selection: eVal. |
|
6766 |
recolorAction value.]. |
|
6767 |
||
6768 |
syntaxEmphasises := SelectionInList |
|
6769 |
with:#( |
|
6770 |
normal |
|
6771 |
underline |
|
6772 |
#'red underline' |
|
6773 |
underwave |
|
6774 |
#'red underwave' |
|
6775 |
bold |
|
6776 |
boldUnderline |
|
6777 |
#'bold+red underline' |
|
6778 |
boldUnderwave |
|
6779 |
#'bold+red underwave' |
|
6780 |
italic |
|
6781 |
italicUnderline |
|
6782 |
#'italic+red underline' |
|
6783 |
italicUnderwave |
|
6784 |
#'italic+red underwave' |
|
6785 |
reverse |
|
6786 |
) |
|
6787 |
initialSelection:1. |
|
6788 |
syntaxEmphasisesBox := box addComboListOn:syntaxEmphasises. |
|
6789 |
syntaxEmphasises |
|
6790 |
onChangeEvaluate:[ |em| |
|
6791 |
em := syntaxEmphasises selection. |
|
6792 |
em notNil ifTrue:[ |
|
6793 |
em := em asSymbol. |
|
6794 |
em == #'red underline' ifTrue:[ em := Array with:#underline with:(#underlineColor->Color red)]. |
|
6795 |
em == #'red underwave' ifTrue:[ em := Array with:#underwave with:(#underlineColor->Color red)]. |
|
6796 |
em == #'bold+red underline' ifTrue:[ em := Array with:#bold with:#underline with:(#underlineColor->Color red)]. |
|
6797 |
em == #'bold+red underwave' ifTrue:[ em := Array with:#bold with:#underwave with:(#underlineColor->Color red)]. |
|
6798 |
em == #'italic+red underline' ifTrue:[ em := Array with:#italic with:#underline with:(#underlineColor->Color red)]. |
|
6799 |
em == #'italic+red underwave' ifTrue:[ em := Array with:#italic with:#underwave with:(#underlineColor->Color red)]. |
|
6800 |
||
6801 |
currentUserPrefs at: syntaxEmphasisSelector value put:em. |
|
6802 |
]. |
|
6803 |
recolorAction value |
|
6804 |
]. |
|
6805 |
syntaxColors changed:#value. "/ to force initial update of emphasis |
|
6806 |
box addComponent:colorMenu tabable:true. |
|
6807 |
||
6808 |
y := box yPosition. |
|
6809 |
||
6810 |
b := Button new label: (resources string:'reset to:'). |
|
6811 |
b action:[ |
|
6812 |
|resetSelector| |
|
6813 |
||
6814 |
resetSelector := (currentUserPrefs listOfPredefinedSyntaxColoringSchemes |
|
6815 |
collect:[:eachEntry | eachEntry first]) |
|
6816 |
at:resetList selectionIndex. |
|
6817 |
currentUserPrefs perform:resetSelector. |
|
6818 |
recolorAction value. |
|
6819 |
]. |
|
6820 |
syntaxColoringResetButton := box addComponent:b. |
|
6821 |
box makeTabable:syntaxColoringResetButton. |
|
6822 |
||
6823 |
box yPosition:y. |
|
6824 |
||
6825 |
resetList := SelectionInList |
|
6826 |
with:(currentUserPrefs listOfPredefinedSyntaxColoringSchemes |
|
6827 |
collect:[:eachEntry | eachEntry second]) |
|
6828 |
initialSelection:1. |
|
6829 |
resetListBox := box addComboListOn:resetList. |
|
6830 |
box makeTabable:resetListBox. |
|
6831 |
||
6832 |
syntaxColoringBox enable. |
|
6833 |
colorMenu enable. |
|
6834 |
syntaxEmphasisesBox enable. |
|
6835 |
syntaxColoringResetButton enable. |
|
6836 |
||
6837 |
box |
|
6838 |
"/ addHelpButtonFor:'Launcher/sourceSettings.html'; |
|
6839 |
addAbortAndOkButtons. |
|
6840 |
||
6841 |
box stickAtBottomWithVariableHeight:frame. |
|
6842 |
box stickAtBottomWithFixHeight:syntaxColoringBox. |
|
6843 |
box stickAtBottomWithFixHeight:syntaxEmphasisesBox. |
|
6844 |
box stickAtBottomWithFixHeight:colorMenu. |
|
6845 |
box stickAtBottomWithFixHeight:syntaxColoringResetButton left:0.0 right:0.5. |
|
6846 |
box stickAtBottomWithFixHeight:resetListBox left:0.5 right:1.0. |
|
6847 |
||
6848 |
"/ |
|
6849 |
"/ show the box ... |
|
6850 |
"/ |
|
6851 |
box extent:600@400. |
|
6852 |
box openModal. |
|
6853 |
||
6854 |
"/ |
|
6855 |
"/ update system settings |
|
6856 |
"/ |
|
6857 |
box accepted ifTrue:[ |
|
6858 |
] ifFalse: [ |
|
6859 |
(UserPreferences reset; current) declareAllFrom: oldUserPreferences |
|
6860 |
]. |
|
6861 |
box destroy |
|
6862 |
||
6863 |
"Modified: / 16.4.1998 / 17:18:16 / ca" |
|
6864 |
"Modified: / 7.7.1999 / 00:27:02 / cg" |
|
2001 | 6865 |
! ! |
6866 |
||
2596 | 6867 |
!AbstractLauncherApplication::LauncherDialogs class methodsFor:'interface specs'! |
6868 |
||
4244 | 6869 |
cvsSetupSpec |
6870 |
"This resource specification was automatically generated |
|
6871 |
by the UIPainter of ST/X." |
|
6872 |
||
6873 |
"Do not manually edit this!! If it is corrupted, |
|
6874 |
the UIPainter may not be able to read the specification." |
|
6875 |
||
6876 |
" |
|
6877 |
UIPainter new openOnClass:AbstractLauncherApplication::LauncherDialogs andSelector:#cvsSetupSpec |
|
6878 |
" |
|
6879 |
||
6880 |
<resource: #canvas> |
|
6881 |
||
6882 |
^ |
|
6883 |
#(#FullSpec |
|
6884 |
#name: #cvsSetupSpec |
|
6885 |
#window: |
|
6886 |
#(#WindowSpec |
|
6887 |
#label: 'CVS Setup' |
|
6888 |
#name: 'CVS Setup' |
|
6889 |
#min: #(#Point 436 316) |
|
6890 |
#max: #(#Point 1280 1024) |
|
6891 |
#bounds: #(#Rectangle 13 23 449 377) |
|
6892 |
) |
|
6893 |
#component: |
|
6894 |
#(#SpecCollection |
|
6895 |
#collection: #( |
|
6896 |
#(#LabelSpec |
|
6897 |
#label: 'CVS BinDirectory:' |
|
6898 |
#name: 'Label1' |
|
6899 |
#layout: #(#LayoutFrame 0 0.0 36 0 40 0.25 53 0) |
|
6900 |
#level: 0 |
|
6901 |
#translateLabel: true |
|
6902 |
#adjust: #right |
|
6903 |
) |
|
6904 |
#(#InputFieldSpec |
|
6905 |
#name: 'BinDirectoryField' |
|
6906 |
#layout: #(#LayoutFrame 44 0.25 34 0 -1 1 56 0) |
|
6907 |
#tabable: true |
|
6908 |
#model: #cvsBinDirectoryHolder |
|
6909 |
#acceptChannel: #acceptChannel |
|
6910 |
#acceptOnPointerLeave: false |
|
6911 |
) |
|
6912 |
#(#DividerSpec |
|
6913 |
#name: 'Separator3' |
|
6914 |
#layout: #(#LayoutFrame 0 0.0 60 0 0 1.0 64 0) |
|
6915 |
) |
|
6916 |
#(#LabelSpec |
|
6917 |
#label: 'CVS SourceCodeManager setup' |
|
6918 |
#name: 'label' |
|
6919 |
#layout: #(#LayoutFrame 1 0.0 3 0 -1 1.0 20 0) |
|
6920 |
#translateLabel: true |
|
6921 |
#adjust: #left |
|
6922 |
) |
|
6923 |
#(#LabelSpec |
|
6924 |
#label: 'CVSRoot default:' |
|
6925 |
#name: 'defaultCvsRootLabel' |
|
6926 |
#layout: #(#LayoutFrame 0 0.0 71 0 40 0.25 88 0) |
|
6927 |
#level: 0 |
|
6928 |
#translateLabel: true |
|
6929 |
#adjust: #right |
|
6930 |
) |
|
6931 |
#(#ComboBoxSpec |
|
6932 |
#name: 'cvsRootComboBox' |
|
6933 |
#layout: #(#LayoutFrame 44 0.25 71 0 -1 1.0 93 0) |
|
6934 |
#tabable: true |
|
6935 |
#model: #cvsRootHolder |
|
6936 |
#immediateAccept: true |
|
6937 |
#acceptOnLeave: true |
|
6938 |
#acceptOnReturn: true |
|
6939 |
#acceptOnTab: true |
|
6940 |
#acceptOnLostFocus: true |
|
6941 |
#acceptChannel: #acceptChannel |
|
6942 |
#acceptOnPointerLeave: false |
|
6943 |
#comboList: #cvsRootPrototypeList |
|
6944 |
) |
|
6945 |
#(#DividerSpec |
|
6946 |
#name: 'Separator1' |
|
6947 |
#layout: #(#LayoutFrame 0 0.0 96 0 0 1.0 100 0) |
|
6948 |
) |
|
6949 |
#(#LabelSpec |
|
6950 |
#label: 'CVSRoot per Module:' |
|
6951 |
#name: 'knownModulesLabel' |
|
6952 |
#layout: #(#LayoutFrame 0 0.0 109 0 40 0.25 126 0) |
|
6953 |
#translateLabel: true |
|
6954 |
#adjust: #right |
|
6955 |
) |
|
6956 |
#(#SequenceViewSpec |
|
6957 |
#name: 'List1' |
|
6958 |
#layout: #(#LayoutFrame 44 0.25 104 0 -1 1 202 0) |
|
6959 |
#tabable: true |
|
6960 |
#model: #selectedPerModuleRoot |
|
6961 |
#hasHorizontalScrollBar: true |
|
6962 |
#hasVerticalScrollBar: true |
|
6963 |
#miniScrollerHorizontal: true |
|
6964 |
#useIndex: false |
|
6965 |
#sequenceList: #listOfModules |
|
6966 |
) |
|
6967 |
#(#LabelSpec |
|
6968 |
#label: 'Module:' |
|
6969 |
#name: 'moduleLabel' |
|
6970 |
#layout: #(#LayoutFrame 0 0.0 209 0 40 0.25 226 0) |
|
6971 |
#translateLabel: true |
|
6972 |
#adjust: #right |
|
6973 |
) |
|
6974 |
#(#InputFieldSpec |
|
6975 |
#name: 'perModuleRootModuleEntryField' |
|
6976 |
#layout: #(#LayoutFrame 44 0.25 205 0 -1 1 227 0) |
|
6977 |
#tabable: true |
|
6978 |
#model: #perModuleRootModule |
|
6979 |
#acceptChannel: #acceptChannel |
|
6980 |
#acceptOnPointerLeave: false |
|
6981 |
) |
|
6982 |
#(#LabelSpec |
|
6983 |
#label: 'CVSRoot:' |
|
6984 |
#name: 'cvsRootLabel' |
|
6985 |
#layout: #(#LayoutFrame 0 0.0 236 0 40 0.25 253 0) |
|
6986 |
#translateLabel: true |
|
6987 |
#adjust: #right |
|
6988 |
) |
|
6989 |
#(#ComboBoxSpec |
|
6990 |
#name: 'perModuleRootComboBox' |
|
6991 |
#layout: #(#LayoutFrame 44 0.25 232 0 -1 1.0 254 0) |
|
6992 |
#tabable: true |
|
6993 |
#model: #perModuleRoot |
|
6994 |
#immediateAccept: true |
|
6995 |
#acceptOnLeave: true |
|
6996 |
#acceptOnReturn: true |
|
6997 |
#acceptOnTab: true |
|
6998 |
#acceptOnLostFocus: true |
|
6999 |
#acceptChannel: #acceptChannel |
|
7000 |
#acceptOnPointerLeave: false |
|
7001 |
#comboList: #cvsRootPrototypeList |
|
7002 |
) |
|
7003 |
#(#HorizontalPanelViewSpec |
|
7004 |
#name: 'HorizontalPanel1' |
|
7005 |
#layout: #(#LayoutFrame 44 0.25 258 0 -1 1 289 0) |
|
7006 |
#horizontalLayout: #fitSpace |
|
7007 |
#verticalLayout: #center |
|
7008 |
#horizontalSpace: 3 |
|
7009 |
#verticalSpace: 3 |
|
7010 |
#component: |
|
7011 |
#(#SpecCollection |
|
7012 |
#collection: #( |
|
7013 |
#(#ActionButtonSpec |
|
7014 |
#label: 'Add/Apply' |
|
7015 |
#name: 'addButton' |
|
7016 |
#translateLabel: true |
|
7017 |
#tabable: true |
|
7018 |
#model: #addPerModuleRoot |
|
7019 |
#extent: #(#Point 136 22) |
|
7020 |
) |
|
7021 |
#(#ActionButtonSpec |
|
7022 |
#label: 'Remove' |
|
7023 |
#name: 'removeButton' |
|
7024 |
#translateLabel: true |
|
7025 |
#tabable: true |
|
7026 |
#model: #removePerModuleRoot |
|
7027 |
#enableChannel: #removeEnabled |
|
7028 |
#extent: #(#Point 137 22) |
|
7029 |
) |
|
7030 |
) |
|
7031 |
||
7032 |
) |
|
7033 |
) |
|
7034 |
#(#DividerSpec |
|
7035 |
#name: 'Separator2' |
|
7036 |
#layout: #(#LayoutFrame 0 0.0 -45 1 0 1.0 -34 1) |
|
7037 |
) |
|
7038 |
#(#HorizontalPanelViewSpec |
|
7039 |
#name: 'buttonPanel' |
|
7040 |
#layout: #(#LayoutFrame 0 0.0 -29 1.0 0 1.0 -3 1.0) |
|
7041 |
#horizontalLayout: #fitSpace |
|
7042 |
#verticalLayout: #center |
|
7043 |
#horizontalSpace: 3 |
|
7044 |
#verticalSpace: 3 |
|
7045 |
#ignoreInvisibleComponents: true |
|
7046 |
#reverseOrderIfOKAtLeft: true |
|
7047 |
#component: |
|
7048 |
#(#SpecCollection |
|
7049 |
#collection: #( |
|
7050 |
#(#ActionButtonSpec |
|
7051 |
#label: 'Cancel' |
|
7052 |
#name: 'cancelButton' |
|
7053 |
#translateLabel: true |
|
7054 |
#tabable: true |
|
7055 |
#model: #cancel |
|
7056 |
#extent: #(#Point 141 21) |
|
7057 |
) |
|
7058 |
#(#ActionButtonSpec |
|
7059 |
#label: 'Help' |
|
7060 |
#name: 'helpButton' |
|
7061 |
#translateLabel: true |
|
7062 |
#tabable: true |
|
7063 |
#model: #help |
|
7064 |
#extent: #(#Point 141 21) |
|
7065 |
) |
|
7066 |
#(#ActionButtonSpec |
|
7067 |
#label: 'OK' |
|
7068 |
#name: 'okButton' |
|
7069 |
#translateLabel: true |
|
7070 |
#tabable: true |
|
7071 |
#model: #accept |
|
7072 |
#isDefault: true |
|
7073 |
#extent: #(#Point 142 21) |
|
7074 |
) |
|
7075 |
) |
|
7076 |
||
7077 |
) |
|
7078 |
) |
|
7079 |
) |
|
7080 |
||
7081 |
) |
|
7082 |
) |
|
7083 |
! |
|
7084 |
||
7085 |
formatterDialogSpec |
|
7086 |
"This resource specification was automatically generated |
|
7087 |
by the UIPainter of ST/X." |
|
7088 |
||
7089 |
"Do not manually edit this!! If it is corrupted, |
|
7090 |
the UIPainter may not be able to read the specification." |
|
7091 |
||
7092 |
" |
|
7093 |
UIPainter new openOnClass:AbstractLauncherApplication::LauncherDialogs andSelector:#formatterDialogSpec |
|
7094 |
" |
|
7095 |
||
7096 |
<resource: #canvas> |
|
7097 |
||
7098 |
^ |
|
7099 |
#(#FullSpec |
|
7100 |
#name: #formatterDialogSpec |
|
7101 |
#window: |
|
7102 |
#(#WindowSpec |
|
7103 |
#label: 'Formatting parameters' |
|
7104 |
#name: 'Formatting parameters' |
|
7105 |
#min: #(#Point 10 10) |
|
7106 |
#max: #(#Point 1280 1024) |
|
7107 |
#bounds: #(#Rectangle 10 406 606 989) |
|
7108 |
) |
|
7109 |
#component: |
|
7110 |
#(#SpecCollection |
|
7111 |
#collection: #( |
|
7112 |
#(#LabelSpec |
|
7113 |
#label: 'Sample output:' |
|
7114 |
#name: 'Label2' |
|
7115 |
#layout: #(#LayoutFrame 0 0.0 4 0 0 1.0 26 0) |
|
7116 |
#translateLabel: true |
|
7117 |
#adjust: #left |
|
7118 |
) |
|
7119 |
#(#TextEditorSpec |
|
7120 |
#name: 'sampleTextView' |
|
7121 |
#layout: #(#LayoutFrame 0 0.0 30 0.0 0 1.0 -234 1.0) |
|
7122 |
#level: -1 |
|
7123 |
#model: #formattedText |
|
7124 |
#hasHorizontalScrollBar: true |
|
7125 |
#hasVerticalScrollBar: true |
|
7126 |
) |
|
7127 |
#(#FramedBoxSpec |
|
7128 |
#label: 'Parameters' |
|
7129 |
#name: 'FramedBox1' |
|
7130 |
#layout: #(#LayoutFrame 0 0.0 -225 1 0 1.0 -30 1) |
|
7131 |
#labelPosition: #topLeft |
|
7132 |
#translateLabel: true |
|
7133 |
#component: |
|
7134 |
#(#SpecCollection |
|
7135 |
#collection: #( |
|
7136 |
#(#LabelSpec |
|
7137 |
#label: 'Max length for single line blocks:' |
|
7138 |
#name: 'Label1' |
|
7139 |
#layout: #(#LayoutFrame 185 0.0 127 0 66 0.7 153 0) |
|
7140 |
#level: 0 |
|
7141 |
#adjust: #right |
|
7142 |
) |
|
7143 |
#(#CheckBoxSpec |
|
7144 |
#label: 'Space around temporaries ' |
|
7145 |
#name: 'checkBox' |
|
7146 |
#layout: #(#LayoutFrame 2 0 3 0 260 0 32 0) |
|
7147 |
#level: 0 |
|
7148 |
#tabable: true |
|
7149 |
#model: #spaceAroundTemporaries |
|
7150 |
#translateLabel: true |
|
7151 |
) |
|
7152 |
#(#CheckBoxSpec |
|
7153 |
#label: 'Blank line after local var declaration' |
|
7154 |
#name: 'CheckBox1' |
|
7155 |
#layout: #(#LayoutFrame 267 0 3 0 567 0 32 0) |
|
7156 |
#level: 0 |
|
7157 |
#tabable: true |
|
7158 |
#model: #emptyLineAfterTemporaries |
|
7159 |
#translateLabel: true |
|
7160 |
) |
|
7161 |
#(#CheckBoxSpec |
|
7162 |
#label: 'Space after ''^''' |
|
7163 |
#name: 'CheckBox2' |
|
7164 |
#layout: #(#LayoutFrame 2 0 31 0 260 0 60 0) |
|
7165 |
#level: 0 |
|
7166 |
#tabable: true |
|
7167 |
#model: #spaceAfterReturnToken |
|
7168 |
#translateLabel: true |
|
7169 |
) |
|
7170 |
#(#CheckBoxSpec |
|
7171 |
#label: 'Space after '':'' in keywords' |
|
7172 |
#name: 'CheckBox3' |
|
7173 |
#layout: #(#LayoutFrame 267 0 31 0 567 0 60 0) |
|
7174 |
#level: 0 |
|
7175 |
#tabable: true |
|
7176 |
#model: #spaceAfterKeywordSelector |
|
7177 |
#translateLabel: true |
|
7178 |
) |
|
7179 |
#(#CheckBoxSpec |
|
7180 |
#label: 'C-Style blocks' |
|
7181 |
#name: 'CheckBox4' |
|
7182 |
#layout: #(#LayoutFrame 2 0 59 0 260 0 88 0) |
|
7183 |
#level: 0 |
|
7184 |
#tabable: true |
|
7185 |
#model: #cStyleBlocks |
|
7186 |
#translateLabel: true |
|
7187 |
) |
|
7188 |
#(#InputFieldSpec |
|
7189 |
#name: 'editField' |
|
7190 |
#layout: #(#LayoutFrame 74 0.7 93 0 -38 1.0 119 0) |
|
7191 |
#level: -1 |
|
7192 |
#tabable: true |
|
7193 |
#model: #tabIndent |
|
7194 |
#type: #number |
|
7195 |
#immediateAccept: false |
|
7196 |
#acceptOnLeave: true |
|
7197 |
#acceptOnReturn: true |
|
7198 |
#acceptOnTab: true |
|
7199 |
#acceptOnLostFocus: true |
|
7200 |
#acceptOnPointerLeave: true |
|
7201 |
) |
|
7202 |
#(#LabelSpec |
|
7203 |
#label: 'Indent:' |
|
7204 |
#name: 'label' |
|
7205 |
#layout: #(#LayoutFrame 242 0.0 93 0 66 0.7 119 0) |
|
7206 |
#level: 0 |
|
7207 |
#adjust: #right |
|
7208 |
) |
|
7209 |
#(#InputFieldSpec |
|
7210 |
#name: 'EntryField1' |
|
7211 |
#layout: #(#LayoutFrame 74 0.7 127 0 -38 1.0 153 0) |
|
7212 |
#level: -1 |
|
7213 |
#tabable: true |
|
7214 |
#model: #maxLengthForSingleLineBlocks |
|
7215 |
#type: #number |
|
7216 |
#immediateAccept: false |
|
7217 |
#acceptOnLeave: true |
|
7218 |
#acceptOnReturn: true |
|
7219 |
#acceptOnTab: true |
|
7220 |
#acceptOnLostFocus: true |
|
7221 |
#acceptOnPointerLeave: true |
|
7222 |
) |
|
7223 |
#(#PopUpListSpec |
|
7224 |
#label: 'Reset to...' |
|
7225 |
#name: 'PopUpList1' |
|
7226 |
#layout: #(#LayoutFrame 2 0 129 0 127 0 151 0) |
|
7227 |
#tabable: true |
|
7228 |
#model: #resetValue |
|
7229 |
#menu: #resetList |
|
7230 |
#useIndex: true |
|
7231 |
) |
|
7232 |
#(#CheckBoxSpec |
|
7233 |
#label: 'Block args on new line' |
|
7234 |
#name: 'CheckBox5' |
|
7235 |
#layout: #(#LayoutFrame 267 0 59 0 567 0 88 0) |
|
7236 |
#level: 0 |
|
7237 |
#tabable: true |
|
7238 |
#model: #blockArgumentsOnNewLine |
|
7239 |
#translateLabel: true |
|
7240 |
) |
|
7241 |
) |
|
7242 |
||
7243 |
) |
|
7244 |
) |
|
7245 |
#(#HorizontalPanelViewSpec |
|
7246 |
#name: 'horizontalPanelView' |
|
7247 |
#layout: #(#LayoutFrame 0 0.0 -35 1.0 0 1.0 0 1.0) |
|
7248 |
#level: 0 |
|
7249 |
#horizontalLayout: #fitSpace |
|
7250 |
#verticalLayout: #center |
|
7251 |
#horizontalSpace: 4 |
|
7252 |
#verticalSpace: 4 |
|
7253 |
#ignoreInvisibleComponents: true |
|
7254 |
#component: |
|
7255 |
#(#SpecCollection |
|
7256 |
#collection: #( |
|
7257 |
#(#ActionButtonSpec |
|
7258 |
#label: 'Cancel' |
|
7259 |
#name: 'button' |
|
7260 |
#translateLabel: true |
|
7261 |
#tabable: true |
|
7262 |
#model: #cancel |
|
7263 |
#useDefaultExtent: true |
|
7264 |
) |
|
7265 |
#(#ActionButtonSpec |
|
7266 |
#label: 'OK' |
|
7267 |
#name: 'Button1' |
|
7268 |
#translateLabel: true |
|
7269 |
#tabable: true |
|
7270 |
#model: #accept |
|
7271 |
#isDefault: true |
|
7272 |
#useDefaultExtent: true |
|
7273 |
) |
|
7274 |
) |
|
7275 |
||
7276 |
) |
|
7277 |
) |
|
7278 |
) |
|
7279 |
||
7280 |
) |
|
7281 |
) |
|
2596 | 7282 |
! ! |
7283 |
||
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7284 |
!AbstractLauncherApplication::SettingsDialog class methodsFor:'applications'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7285 |
|
4244 | 7286 |
addApplClass:aClass withName:aName |
7287 |
||
7288 |
ApplicationList isNil ifTrue:[ |
|
7289 |
self initialize. |
|
7290 |
]. |
|
7291 |
ApplicationList add:(Array with:aName with:aClass asString asSymbol) |
|
7292 |
! |
|
7293 |
||
7294 |
applList |
|
7295 |
ApplicationList isNil ifTrue:[ |
|
7296 |
self initialize. |
|
7297 |
]. |
|
7298 |
^ ApplicationList |
|
7299 |
! |
|
7300 |
||
7301 |
defaultAppList |
|
7302 |
" list of settings applications |
|
7303 |
format: nameString applicationClassNameMethod" |
|
7304 |
||
7305 |
^ #( |
|
7306 |
#('Tools' #'AbstractLauncherApplication::ToolsSettingsAppl') |
|
7307 |
#('Language' #'AbstractLauncherApplication::LanguageSettingsAppl') |
|
7308 |
#('Keyboard Mappings' #'AbstractLauncherApplication::KbdMappingSettingsAppl') |
|
7309 |
#('Style Selection' #'AbstractLauncherApplication::StyleSettingsAppl') |
|
7310 |
||
7311 |
). |
|
7312 |
! |
|
7313 |
||
7314 |
removeApplClass:aClass |
|
7315 |
||
7316 |
|index| |
|
7317 |
||
7318 |
ApplicationList isNil ifTrue:[ |
|
7319 |
self initialize. |
|
7320 |
]. |
|
7321 |
index := ApplicationList findFirst:[:el | |
|
7322 |
el second == aClass asSymbol |
|
7323 |
]. |
|
7324 |
index ~~ 0 ifTrue:[ |
|
7325 |
ApplicationList removeIndex:index. |
|
7326 |
]. |
|
7327 |
! |
|
7328 |
||
7329 |
settingsAppListClasses |
|
7330 |
||
7331 |
^ self applList collect:[:entry | entry last]. |
|
7332 |
! |
|
7333 |
||
7334 |
settingsAppListNames |
|
7335 |
||
7336 |
^ self applList collect:[:entry | entry first]. |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7337 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7338 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7339 |
!AbstractLauncherApplication::SettingsDialog class methodsFor:'initialize'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7340 |
|
4244 | 7341 |
initialize |
7342 |
||
7343 |
ApplicationList := self defaultAppList. |
|
7344 |
||
7345 |
" |
|
7346 |
self initialize |
|
7347 |
" |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7348 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7349 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7350 |
!AbstractLauncherApplication::SettingsDialog class methodsFor:'interface specs'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7351 |
|
4244 | 7352 |
windowSpec |
7353 |
"This resource specification was automatically generated |
|
7354 |
by the UIPainter of ST/X." |
|
7355 |
||
7356 |
"Do not manually edit this!! If it is corrupted, |
|
7357 |
the UIPainter may not be able to read the specification." |
|
7358 |
||
7359 |
" |
|
7360 |
UIPainter new openOnClass:AbstractLauncherApplication::SettingsDialog andSelector:#windowSpec |
|
7361 |
AbstractLauncherApplication::SettingsDialog new openInterface:#windowSpec |
|
7362 |
AbstractLauncherApplication::SettingsDialog open |
|
7363 |
" |
|
7364 |
||
7365 |
<resource: #canvas> |
|
7366 |
||
7367 |
^ |
|
7368 |
#(#FullSpec |
|
7369 |
#name: #windowSpec |
|
7370 |
#window: |
|
7371 |
#(#WindowSpec |
|
7372 |
#label: 'Settings Dialog' |
|
7373 |
#name: 'Settings Dialog' |
|
7374 |
#min: #(#Point 10 10) |
|
7375 |
#max: #(#Point 1024 768) |
|
7376 |
#bounds: #(#Rectangle 16 42 516 562) |
|
7377 |
#menu: #mainMenu |
|
7378 |
) |
|
7379 |
#component: |
|
7380 |
#(#SpecCollection |
|
7381 |
#collection: #( |
|
7382 |
#(#NoteBookViewSpec |
|
7383 |
#name: 'SettingsNoteBook' |
|
7384 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
7385 |
#model: #selectionHolder |
|
7386 |
#menu: #settingsAppList |
|
7387 |
#useIndex: true |
|
7388 |
#canvas: #canvasHolder |
|
7389 |
#keepCanvasAlive: true |
|
7390 |
) |
|
7391 |
) |
|
7392 |
||
7393 |
) |
|
7394 |
) |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7395 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7396 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7397 |
!AbstractLauncherApplication::SettingsDialog class methodsFor:'menu specs'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7398 |
|
4244 | 7399 |
mainMenu |
7400 |
"This resource specification was automatically generated |
|
7401 |
by the MenuEditor of ST/X." |
|
7402 |
||
7403 |
"Do not manually edit this!! If it is corrupted, |
|
7404 |
the MenuEditor may not be able to read the specification." |
|
7405 |
||
7406 |
" |
|
7407 |
MenuEditor new openOnClass:SettingsDialog andSelector:#mainMenu |
|
7408 |
(Menu new fromLiteralArrayEncoding:(SettingsDialog mainMenu)) startUp |
|
7409 |
" |
|
7410 |
||
7411 |
<resource: #menu> |
|
7412 |
||
7413 |
^ |
|
7414 |
#(#Menu |
|
7415 |
#( |
|
7416 |
#(#MenuItem |
|
7417 |
#label: 'File' |
|
7418 |
#translateLabel: true |
|
7419 |
#submenu: |
|
7420 |
#(#Menu |
|
7421 |
#( |
|
7422 |
#(#MenuItem |
|
7423 |
#label: 'Load Settings...' |
|
7424 |
#itemValue: #loadSettings |
|
7425 |
#translateLabel: true |
|
7426 |
) |
|
7427 |
#(#MenuItem |
|
7428 |
#label: 'Save Settings...' |
|
7429 |
#itemValue: #saveSettings |
|
7430 |
#translateLabel: true |
|
7431 |
) |
|
7432 |
#(#MenuItem |
|
7433 |
#label: 'Exit' |
|
7434 |
#itemValue: #closeRequest |
|
7435 |
#translateLabel: true |
|
7436 |
) |
|
7437 |
) |
|
7438 |
nil |
|
7439 |
nil |
|
7440 |
) |
|
7441 |
) |
|
7442 |
) |
|
7443 |
nil |
|
7444 |
nil |
|
7445 |
) |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7446 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7447 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7448 |
!AbstractLauncherApplication::SettingsDialog methodsFor:'accessing'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7449 |
|
4244 | 7450 |
requestor |
7451 |
"return the 'requestor' of the SettingsDialog" |
|
7452 |
||
7453 |
^ requestor |
|
7454 |
! |
|
7455 |
||
7456 |
requestor:something |
|
7457 |
"set the value of the instance variable 'requestor' (automatically generated)" |
|
7458 |
||
7459 |
requestor := something. |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7460 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7461 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7462 |
!AbstractLauncherApplication::SettingsDialog methodsFor:'actions'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7463 |
|
4244 | 7464 |
sendLoadRequest |
7465 |
||
7466 |
colOfInstances do:[:settInst| |
|
7467 |
settInst loadRequest. |
|
7468 |
]. |
|
7469 |
! |
|
7470 |
||
7471 |
sendSaveRequest |
|
7472 |
||
7473 |
|oldClient| |
|
7474 |
||
7475 |
oldClient := self canvasHolder value application. |
|
7476 |
oldClient notNil ifTrue:[ |
|
7477 |
oldClient saveRequest ifFalse:[^ false]. |
|
7478 |
]. |
|
7479 |
^ true |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7480 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7481 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7482 |
!AbstractLauncherApplication::SettingsDialog methodsFor:'aspects'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7483 |
|
4244 | 7484 |
canvasHolder |
7485 |
||
7486 |
canvasHolder isNil ifTrue:[ |
|
7487 |
canvasHolder := ValueHolder new. |
|
7488 |
]. |
|
7489 |
^ canvasHolder. |
|
7490 |
! |
|
7491 |
||
7492 |
selection |
|
7493 |
"get the selection |
|
7494 |
" |
|
7495 |
^ selection |
|
7496 |
! |
|
7497 |
||
7498 |
selection:something |
|
7499 |
"set the selection; update canvas |
|
7500 |
" |
|
7501 |
selection ~~ something ifTrue:[ |
|
7502 |
||
7503 |
self sendSaveRequest ifFalse:[ ^ self]. |
|
7504 |
selection := something. |
|
7505 |
selection ~~ 0 ifTrue:[ |
|
7506 |
self canvasHolder value:((colOfInstances at:selection) window). |
|
7507 |
]. |
|
7508 |
]. |
|
7509 |
! |
|
7510 |
||
7511 |
selectionHolder |
|
7512 |
||
7513 |
selectionHolder isNil ifTrue:[ |
|
7514 |
selectionHolder := AspectAdaptor new subject:self; forAspect:#selection. |
|
7515 |
]. |
|
7516 |
^ selectionHolder. |
|
7517 |
! |
|
7518 |
||
7519 |
settingsAppList |
|
7520 |
||
7521 |
^ self class settingsAppListNames. |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7522 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7523 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7524 |
!AbstractLauncherApplication::SettingsDialog methodsFor:'initialization & release'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7525 |
|
4244 | 7526 |
closeDownViews |
7527 |
"This is a hook method generated by the Browser. |
|
7528 |
It will be invoked when your app/dialog-window is really closed. |
|
7529 |
See also #closeDownViews, which is invoked before and may suppress the close |
|
7530 |
or ask the user for confirmation." |
|
7531 |
||
7532 |
"/ change the code below as required ... |
|
7533 |
"/ This should cleanup any leftover resources |
|
7534 |
"/ (for example, temporary files) |
|
7535 |
"/ super closeRequest will initiate the closeDown |
|
7536 |
||
7537 |
"/ add your code here |
|
7538 |
||
7539 |
"/ do not remove the one below ... |
|
7540 |
^ super closeDownViews |
|
7541 |
! |
|
7542 |
||
7543 |
closeRequest |
|
7544 |
"This is a hook method generated by the Browser. |
|
7545 |
It will be invoked when your app/dialog-window is about to be |
|
7546 |
closed (this method has a chance to suppress the close). |
|
7547 |
See also #closeDownViews, which is invoked when the close is really done." |
|
7548 |
||
7549 |
self sendSaveRequest ifFalse:[ ^ self]. |
|
7550 |
^ super closeRequest |
|
7551 |
! |
|
7552 |
||
7553 |
initialize |
|
7554 |
||
7555 |
selectionHolder := AspectAdaptor new subject:self; forAspect:#selection. |
|
7556 |
super initialize. |
|
7557 |
! |
|
7558 |
||
7559 |
postBuildWith:aBuilder |
|
7560 |
"This is a hook method generated by the Browser. |
|
7561 |
It will be invoked during the initialization of your app/dialog, |
|
7562 |
after all of the visual components have been built, |
|
7563 |
but BEFORE the top window is made visible. |
|
7564 |
Add any app-specific actions here (reading files, setting up values etc.) |
|
7565 |
See also #postOpenWith:, which is invoked after opening." |
|
7566 |
||
7567 |
"/ add any code here ... |
|
7568 |
||
7569 |
^ super postBuildWith:aBuilder |
|
7570 |
! |
|
7571 |
||
7572 |
postOpenWith:aBuilder |
|
7573 |
"This is a hook method generated by the Browser. |
|
7574 |
It will be invoked right after the applications window has been opened. |
|
7575 |
Add any app-specific actions here (starting background processes etc.). |
|
7576 |
See also #postBuildWith:, which is invoked before opening." |
|
7577 |
||
7578 |
"/ add any code here ... |
|
7579 |
||
7580 |
colOfInstances := OrderedCollection new. |
|
7581 |
self class settingsAppListClasses do:[:cls| | className | |
|
7582 |
className := Smalltalk classNamed:cls. |
|
7583 |
cls isNil ifTrue:[ |
|
7584 |
Transcript showCR:'no class named:' , className |
|
7585 |
] ifFalse:[ |
|
7586 |
| appl window| |
|
7587 |
appl := className new. |
|
7588 |
window := ApplicationSubView new. |
|
7589 |
appl createBuilder. |
|
7590 |
window client:appl. |
|
7591 |
||
7592 |
colOfInstances add:appl. |
|
7593 |
] |
|
7594 |
]. |
|
7595 |
self selectionHolder value:1. |
|
7596 |
^ super postOpenWith:aBuilder |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7597 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7598 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7599 |
!AbstractLauncherApplication::SettingsDialog methodsFor:'menu actions'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
7600 |
|
4244 | 7601 |
loadSettings |
7602 |
||
7603 |
"restore settings from a settings-file." |
|
7604 |
||
7605 |
"a temporary kludge - we need a central systemSettings object for this, |
|
7606 |
which can be saved/restored with a single store/read." |
|
7607 |
||
7608 |
|fileName| |
|
7609 |
||
7610 |
fileName := Dialog |
|
7611 |
requestFileName:(resources string:'Load Settings From:') |
|
7612 |
default:'settings.stx' |
|
7613 |
ok:(resources string:'Load') |
|
7614 |
abort:(resources string:'Cancel') |
|
7615 |
pattern:'*.stx' |
|
7616 |
fromDirectory:nil. |
|
7617 |
||
7618 |
(fileName size == 0) ifTrue:[ |
|
7619 |
"/ canceled |
|
7620 |
^ self |
|
7621 |
]. |
|
7622 |
||
7623 |
self withWaitCursorDo:[ |
|
7624 |
Smalltalk fileIn:fileName. |
|
7625 |
Transcript current topView model reOpen. |
|
7626 |
self sendLoadRequest. |
|
7627 |
]. |
|
7628 |
! |
|
7629 |
||
7630 |
saveSettings |
|
7631 |
||
7632 |
|fileName resources| |
|
7633 |
||
7634 |
resources := self class owningClass classResources. |
|
7635 |
||
7636 |
fileName := Dialog |
|
7637 |
requestFileName:(resources string:'Save settings in:') |
|
7638 |
default:'settings.stx' |
|
7639 |
ok:(resources string:'Save') |
|
7640 |
abort:(resources string:'Cancel') |
|
7641 |
pattern:'*.stx' |
|
7642 |
fromDirectory:'.'. |
|
7643 |
||
7644 |
fileName size ~~ 0 ifTrue:[ |
|
7645 |
"not canceled" |
|
7646 |
self saveSettingsIn:fileName. |
|
4243 | 7647 |
] |
4244 | 7648 |
! |
7649 |
||
7650 |
saveSettingsIn:fileName |
|
7651 |
"save settings to a settings-file." |
|
7652 |
||
7653 |
"a temporary kludge - we need a central systemSettings object for this, |
|
7654 |
which can be saved/restored with a single store/read. |
|
7655 |
Will move entries over to UserPreferences over time; |
|
7656 |
new items should always go there." |
|
7657 |
||
7658 |
|resources s screen currentUserPrefs| |
|
7659 |
||
7660 |
resources := self class owningClass classResources. |
|
7661 |
||
7662 |
s := fileName asFilename writeStream. |
|
7663 |
s isNil ifTrue:[ |
|
7664 |
self warn:(resources string:'Cannot write the %1 file !!' with:fileName). |
|
7665 |
^ self |
|
7666 |
]. |
|
7667 |
||
7668 |
currentUserPrefs := UserPreferences current. |
|
7669 |
screen := Screen current. |
|
7670 |
||
7671 |
s nextPutLine:'"/ ST/X saved settings'; |
|
7672 |
nextPutLine:'"/ DO NOT MODIFY MANUALLY'; |
|
7673 |
nextPutLine:'"/ (modifications would be lost with next save-settings)'; |
|
7674 |
nextPutLine:'"/'; |
|
7675 |
nextPutLine:'"/ this file was automatically generated by the'; |
|
7676 |
nextPutLine:'"/ ''save settings'' function of the Launcher'; |
|
7677 |
nextPutLine:'"/'. |
|
7678 |
s cr. |
|
7679 |
||
7680 |
s nextPutLine:'"/'. |
|
7681 |
s nextPutLine:'"/ saved by ' , OperatingSystem getLoginName , '@' , OperatingSystem getHostName , ' at ' , AbsoluteTime now printString. |
|
7682 |
s nextPutLine:'"/'. |
|
7683 |
s cr. |
|
7684 |
||
7685 |
s nextPutLine:'"/'. |
|
7686 |
s nextPutLine:'"/ Display settings:'. |
|
7687 |
s nextPutLine:'"/'. |
|
7688 |
s nextPutLine:'"/ only restore the display settings, if on the same Display ...'. |
|
7689 |
s nextPutLine:'Display notNil ifTrue:['. |
|
7690 |
s nextPutLine:' Display displayName = ' , (screen displayName storeString) , ' ifTrue:['. |
|
7691 |
screen fixColors notNil ifTrue:[ |
|
7692 |
s nextPutLine:' Image flushDeviceImages.'. |
|
7693 |
s nextPutLine:' Color colorAllocationFailSignal catch:['. |
|
7694 |
s nextPutLine:' Color getColorsRed:6 green:6 blue:4 on:Display'. |
|
7695 |
s nextPutLine:' ].'. |
|
7696 |
] ifFalse:[ |
|
7697 |
s nextPutLine:' Display releaseFixColors.'. |
|
7698 |
]. |
|
7699 |
s nextPutLine:' Display hasColors: ' , (screen hasColors storeString) , '.'. |
|
7700 |
s nextPutLine:' Display widthInMillimeter: ' , (screen widthInMillimeter storeString) , '.'. |
|
7701 |
s nextPutLine:' Display heightInMillimeter: ' , (screen heightInMillimeter storeString) , '.'. |
|
7702 |
s nextPutLine:' Display supportsDeepIcons: ' , (screen supportsDeepIcons storeString) , '.'. |
|
7703 |
s nextPutLine:' Image ditherAlgorithm: ' , (Image ditherAlgorithm storeString) , '.'. |
|
7704 |
s nextPutLine:' View defaultStyle:' , View defaultStyle storeString , '.'. |
|
7705 |
s nextPutLine:' ].'. |
|
7706 |
s nextPutLine:'].'. |
|
7707 |
s cr. |
|
7708 |
||
7709 |
s nextPutLine:'"/'. |
|
7710 |
s nextPutLine:'"/ Compiler settings:'. |
|
7711 |
s nextPutLine:'"/'. |
|
7712 |
s nextPutLine:'Compiler warnSTXSpecials: ' , (Compiler warnSTXSpecials storeString) , '.'; |
|
7713 |
nextPutLine:'Compiler warnUnderscoreInIdentifier: ' , (Compiler warnUnderscoreInIdentifier storeString) , '.'; |
|
7714 |
nextPutLine:'Compiler warnOldStyleAssignment: ' , (Compiler warnOldStyleAssignment storeString) , '.'; |
|
7715 |
nextPutLine:'Compiler warnCommonMistakes: ' , (Compiler warnCommonMistakes storeString) , '.'; |
|
7716 |
nextPutLine:'Compiler warnPossibleIncompatibilities: ' , (Compiler warnPossibleIncompatibilities storeString) , '.'; |
|
7717 |
nextPutLine:'Compiler allowUnderscoreInIdentifier: ' , (Compiler allowUnderscoreInIdentifier storeString) , '.'; |
|
7718 |
nextPutLine:'Compiler allowSqueakExtensions: ' , (Compiler allowSqueakExtensions storeString) , '.'; |
|
7719 |
nextPutLine:'Compiler allowDolphinExtensions: ' , (Compiler allowDolphinExtensions storeString) , '.'; |
|
7720 |
nextPutLine:'Compiler arraysAreImmutable: ' , (Compiler arraysAreImmutable storeString) , '.'; |
|
7721 |
nextPutLine:'Compiler lineNumberInfo: ' , (Compiler lineNumberInfo storeString) , '.'; |
|
7722 |
||
7723 |
nextPutLine:'Compiler foldConstants: ' , (Compiler foldConstants storeString) , '.'; |
|
7724 |
nextPutLine:'Compiler stcCompilation: ' , (Compiler stcCompilation storeString) , '.'; |
|
7725 |
nextPutLine:'OperatingSystem getOSType = ' , (OperatingSystem getOSType storeString) , ' ifTrue:['; |
|
7726 |
nextPutLine:' Compiler stcCompilationIncludes: ' , (Compiler stcCompilationIncludes storeString) , '.'; |
|
7727 |
nextPutLine:' Compiler stcCompilationDefines: ' , (Compiler stcCompilationDefines storeString) , '.'; |
|
7728 |
nextPutLine:' Compiler stcCompilationOptions: ' , (Compiler stcCompilationOptions storeString) , '.'; |
|
7729 |
nextPutLine:' ' , (Compiler stcModulePath storeString) , ' asFilename exists ifTrue:['; |
|
7730 |
nextPutLine:' Compiler stcModulePath: ' , (Compiler stcModulePath storeString) , '.'; |
|
7731 |
nextPutLine:' ].'; |
|
7732 |
nextPutLine:' Compiler stcPath: ' , (Compiler stcPath storeString) , '.'; |
|
7733 |
nextPutLine:' Compiler ccCompilationOptions: ' , (Compiler ccCompilationOptions storeString) , '.'; |
|
7734 |
nextPutLine:' Compiler ccPath: ' , (Compiler ccPath storeString) , '.'; |
|
7735 |
nextPutLine:' ObjectFileLoader linkArgs: ' , (ObjectFileLoader linkArgs storeString) , '.'; |
|
7736 |
nextPutLine:' ObjectFileLoader linkCommand: ' , (ObjectFileLoader linkCommand storeString) , '.'; |
|
7737 |
nextPutLine:' ObjectFileLoader libPath: ' , (ObjectFileLoader libPath storeString) , '.'; |
|
7738 |
nextPutLine:' ObjectFileLoader searchedLibraries: ' , (ObjectFileLoader searchedLibraries storeString) , '.'; |
|
7739 |
nextPutLine:'].'; |
|
7740 |
||
7741 |
nextPutLine:'ObjectMemory justInTimeCompilation: ' , (ObjectMemory justInTimeCompilation storeString) , '.'; |
|
7742 |
nextPutLine:'ObjectMemory fullSingleStepSupport: ' , (ObjectMemory fullSingleStepSupport storeString) , '.'. |
|
7743 |
||
7744 |
HistoryManager notNil ifTrue:[ |
|
7745 |
HistoryManager isActive ifTrue:[ |
|
7746 |
s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager activate].'. |
|
7747 |
s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager fullHistoryUpdate:' , HistoryManager fullHistoryUpdate storeString , '].'. |
|
7748 |
] ifFalse:[ |
|
7749 |
s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager deactivate].'. |
|
7750 |
]. |
|
7751 |
]. |
|
7752 |
||
7753 |
ObjectFileLoader notNil ifTrue:[ |
|
7754 |
s nextPutLine:'ObjectFileLoader searchedLibraries: ' , (ObjectFileLoader searchedLibraries storeString) , '.'. |
|
7755 |
s nextPutLine:'ObjectFileLoader libPath: ' , (ObjectFileLoader libPath storeString) , '.'. |
|
7756 |
]. |
|
7757 |
||
7758 |
s nextPutLine:'Class catchMethodRedefinitions: ' , (Class catchMethodRedefinitions storeString) , '.'. |
|
7759 |
s nextPutLine:'ClassCategoryReader sourceMode: ' , (ClassCategoryReader sourceMode storeString) , '.'. |
|
7760 |
||
7761 |
s cr. |
|
7762 |
s nextPutLine:'"/'. |
|
7763 |
s nextPutLine:'"/ Info & Debug Messages:'. |
|
7764 |
s nextPutLine:'"/'. |
|
7765 |
s nextPutLine:'ObjectMemory infoPrinting: ' , (ObjectMemory infoPrinting storeString) , '.'; |
|
7766 |
nextPutLine:'ObjectMemory debugPrinting: ' , (ObjectMemory debugPrinting storeString) , '.'; |
|
7767 |
nextPutLine:'Object infoPrinting: ' , (Object infoPrinting storeString) , '.'; |
|
7768 |
nextPutLine:'DeviceWorkstation errorPrinting: ' , (DeviceWorkstation errorPrinting storeString) , '.'. |
|
7769 |
||
7770 |
FlyByHelp isActive ifTrue:[ |
|
7771 |
s nextPutLine:'FlyByHelp start.' |
|
7772 |
]. |
|
7773 |
||
7774 |
s cr. |
|
7775 |
s nextPutLine:'"/'. |
|
7776 |
s nextPutLine:'"/ Edit settings:'. |
|
7777 |
s nextPutLine:'"/'. |
|
7778 |
"/ s nextPutLine:'EditTextView st80Mode: ' , (EditTextView st80Mode storeString) , '.'. |
|
7779 |
s nextPutLine:'TextView st80SelectMode: ' , (TextView st80SelectMode storeString) , '.'. |
|
7780 |
s nextPutLine:'UserPreferences current syntaxColoring: ' , (currentUserPrefs syntaxColoring storeString) , '.'. |
|
7781 |
(ListView userDefaultTabPositions = ListView tab4Positions) ifTrue:[ |
|
7782 |
s nextPutLine:'ListView userDefaultTabPositions:(ListView tab4Positions).'. |
|
7783 |
] ifFalse:[ |
|
7784 |
s nextPutLine:'ListView userDefaultTabPositions:(ListView tab8Positions).'. |
|
7785 |
]. |
|
7786 |
||
7787 |
s nextPutLine:'"/'. |
|
7788 |
s nextPutLine:'"/ User preference values:'. |
|
7789 |
s nextPutLine:'"/'. |
|
7790 |
currentUserPrefs keysAndValuesDo:[:k :v | |
|
7791 |
(UserPreferences includesSelector:(k , ':') asSymbol) ifTrue:[ |
|
7792 |
s nextPutLine:'UserPreferences current ' , k , ':' , v storeString , '.'. |
|
7793 |
] ifFalse:[ |
|
7794 |
s nextPutLine:'UserPreferences current at:' , k storeString , ' put:' , v storeString , '.'. |
|
7795 |
] |
|
7796 |
]. |
|
7797 |
||
7798 |
s cr. |
|
7799 |
s nextPutLine:'"/'. |
|
7800 |
s nextPutLine:'"/ Misc settings:'. |
|
7801 |
s nextPutLine:'"/'. |
|
7802 |
s nextPutLine:'Class keepMethodHistory: ' , (Class methodHistory notNil storeString) , '.'; |
|
7803 |
nextPutLine:'Smalltalk logDoits: ' , (Smalltalk logDoits storeString) , '.'; |
|
7804 |
nextPutLine:'Autoload compileLazy: ' , (Autoload compileLazy storeString) , '.'; |
|
7805 |
nextPutLine:'Smalltalk loadBinaries: ' , (Smalltalk loadBinaries storeString) , '.'; |
|
7806 |
nextPutLine:'StandardSystemView includeHostNameInLabel: ' , (StandardSystemView includeHostNameInLabel storeString) , '.'; |
|
7807 |
||
7808 |
"/ claus - I dont think its a good idea to save those ... |
|
7809 |
nextPutLine:'"/ Class updateChanges: ' , (Class updatingChanges storeString) , '.'; |
|
7810 |
nextPutLine:'"/ ObjectMemory nameForChanges: ' , (ObjectMemory nameForChanges storeString) , '.'; |
|
7811 |
||
7812 |
nextPutLine:'StandardSystemView returnFocusWhenClosingModalBoxes: ' , (StandardSystemView returnFocusWhenClosingModalBoxes storeString) , '.'; |
|
7813 |
nextPutLine:'StandardSystemView takeFocusWhenMapped: ' , (StandardSystemView takeFocusWhenMapped storeString) , '.'; |
|
7814 |
nextPutLine:'Display notNil ifTrue:['; |
|
7815 |
nextPutLine:' Display activateOnClick: ' , ((screen activateOnClick:nil) storeString) , '.'; |
|
7816 |
nextPutLine:'].'; |
|
7817 |
nextPutLine:'MenuView showAcceleratorKeys: ' , (MenuView showAcceleratorKeys storeString) , '.'; |
|
7818 |
nextPutLine:'Class tryLocalSourceFirst: ' , (Class tryLocalSourceFirst storeString) , '.'. |
|
7819 |
(Exception emergencyHandler == AbstractLauncherApplication notifyingEmergencyHandler) ifTrue:[ |
|
7820 |
s nextPutLine:'Exception emergencyHandler:(AbstractLauncherApplication notifyingEmergencyHandler).'. |
|
7821 |
]. |
|
7822 |
Processor isTimeSlicing ifTrue:[ |
|
7823 |
s nextPutLine:'Processor startTimeSlicing.'. |
|
7824 |
s nextPutLine:('Processor supportDynamicPriorities:' , (Processor supportDynamicPriorities ? false) storeString , '.'). |
|
7825 |
] ifFalse:[ |
|
7826 |
s nextPutLine:'Processor stopTimeSlicing.'. |
|
7827 |
]. |
|
7828 |
||
7829 |
s cr. |
|
7830 |
s nextPutLine:'"/'. |
|
7831 |
s nextPutLine:'"/ Printer settings:'. |
|
7832 |
s nextPutLine:'"/'. |
|
7833 |
s nextPutLine:'Printer := ' , (Printer name) , '.'; |
|
7834 |
nextPutLine:'Printer printCommand: ' , (Printer printCommand storeString) , '.'. |
|
7835 |
||
7836 |
Printer supportsPageSizes ifTrue:[ |
|
7837 |
s nextPutLine:'Printer pageFormat: ' , (Printer pageFormat storeString) , '.'. |
|
7838 |
s nextPutLine:'Printer landscape: ' , (Printer landscape storeString) , '.'. |
|
7839 |
]. |
|
7840 |
Printer supportsMargins ifTrue:[ |
|
7841 |
s nextPutLine:'Printer topMargin: ' , (Printer topMargin storeString) , '.'. |
|
7842 |
s nextPutLine:'Printer leftMargin: ' , (Printer leftMargin storeString) , '.'. |
|
7843 |
s nextPutLine:'Printer rightMargin: ' , (Printer rightMargin storeString) , '.'. |
|
7844 |
s nextPutLine:'Printer bottomMargin: ' , (Printer bottomMargin storeString) , '.'. |
|
7845 |
]. |
|
7846 |
Printer supportsPostscript ifTrue:[ |
|
7847 |
s nextPutLine:'Printer supportsColor: ' , (Printer supportsColor storeString) , '.'. |
|
7848 |
]. |
|
7849 |
||
7850 |
s cr. |
|
7851 |
s nextPutLine:'"/'. |
|
7852 |
s nextPutLine:'"/ Font settings:'. |
|
7853 |
s nextPutLine:'"/ (only restored, if image is restarted on the same display)'. |
|
7854 |
s nextPutLine:'"/'. |
|
7855 |
s nextPutLine:'Display notNil ifTrue:['. |
|
7856 |
s nextPutLine:' Display displayName = ' , (screen displayName storeString) , ' ifTrue:['. |
|
7857 |
s nextPutLine:' View defaultFont: ' , (View defaultFont storeString) , '.'. |
|
7858 |
s nextPutLine:' Label defaultFont: ' , (Label defaultFont storeString) , '.'. |
|
7859 |
s nextPutLine:' Button defaultFont: ' , (Button defaultFont storeString) , '.'. |
|
7860 |
s nextPutLine:' Toggle defaultFont: ' , (Toggle defaultFont storeString) , '.'. |
|
7861 |
s nextPutLine:' SelectionInListView defaultFont: ' , (SelectionInListView defaultFont storeString) , '.'. |
|
7862 |
s nextPutLine:' MenuView defaultFont: ' , (MenuView defaultFont storeString) , '.'. |
|
7863 |
s nextPutLine:' PullDownMenu defaultFont: ' , (PullDownMenu defaultFont storeString) , '.'. |
|
7864 |
s nextPutLine:' TextView defaultFont: ' , (TextView defaultFont storeString) , '.'. |
|
7865 |
s nextPutLine:' EditTextView defaultFont: ' , (EditTextView defaultFont storeString) , '.'. |
|
7866 |
s nextPutLine:' CodeView defaultFont: ' , (CodeView defaultFont storeString) , '.'. |
|
7867 |
s nextPutLine:' ].'. |
|
7868 |
s nextPutLine:'].'. |
|
7869 |
||
7870 |
s cr. |
|
7871 |
s nextPutLine:'"/'. |
|
7872 |
s nextPutLine:'"/ Language setting:'. |
|
7873 |
s nextPutLine:'"/'. |
|
7874 |
s nextPutLine:'Smalltalk language: ' , (Smalltalk language storeString) , '.'. |
|
7875 |
s nextPutLine:'Smalltalk languageTerritory: ' , (Smalltalk languageTerritory storeString) , '.'. |
|
7876 |
||
7877 |
s cr. |
|
7878 |
s nextPutLine:'"/'. |
|
7879 |
s nextPutLine:'"/ SourceCodeManager settings:'. |
|
7880 |
s nextPutLine:'"/ (only restored, if image is restarted on the same host)'. |
|
7881 |
s nextPutLine:'"/'. |
|
7882 |
s nextPutLine:'OperatingSystem getHostName = ' , (OperatingSystem getHostName storeString) , ' ifTrue:['. |
|
7883 |
s nextPutLine:' Class tryLocalSourceFirst:' , Class tryLocalSourceFirst storeString , '.'. |
|
7884 |
(Smalltalk at:#SourceCodeManager) == CVSSourceCodeManager ifTrue:[ |
|
7885 |
s nextPutLine:' Smalltalk at:#SourceCodeManager put: CVSSourceCodeManager.'. |
|
7886 |
s nextPutLine:' AbstractSourceCodeManager cacheDirectoryName:' , AbstractSourceCodeManager cacheDirectoryName storeString , '.'. |
|
7887 |
s nextPutLine:' CVSSourceCodeManager cvsBinDirectory:' , CVSSourceCodeManager cvsBinDirectory storeString , '.'. |
|
7888 |
s nextPutLine:' CVSSourceCodeManager repositoryNamesPerModule:' , CVSSourceCodeManager repositoryNamesPerModule storeString , '.'. |
|
7889 |
s nextPutLine:' CVSSourceCodeManager initializeForRepository:' , CVSSourceCodeManager repositoryName storeString , '.'. |
|
7890 |
]. |
|
7891 |
s nextPutLine:'].'. |
|
7892 |
||
7893 |
s close. |
|
7894 |
||
7895 |
" |
|
7896 |
Transcript topView application saveSettings |
|
7897 |
" |
|
7898 |
||
7899 |
"Modified: / 6.1.1999 / 14:24:16 / cg" |
|
4240 | 7900 |
! ! |
7901 |
||
7902 |
!AbstractLauncherApplication::StyleSettingsAppl class methodsFor:'defaults'! |
|
7903 |
||
4244 | 7904 |
standardStyles |
7905 |
||
7906 |
^ #( |
|
7907 |
'decWindows' |
|
7908 |
'iris' |
|
7909 |
'motif' |
|
7910 |
'mswindows95' |
|
7911 |
'next' |
|
7912 |
'normal' |
|
7913 |
'os2' |
|
7914 |
'st80' |
|
7915 |
) |
|
4240 | 7916 |
! ! |
7917 |
||
7918 |
!AbstractLauncherApplication::StyleSettingsAppl class methodsFor:'interface specs'! |
|
7919 |
||
4244 | 7920 |
windowSpec |
7921 |
"This resource specification was automatically generated |
|
7922 |
by the UIPainter of ST/X." |
|
7923 |
||
7924 |
"Do not manually edit this!! If it is corrupted, |
|
7925 |
the UIPainter may not be able to read the specification." |
|
7926 |
||
7927 |
" |
|
7928 |
UIPainter new openOnClass:AbstractLauncherApplication::StyleSettingsAppl andSelector:#windowSpec |
|
7929 |
AbstractLauncherApplication::StyleSettingsAppl new openInterface:#windowSpec |
|
7930 |
AbstractLauncherApplication::StyleSettingsAppl open |
|
7931 |
" |
|
7932 |
||
7933 |
<resource: #canvas> |
|
7934 |
||
7935 |
^ |
|
7936 |
#(#FullSpec |
|
7937 |
#name: #windowSpec |
|
7938 |
#window: |
|
7939 |
#(#WindowSpec |
|
7940 |
#label: 'Style Selection' |
|
7941 |
#name: 'Style Selection' |
|
7942 |
#min: #(#Point 10 10) |
|
7943 |
#max: #(#Point 1024 768) |
|
7944 |
#bounds: #(#Rectangle 12 22 487 553) |
|
7945 |
) |
|
7946 |
#component: |
|
7947 |
#(#SpecCollection |
|
7948 |
#collection: #( |
|
7949 |
#(#LabelSpec |
|
7950 |
#label: 'Label' |
|
7951 |
#name: 'Label1' |
|
7952 |
#layout: #(#LayoutFrame 0 0.0 -71 1 0 1.0 -34 1) |
|
7953 |
#style: #(#FontDescription #helvetica #bold #roman 12) |
|
7954 |
#translateLabel: true |
|
7955 |
#labelChannel: #infoLabelHolder |
|
7956 |
#resizeForLabel: true |
|
7957 |
#adjust: #left |
|
7958 |
) |
|
7959 |
#(#HorizontalPanelViewSpec |
|
7960 |
#name: 'HorizontalPanel1' |
|
7961 |
#layout: #(#LayoutFrame 0 0.0 -34 1 0 1.0 0 1) |
|
7962 |
#horizontalLayout: #center |
|
7963 |
#verticalLayout: #center |
|
7964 |
#horizontalSpace: 3 |
|
7965 |
#verticalSpace: 3 |
|
7966 |
#component: |
|
7967 |
#(#SpecCollection |
|
7968 |
#collection: #( |
|
7969 |
#(#ActionButtonSpec |
|
7970 |
#label: 'OK' |
|
7971 |
#name: 'OK' |
|
7972 |
#translateLabel: true |
|
7973 |
#model: #saveSettings |
|
7974 |
#enableChannel: #modifiedChannel |
|
7975 |
#extent: #(#Point 125 22) |
|
7976 |
) |
|
7977 |
#(#ActionButtonSpec |
|
7978 |
#label: 'Cancel' |
|
7979 |
#name: 'Cancel' |
|
7980 |
#translateLabel: true |
|
7981 |
#model: #doCancel |
|
7982 |
#extent: #(#Point 125 22) |
|
7983 |
) |
|
7984 |
#(#ActionButtonSpec |
|
7985 |
#label: 'Help' |
|
7986 |
#name: 'Help' |
|
7987 |
#translateLabel: true |
|
7988 |
#model: #help |
|
7989 |
#extent: #(#Point 125 22) |
|
7990 |
) |
|
7991 |
) |
|
7992 |
||
7993 |
) |
|
7994 |
) |
|
7995 |
#(#LabelSpec |
|
7996 |
#label: 'NoticeText' |
|
7997 |
#name: 'Text' |
|
7998 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 160 0) |
|
7999 |
#translateLabel: true |
|
8000 |
#labelChannel: #noticeLabelHolder |
|
8001 |
#resizeForLabel: true |
|
8002 |
#adjust: #left |
|
8003 |
) |
|
8004 |
#(#CheckBoxSpec |
|
8005 |
#label: 'standard styles only' |
|
8006 |
#name: 'CheckBox1' |
|
8007 |
#layout: #(#LayoutFrame 0 0.0 160 0 0 1.0 182 0) |
|
8008 |
#model: #showStandardStylesOnly |
|
8009 |
#translateLabel: true |
|
8010 |
) |
|
8011 |
#(#SequenceViewSpec |
|
8012 |
#name: 'StyleList' |
|
8013 |
#layout: #(#LayoutFrame 0 0.0 182 0 0 1.0 -74 1) |
|
8014 |
#model: #selectedStyle |
|
8015 |
#hasHorizontalScrollBar: true |
|
8016 |
#hasVerticalScrollBar: true |
|
8017 |
#useIndex: false |
|
8018 |
#sequenceList: #styleList |
|
8019 |
) |
|
8020 |
) |
|
8021 |
||
8022 |
) |
|
8023 |
) |
|
4240 | 8024 |
! ! |
8025 |
||
8026 |
!AbstractLauncherApplication::StyleSettingsAppl methodsFor:'actions'! |
|
8027 |
||
4244 | 8028 |
doCancel |
8029 |
||
8030 |
self isPartOfSettinsDialog ifTrue:[ |
|
8031 |
self loadRequest. |
|
8032 |
]. |
|
8033 |
self closeRequest. |
|
8034 |
! |
|
8035 |
||
8036 |
evaluateModified |
|
8037 |
||
8038 |
self modifiedChannel value:(self hasUnsavedChanges). |
|
8039 |
! |
|
8040 |
||
8041 |
help |
|
8042 |
||
8043 |
self warn:'no help available here'. |
|
8044 |
"/ self withWaitCursorDo:[HTMLDocumentView openFullOnHelpFile:'Launcher/keyboardSetting.html']. |
|
8045 |
! |
|
8046 |
||
8047 |
loadRequest |
|
8048 |
||
8049 |
self modifiedChannel value:false. |
|
8050 |
! |
|
8051 |
||
8052 |
saveRequest |
|
8053 |
| result | |
|
8054 |
||
8055 |
(self hasUnsavedChanges) ifTrue:[ |
|
8056 |
result := self confirmWithCancel:(resources string:'Save changed Tool Settings ?'). |
|
8057 |
result isNil ifTrue:[ ^ false]. |
|
8058 |
result ifTrue:[ |
|
8059 |
self saveSettings. |
|
8060 |
] |
|
8061 |
]. |
|
8062 |
^ true |
|
4240 | 8063 |
! |
8064 |
||
8065 |
saveSettings |
|
8066 |
||
8067 |
| newStyle master requestor| |
|
8068 |
||
4244 | 8069 |
self halt. |
4240 | 8070 |
newStyle := self selectedStyle value. |
8071 |
master := self masterApplication. |
|
8072 |
master notNil ifTrue:[ |
|
8073 |
requestor := master requestor. |
|
8074 |
]. |
|
4244 | 8075 |
self halt. |
4240 | 8076 |
self hasUnsavedChanges ifTrue:[ |
8077 |
self withWaitCursorDo:[ |
|
8078 |
Transcript showCR:'change style to ' , newStyle , ' ...'. |
|
8079 |
View defaultStyle:newStyle asSymbol. |
|
8080 |
]. |
|
4244 | 8081 |
requestor notNil ifTrue:[ |
8082 |
self halt. |
|
8083 |
requestor reopenLauncher. |
|
4240 | 8084 |
]. |
8085 |
DebugView newDebugger. |
|
8086 |
self modifiedChannel value:false. |
|
8087 |
]. |
|
8088 |
! ! |
|
8089 |
||
8090 |
!AbstractLauncherApplication::StyleSettingsAppl methodsFor:'aspects'! |
|
8091 |
||
4244 | 8092 |
infoLabelHolder |
8093 |
||
8094 |
infoLabelHolder isNil ifTrue:[ |
|
8095 |
infoLabelHolder := '' asValue. |
|
8096 |
]. |
|
8097 |
^ infoLabelHolder. |
|
8098 |
! |
|
8099 |
||
8100 |
modifiedChannel |
|
8101 |
||
8102 |
modifiedChannel isNil ifTrue:[ |
|
8103 |
modifiedChannel := false asValue. |
|
8104 |
]. |
|
8105 |
^ modifiedChannel |
|
8106 |
! |
|
8107 |
||
8108 |
noticeLabelHolder |
|
8109 |
||
8110 |
noticeLabelHolder isNil ifTrue:[ |
|
8111 |
noticeLabelHolder := '' asValue. |
|
8112 |
]. |
|
8113 |
^ noticeLabelHolder. |
|
8114 |
! |
|
8115 |
||
8116 |
selectedStyle |
|
8117 |
||
8118 |
selectedStyle isNil ifTrue:[ |
|
8119 |
selectedStyle := ValueHolder new. |
|
8120 |
selectedStyle addDependent:self. |
|
8121 |
]. |
|
8122 |
^ selectedStyle. |
|
8123 |
! |
|
8124 |
||
8125 |
showStandardStylesOnly |
|
8126 |
||
8127 |
showStandardStylesOnly isNil ifTrue:[ |
|
8128 |
showStandardStylesOnly := true asValue. |
|
8129 |
showStandardStylesOnly addDependent:self. |
|
8130 |
]. |
|
8131 |
^ showStandardStylesOnly. |
|
8132 |
! |
|
8133 |
||
8134 |
styleList |
|
8135 |
||
8136 |
styleList isNil ifTrue:[ |
|
8137 |
styleList := List new. |
|
8138 |
styleList addDependent:self. |
|
8139 |
]. |
|
8140 |
^ styleList. |
|
4240 | 8141 |
! ! |
8142 |
||
8143 |
!AbstractLauncherApplication::StyleSettingsAppl methodsFor:'change & update'! |
|
8144 |
||
4244 | 8145 |
changeInfoLabel |
8146 |
||
8147 |
|nm sheet comment| |
|
8148 |
||
8149 |
comment := ''. |
|
8150 |
nm := self selectedStyle value. |
|
8151 |
nm notNil ifTrue:[ |
|
8152 |
sheet := ViewStyle fromFile:(nm , '.style'). |
|
8153 |
comment := (sheet at:#comment ifAbsent:'') withoutSeparators. |
|
8154 |
]. |
|
8155 |
comment := comment withCRs asStringCollection. |
|
8156 |
comment size == 1 ifTrue:[ |
|
8157 |
comment := comment first |
|
8158 |
]. |
|
8159 |
self infoLabelHolder value:comment |
|
8160 |
! |
|
8161 |
||
8162 |
update:something with:aParameter from:changedObject |
|
8163 |
"Invoked when an object that I depend upon sends a change notification." |
|
8164 |
||
8165 |
"stub code automatically generated - please change as required" |
|
8166 |
||
8167 |
changedObject == self showStandardStylesOnly ifTrue:[ |
|
8168 |
self updateList. |
|
8169 |
^ self. |
|
8170 |
]. |
|
8171 |
changedObject == self selectedStyle ifTrue:[ |
|
8172 |
self changeInfoLabel. |
|
8173 |
self evaluateModified. |
|
8174 |
^ self. |
|
8175 |
]. |
|
8176 |
||
8177 |
super update:something with:aParameter from:changedObject |
|
4240 | 8178 |
! |
8179 |
||
8180 |
updateList |
|
8181 |
||
8182 |
|listOfStyles lastSelection| |
|
8183 |
||
8184 |
lastSelection := self selectedStyle value. |
|
8185 |
listOfStyles := styleDirectoryContents select:[:aFileName | aFileName asFilename hasSuffix:'style']. |
|
8186 |
listOfStyles := listOfStyles collect:[:aFileName | aFileName asFilename withoutSuffix name]. |
|
8187 |
Filename isCaseSensitive ifFalse:[ |
|
8188 |
listOfStyles := listOfStyles collect:[:aStyleName | aStyleName asLowercase]. |
|
8189 |
]. |
|
8190 |
listOfStyles remove:'generic' ifAbsent:nil; remove:'mswindows3' ifAbsent:nil. |
|
4244 | 8191 |
showStandardStylesOnly value ifTrue:[ |
4240 | 8192 |
listOfStyles := listOfStyles select:[:aStyleName | self class standardStyles includes:aStyleName]. |
8193 |
]. |
|
8194 |
||
8195 |
listOfStyles sort. |
|
8196 |
self styleList contents:listOfStyles. |
|
8197 |
self selectedStyle value:lastSelection. |
|
8198 |
! ! |
|
8199 |
||
8200 |
!AbstractLauncherApplication::StyleSettingsAppl methodsFor:'initialization & release'! |
|
8201 |
||
4244 | 8202 |
closeDownViews |
8203 |
"This is a hook method generated by the Browser. |
|
8204 |
It will be invoked when your app/dialog-window is really closed. |
|
8205 |
See also #closeDownViews, which is invoked before and may suppress the close |
|
8206 |
or ask the user for confirmation." |
|
8207 |
||
8208 |
"/ change the code below as required ... |
|
8209 |
"/ This should cleanup any leftover resources |
|
8210 |
"/ (for example, temporary files) |
|
8211 |
"/ super closeRequest will initiate the closeDown |
|
8212 |
||
8213 |
"/ add your code here |
|
8214 |
||
8215 |
"/ do not remove the one below ... |
|
8216 |
^ super closeDownViews |
|
8217 |
! |
|
8218 |
||
8219 |
closeRequest |
|
8220 |
||
8221 |
self saveRequest ifFalse:[ |
|
8222 |
^ self |
|
8223 |
]. |
|
8224 |
||
8225 |
^ super closeRequest. |
|
8226 |
! |
|
8227 |
||
8228 |
initialize |
|
8229 |
||
8230 |
|someRsrcFile resourceDir| |
|
8231 |
||
8232 |
resources := self class owningClass classResources. |
|
8233 |
someRsrcFile := Smalltalk getSystemFileName:('resources' asFilename constructString:'normal.style'). |
|
8234 |
someRsrcFile isNil ifTrue:[ |
|
8235 |
someRsrcFile := Smalltalk getResourceFileName:'normal.style' forPackage:'stx:libview'. |
|
8236 |
someRsrcFile isNil ifTrue:[ |
|
8237 |
someRsrcFile := Smalltalk getResourceFileName:'styles/normal.style' forPackage:'stx:libview'. |
|
8238 |
]. |
|
8239 |
]. |
|
8240 |
someRsrcFile notNil ifTrue:[ |
|
8241 |
resourceDir := someRsrcFile asFilename directoryName |
|
8242 |
] ifFalse:[ |
|
8243 |
resourceDir := Smalltalk getSystemFileName:'resources'. |
|
8244 |
]. |
|
8245 |
||
8246 |
resourceDir isNil ifTrue:[ |
|
8247 |
self warn:'no styles found (missing ''resources'' directory)'. |
|
8248 |
^ self |
|
8249 |
]. |
|
8250 |
styleDirectoryContents := resourceDir asFilename directoryContents. |
|
8251 |
self updateList. |
|
8252 |
(self class standardStyles includes:View defaultStyle) ifFalse:[ |
|
8253 |
showStandardStylesOnly value:false |
|
8254 |
]. |
|
8255 |
self selectedStyle value:(View defaultStyle). |
|
8256 |
self noticeLabelHolder value:(resources at:'STYLE_MSG' default:'Select a Style') withCRs. |
|
8257 |
super initialize |
|
4240 | 8258 |
! ! |
8259 |
||
8260 |
!AbstractLauncherApplication::StyleSettingsAppl methodsFor:'queries'! |
|
8261 |
||
4244 | 8262 |
hasUnsavedChanges |
8263 |
||
8264 |
^ (self selectedStyle value ~= View defaultStyle) |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8265 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8266 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8267 |
!AbstractLauncherApplication::ToolsSettingsAppl class methodsFor:'interface specs'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8268 |
|
4244 | 8269 |
windowSpec |
8270 |
"This resource specification was automatically generated |
|
8271 |
by the UIPainter of ST/X." |
|
8272 |
||
8273 |
"Do not manually edit this!! If it is corrupted, |
|
8274 |
the UIPainter may not be able to read the specification." |
|
8275 |
||
8276 |
" |
|
8277 |
UIPainter new openOnClass:AbstractLauncherApplication::ToolsSettingsAppl andSelector:#windowSpec |
|
8278 |
AbstractLauncherApplication::ToolsSettingsAppl new openInterface:#windowSpec |
|
8279 |
AbstractLauncherApplication::ToolsSettingsAppl open |
|
8280 |
" |
|
8281 |
||
8282 |
<resource: #canvas> |
|
8283 |
||
8284 |
^ |
|
8285 |
#(#FullSpec |
|
8286 |
#name: #windowSpec |
|
8287 |
#window: |
|
8288 |
#(#WindowSpec |
|
8289 |
#label: 'AbstractLauncherApplication::LauncherDialogs::ToolsSettingsAppl' |
|
8290 |
#name: 'AbstractLauncherApplication::LauncherDialogs::ToolsSettingsAppl' |
|
8291 |
#min: #(#Point 10 10) |
|
8292 |
#max: #(#Point 1024 768) |
|
8293 |
#bounds: #(#Rectangle 16 42 491 313) |
|
8294 |
) |
|
8295 |
#component: |
|
8296 |
#(#SpecCollection |
|
8297 |
#collection: #( |
|
8298 |
#(#CheckBoxSpec |
|
8299 |
#label: 'Use the New Changes Browser' |
|
8300 |
#name: 'ChangesBrowser' |
|
8301 |
#layout: #(#LayoutFrame 5 0 5 0 250 0 30 0) |
|
8302 |
#model: #useNewChangesBrowser |
|
8303 |
#translateLabel: true |
|
8304 |
) |
|
8305 |
#(#DividerSpec |
|
8306 |
#name: 'Separator1' |
|
8307 |
#layout: #(#LayoutFrame 0 0.0 35 0 0 1 38 0) |
|
8308 |
) |
|
8309 |
#(#CheckBoxSpec |
|
8310 |
#label: 'Use the New System Browser' |
|
8311 |
#name: 'NewSystemBrowser' |
|
8312 |
#layout: #(#LayoutFrame 250 0 5 0 0 1 30 0) |
|
8313 |
#model: #useNewSystemBrowser |
|
8314 |
#translateLabel: true |
|
8315 |
) |
|
8316 |
#(#DividerSpec |
|
8317 |
#name: 'Separator2' |
|
8318 |
#layout: #(#LayoutFrame 0 0.0 70 0 0 1 73 0) |
|
8319 |
) |
|
8320 |
#(#CheckBoxSpec |
|
8321 |
#label: 'Use the New VersionDiff Browser' |
|
8322 |
#name: 'VersionDiffBrowser' |
|
8323 |
#layout: #(#LayoutFrame 5 0 40 0 250 0 65 0) |
|
8324 |
#model: #useNewVersionDiffBrowser |
|
8325 |
#translateLabel: true |
|
8326 |
) |
|
8327 |
#(#DividerSpec |
|
8328 |
#name: 'Separator3' |
|
8329 |
#layout: #(#LayoutFrame 0 0.0 105 0 0 1 108 0) |
|
8330 |
) |
|
8331 |
#(#CheckBoxSpec |
|
8332 |
#label: 'Use the New File Browser' |
|
8333 |
#name: 'NewFileBrowser' |
|
8334 |
#layout: #(#LayoutFrame 250 0 40 0 0 1 65 0) |
|
8335 |
#model: #useNewFileBrowser |
|
8336 |
#translateLabel: true |
|
8337 |
) |
|
8338 |
#(#CheckBoxSpec |
|
8339 |
#label: 'Use Hierarchical Inspector' |
|
8340 |
#name: 'HierarchicalInspector' |
|
8341 |
#layout: #(#LayoutFrame 5 0 75 0 250 0 100 0) |
|
8342 |
#model: #useNewInspector |
|
8343 |
#translateLabel: true |
|
8344 |
) |
|
8345 |
#(#CheckBoxSpec |
|
8346 |
#label: 'Show Clock in Launcher' |
|
8347 |
#name: 'Clock' |
|
8348 |
#layout: #(#LayoutFrame 250 0 75 0 0 1 100 0) |
|
8349 |
#model: #showClockInLauncher |
|
8350 |
#translateLabel: true |
|
8351 |
) |
|
8352 |
#(#LabelSpec |
|
8353 |
#label: '''Transcripts Buffer Size:''' |
|
8354 |
#name: 'Label1' |
|
8355 |
#layout: #(#LayoutFrame 9 0 133 0 154 0 155 0) |
|
8356 |
#translateLabel: true |
|
8357 |
#adjust: #left |
|
8358 |
) |
|
8359 |
#(#InputFieldSpec |
|
8360 |
#name: 'Transcripts Buffer Size' |
|
8361 |
#layout: #(#LayoutFrame 159 0 133 0 214 0 155 0) |
|
8362 |
#model: #transcriptBufferSize |
|
8363 |
#type: #number |
|
8364 |
#immediateAccept: true |
|
8365 |
#acceptOnReturn: true |
|
8366 |
#acceptOnTab: true |
|
8367 |
#acceptOnLostFocus: true |
|
8368 |
#acceptOnPointerLeave: false |
|
8369 |
) |
|
8370 |
#(#HorizontalPanelViewSpec |
|
8371 |
#name: 'HorizontalPanel1' |
|
8372 |
#layout: #(#LayoutFrame 0 0.0 -34 1 0 1.0 0 1) |
|
8373 |
#horizontalLayout: #center |
|
8374 |
#verticalLayout: #center |
|
8375 |
#horizontalSpace: 3 |
|
8376 |
#verticalSpace: 3 |
|
8377 |
#component: |
|
8378 |
#(#SpecCollection |
|
8379 |
#collection: #( |
|
8380 |
#(#ActionButtonSpec |
|
8381 |
#label: 'OK' |
|
8382 |
#name: 'OK' |
|
8383 |
#translateLabel: true |
|
8384 |
#model: #saveSettings |
|
8385 |
#enableChannel: #modifiedChannel |
|
8386 |
#extent: #(#Point 125 22) |
|
8387 |
) |
|
8388 |
#(#ActionButtonSpec |
|
8389 |
#label: 'Cancel' |
|
8390 |
#name: 'Cancel' |
|
8391 |
#translateLabel: true |
|
8392 |
#model: #doCancel |
|
8393 |
#extent: #(#Point 125 22) |
|
8394 |
) |
|
8395 |
#(#ActionButtonSpec |
|
8396 |
#label: 'Help' |
|
8397 |
#name: 'Help' |
|
8398 |
#translateLabel: true |
|
8399 |
#model: #help |
|
8400 |
#extent: #(#Point 125 22) |
|
8401 |
) |
|
8402 |
) |
|
8403 |
||
8404 |
) |
|
8405 |
) |
|
8406 |
) |
|
8407 |
||
8408 |
) |
|
8409 |
) |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8410 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8411 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8412 |
!AbstractLauncherApplication::ToolsSettingsAppl methodsFor:'actions'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8413 |
|
4244 | 8414 |
doCancel |
8415 |
||
8416 |
self isPartOfSettinsDialog ifTrue:[ |
|
8417 |
self loadRequest. |
|
8418 |
]. |
|
8419 |
self closeRequest. |
|
8420 |
! |
|
8421 |
||
8422 |
evaluateModified |
|
8423 |
||
8424 |
self modifiedChannel value:(self hasUnsavedChanges). |
|
8425 |
! |
|
8426 |
||
8427 |
help |
|
8428 |
||
8429 |
self withWaitCursorDo:[HTMLDocumentView openFullOnHelpFile:'Launcher/toolSettings.html']. |
|
8430 |
! |
|
8431 |
||
8432 |
loadRequest |
|
8433 |
||
8434 |
self showClockInLauncher value:currentUserPrefs showClockInLauncher. |
|
8435 |
self transcriptBufferSize value:Transcript current lineLimit. |
|
8436 |
self useNewChangesBrowser value:currentUserPrefs useNewChangesBrowser. |
|
8437 |
self useNewFileBrowser value:currentUserPrefs useNewFileBrowser. |
|
8438 |
self useNewInspector value:currentUserPrefs useNewInspector. |
|
8439 |
self useNewSystemBrowser value:currentUserPrefs useNewSystemBrowser. |
|
8440 |
self useNewVersionDiffBrowser value:currentUserPrefs useNewVersionDiffBrowser. |
|
8441 |
self modifiedChannel value:false. |
|
8442 |
! |
|
8443 |
||
8444 |
saveRequest |
|
8445 |
| result | |
|
8446 |
||
8447 |
(self hasUnsavedChanges) ifTrue:[ |
|
8448 |
result := self confirmWithCancel:(resources string:'Save changed Tool Settings ?'). |
|
8449 |
result isNil ifTrue:[ ^ false]. |
|
8450 |
result ifTrue:[ |
|
8451 |
self saveSettings. |
|
8452 |
] |
|
8453 |
]. |
|
8454 |
^ true |
|
8455 |
! |
|
8456 |
||
8457 |
saveSettings |
|
8458 |
||
8459 |
| showClock launcher | |
|
8460 |
||
8461 |
currentUserPrefs useNewInspector:self useNewInspector value. |
|
8462 |
currentUserPrefs useNewChangesBrowser:self useNewChangesBrowser value. |
|
8463 |
currentUserPrefs useNewSystemBrowser:self useNewSystemBrowser value. |
|
8464 |
currentUserPrefs useNewVersionDiffBrowser:self useNewVersionDiffBrowser value. |
|
8465 |
currentUserPrefs useNewFileBrowser:self useNewFileBrowser value. |
|
8466 |
(Smalltalk at:#FileBrowserV2) isBehavior ifTrue:[ |
|
8467 |
self useNewFileBrowser value ifTrue:[ |
|
8468 |
FileBrowserV2 installInLauncher. |
|
8469 |
] ifFalse:[ |
|
8470 |
FileBrowserV2 isLoaded ifTrue:[ |
|
8471 |
FileBrowserV2 removeFromLauncher. |
|
8472 |
] |
|
8473 |
]. |
|
8474 |
]. |
|
8475 |
showClock := self showClockInLauncher value. |
|
8476 |
currentUserPrefs showClockInLauncher ~= showClock ifTrue:[ |
|
8477 |
currentUserPrefs showClockInLauncher:showClock. |
|
8478 |
launcher := Transcript application. |
|
8479 |
(launcher isKindOf:ToolApplicationModel) ifTrue:[ |
|
8480 |
showClock ifTrue:[ |
|
8481 |
launcher startClock |
|
8482 |
] ifFalse:[ |
|
8483 |
launcher stopClock |
|
8484 |
] |
|
8485 |
] |
|
8486 |
]. |
|
8487 |
Inspector := currentUserPrefs inspectorClassSetting. |
|
8488 |
Transcript current lineLimit:self transcriptBufferSize value. |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8489 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8490 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8491 |
!AbstractLauncherApplication::ToolsSettingsAppl methodsFor:'aspects'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8492 |
|
4244 | 8493 |
modifiedChannel |
8494 |
||
8495 |
modifiedChannel isNil ifTrue:[ |
|
8496 |
modifiedChannel := false asValue. |
|
8497 |
]. |
|
8498 |
^ modifiedChannel |
|
8499 |
! |
|
8500 |
||
8501 |
showClockInLauncher |
|
8502 |
||
8503 |
showClockInLauncher isNil ifTrue:[ |
|
8504 |
showClockInLauncher := currentUserPrefs showClockInLauncher asValue. |
|
8505 |
showClockInLauncher onChangeSend:#evaluateModified to:self |
|
8506 |
]. |
|
8507 |
^ showClockInLauncher. |
|
8508 |
! |
|
8509 |
||
8510 |
transcriptBufferSize |
|
8511 |
||
8512 |
transcriptBufferSize isNil ifTrue:[ |
|
8513 |
transcriptBufferSize := Transcript current lineLimit asValue. |
|
8514 |
transcriptBufferSize onChangeSend:#evaluateModified to:self |
|
8515 |
]. |
|
8516 |
^ transcriptBufferSize. |
|
8517 |
! |
|
8518 |
||
8519 |
useNewChangesBrowser |
|
8520 |
||
8521 |
useNewChangesBrowser isNil ifTrue:[ |
|
8522 |
useNewChangesBrowser := currentUserPrefs useNewChangesBrowser asValue. |
|
8523 |
useNewChangesBrowser onChangeSend:#evaluateModified to:self |
|
8524 |
]. |
|
8525 |
^ useNewChangesBrowser. |
|
8526 |
! |
|
8527 |
||
8528 |
useNewFileBrowser |
|
8529 |
||
8530 |
useNewFileBrowser isNil ifTrue:[ |
|
8531 |
useNewFileBrowser := currentUserPrefs useNewFileBrowser asValue. |
|
8532 |
useNewFileBrowser onChangeSend:#evaluateModified to:self |
|
8533 |
]. |
|
8534 |
^ useNewFileBrowser. |
|
8535 |
! |
|
8536 |
||
8537 |
useNewInspector |
|
8538 |
||
8539 |
useNewInspector isNil ifTrue:[ |
|
8540 |
useNewInspector := currentUserPrefs useNewInspector asValue. |
|
8541 |
useNewInspector onChangeSend:#evaluateModified to:self |
|
8542 |
]. |
|
8543 |
^ useNewInspector. |
|
8544 |
! |
|
8545 |
||
8546 |
useNewSystemBrowser |
|
8547 |
||
8548 |
useNewSystemBrowser isNil ifTrue:[ |
|
8549 |
useNewSystemBrowser := currentUserPrefs useNewSystemBrowser asValue. |
|
8550 |
useNewSystemBrowser onChangeSend:#evaluateModified to:self |
|
8551 |
]. |
|
8552 |
^ useNewSystemBrowser. |
|
8553 |
! |
|
8554 |
||
8555 |
useNewVersionDiffBrowser |
|
8556 |
||
8557 |
useNewVersionDiffBrowser isNil ifTrue:[ |
|
8558 |
useNewVersionDiffBrowser := currentUserPrefs useNewVersionDiffBrowser asValue. |
|
8559 |
useNewVersionDiffBrowser onChangeSend:#evaluateModified to:self |
|
8560 |
]. |
|
8561 |
^ useNewVersionDiffBrowser. |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8562 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8563 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8564 |
!AbstractLauncherApplication::ToolsSettingsAppl methodsFor:'initialization & release'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8565 |
|
4244 | 8566 |
closeDownViews |
8567 |
"This is a hook method generated by the Browser. |
|
8568 |
It will be invoked when your app/dialog-window is really closed. |
|
8569 |
See also #closeDownViews, which is invoked before and may suppress the close |
|
8570 |
or ask the user for confirmation." |
|
8571 |
||
8572 |
"/ change the code below as required ... |
|
8573 |
"/ This should cleanup any leftover resources |
|
8574 |
"/ (for example, temporary files) |
|
8575 |
"/ super closeRequest will initiate the closeDown |
|
8576 |
||
8577 |
"/ add your code here |
|
8578 |
||
8579 |
"/ do not remove the one below ... |
|
8580 |
^ super closeDownViews |
|
8581 |
! |
|
8582 |
||
8583 |
closeRequest |
|
8584 |
||
8585 |
self saveRequest ifFalse:[ |
|
8586 |
^ self |
|
8587 |
]. |
|
8588 |
||
8589 |
^ super closeRequest. |
|
8590 |
! |
|
8591 |
||
8592 |
initialize |
|
8593 |
||
8594 |
currentUserPrefs := UserPreferences current. |
|
8595 |
super initialize |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8596 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8597 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8598 |
!AbstractLauncherApplication::ToolsSettingsAppl methodsFor:'menu actions'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8599 |
|
4244 | 8600 |
menuNew |
8601 |
"This method was generated by the Browser. |
|
8602 |
It will be invoked when the menu-item 'new' is selected." |
|
8603 |
||
8604 |
"/ change below and add any actions as required here ... |
|
8605 |
self warn:'no action for ''new'' available.'. |
|
8606 |
! |
|
8607 |
||
8608 |
menuOpen |
|
8609 |
"This method was generated by the Browser. |
|
8610 |
It will be invoked when the menu-item 'open' is selected." |
|
8611 |
||
8612 |
"/ change below and add any actions as required here ... |
|
8613 |
self warn:'no action for ''open'' available.'. |
|
8614 |
! |
|
8615 |
||
8616 |
menuSave |
|
8617 |
"This method was generated by the Browser. |
|
8618 |
It will be invoked when the menu-item 'save' is selected." |
|
8619 |
||
8620 |
"/ change below and add any actions as required here ... |
|
8621 |
self warn:'no action for ''save'' available.'. |
|
8622 |
! |
|
8623 |
||
8624 |
menuSaveAs |
|
8625 |
"This method was generated by the Browser. |
|
8626 |
It will be invoked when the menu-item 'saveAs' is selected." |
|
8627 |
||
8628 |
"/ change below and add any actions as required here ... |
|
8629 |
self warn:'no action for ''saveAs'' available.'. |
|
8630 |
! |
|
8631 |
||
8632 |
openAboutThisApplication |
|
8633 |
"This method was generated by the Browser. |
|
8634 |
It will be invoked when the menu-item 'help-about' is selected." |
|
8635 |
||
8636 |
"/ could open a customized aboutBox here ... |
|
8637 |
super openAboutThisApplication |
|
8638 |
! |
|
8639 |
||
8640 |
openDocumentation |
|
8641 |
"This method was generated by the Browser. |
|
8642 |
It will be invoked when the menu-item 'help-documentation' is selected." |
|
8643 |
||
8644 |
"/ change below as required ... |
|
8645 |
||
8646 |
"/ to open an HTML viewer on some document (under 'doc/online/<language>/' ): |
|
8647 |
HTMLDocumentView openFullOnDocumentationFile:'TOP.html'. |
|
8648 |
||
8649 |
"/ add application-specific help files under the 'doc/online/<language>/help/appName' |
|
8650 |
"/ directory, and open a viewer with: |
|
8651 |
"/ HTMLDocumentView openFullOnDocumentationFile:'help/<MyApplication>/TOP.html'. |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8652 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8653 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8654 |
!AbstractLauncherApplication::ToolsSettingsAppl methodsFor:'queries'! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8655 |
|
4244 | 8656 |
hasUnsavedChanges |
8657 |
||
8658 |
^ ((self useNewInspector value ~= currentUserPrefs useNewInspector) or:[ |
|
8659 |
(self useNewChangesBrowser value ~= currentUserPrefs useNewChangesBrowser) or:[ |
|
8660 |
(self useNewSystemBrowser value ~= currentUserPrefs useNewSystemBrowser) or:[ |
|
8661 |
(self showClockInLauncher value ~= currentUserPrefs showClockInLauncher) or:[ |
|
8662 |
(self useNewVersionDiffBrowser value ~= currentUserPrefs useNewVersionDiffBrowser) or:[ |
|
8663 |
(self useNewFileBrowser value ~= currentUserPrefs useNewFileBrowser) or:[ |
|
8664 |
(self transcriptBufferSize value ~= Transcript current lineLimit)]]]]]]) |
|
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8665 |
! ! |
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8666 |
|
2001 | 8667 |
!AbstractLauncherApplication class methodsFor:'documentation'! |
8668 |
||
8669 |
version |
|
4244 | 8670 |
^ '$Header: /cvs/stx/stx/libtool/AbstractLauncherApplication.st,v 1.230 2002-11-12 11:25:24 penk Exp $' |
2001 | 8671 |
! ! |
4224
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8672 |
|
6a5892a6c179
first new settings application startup instable in work by penk
penk
parents:
4199
diff
changeset
|
8673 |
AbstractLauncherApplication::SettingsDialog initialize! |