Fixed CDROM_Audio_Seek for non-linux systems.
[wine.git] / tools / wineconf.libs / wineconf1.tcl
blob19342f0d1c9b3b3cd2a03271d7636e78de59cfc2
1 proc TkW:debug {msg} {
3 proc TkW:fixme {msg} {
5 proc TkW:wineconf1 {} {
7 # propmt the user for a choice of the default config file:
8 # can be:
9 # Existing {--> menu ~/.winerc or /etc/wineconf or custom}
10 # autogenarated with tools/wineconf
11 # built-in the script
13 # test of existing is preformed first; test of existing wineconf also
16 set ExistEtc [TkW:ListConfig /etc/wine.conf]
17 set ExistHome [TkW:ListConfig "~/.winerc"]
19 TkW:AskUserConfMethod $ExistEtc $ExistHome
20 tkwait vis .askConf
21 while [winfo exists .askConf] {update}
24 proc TkW:ListConfig {fileConf} {
26 global HOME
28 set ExistConf 0
29 if [file writa $fileConf] {return 1} {return 0}
32 proc TkW:AskUserConfMethod {ExistEtc ExistHome} {
34 global USER ChDefautConf DejaConf HOME OK CANCEL WAITfilename
35 global DefaultType EtcState HomeState GiveCustomDefault Default
36 global GetFileName GenereConf TkWBuiltConf
38 toplevel .askConf -backgr #ffffff
39 label .askConf.banner -text $ChDefautConf -backgr #0000ff \
40 -foregr #ffffff -height 2
41 pack .askConf.banner -side top -fill x
43 if {$USER == "root" && $ExistEtc == 1} {
44 set Default /etc/wine.conf
45 } else {
46 if {$ExistHome == 1} {set Default "~/.winerc"} \
47 else {set Default Custom}
49 if {[file writable /etc/wine.conf]} {set EtcState normal} {set EtcState disabled}
50 if {$ExistHome == 1} {set HomeState normal} {set HomeState disabled}
51 set DefaultType 0
52 frame .askConf.deja -width 200 -backgr #ffffff
53 radiobutton .askConf.deja.rad -backgr #dddddd -text $DejaConf\
54 -anchor nw -value 0 -variable DefaultType \
55 -indicatoron 1 -relief raised -selectcolor #00ff00
56 pack .askConf.deja.rad -side left -padx 5
57 menubutton .askConf.deja.men -backgr #dddddd \
58 -menu .askConf.deja.men.m -width 50 -text $Default\
59 -relief raised
61 menu .askConf.deja.men.m -cursor {} -tearoff 0
62 .askConf.deja.men.m add command \
63 -command {
64 set Default "$HOME/.winerc"
65 .askConf.deja.men configure -text $Default
66 } -label "~/.winerc" -state $HomeState
67 .askConf.deja.men.m add command \
68 -command {
69 set Default "/etc/wine.conf"
70 .askConf.deja.men configure -text $Default
71 } -state $EtcState \
72 -label "/etc/wine.conf (System wide configuration)"
73 .askConf.deja.men.m add command \
74 -command {
75 TkW:GetFileName $GiveCustomDefault $OK $CANCEL File
76 #set WAITfilename wait
77 #while {$WAITfilename == "wait"} {update}
78 if {$WAITfilename == "opt1"} {
79 set Default $GetFileName
81 .askConf.deja.men configure -text $Default
82 update
83 } \
84 -label "Custom (Give your own configuration file)"
85 pack .askConf.deja -padx 5 -pady 10
86 pack .askConf.deja.men
88 label .askConf.img -image wine_half -backgr #ffffff -relief flat
89 pack .askConf.img -side right -anchor se -padx 5 -pady 5
91 # Next radiobutton: tools/wineconf:
93 frame .askConf.radio -backgr #ffffff -relief flat
94 radiobutton .askConf.radio.generate -text $GenereConf\
95 -anchor nw -value 1 -variable DefaultType \
96 -selectcolor #00ff00 -relief raised
97 pack .askConf.radio.generate -padx 5 -pady 5 -anchor w -fill x
99 # Next radiobutton : TkWine Built-in
101 radiobutton .askConf.radio.tkwbuilt -text $TkWBuiltConf\
102 -anchor nw -value 2 -variable DefaultType \
103 -selectcolor #00ff00 -relief raised
104 pack .askConf.radio.tkwbuilt -padx 5 -pady 5 -anchor w -fill x
105 pack .askConf.radio -padx 0 -pady 0 -anchor w
107 # now OK or CANCEL....
108 frame .askConf.buttons -backgr #ffffff -relief flat -height 25
109 button .askConf.buttons.ok -width 8 -text $OK -command {
110 destroy .askConf
111 TkW:CallWineConf
113 button .askConf.buttons.cancel -width 8 -text $CANCEL -command {
114 destroy .askConf
116 pack .askConf.buttons.ok -side left -padx 25 -pady 5
117 pack .askConf.buttons.cancel -side left -padx 5 -pady 5
118 pack .askConf.buttons -anchor w -padx 5
121 proc TkW:CallWineConf {} {
123 global Default DefaultType TKW
124 switch $DefaultType {
125 0 {TkW:wineconf $Default}
127 set FoundWineConf 0
128 set FoundWineConf [TkW:autoconf /tmp/auto_generated_wineconf]
129 while {$FoundWineConf == 0} update
130 TkW:wineconf /tmp/auto_generated_wineconf
133 2 {TkW:wineconf $TKW/setupfiles/wine.ini}
138 proc TkW:GenereTmpConf {wineconfTool} {
139 global specialwhere
140 set wherearewe ConfTool
141 set Pipe [open "| $wineconfTool " r+]
142 exec rm -f /tmp/auto_generated_wineconf
143 set TmpConf [open /tmp/auto_generated_wineconf w]
144 while {![eof $Pipe]} {
145 gets $Pipe line
146 puts $TmpConf $line
148 close $TmpConf
149 set specialwhere CloseWineAutoConf
150 close $Pipe