Added regedit unit test, a couple minor changes to regedit.
[wine] / tools / wineconf.libs / saveRC.tcl
1 # Copyright 1999 Jean-Louis Thirot
2 #
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.
7 #
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.
12 #
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
16 #
17
18 proc TkW:exit {} {
19         global EXIT_title QUITSAVING QUITNOSAVE CANCEL TKW
20     set base .saveRC
21     if {![winfo exists .choosemethod]} {
22         cd $TKW
23         TkW:choosemethod
24         return
25     }
26
27         TkW:CloseOtherWindows
28  
29         TkW:debug "Other should be detroyed now......"
30     if {[winfo exists .saveRC]} {
31         wm deiconify .saveRC; return
32     }
33         TkW:debug "Entering TkW:exit"
34     ###################
35     # CREATING WIDGETS
36     ###################
37     toplevel .saveRC -class Toplevel \
38         -background #ffffff 
39     wm focusmodel .saveRC passive
40     wm geometry .saveRC 412x163+404+267
41     wm maxsize .saveRC 1265 994
42     wm minsize .saveRC 1 1
43     wm overrideredirect .saveRC 0
44     wm resizable .saveRC 1 1
45     wm deiconify .saveRC
46     wm title .saveRC "$EXIT_title"
47     #wm iconbitmap .saveRC @$TKW/setupfiles/images/setup2.xbm
48     #wm iconmask   .saveRC @$TKW/setupfiles/images/setupmask2.xbm
49
50     label .saveRC.lab18 \
51         -background #dddddd \
52         -font -Adobe-Helvetica-Medium-R-Normal-*-*-160-*-*-*-*-*-* \
53         -foreground #0000f6 -relief groove -text label \
54         -textvariable CONFIRMQUIT  -wraplength 350
55     button .saveRC.but19 \
56         -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -padx 9 \
57         -pady 3 -text button -textvariable QUITSAVING -command {TkW:saveRC;exit}
58     button .saveRC.but20 \
59         -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -padx 9 \
60         -pady 3 -text button -textvariable QUITNOSAVE  -command {exit}
61     button .saveRC.but21 \
62         -font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-*-* -padx 9 \
63         -pady 3 -text button -textvariable CANCEL -command {destroy .saveRC}
64     ###################
65     # SETTING GEOMETRY
66     ###################
67     place .saveRC.lab18 \
68         -x 5 -y 5 -width 403 -height 110 -anchor nw -bordermode ignore 
69     place .saveRC.but19 \
70         -x 5 -y 120 -width 135 -height 38 -anchor nw -bordermode ignore 
71     place .saveRC.but20 \
72         -x 138 -y 120 -width 135 -height 38 -anchor nw -bordermode ignore 
73     place .saveRC.but21 \
74         -x 273 -y 120 -width 135 -height 38 -anchor nw -bordermode ignore 
75 }
76
77 proc TkW:CloseOtherWindows {} {
78         set Wins ".wineconf .compile .install .insbin"
79
80         foreach i $Wins { if [winfo exists $i] {destroy $i}}
81
82         return
83
84 }
85
86 proc TkW:saveRC {} {
87 # This proc saves the ~/.winesetuprc file
88 # all the last compile option, source dest, install dire,
89 # and the like are saved.
90 # Could be improved by adding a "default" button in some places so some
91 #changes could be ignore there....
92 # For now, it saves all the last selections.
93
94 # Opens the ~/.winesetuprc for writting:
95 set savein [open ~/.winesetuprc w]
96
97 # Puts the comments as well as the content:
98
99 puts $savein "#"
100 puts $savein "# System description:"
101 puts $savein "#"
102 global distrib; puts $savein "set distrib \"$distrib\""
103 global kernel; puts $savein "set kernel \"$kernel\""
104 global processor; puts $savein "set processor \"$processor\""
105 global FTPNUM bz2docdest bz2exedest
106 global BROWSER;puts $savein "set BROWSER \"$BROWSER\""
107 puts $savein "#"
108 puts $savein "# Method:"
109 puts $savein "#"
110 global choosenmethod; puts $savein "set choosenmethod \"$choosenmethod\""
111 puts $savein "#"
112 puts $savein "# Compile options"
113 puts $savein "#"
114 puts $savein "# where to search the archive"
115 global dir_search; puts $savein "set dir_search \"$dir_search\""
116 puts $savein "# where to put the executable"
117 global bindir; puts $savein "set bindir \"$bindir\""
118 puts $savein "# options"
119 global debug trace noemu dll nolib clean
120 puts $savein "set debug $debug ; set trace $trace ; set noemu $noemu ; set dll $dll ; set nolib $nolib ; set clean $clean"
121
122 puts $savein "# where to put the source tree"
123 global srcdest; puts $savein "set srcdest \"$srcdest\""
124 puts $savein "# where is the top of the source tree"
125 global winedir; puts $savein "set winedir \"$winedir\""
126 puts $savein "#"
127 puts $savein "# Number in the list of ftp site to use"
128 puts $savein "set FTPNUM $FTPNUM"
129
130 puts $savein "#"
131 puts $savein "# BZIP@ exe and doc dest"
132 puts $savein "set bz2exedest $bz2exedest"
133 puts $savein "set bz2docdest $bz2docdest"
134
135 puts $savein "# "
136 puts $savein "# memory from last start"
137 puts $savein "# "
138 global laststart ; puts $savein "set laststart \"$laststart\""
139
140 }