Annotation of /trunk/installer/gtk-gui/locales.sh
Parent Directory | Revision Log
Revision 719 -
(hide annotations)
(download)
(as text)
Fri Apr 18 20:40:28 2008 UTC (16 years, 5 months ago) by niro
File MIME type: application/x-sh
File size: 4280 byte(s)
Fri Apr 18 20:40:28 2008 UTC (16 years, 5 months ago) by niro
File MIME type: application/x-sh
File size: 4280 byte(s)
-first import
1 | niro | 719 | # $Header: /home/cvsd/magellan-cvs/magellan-src/installer/gtk-gui/locales.sh,v 1.1 2008-04-18 20:40:28 niro Exp $ |
2 | |||
3 | export SELECT_TIMEZONE_REGION=' | ||
4 | <window title="Locales" icon-name="gtk-preferences" window_position="1" resizable="true"> | ||
5 | <vbox> | ||
6 | <pixmap> | ||
7 | <input file>header.png</input> | ||
8 | </pixmap> | ||
9 | <hbox spacing="180"> | ||
10 | <pixmap> | ||
11 | <input file stock="gtk-preferences"></input> | ||
12 | </pixmap> | ||
13 | <text> | ||
14 | <label>Select a region</label> | ||
15 | </text> | ||
16 | </hbox> | ||
17 | <list selection-mode="2"> | ||
18 | <width>300</width><height>200</height> | ||
19 | <variable>TIMEZONE_REGION</variable> | ||
20 | <label>Region</label> | ||
21 | <input>timezone.sh --regions</input> | ||
22 | </list> | ||
23 | <hbox> | ||
24 | <button> | ||
25 | <label>back</label> | ||
26 | <input file stock="gtk-go-back"></input> | ||
27 | </button> | ||
28 | <button> | ||
29 | <label>next</label> | ||
30 | <input file stock="gtk-go-forward"></input> | ||
31 | </button> | ||
32 | </hbox> | ||
33 | </vbox> | ||
34 | </window> | ||
35 | ' | ||
36 | |||
37 | export SELECT_TIMEZONE_LOCATION=' | ||
38 | <window title="Locales" icon-name="gtk-preferences" window_position="1" resizable="true"> | ||
39 | <vbox> | ||
40 | <pixmap> | ||
41 | <input file>header.png</input> | ||
42 | </pixmap> | ||
43 | <hbox spacing="160"> | ||
44 | <pixmap> | ||
45 | <input file stock="gtk-preferences"></input> | ||
46 | </pixmap> | ||
47 | <text> | ||
48 | <label>Select a Location</label> | ||
49 | </text> | ||
50 | </hbox> | ||
51 | <list selection-mode="2"> | ||
52 | <width>300</width><height>200</height> | ||
53 | <variable>TIMEZONE_LOCATION</variable> | ||
54 | <label>Region</label> | ||
55 | <input>timezone.sh --locations "${TIMEZONE_REGION}"</input> | ||
56 | </list> | ||
57 | <hbox> | ||
58 | <button> | ||
59 | <label>back</label> | ||
60 | <input file stock="gtk-go-back"></input> | ||
61 | </button> | ||
62 | <button> | ||
63 | <label>next</label> | ||
64 | <input file stock="gtk-go-forward"></input> | ||
65 | </button> | ||
66 | </hbox> | ||
67 | </vbox> | ||
68 | </window> | ||
69 | ' | ||
70 | |||
71 | export SELECT_LOCALES=' | ||
72 | <window title="Locales" icon-name="gtk-preferences" window_position="1" resizable="true"> | ||
73 | <vbox> | ||
74 | <pixmap> | ||
75 | <input file>header.png</input> | ||
76 | </pixmap> | ||
77 | <hbox spacing="140"> | ||
78 | <pixmap> | ||
79 | <input file stock="gtk-preferences"></input> | ||
80 | </pixmap> | ||
81 | <text> | ||
82 | <label>Select a default locale</label> | ||
83 | </text> | ||
84 | </hbox> | ||
85 | <list selection-mode="2"> | ||
86 | <width>300</width><height>200</height> | ||
87 | <variable>LOCALE</variable> | ||
88 | <label>Region</label> | ||
89 | <input>localedef --list-archive | grep $(timezone.sh --get-code ${TIMEZONE_LOCATION})</input> | ||
90 | </list> | ||
91 | <hbox> | ||
92 | <button> | ||
93 | <label>back</label> | ||
94 | <input file stock="gtk-go-back"></input> | ||
95 | </button> | ||
96 | <button> | ||
97 | <label>next</label> | ||
98 | <input file stock="gtk-go-forward"></input> | ||
99 | </button> | ||
100 | </hbox> | ||
101 | </vbox> | ||
102 | </window> | ||
103 | ' | ||
104 | |||
105 | rundialog_select_timezone_region() | ||
106 | { | ||
107 | rundialog SELECT_TIMEZONE_REGION | ||
108 | echo "DEBUG: EXIT='${EXIT}'" | ||
109 | |||
110 | # save given variables in env | ||
111 | # they will be shown as default on error | ||
112 | export TIMEZONE_REGION | ||
113 | |||
114 | case ${EXIT} in | ||
115 | abort) | ||
116 | echo "Aborted by user." | ||
117 | exit 1 | ||
118 | ;; | ||
119 | back) | ||
120 | # placeholder | ||
121 | return 1 | ||
122 | ;; | ||
123 | next) | ||
124 | if [[ -z ${TIMEZONE_REGION} ]] | ||
125 | then | ||
126 | FAILURE_MESSAGE="No Timezone Region selected!" \ | ||
127 | rundialog FAILURE_DIALOG | ||
128 | rundialog_select_timezone_region | ||
129 | fi | ||
130 | ;; | ||
131 | esac | ||
132 | } | ||
133 | |||
134 | rundialog_select_timezone_location() | ||
135 | { | ||
136 | rundialog SELECT_TIMEZONE_LOCATION | ||
137 | echo "DEBUG: EXIT='${EXIT}'" | ||
138 | |||
139 | # save given variables in env | ||
140 | # they will be shown as default on error | ||
141 | export TIMEZONE_LOCATION | ||
142 | |||
143 | case ${EXIT} in | ||
144 | abort) | ||
145 | echo "Aborted by user." | ||
146 | exit 1 | ||
147 | ;; | ||
148 | back) | ||
149 | rundialog_select_timezone_region | ||
150 | rundialog_select_timezone_location | ||
151 | ;; | ||
152 | next) | ||
153 | if [[ -z ${TIMEZONE_LOCATION} ]] | ||
154 | then | ||
155 | FAILURE_MESSAGE="No Timezone Location selected!" \ | ||
156 | rundialog FAILURE_DIALOG | ||
157 | rundialog_select_timezone_location | ||
158 | fi | ||
159 | ;; | ||
160 | esac | ||
161 | } | ||
162 | |||
163 | rundialog_select_locales() | ||
164 | { | ||
165 | rundialog SELECT_LOCALES | ||
166 | echo "DEBUG: EXIT='${EXIT}'" | ||
167 | |||
168 | # save given variables in env | ||
169 | # they will be shown as default on error | ||
170 | export LOCALES | ||
171 | |||
172 | case ${EXIT} in | ||
173 | abort) | ||
174 | echo "Aborted by user." | ||
175 | exit 1 | ||
176 | ;; | ||
177 | back) | ||
178 | rundialog_select_timezone_location | ||
179 | rundialog_select_locales | ||
180 | ;; | ||
181 | next) | ||
182 | if [[ -z ${TIMEZONE_LOCATION} ]] | ||
183 | then | ||
184 | FAILURE_MESSAGE="No locale selected!" \ | ||
185 | rundialog FAILURE_DIALOG | ||
186 | rundialog_select_locale | ||
187 | fi | ||
188 | ;; | ||
189 | esac | ||
190 | } | ||
191 | |||
192 | main_locales() | ||
193 | { | ||
194 | rundialog_select_timezone_region | ||
195 | rundialog_select_timezone_location | ||
196 | rundialog_select_locales | ||
197 | |||
198 | # export all variables | ||
199 | export TIMEZONE_REGION | ||
200 | export TIMEZONE_LOCATION | ||
201 | export LOCALE_ALL | ||
202 | export LOCALE | ||
203 | } |