Contents of /trunk/installer/ncurses-gui/common.sh
Parent Directory | Revision Log
Revision 1059 -
(show annotations)
(download)
(as text)
Mon May 31 20:59:19 2010 UTC (14 years, 3 months ago) by niro
File MIME type: application/x-sh
File size: 2192 byte(s)
Mon May 31 20:59:19 2010 UTC (14 years, 3 months ago) by niro
File MIME type: application/x-sh
File size: 2192 byte(s)
-variable OK_LABEL for finish message
1 | # $Id$ |
2 | |
3 | TITLE="Magellan Linux Installer" |
4 | |
5 | # common dialog boxes |
6 | messagebox() |
7 | { |
8 | local header="$1" |
9 | local text="$2" |
10 | local height="$3" |
11 | local width="$4" |
12 | |
13 | [[ -z ${header} ]] && die "no header given" |
14 | [[ -z ${text} ]] && die "no text given" |
15 | [[ -z ${height} ]] && height=0 |
16 | [[ -z ${width} ]] && width=0 |
17 | |
18 | [[ -z ${OK_LABEL} ]] && OK_LABEL="Next" |
19 | |
20 | dialog \ |
21 | --colors \ |
22 | --title "${header}" \ |
23 | --backtitle "${TITLE}" \ |
24 | --ok-label "${OK_LABEL}" \ |
25 | --msgbox "${text}" "${height}" "${width}" |
26 | } |
27 | |
28 | inputbox() |
29 | { |
30 | local header="$1" |
31 | local text="$2" |
32 | local height="$3" |
33 | local width="$4" |
34 | |
35 | [[ -z ${header} ]] && die "no header given" |
36 | [[ -z ${text} ]] && die "no text given" |
37 | [[ -z ${height} ]] && height=0 |
38 | [[ -z ${width} ]] && width=0 |
39 | |
40 | dialog \ |
41 | --stdout \ |
42 | --colors \ |
43 | --title "${header}" \ |
44 | --backtitle "${TITLE}" \ |
45 | --inputbox "${text}" "${height}" "${width}" |
46 | } |
47 | |
48 | passwordbox() |
49 | { |
50 | local header="$1" |
51 | local text="$2" |
52 | local height="$3" |
53 | local width="$4" |
54 | |
55 | [[ -z ${header} ]] && die "no header given" |
56 | [[ -z ${text} ]] && die "no text given" |
57 | [[ -z ${height} ]] && height=0 |
58 | [[ -z ${width} ]] && width=0 |
59 | |
60 | dialog \ |
61 | --stdout \ |
62 | --colors \ |
63 | --title "${header}" \ |
64 | --backtitle "${TITLE}" \ |
65 | --insecure \ |
66 | --passwordbox "${text}" "${height}" "${width}" |
67 | } |
68 | |
69 | gauge() |
70 | { |
71 | local header="$1" |
72 | local text="$2" |
73 | local height="$3" |
74 | local width="$4" |
75 | |
76 | [[ -z ${header} ]] && die "no header given" |
77 | [[ -z ${text} ]] && die "no text given" |
78 | [[ -z ${height} ]] && height=0 |
79 | [[ -z ${width} ]] && width=0 |
80 | |
81 | dialog \ |
82 | --colors \ |
83 | --title "${header}" \ |
84 | --backtitle "${TITLE}" \ |
85 | --gauge "${text}" "${height}" "${width}" |
86 | } |
87 | |
88 | yesno() |
89 | { |
90 | local header="$1" |
91 | local text="$2" |
92 | local height="$3" |
93 | local width="$4" |
94 | |
95 | [[ -z ${header} ]] && die "no header given" |
96 | [[ -z ${text} ]] && die "no text given" |
97 | [[ -z ${height} ]] && height=0 |
98 | [[ -z ${width} ]] && width=0 |
99 | |
100 | dialog \ |
101 | --colors \ |
102 | --title "${header}" \ |
103 | --backtitle "${TITLE}" \ |
104 | --defaultno \ |
105 | --yesno "${text}" "${height}" "${width}" |
106 | } |
107 | |
108 | welcome() { messagebox "Welcome" "Welcome to the Magellan-Linux Installer.\n\n\nPress [Enter] to continue." 10 45; } |
109 | finish() { OK_LABEL="Exit" messagebox "Finish" "Installation successfully finished." 10 40; } |
Properties
Name | Value |
---|---|
svn:keywords | Id |