Fix the ofn flags setup.
[wine/dcerpc.git] / tools / wineconf.libs / wineconf.tcl
blob080b3fde6d5240e2dfedf5943eb09cbe130a09ce
1 # Copyright 1999 Jean-Louis Thirot
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 proc TkW:wineconf {DefaultConfFile} {
19 global WC_banner WC_driveSect WC_path WC_type WC_label WC_fstype
20 global EDIT SAVE REMOVE ADD WC_wineSect WC_windows WC_system WC_temp
21 global WC_Symbols WC_winepath WC_serialSect CLEAR WC_parallelSect
22 global WC_logSect WC_exclude WC_wineLook
23 global windowspath varpath syspath tmppath symbols winelook
24 global ndrives drive drivepath drivetype drivefstype drivelabel
25 global drivedevice driveserial
26 global resolution defaultfont
27 global readport writeport TKW WAITconf
28 global exclude default_progs startup allocsyscolors winelook wine_logfile
29 global com lpt spool nspool alias nalias
30 global WC_helpondrives WC_helponwine WC_helponserial WC_helponPP
31 global WC_helponmisc WAIT WC_quit WC_quit
32 global WC_quitreally WC_noquit
33 if {[winfo exist .choosemethod] } {destroy .choosemethod}
34 if {[winfo exist .install] } {destroy .install}
35 set base .wineconf
36 if {[winfo exists .wineconf]} {
37 wm deiconify .wineconf; return
39 ###################
40 # CREATING WIDGETS
41 ###################
42 toplevel .wineconf -class Toplevel \
43 -background #3c1cfe
44 wm focusmodel .wineconf passive
45 wm geometry .wineconf 462x600+148+153
46 wm maxsize .wineconf 1265 994
47 wm minsize .wineconf 1 1
48 wm overrideredirect .wineconf 0
49 wm resizable .wineconf 1 1
50 wm deiconify .wineconf
51 wm title .wineconf "TkWineSetup Configuring Wine"
52 #wm iconbitmap .wineconf @$TKW/setupfiles/images/setup2.xbm
53 #wm iconmask .wineconf @$TKW/setupfiles/images/setupmask2.xbm
55 label .wineconf.lab18 \
56 -background #fcfefe \
57 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
58 -relief groove -text label -textvariable WC_banner
59 canvas .wineconf.can01 \
60 -background #fee0b4 -borderwidth 2 -height 207 -relief ridge \
61 -width 296
62 label .wineconf.can01.lab22 \
63 -background #fefefe \
64 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
65 -relief groove -text label -textvariable WC_drivesSect
66 listbox .wineconf.can01.lis23 \
67 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
68 -yscrollcommand {.wineconf.can01.scrDrives set }
69 scrollbar .wineconf.can01.scrDrives \
70 -borderwidth 1 -orient vert -width 10 \
71 -command { .wineconf.can01.lis23 yview }
72 listbox .wineconf.can01.lis24 \
73 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*
74 listbox .wineconf.can01.lis25 \
75 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*
76 listbox .wineconf.can01.lis26 \
77 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*
78 button .wineconf.can01.but28 \
79 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -padx 9 \
80 -pady 3 -text button -textvariable ADD \
81 -command {TkW:drives new}
82 button .wineconf.can01.but29 \
83 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -padx 9 \
84 -pady 3 -state disabled -text button -textvariable REMOVE \
85 -command {TkW:delDrive $sel_drive}
86 button .wineconf.can01.but30 \
87 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -padx 9 \
88 -pady 3 -state disabled -text button -textvariable EDIT \
89 -command {TkW:drives $sel_drive}
90 label .wineconf.can01.lab31 \
91 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
92 -relief groove -text label -textvariable WC_path
93 label .wineconf.can01.lab32 \
94 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
95 -relief groove -text label -textvariable WC_type
96 label .wineconf.can01.lab33 \
97 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
98 -relief groove -text label -textvariable WC_label
99 label .wineconf.can01.lab34 \
100 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
101 -relief groove -text label -textvariable WC_fstype
102 button .wineconf.can01.but51 \
103 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -padx 9 \
104 -pady 3 -text button -textvariable HELP \
105 -command {TkW:message $WC_helpondrives}
108 #section wine
110 canvas .wineconf.can37 \
111 -background #fedcdc -borderwidth 2 -height 207 -relief ridge \
112 -width 296
113 label .wineconf.can37.lab39 \
114 -background #fefefe \
115 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
116 -relief groove -text label -textvariable WC_wineSect
117 label .wineconf.can37.lab40 \
118 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
119 -relief groove -text label -textvariable WC_windows
120 label .wineconf.can37.lab41 \
121 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
122 -relief groove -text label -textvariable WC_system
123 button .wineconf.can37.but42 \
124 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
125 -relief groove -textvariable WC_winepath \
126 -command TkW:editWinePath
128 button .wineconf.can37.but43 \
129 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -padx 9 \
130 -pady 3 -text button -textvariable HELP \
131 -command {TkW:message $WC_helponwine}
132 entry .wineconf.can37.ent45 \
133 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
134 -textvariable windowspath
135 entry .wineconf.can37.ent46 \
136 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
137 -textvariable syspath
138 label .wineconf.can37.lab47 \
139 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
140 -relief groove -text label -textvariable WC_temp
141 label .wineconf.can37.lab48 \
142 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
143 -relief groove -text label -textvariable WC_Symbols
144 entry .wineconf.can37.ent49 \
145 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
146 -textvariable tmppath
147 entry .wineconf.can37.ent50 \
148 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
149 -textvariable symbols
151 # section serialports
152 canvas .wineconf.can53 \
153 -background #fedcdc -borderwidth 2 -relief ridge
154 label .wineconf.can53.lab57 \
155 -background #fefefe \
156 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
157 -relief groove -text label -textvariable WC_serialSect
158 listbox .wineconf.can53.lis58 \
159 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*
160 listbox .wineconf.can53.lis59 \
161 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
162 -yscrollcommand {.wineconf.can53.scr60 set }
163 scrollbar .wineconf.can53.scr60 \
164 -borderwidth 1 -orient vert -width 10 \
165 -command { .wineconf.can53.lis59 yview }
166 button .wineconf.can53.but63 \
167 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -padx 9 \
168 -pady 3 -text button -textvariable EDIT \
169 -command {TkW:editports com}
170 button .wineconf.can53.but64 \
171 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -padx 9 \
172 -pady 3 -text button -textvariable CLEAR -state disabled \
173 -command {
174 set com([expr $sel_com + 1]) " "
175 TkW:setboxes
176 .wineconf.can53.but64 configure -state disabled
178 button .wineconf.can53.help \
179 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -padx 9 \
180 -pady 3 -text button -textvariable HELP\
181 -command {TkW:message $WC_helponserial}
183 #section parallelports
184 canvas .wineconf.can54 \
185 -background #fedcdc -borderwidth 2 -relief ridge
186 label .wineconf.can54.lab65 \
187 -background #fefefe \
188 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
189 -relief groove -text label -textvariable WC_parallelSect
190 listbox .wineconf.can54.lis67 \
191 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
192 -yscrollcommand {.wineconf.can54.scr71 set }
193 listbox .wineconf.can54.lis68 \
194 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*
195 button .wineconf.can54.but69 \
196 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -padx 9 \
197 -pady 3 -text button -textvariable EDIT \
198 -command {TkW:editports lpt}
199 button .wineconf.can54.but70 \
200 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -padx 9 \
201 -pady 3 -text button -textvariable CLEAR -state disabled \
202 -command {
203 set lpt([expr $sel_port + 1]) " "
204 TkW:setboxes
205 .wineconf.can54.but70 configure -state disabled
207 scrollbar .wineconf.can54.scr71 \
208 -borderwidth 1 -orient vert -width 10 \
209 -command {.wineconf.can54.lis67 yview}
210 button .wineconf.can54.help \
211 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -padx 9 \
212 -pady 3 -text button -textvariable HELP\
213 -command {TkW:message $WC_helponPP}
215 #sections spy et Tweak.Layout
216 canvas .wineconf.can55 \
217 -background #fedcdc -borderwidth 2 -height 207 -relief ridge \
218 -width 296
219 label .wineconf.can55.lab72 \
220 -background #fefefe \
221 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
222 -relief groove -text label -textvariable WC_logSect
223 entry .wineconf.can55.ent74 \
224 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
225 -textvariable wine_logfile
226 button .wineconf.can55.but75 \
227 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -padx 9 \
228 -pady 3 -text button -textvariable WC_exclude
229 label .wineconf.can55.lab76 \
230 -background #fefefe \
231 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
232 -relief groove -text label -textvariable WC_wineLook
233 menubutton .wineconf.can55.men78 \
234 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
235 -menu .wineconf.can55.men78.m -padx 4 -pady 3 -text menu \
236 -textvariable winelook
237 menu .wineconf.can55.men78.m \
238 -cursor {} -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*
239 .wineconf.can55.men78.m add command \
240 -command {set winelook "Win31"} -label {Win 3.1}
241 .wineconf.can55.men78.m add command \
242 -command {set winelook "Win95"} -label win95/98
243 .wineconf.can55.men78.m add command \
244 -command {set winelook "Win98"} -label {Win 98}
245 button .wineconf.can55.help \
246 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -padx 9 \
247 -pady 3 -text button -textvariable HELP \
248 -command {TkW:message $WC_helponmisc}
250 #main window buttons:
252 button .wineconf.but80 \
253 -command {
254 set WAIT wait
255 TkW:message2 $WC_quit $WC_quitreally $WC_noquit
256 while {$WAIT == "wait"} {update}
257 if {$WAIT == "opt1"} { if {[winfo exists .desktop]} {
258 destroy .wineconf
259 set WAITconf 0
260 return
261 } else {
262 exit
266 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -padx 9 \
267 -pady 3 -text button -textvariable QUIT
268 button .wineconf.save \
269 -command TkW:writewinerc \
270 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -padx 9 \
271 -pady 3 -text button -textvariable SAVE
272 ###################
273 # SETTING GEOMETRY
274 ###################
275 place .wineconf.lab18 \
276 -x 3 -y 5 -width 453 -height 20 -anchor nw -bordermode ignore
278 #placing drives sctions widgets:
279 place .wineconf.can01 \
280 -x 5 -y 35 -width 466 -height 180 -anchor nw -bordermode ignore
281 place .wineconf.can01.lab22 \
282 -x 0 -y 0 -width 443 -height 25 -anchor nw -bordermode ignore
283 place .wineconf.can01.lis23 \
284 -x 10 -y 56 -width 130 -height 113 -anchor nw -bordermode ignore
285 place .wineconf.can01.lis24 \
286 -x 139 -y 55 -width 85 -height 113 -anchor nw -bordermode ignore
287 place .wineconf.can01.lis25 \
288 -x 223 -y 55 -width 65 -height 113 -anchor nw -bordermode ignore
289 place .wineconf.can01.lis26 \
290 -x 288 -y 55 -width 65 -height 113 -anchor nw -bordermode ignore
291 place .wineconf.can01.scrDrives \
292 -x 353 -y 55 -width 16 -height 113 -anchor nw -bordermode ignore
293 # bind lis23-26
294 bind .wineconf.can01.lis23 <ButtonRelease> {
295 set sel_drive [ .wineconf.can01.lis23 nearest %y]
296 #enable related button
297 .wineconf.can01.but30 configure -state normal
298 .wineconf.can01.but29 configure -state normal
299 # disable the tow CLEAR buttons of ports:
300 .wineconf.can54.but70 configure -state disabled
301 .wineconf.can53.but64 configure -state disabled
303 bind .wineconf.can01.lis24 <ButtonRelease> {
304 set sel_drive [ .wineconf.can01.lis23 nearest %y]
305 .wineconf.can01.lis23 selection set $sel_drive
306 .wineconf.can01.but30 configure -state normal
307 .wineconf.can01.but29 configure -state normal
308 # disable the tow CLEAR buttons of ports:
309 .wineconf.can54.but70 configure -state disabled
310 .wineconf.can53.but64 configure -state disabled
312 bind .wineconf.can01.lis25 <ButtonRelease> {
313 set sel_drive [ .wineconf.can01.lis23 nearest %y]
314 .wineconf.can01.lis23 selection set $sel_drive
315 .wineconf.can01.but30 configure -state normal
316 .wineconf.can01.but29 configure -state normal
317 # disble the tow CLEAR buttons of ports:
318 .wineconf.can54.but70 configure -state disabled
319 .wineconf.can53.but64 configure -state disabled
321 bind .wineconf.can01.lis26 <ButtonRelease> {
322 set sel_drive [ .wineconf.can01.lis23 nearest %y]
323 .wineconf.can01.lis23 selection set $sel_drive
324 .wineconf.can01.but30 configure -state normal
325 .wineconf.can01.but29 configure -state normal
326 # disble the tow CLEAR buttons of ports:
327 .wineconf.can54.but70 configure -state disabled
328 .wineconf.can53.but64 configure -state disabled
330 place .wineconf.can01.but28 \
331 -x 375 -y 44 -width 60 -height 28 -anchor nw -bordermode ignore
332 place .wineconf.can01.but29 \
333 -x 375 -y 76 -width 60 -height 28 -anchor nw -bordermode ignore
334 place .wineconf.can01.but30 \
335 -x 375 -y 110 -width 60 -height 28 -anchor nw -bordermode ignore
336 place .wineconf.can01.lab31 \
337 -x 13 -y 36 -width 128 -height 20 -anchor nw -bordermode ignore
338 place .wineconf.can01.lab32 \
339 -x 140 -y 36 -width 83 -height 20 -anchor nw -bordermode ignore
340 place .wineconf.can01.lab33 \
341 -x 223 -y 36 -width 68 -height 20 -anchor nw -bordermode ignore
342 place .wineconf.can01.lab34 \
343 -x 290 -y 36 -width 68 -height 20 -anchor nw -bordermode ignore
344 place .wineconf.can01.but51 \
345 -x 375 -y 141 -width 60 -height 28 -anchor nw -bordermode ignore
347 #placing wine sctions widgets:
349 place .wineconf.can37 \
350 -x 5 -y 230 -width 449 -height 115 -anchor nw -bordermode ignore
351 place .wineconf.can37.lab39 \
352 -x 3 -y 1 -width 443 -height 20 -anchor nw -bordermode ignore
353 place .wineconf.can37.lab40 \
354 -x 7 -y 29 -width 58 -height 20 -anchor nw -bordermode ignore
355 place .wineconf.can37.lab41 \
356 -x 7 -y 55 -width 58 -height 20 -anchor nw -bordermode ignore
357 place .wineconf.can37.but42 \
358 -x 7 -y 84 -width 248 -height 20 -anchor nw -bordermode ignore
359 place .wineconf.can37.but43 \
360 -x 375 -y 80 -width 60 -height 28 -anchor nw -bordermode ignore
361 place .wineconf.can37.ent45 \
362 -x 74 -y 26 -width 150 -height 24 -anchor nw -bordermode ignore
363 place .wineconf.can37.ent46 \
364 -x 74 -y 52 -width 150 -height 24 -anchor nw -bordermode ignore
365 place .wineconf.can37.lab47 \
366 -x 239 -y 29 -width 58 -height 20 -anchor nw -bordermode ignore
367 place .wineconf.can37.lab48 \
368 -x 239 -y 54 -width 58 -height 20 -anchor nw -bordermode ignore
369 place .wineconf.can37.ent49 \
370 -x 304 -y 26 -width 135 -height 24 -anchor nw -bordermode ignore
371 place .wineconf.can37.ent50 \
372 -x 304 -y 52 -width 135 -height 24 -anchor nw -bordermode ignore
374 #placing serialports sections widgets:
376 place .wineconf.can53 \
377 -x 9 -y 356 -width 144 -height 180 -anchor nw -bordermode ignore
378 place .wineconf.can53.lab57 \
379 -x 3 -y 3 -width 138 -height 20 -anchor nw -bordermode ignore
380 place .wineconf.can53.lis58 \
381 -x 3 -y 25 -width 40 -height 83 -anchor nw -bordermode ignore
382 place .wineconf.can53.lis59 \
383 -x 44 -y 25 -width 85 -height 83 -anchor nw -bordermode ignore
384 # bind lis59 to select lis58 at the same time...
385 bind .wineconf.can53.lis58 <ButtonRelease> {
386 set sel_com [ .wineconf.can53.lis58 nearest %y]
387 .wineconf.can53.lis58 selection set $sel_com
388 #disbale other list related buttons:
389 .wineconf.can01.but30 configure -state disabled
390 .wineconf.can01.but29 configure -state disabled
391 # disable/enable the tow CLEAR buttons of ports:
392 .wineconf.can54.but70 configure -state disabled
393 .wineconf.can53.but64 configure -state normal
395 # bind lis58 to select lis59 at the same time...
396 bind .wineconf.can53.lis59 <ButtonRelease> {
397 set sel_com [ .wineconf.can53.lis59 nearest %y]
398 .wineconf.can53.lis58 selection set $sel_com
399 #disbale other list related buttons:
400 .wineconf.can01.but30 configure -state disabled
401 .wineconf.can01.but29 configure -state disabled
402 # disable/enable the tow CLEAR buttons of ports:
403 .wineconf.can54.but70 configure -state disabled
404 .wineconf.can53.but64 configure -state normal
406 place .wineconf.can53.scr60 \
407 -x 123 -y 26 -width 16 -height 80 -anchor nw -bordermode ignore
408 place .wineconf.can53.but63 \
409 -x 10 -y 115 -width 60 -height 28 -anchor nw -bordermode ignore
410 place .wineconf.can53.but64 \
411 -x 78 -y 115 -width 60 -height 28 -anchor nw -bordermode ignore
412 place .wineconf.can53.help \
413 -x 10 -y 145 -width 130 -height 28 -anchor nw -bordermode ignore
415 #placing parallelports sections widgets:
417 place .wineconf.can54 \
418 -x 160 -y 356 -width 144 -height 180 -anchor nw -bordermode ignore
419 place .wineconf.can54.lab65 \
420 -x 1 -y 3 -width 143 -height 20 -anchor nw -bordermode ignore
421 place .wineconf.can54.lis67 \
422 -x 5 -y 26 -width 45 -height 83 -anchor nw -bordermode ignore
423 place .wineconf.can54.lis68 \
424 -x 50 -y 25 -width 75 -height 83 -anchor nw -bordermode ignore
425 # bind lis67
426 bind .wineconf.can54.lis68 <ButtonRelease> {
427 set sel_port [ .wineconf.can53.lis59 nearest %y]
428 #disbale other list related buttons:
429 .wineconf.can01.but30 configure -state disabled
430 .wineconf.can01.but29 configure -state disabled
431 # disable/enable the tow CLEAR buttons of ports:
432 .wineconf.can54.but70 configure -state normal
433 .wineconf.can53.but64 configure -state disabled
435 # bind lis68 to select lis67 at the same time...
436 bind .wineconf.can54.lis67 <ButtonRelease> {
437 set sel_port [ .wineconf.can53.lis59 nearest %y]
438 .wineconf.can54.lis67 selection set $sel_port
439 #disbale other list related buttons:
440 .wineconf.can01.but30 configure -state disabled
441 .wineconf.can01.but29 configure -state disabled
442 # disable/enable the tow CLEAR buttons of ports:
443 .wineconf.can54.but70 configure -state normal
444 .wineconf.can53.but64 configure -state disabled
446 place .wineconf.can54.but69 \
447 -x 10 -y 115 -width 60 -height 28 -anchor nw -bordermode ignore
448 place .wineconf.can54.but70 \
449 -x 78 -y 115 -width 60 -height 28 -anchor nw -bordermode ignore
450 place .wineconf.can54.scr71 \
451 -x 123 -y 26 -width 16 -height 80 -anchor nw -bordermode ignore
452 place .wineconf.can54.help \
453 -x 10 -y 145 -width 130 -height 28 -anchor nw -bordermode ignore
455 #placing spy and Tweak.Layout sections widgets:
457 place .wineconf.can55 \
458 -x 313 -y 357 -width 139 -height 180 -anchor nw -bordermode ignore
459 place .wineconf.can55.lab72 \
460 -x 3 -y 3 -width 133 -height 20 -anchor nw -bordermode ignore
461 place .wineconf.can55.ent74 \
462 -x 5 -y 25 -width 130 -height 24 -anchor nw -bordermode ignore
463 place .wineconf.can55.but75 \
464 -x 5 -y 50 -width 130 -height 28 -anchor nw -bordermode ignore
465 place .wineconf.can55.lab76 \
466 -x 3 -y 83 -width 133 -height 20 -anchor nw -bordermode ignore
467 place .wineconf.can55.men78 \
468 -x 10 -y 110 -width 122 -height 24 -anchor nw -bordermode ignore
469 place .wineconf.can55.help \
470 -x 5 -y 145 -width 130 -height 28 -anchor nw -bordermode ignore
472 #Main window buttons:
474 pack .wineconf.but80 -padx 5 -pady 1 -side bottom -fill x
475 pack .wineconf.save -padx 5 -side bottom -fill x
477 # initialise the arrays
478 TkW:initarrays
479 # Now start reading the .winerc (or the default wine.ini)
480 TkW:readwinerc $DefaultConfFile
481 # Set the listboxes:
482 TkW:setboxes
483 #updates the scollings
484 set WAITconf 1
485 while {$WAITconf == 1} { TkW:scrollwindows }
488 proc TkW:readwinerc {DefaultConfFile} {
489 global sect ndrives drive n rcout line wine_logfile winelook
490 global nspool nalias srcdest TKW
492 TkW:debug "Entering readwinerc -----------------------------"
494 # OPEN THE FILE Read-Only:
495 TkW:fixme "TkW:wineconf::\
496 Detection of wine.ini will fail when ~/.winerc ~/wine.conf not there"
497 if {[file exist $DefaultConfFile] } then {
498 set winerc [open $DefaultConfFile r]
499 } else {
500 TkW:message "No file $DefaultConfFile... This is a TkWine error"
501 return
503 # Adds a fe setting in case they're missing (actually, they are in the std file) in the wine.ini
504 set winelook Win95
505 set wine_logfile /tmp/winelog
507 # OPEN /tmp/tkwwinerc for writting
508 set rcout [open /tmp/tkwinerc w]
510 set ndrives -1
511 set nspool 0
512 set nalias -1
513 global NDllOver NDllPairs DllPairs DllOver
514 set NDllOver 0
515 set NDllPairs 0
517 # Read line by line
518 set charread 0
519 while {$charread != -1} {
521 set charread [gets $winerc line]
522 set line [string trim $line]
523 set n [expr $charread - 1]
524 set idok 0
525 TkW:debug "READ:$line-$charread"
526 if {[string match ";*" $line]} {
527 #puts $rcout $line
528 TkW:debug Comment; set idok 1}
529 # The two lines below SHOULD work... they don't
530 #if {[string match "\[*\]" $line]} \
531 #{TkW:debug Section;set idok 1}
532 ## a ugly replacement:
533 if {"[string range $line 0 0][string range $line $n $n]"\
534 == "\[\]"} {
535 TkW:sections
536 set idok 1
538 if {$idok != 1 && [string match "*=*" $line]} {
539 TkW:assign
540 TkW:debug Assignment
541 set idok 1
543 if {!$idok && $charread > 0} {
544 TkW:debug "Error::Unknow line in .winerc"
545 puts "************Warning: Error in config \
546 file ****************"
547 puts "Line $line incomprehensible"
552 proc TkW:sections {} {
553 global sect ndrives drive n rcout line
554 global drivepath drivelabel drivetype drivefstype driveserial drivedevice
555 set sect [string tolower [string range $line 1 [expr $n - 1]]]
556 if {[string tolower [string range $sect 0 4]] == "drive"} {
557 set ndrives [expr $ndrives + 1]
558 set drive($ndrives) [string range $sect 6 6]
559 set drivepath($ndrives) ""
560 set drivelabel($ndrives) ""
561 set drivetype($ndrives) ""
562 set drivefstype($ndrives) ""
563 set driveserial($ndrives) ""
564 set drivedevice($ndrives) ""
565 set sect drive
566 TkW:debug "Section $sect $drive($ndrives)"
567 #puts $rcout "\[$sect $drive($ndrives)\]"
568 } else {
569 TkW:debug "Section $sect"
570 #puts $rcout "\[$sect]"
574 proc TkW:assign {} {
575 global sect ndrives drive n rcout line
577 global windowspath varpath syspath tmppath symbols winelook
578 global ndrives drive drivepath drivetype drivefstype drivelabel
579 global drivedevice driveserial
580 global resolution defaultfont
581 global readport writeport
582 global exclude default_progs startup allocsyscolors winelook wine_logfile
583 global com lpt spool nspool alias nalias
584 global NDllOver NDllPairs
585 global DllOver DllPairs
587 set equalis [string first "=" $line ]
588 set varname [string tolower [string trim [string range $line 0 [expr $equalis - 1]]]]
589 set value [string trim [string range $line [expr $equalis + 1] $n]]
590 if {$varname == "default"} {set varname Default}
591 switch $varname {
592 {path} {
593 switch $sect {
594 {drive} {set drivepath($ndrives) $value}
595 {wine} {set varpath $value;update}
596 {default} {TkW:conferror $sect $varname $value}
599 {type} {
600 if {$sect != "drive"} then {
601 TkW:conferror $sect $varname $value
602 } else {
603 set drivetype($ndrives) $value
606 {label} {
607 if {$sect != "drive"} then {
608 TkW:conferror $sect $varname $value
609 } else {
610 set drivelabel($ndrives) $value
613 {serial} {
614 if {$sect != "drive"} then {
615 TkW:conferror $sect $varname $value
616 } else {
617 set driveserial($ndrives) $value
620 {filesystem} {
621 if {$sect != "drive"} then {
622 TkW:conferror $sect $varname $value
623 } else {
624 set drivefstype($ndrives) $value
627 {device} {
628 if {$sect != "drive"} then {
629 TkW:conferror $sect $varname $value
630 } else {
631 set drivedevice($ndrives) $value
634 {windows} {
635 if {$sect != "wine"} then {
636 TkW:conferror $sect $varname $value
637 } else {
638 set windowspath $value
641 {system} {
642 if {$sect != "wine"} then {
643 TkW:conferror $sect $varname $value
644 } else {
645 set syspath $value
648 {temp} {
649 if {$sect != "wine"} then {
650 TkW:conferror $sect $varname $value
651 } else {
652 set tmppath $value
655 {symboltablefile} {
656 if {$sect != "wine"} then {
657 TkW:conferror $sect\
658 $varname $value
659 } else {
660 set symbols $value
663 {resolution} {
664 if {$sect != "fonts"} then {
665 TkW:conferror $sect $varname $value
666 } else {
667 set resolution $value
670 {Default} {
671 switch $sect {
672 {fonts} { set defaultfont $value}
673 {programs} {set default_progs $value}
674 {default} { TkW:conferror \
675 $sect $varname $value }
678 {read} {
679 if {$sect != "ports"} then {
680 TkW:conferror $sect $varname $value
681 } else {
682 set readport $value
685 {write} {
686 if {$sect != "ports"} then {
687 TkW:conferror $sect $varname $value
688 } else {
689 set writeport $value
692 {file} {
693 if {$sect != "spy"} then {
694 TkW:conferror $sect $varname $value
695 } else {
696 set wine_logfile $value
699 {exclude} {
700 if {$sect != "spy"} then {
701 TkW:conferror $sect $varname $value
702 } else {
703 set Exclude $value
706 {allocsystemcolors} {
707 if {$sect != "options"} then {
708 TkW:conferror $sect $varname\
709 $value
710 } else {
711 set allocsyscolors $value
714 {winelook} {
715 if {$sect != "tweak.layout"} then {
716 TkW:conferror $sect $varname\
717 $value
718 } else {
719 set winelook $value
722 {startup} {
723 if {$sect != "programs"} then {
724 TkW:conferror $sect $varname\
725 $value
726 } else {
727 set startup $value
730 {printer} {
731 if {$sect != "wine"} then {
732 TkW:conferror $sect $varname\
733 $value
734 } else {
735 set printer $value
738 {default} {
739 if {$sect == "dllpairs"} {
740 set NDllPairs [expr $NDllPairs + 1]
741 set DllPairs($NDllPairs) "$varname = $value"
742 return
744 if {$sect == "dlloverrides"} {
745 set NDllOver [expr $NDllOver + 1]
746 set DllOver($NDllOver) "$varname = $value"
747 return
749 if {[string tolower [string trim [string range $line 0 2]]] == "lpt" && [string range $line 4 4 ] == ":" } {
750 if {$sect != "spooler"} then {
751 TkW:conferror $sect $varname $value
752 } else {
753 set nspool [expr $nspool + 1]
754 set spool($nspool) $value
756 return
759 set varname2 [string tolower [string trim \
760 [string range $line 0 [expr $equalis - 2]]]]
761 set letter [string tolower [string range $line [expr $equalis - 1]\
762 [expr $equalis - 1] ]]
763 #set varname2 [string tolower $varname2]
764 switch $varname2 {
766 {com} {
767 if {$sect != "serialports"} then {
768 TkW:conferror $sect $varname\
769 $value
770 } else {
771 set com($letter) $value
774 {lpt} {
775 if {$sect != "parallelports"} then {
776 TkW:conferror $sect $varname\
777 $value
778 } else {
779 set lpt($letter) $value
783 {alias} {
784 if {$sect != "fonts"} then {
785 TkW:conferror $sect $varname\
786 $value
787 } else {
788 set nalias [expr $nalias + 1]
789 set alias($nalias) $value
792 {default} {
793 TkW:conferror $sect $varname $value
804 proc TkW:conferror {sect varname value} {
806 puts "ERROR IN CONFIG FILE, FOUND $varname=$value in section $sect"
809 proc TkW:setboxes {} {
811 global ndrives drive drivepath drivetype drivefstype drivelabel
812 global drivedevice driveserial
813 global com lpt
815 .wineconf.can01.lis23 delete 0 end
816 .wineconf.can01.lis24 delete 0 end
817 .wineconf.can01.lis25 delete 0 end
818 .wineconf.can01.lis26 delete 0 end
820 for {set i 0} {$i <= $ndrives } {set i [expr $i + 1]} {
822 TkW:debug "Drive $i : $drive($i) $drivepath($i) $drivetype($i)\
823 $drivelabel($i)"
824 TkW:debug " $drivefstype($i) $drivedevice($i) $driveserial($i)"
826 set yes " "
827 if {![file isdirectory $drivepath($i)]} {set yes "*"}
828 .wineconf.can01.lis23 insert end \
829 "$yes\($drive($i):\\) $drivepath($i) "
830 .wineconf.can01.lis24 insert end \
831 "$yes$drivetype($i)"
832 .wineconf.can01.lis25 insert end \
833 "$yes$drivelabel($i)"
834 .wineconf.can01.lis26 insert end \
835 "$yes$drivefstype($i)"
838 .wineconf.can53.lis59 delete 0 end
839 .wineconf.can53.lis58 delete 0 end
840 for {set i 1} {$i <= 8 } {set i [expr $i + 1]} {
841 .wineconf.can53.lis58 insert end "com$i"
842 .wineconf.can53.lis59 insert end $com($i)
844 .wineconf.can54.lis67 delete 0 end
845 .wineconf.can54.lis68 delete 0 end
846 for {set i 1} {$i <= 8 } {set i [expr $i + 1]} {
847 .wineconf.can54.lis67 insert end "lpt$i"
848 .wineconf.can54.lis68 insert end $lpt($i)
853 proc TkW:scrollwindows {} {
855 global OldPos
857 if {![info exists OldPos]} {set OldPos 0}
859 # Serial
860 set lis58pos [.wineconf.can53.lis59 yview]; set a 1
861 foreach i $lis58pos { if {$a} {set pos $i}; set a 0 }
862 .wineconf.can53.lis58 yview moveto $pos
863 # // ports
864 set lis67pos [.wineconf.can54.lis67 yview]; set a 1
865 foreach i $lis67pos { if {$a} {set pos $i}; set a 0 }
866 .wineconf.can54.lis68 yview moveto $pos
867 # drives:
868 set lis23pos [.wineconf.can01.lis23 yview]; set a 1
869 foreach i $lis23pos { if {$a} {set pos $i}; set a 0 }
870 if {$lis23pos != $OldPos} {
871 TkW:debug "listbox23 has move from $OldPos to $lis23pos"
872 TkW:debug "listbox24 goes to $pos "
874 set OldPos $lis23pos
875 .wineconf.can01.lis24 yview moveto $pos
876 .wineconf.can01.lis25 yview moveto $pos
877 .wineconf.can01.lis26 yview moveto $pos
879 update
882 proc TkW:initarrays {} {
884 global com lpt spool
886 for {set i 1 } {$i <= 8 } {set i [expr $i + 1]} {
887 set com($i) ""
888 set lpt($i) ""
890 for {set i 1 } {$i <= 8 } {set i [expr $i + 1]} {
891 set spool($i) ""
895 proc TkW:editports {comlpt} {
897 global OK CANCEL com portch lpt lptcom win banner TKW
898 global WC_confserial WC_confparallel WC_PPbanner WC_serialbanner
900 .wineconf.can54.but69 configure -state disabled
901 .wineconf.can53.but63 configure -state disabled
903 # this is a ugly trick as buttons command need a global variable, not an arg
904 set lptcom $comlpt
906 if {$comlpt == "com"} then {
907 set win .comedit
908 set title $WC_confserial
909 set banner $WC_serialbanner
910 } else {
911 set win .lptedit
912 set title $WC_confparallel
913 set banner $WC_PPbanner
915 toplevel $win -class Toplevel \
916 -background #3c1cfe
917 wm focusmodel $win passive
918 wm geometry $win 205x365+448+253
919 wm maxsize $win 1265 994
920 wm minsize $win 1 1
921 wm overrideredirect $win 0
922 wm resizable $win 1 1
923 wm deiconify $win
924 wm title $win $title
925 #wm iconbitmap $win @$TKW/setupfiles/images/setup2.xbm
926 #wm iconmask $win @$TKW/setupfiles/images/setupmask2.xbm
928 # creating the Banner
930 label "$win.banner" \
931 -background #dc96dc \
932 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
933 -relief groove -text $banner
935 # creating the labels and entries
937 for {set i 1} {$i <= 8} {set i [expr $i + 1 ]} {
939 set portch($i) $com($i)
940 if {$comlpt == "com"} then {
941 set portch($i) $com($i)
942 } else {
943 set portch($i) $lpt($i)
946 label "$win.lab$i" \
947 -background #dc96dc \
948 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
949 -relief groove -text "Com$i"
950 entry "$win.ent$i" \
951 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
952 -textvariable portch($i)
953 set Y [expr 55 + $i * 30]
954 place "$win.lab$i"\
955 -x 5 -y $Y -width 45 -height 28 \
956 -anchor nw -bordermode ignore
957 place "$win.ent$i"\
958 -x 55 -y $Y -width 145 -height 28 \
959 -anchor nw -bordermode ignore
962 button $win.but80 \
963 -command {
964 for {set i 1} {$i <= 8} {set i [expr $i + 1]} {
965 if {$lptcom == "com"} then {
966 set com($i) $portch($i)
967 } else {
968 set lpt($i) $portch($i)
970 .wineconf.can54.but69 configure -state normal
971 .wineconf.can53.but63 configure -state normal
973 destroy $win
974 TkW:setboxes
976 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
977 -padx 9 -pady 3 -text button -textvariable OK
978 place $win.banner -x 5 -y 5 -width 195 -height 70
980 place $win.but80 \
981 -x 5 -y 335 -width 100 -height 28 \
982 -anchor nw -bordermode ignore
983 button $win.but81 \
984 -command {destroy $win
985 .wineconf.can54.but69 configure -state normal
986 .wineconf.can53.but63 configure -state normal
988 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
989 -padx 9 -pady 3 -text button -textvariable CANCEL \
991 place $win.but81 \
992 -x 105 -y 335 -width 100 -height 28 \
993 -anchor nw -bordermode ignore
997 proc TkW:drives {n} {
999 global ndrives drive drivepath drivetype drivefstype drivelabel
1000 global drivedevice driveserial TKW
1001 global WC_confdrives HELP WCHLP WC_driveSetBanner
1002 global chdrives1 chdrives2 chdrives3 chdrives4
1003 global chdrives5 chdrives6 chdrives7
1004 global win i num ch drOK
1006 set chdrives(1) $chdrives1
1007 set chdrives(2) $chdrives2
1008 set chdrives(3) $chdrives3
1009 set chdrives(4) $chdrives4
1010 set chdrives(5) $chdrives5
1011 set chdrives(6) $chdrives6
1012 set chdrives(7) $chdrives7
1015 if {$n == "new"} then {
1016 set num [expr $ndrives + 1]
1017 set ch(1) ""
1018 set ch(2) ""
1019 set ch(3) ""
1020 set ch(4) ""
1021 set ch(5) ""
1022 set ch(6) ""
1023 set ch(7) ""
1024 } else {
1025 set num $n
1026 set ch(1) $drive($num)
1027 set ch(2) $drivepath($num)
1028 set ch(3) $drivetype($num)
1029 set ch(4) $drivefstype($num)
1030 set ch(5) $drivelabel($num)
1031 set ch(6) $drivedevice($num)
1032 set ch(7) $driveserial($num)
1035 TkW:debug "Entering TkW:drives - drive number: $num"
1037 .wineconf.can01.but28 configure -state disabled
1038 .wineconf.can01.but29 configure -state disabled
1039 .wineconf.can01.but30 configure -state disabled
1040 # re-enable the tow EDIT buttons of ports:
1041 .wineconf.can54.but69 configure -state disabled
1042 .wineconf.can53.but63 configure -state disabled
1045 set win .drivedit
1046 set title $WC_confdrives
1048 toplevel $win -class Toplevel \
1049 -background #3c1cfe
1050 wm focusmodel $win passive
1051 wm geometry $win 305x325+448+253
1052 wm maxsize $win 1265 994
1053 wm minsize $win 1 1
1054 wm overrideredirect $win 0
1055 wm resizable $win 1 1
1056 wm deiconify $win
1057 wm title $win $title
1058 #wm iconbitmap $win @$TKW/setupfiles/images/setup2.xbm
1059 #wm iconmask $win @$TKW/setupfiles/images/setupmask2.xbm
1061 # setting the banner:
1063 label "$win.banner" \
1064 -background #dc96dc \
1065 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
1066 -relief groove -text $WC_driveSetBanner -height 35
1070 # creating the labels and entries
1072 # setting HELP buttons
1073 button $win.hlp1\
1074 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
1075 -padx 9 -pady 3 -text button -textvariable HELP \
1076 -command {TkW:message $WCHLP(1)}
1077 button $win.hlp2\
1078 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
1079 -padx 9 -pady 3 -text button -textvariable HELP \
1080 -command {TkW:message $WCHLP(2)}
1081 button $win.hlp3\
1082 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
1083 -padx 9 -pady 3 -text button -textvariable HELP \
1084 -command {TkW:message $WCHLP(3)}
1085 button $win.hlp4\
1086 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
1087 -padx 9 -pady 3 -text button -textvariable HELP \
1088 -command {TkW:message $WCHLP(4)}
1089 button $win.hlp5\
1090 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
1091 -padx 9 -pady 3 -text button -textvariable HELP \
1092 -command {TkW:message $WCHLP(5)}
1093 button $win.hlp6\
1094 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
1095 -padx 9 -pady 3 -text button -textvariable HELP \
1096 -command {TkW:message $WCHLP(6)}
1097 button $win.hlp7\
1098 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
1099 -padx 9 -pady 3 -text button -textvariable HELP \
1100 -command {TkW:message $WCHLP(7)}
1103 for {set i 1} {$i <= 7} {set i [expr $i + 1 ]} {
1106 label "$win.lab$i" \
1107 -background #dc96dc \
1108 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
1109 -relief groove -text $chdrives($i)
1110 if {$i < 3 || $i > 4} then {
1111 entry "$win.ent$i" \
1112 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
1113 -text text -textvariable ch($i)
1114 } else {
1115 menubutton $win.ent$i \
1116 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* \
1117 -menu $win.ent$i.m -padx 4 -pady 3 \
1118 -text text -textvariable ch($i)
1120 # settings the menus:
1121 if {$i == 3} then {
1122 menu $win.ent$i.m \
1123 -cursor {} \
1124 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*
1125 $win.ent$i.m add command \
1126 -command {set ch(3) "hd"} -label {Hard Drive}
1127 $win.ent$i.m add command \
1128 -command {set ch(3) "floppy"} -label {Floppy}
1129 $win.ent$i.m add command \
1130 -command {set ch(3) "cdrom"} -label {CDrom}
1131 $win.ent$i.m add command \
1132 -command {set ch(3) "network"} \
1133 -label {network}
1135 if {$i == 4} then {
1136 menu $win.ent$i.m \
1137 -cursor {} \
1138 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*
1139 $win.ent$i.m add command \
1140 -command {set ch(4) "msdos"} -label {msdos}
1141 $win.ent$i.m add command \
1142 -command {set ch(4) "win95"} -label {Win95}
1143 $win.ent$i.m add command \
1144 -command {set ch(4) "Unix"} -label {Unix}
1148 set Y [expr 40 + $i * 30]
1149 place "$win.lab$i"\
1150 -x 5 -y $Y -width 145 -height 28 \
1151 -anchor nw -bordermode ignore
1152 place "$win.ent$i"\
1153 -x 150 -y $Y -width 85 -height 28 \
1154 -anchor nw -bordermode ignore
1155 place "$win.hlp$i"\
1156 -x 235 -y $Y -width 55 -height 28 \
1157 -anchor nw -bordermode ignore
1162 button $win.but80 \
1163 -command {
1164 TkW:checkdrives
1165 if {$drOK} {
1166 set drive($num) $ch(1)
1167 set drivepath($num) $ch(2)
1168 set drivetype($num) $ch(3)
1169 set drivefstype($num) $ch(4)
1170 set drivelabel($num) $ch(5)
1171 set drivedevice($num) $ch(6)
1172 set driveserial($num) $ch(7)
1173 destroy $win
1174 if {$num > $ndrives} {set ndrives $num}
1175 TkW:setboxes
1176 .wineconf.can01.but28 configure -state normal
1177 # re-enable the tow EDIT buttons of ports:
1178 .wineconf.can54.but69 configure -state normal
1179 .wineconf.can53.but63 configure -state normal
1182 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
1183 -padx 9 -pady 3 -text button -textvariable OK \
1185 place $win.but80 \
1186 -x 5 -y 290 -width 145 -height 28 \
1187 -anchor nw -bordermode ignore
1188 button $win.but81 \
1189 -command {
1190 destroy $win
1191 .wineconf.can01.but28 configure -state normal
1192 #.wineconf.can01.but29 configure -state normal
1193 #.wineconf.can01.but30 configure -state normal
1194 # re-enable the tow EDIT buttons of ports:
1195 #.wineconf.can54.but69 configure -state normal
1196 #.wineconf.can53.but63 configure -state normal
1198 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
1199 -padx 9 -pady 3 -text button -textvariable CANCEL \
1201 place $win.but81 \
1202 -x 150 -y 290 -width 145 -height 28 \
1203 -anchor nw -bordermode ignore
1204 place $win.banner -width 290 -height 35 -x 5 -y 5
1207 proc TkW:checkdrives {} {
1208 global ndrives ch num drOK drive
1209 global WC_givepath WC_oneletter WC_usedletter WC_11letters
1211 if {[string length $ch(1)] != 1} {
1212 TkW:message "$ch(1) $WC_oneletter"
1213 set drOK 0
1214 return
1216 if {[string length $ch(5)] > 11} {
1217 TkW:message "$ch(5) $WC_11letters"
1218 set drOK 0
1219 return
1221 for {set i 0} {$i <=$ndrives} {set i [expr $i + 1]} {
1222 if {$i != $num && [string tolower $ch(1)]\
1223 == [string tolower $drive($i)] } {
1224 TkW:message "$ch(1)$WC_usedletter"
1225 set drOK 0
1226 return
1229 if { $ch(2) == ""} {TkW:message $WC_givepath; set drOK 0;return}
1230 if { $ch(3) == ""} {set ch(3) hd}
1231 if { $ch(4) == ""} {set ch(4) unix}
1232 if { $ch(5) == ""} {set ch(5) "Drive $ch(1)"}
1233 set drOK 1
1236 proc TkW:editWinePath {} {
1237 global OK varpath WC_editPathBanner WC_pathtitle TKW
1238 TkW:debug "Entering TkW:editWinePath with path set to $varpath"
1239 global ndrives dri
1241 # Create the toplevel
1242 toplevel .editpath -class Toplevel \
1243 -background #3c1cfe
1244 wm focusmodel .editpath passive
1245 wm geometry .editpath 410x100+448+253
1246 wm maxsize .editpath 1265 994
1247 wm minsize .editpath 1 1
1248 wm overrideredirect .editpath 0
1249 wm resizable .editpath 1 1
1250 wm deiconify .editpath
1251 wm title .editpath $WC_pathtitle
1252 #wm iconbitmap .editpath @$TKW/setupfiles/images/setup2.xbm
1253 #wm iconmask .editpath @$TKW/setupfiles/images/setupmask2.xbm
1255 #Creates the Banner
1256 label .editpath.banner \
1257 -background #dc96dc \
1258 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
1259 -relief groove -text $WC_editPathBanner
1260 #Creates the entry box
1261 entry .editpath.ent \
1262 -background #dc96dc \
1263 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
1264 -relief groove -textvariable varpath
1265 #Creates OK button
1266 button .editpath.ok\
1267 -background #dc96dc \
1268 -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-*\
1269 -relief groove -text $OK -command {destroy .editpath}
1271 place .editpath.banner -x 5 -y 5 -width 400 -height 30
1272 place .editpath.ent -x 5 -y 40 -width 400 -height 30
1273 place .editpath.ok -x 5 -y 70 -width 400 -height 30
1277 proc TkW:writewinerc {} {
1279 global windowspath varpath syspath tmppath symbols winelook
1280 global ndrives drive drivepath drivetype drivefstype drivelabel
1281 global drivedevice driveserial
1282 global resolution defaultfont HOME
1283 global readport writeport
1284 global exclude default_progs startup allocsyscolors winelook wine_logfile
1285 global com lpt spool nspool alias nalias
1286 global NDllPairs NDllOver DllPairs DllOver
1288 # open file for writing:;;
1290 # move the old file:
1291 if {[file exists ~/.winerc]} {
1292 set free 1
1293 while {[file exists ~/.winerc.$free]} {
1294 set free [expr $free + 1]
1296 exec mv -f $HOME/.winerc $HOME/.winerc.$free
1298 set out [open ~/.winerc w]
1300 # writes drives
1301 # Puts the usual comments:
1302 puts $out ";;"
1303 puts $out ";; MS-DOS drives configuration "
1304 puts $out ";;"
1305 puts $out ";; Each section has the following format:"
1306 puts $out ";; \[Drive X\]"
1307 puts $out ";; Path=xxx (Unix path for drive root)"
1308 puts $out ";; Type=xxx (supported types are 'floppy', 'hd', 'cdrom' and 'network')"
1309 puts $out ";; Label=xxx (drive label, at most 11 characters)"
1310 puts $out ";; Serial=xxx (serial number, 8 characters hexadecimal number)"
1311 puts $out ";; Filesystem=xxx (supported types are 'msdos','win95','unix')"
1312 puts $out ";; Device=/dev/xx (only if you want to allow raw device access)"
1313 puts $out ";; "
1314 for {set i 0} {$i <= $ndrives} {set i [expr $i + 1]} {
1315 puts $out "\[Drive $drive($i)\]"
1316 puts $out "Path=$drivepath($i)"
1317 puts $out "Type=$drivetype($i)"
1318 puts $out "Label=$drivelabel($i)"
1319 if {$drivefstype($i) == ""} {set drivefstype($i) unix}
1320 puts $out "Filesystem=$drivefstype($i)"
1321 if {$driveserial($i) != "" } {puts $out "Serial=$driveserial($i)"}
1322 if {$drivedevice($i) != "" } {puts $out "Device=$drivedevice($i)"}
1323 puts $out ""
1326 #write wine section
1327 puts $out "\[wine\]"
1328 puts $out "Windows=$windowspath"
1329 puts $out "System=$syspath"
1330 puts $out "Temp=$tmppath"
1331 puts $out "Path=$varpath"
1332 puts $out "SymbolTableFile=$symbols"
1333 puts $out ""
1335 # write options
1336 TkW:fixme "Option not supported in wineconf, write de default"
1337 puts $out "\[options\]"
1338 puts $out "AllocSystemColors=$allocsyscolors"
1339 puts $out ""
1341 # DllPairs:
1342 puts $out "\[DllPairs\]"
1343 for {set i 1} {$i <= $NDllPairs} {set i [expr $i + 1]} {
1344 puts $out $DllPairs($i)
1346 puts $out
1347 # DllOverrides:
1348 puts $out "\[DllOverrides\]"
1349 for {set i 1} {$i <= $NDllOver} {set i [expr $i + 1]} {
1350 puts $out $DllOver($i)
1352 puts $out
1353 # write fonts section
1354 TkW:fixme "fonts support to be added to wineconf...."
1355 puts $out "\[fonts\]"
1356 puts $out ";Read documentation/fonts before adding aliases"
1357 puts $out "Resolution = $resolution"
1358 puts $out "Default = $defaultfont"
1359 puts $out ""
1360 # write serial
1361 puts $out "\[serialports\]"
1362 for {set i 1} {$i <= 8} {set i [expr $i + 1]} {
1363 if {$com($i) != ""} {puts $out "Com$i=$com($i)"}
1365 puts $out ""
1366 # write parallel
1367 puts $out "\[parallelports\]"
1368 for {set i 1} {$i <= 8} {set i [expr $i + 1]} {
1369 if {$lpt($i) != ""} {puts $out "Lpt$i=$lpt($i)"}
1371 puts $out ""
1372 # write spooler
1373 puts $out "\[spooler\]"
1374 for {set i 1} {$i <= 8} {set i [expr $i + 1]} {
1375 if {$spool($i) != ""} {puts $out "LPT$i:=$spool($i)"}
1377 puts $out ""
1378 # write ports
1379 puts $out "\[ports]"
1380 if {[info exists readport]} {puts $out $readport} {puts $out ";read=0x779,0x379,0x280-0x2a0"}
1381 if {[info exists writeport]} {puts $out $writeport} {puts $out ";write=0x779,0x379,0x280-0x2a0"}
1382 puts $out ""
1383 #write spy
1384 puts $out "\[spy\]"
1385 puts $out "file=$wine_logfile"
1386 if {[info exists exclude]} {puts $out "Exclude=$exclude"} {puts $out "Exclude=WM_SIZE;WM_TIMER;"}
1387 puts $out ""
1388 #write Tweak.Layout
1389 puts $out "\[Tweak.Layout\]"
1390 puts $out ";; WineLook=xxx (supported styles are \'Win31\'(default), \'Win95\', \'Win98\')"
1391 puts $out "WineLook=Win95"
1393 proc TkW:delDrive {n} {
1395 global ndrives drive drivepath drivetype drivefstype drivelabel
1396 global drivedevice driveserial
1398 TkW:debug "Remove drive [expr $n + 1]"
1399 for {set i $n} {$i<$ndrives} {set i [expr $i +1]} {
1400 set i1 [expr $i + 1]
1401 set drive($i) $drive($i1)
1402 set drivepath($i) $drivepath($i1)
1403 set drivelabel($i) $drivelabel($i1)
1404 set drivetype($i) $drivetype($i1)
1405 set drivefstype($i) $drivefstype($i1)
1406 set driveserial($i) $driveserial($i1)
1408 set ndrives [expr $ndrives - 1]
1409 TkW:setboxes