31 |
|
|
32 |
[[ -z ${OK_LABEL} ]] && OK_LABEL="Next" |
[[ -z ${OK_LABEL} ]] && OK_LABEL="Next" |
33 |
|
|
34 |
|
echo "DEBUG: paused" >&2; read |
35 |
dialog \ |
dialog \ |
36 |
--colors \ |
--colors \ |
37 |
--title "${header}" \ |
--title "${header}" \ |
40 |
--msgbox "${text}" "${height}" "${width}" |
--msgbox "${text}" "${height}" "${width}" |
41 |
} |
} |
42 |
|
|
43 |
|
infobox() |
44 |
|
{ |
45 |
|
local header |
46 |
|
local text |
47 |
|
local height |
48 |
|
local width |
49 |
|
|
50 |
|
# very basic getops |
51 |
|
local OPTIND opt |
52 |
|
while getopts ":h:y:x:" opt |
53 |
|
do |
54 |
|
case ${opt} in |
55 |
|
h) header="${OPTARG}" ;; |
56 |
|
y) height="${OPTARG}" ;; |
57 |
|
x) width="${OPTARG}" ;; |
58 |
|
esac |
59 |
|
done |
60 |
|
shift $((OPTIND-1)) |
61 |
|
text="$@" |
62 |
|
|
63 |
|
#[[ -z ${header} ]] && die "no header given" |
64 |
|
[[ -z ${text} ]] && die "no text given" |
65 |
|
[[ -z ${height} ]] && height=3 |
66 |
|
[[ -z ${width} ]] && width=70 |
67 |
|
|
68 |
|
echo "DEBUG: paused" >&2; read |
69 |
|
dialog \ |
70 |
|
--colors \ |
71 |
|
--title "${header}" \ |
72 |
|
--backtitle "${TITLE}" \ |
73 |
|
--infobox "${text}" "${height}" "${width}" |
74 |
|
} |
75 |
|
|
76 |
inputbox() |
inputbox() |
77 |
{ |
{ |
78 |
local header |
local header |
98 |
[[ -z ${height} ]] && height=0 |
[[ -z ${height} ]] && height=0 |
99 |
[[ -z ${width} ]] && width=0 |
[[ -z ${width} ]] && width=0 |
100 |
|
|
101 |
|
echo "DEBUG: paused" >&2; read |
102 |
dialog \ |
dialog \ |
103 |
--stdout \ |
--stdout \ |
104 |
--colors \ |
--colors \ |
132 |
[[ -z ${height} ]] && height=0 |
[[ -z ${height} ]] && height=0 |
133 |
[[ -z ${width} ]] && width=0 |
[[ -z ${width} ]] && width=0 |
134 |
|
|
135 |
|
echo "DEBUG: paused" >&2; read |
136 |
dialog \ |
dialog \ |
137 |
--stdout \ |
--stdout \ |
138 |
--colors \ |
--colors \ |
142 |
--passwordbox "${text}" "${height}" "${width}" |
--passwordbox "${text}" "${height}" "${width}" |
143 |
} |
} |
144 |
|
|
145 |
|
menubox() |
146 |
|
{ |
147 |
|
local header |
148 |
|
local text |
149 |
|
local height |
150 |
|
local width |
151 |
|
local items |
152 |
|
local index |
153 |
|
local dialog_opts |
154 |
|
|
155 |
|
# very basic getops |
156 |
|
local OPTIND opt |
157 |
|
while getopts ":h:y:x:i:n" opt |
158 |
|
do |
159 |
|
case ${opt} in |
160 |
|
n) dialog_opts+=" --no-cancel" ;; |
161 |
|
h) header="${OPTARG}" ;; |
162 |
|
y) height="${OPTARG}" ;; |
163 |
|
x) width="${OPTARG}" ;; |
164 |
|
esac |
165 |
|
done |
166 |
|
shift $((OPTIND-1)) |
167 |
|
text="$1" |
168 |
|
shift |
169 |
|
items=( "$@" ) |
170 |
|
index="${#items[*]}" |
171 |
|
|
172 |
|
#[[ -z ${header} ]] && header="empty header: add -h yourheader" |
173 |
|
[[ -z ${text} ]] && die "no text given" |
174 |
|
[[ -z ${height} ]] && height=0 |
175 |
|
[[ -z ${width} ]] && width=70 |
176 |
|
|
177 |
|
[[ -z ${OK_LABEL} ]] && OK_LABEL="Next" |
178 |
|
[[ -z ${CANCEL_LABEL} ]] && CANCEL_LABEL="Back" |
179 |
|
|
180 |
|
echo "DEBUG: paused" >&2; read |
181 |
|
eval dialog \ |
182 |
|
--stdout \ |
183 |
|
--colors \ |
184 |
|
--title "'${header}'" \ |
185 |
|
--backtitle "'${TITLE}'" \ |
186 |
|
--ok-label "'${OK_LABEL}'" \ |
187 |
|
--cancel-label "'${CANCEL_LABEL}'" \ |
188 |
|
"${dialog_opts}" \ |
189 |
|
--menu "'${text}'" "${height}" "${width}" "${index}" \ |
190 |
|
$(for ((i=0;i<index;i++)); do echo "'${items[${i}]%%:*}'";echo "'${items[${i}]#*:}'"; done) |
191 |
|
} |
192 |
|
|
193 |
gaugebox() |
gaugebox() |
194 |
{ |
{ |
195 |
local header |
local header |
215 |
[[ -z ${height} ]] && height=0 |
[[ -z ${height} ]] && height=0 |
216 |
[[ -z ${width} ]] && width=70 |
[[ -z ${width} ]] && width=70 |
217 |
|
|
218 |
|
echo "DEBUG: paused" >&2; read |
219 |
dialog \ |
dialog \ |
220 |
--colors \ |
--colors \ |
221 |
--title "${header}" \ |
--title "${header}" \ |
248 |
[[ -z ${height} ]] && height=0 |
[[ -z ${height} ]] && height=0 |
249 |
[[ -z ${width} ]] && width=0 |
[[ -z ${width} ]] && width=0 |
250 |
|
|
251 |
|
echo "DEBUG: paused" >&2; read |
252 |
dialog \ |
dialog \ |
253 |
--colors \ |
--colors \ |
254 |
--title "${header}" \ |
--title "${header}" \ |
256 |
--defaultno \ |
--defaultno \ |
257 |
--yesno "${text}" "${height}" "${width}" |
--yesno "${text}" "${height}" "${width}" |
258 |
} |
} |
|
|
|
|
welcome() { messagebox "Welcome" "Welcome to the ${DEFAULT_TITLE}.\n\n\nPress [Enter] to continue." 10 45; } |
|
|
finish() { OK_LABEL="Exit" messagebox "Finish" "Installation was successfully finished." 10 40; } |
|