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