Magellan Linux

Diff of /trunk/installer-simple/functions/common-dialogs.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2391 by niro, Tue Jan 7 12:46:03 2014 UTC revision 2392 by niro, Tue Jan 7 12:54:43 2014 UTC
# Line 6  CANCEL_LABEL=$"Back" Line 6  CANCEL_LABEL=$"Back"
6  # common dialog boxes  # common dialog boxes
7  messagebox()  messagebox()
8  {  {
9   local header="$1"   local header
10   local text="$2"   local text
11   local height="$3"   local height
12   local width="$4"   local width
13    
14     # very basic getops
15     local OPTIND opt
16     while getopts ":h:y:x:" opt
17     do
18     case ${opt} in
19     h) header="${OPTARG}" ;;
20     y) height="${OPTARG}" ;;
21     x) width="${OPTARG}" ;;
22     esac
23     done
24     shift $((OPTIND-1))
25     text="$@"
26    
27   [[ -z ${header} ]] && die "no header given"   [[ -z ${header} ]] && die "no header given"
28   [[ -z ${text} ]] && die "no text given"   [[ -z ${text} ]] && die "no text given"
# Line 28  messagebox() Line 41  messagebox()
41    
42  inputbox()  inputbox()
43  {  {
44   local header="$1"   local header
45   local text="$2"   local text
46   local height="$3"   local height
47   local width="$4"   local width
48    
49     # very basic getops
50     local OPTIND opt
51     while getopts ":h:y:x:" opt
52     do
53     case ${opt} in
54     h) header="${OPTARG}" ;;
55     y) height="${OPTARG}" ;;
56     x) width="${OPTARG}" ;;
57     esac
58     done
59     shift $((OPTIND-1))
60     text="$@"
61    
62   [[ -z ${header} ]] && die "no header given"   [[ -z ${header} ]] && die "no header given"
63   [[ -z ${text} ]] && die "no text given"   [[ -z ${text} ]] && die "no text given"
# Line 48  inputbox() Line 74  inputbox()
74    
75  passwordbox()  passwordbox()
76  {  {
77   local header="$1"   local header
78   local text="$2"   local text
79   local height="$3"   local height
80   local width="$4"   local width
81    
82     # very basic getops
83     local OPTIND opt
84     while getopts ":h:y:x:" opt
85     do
86     case ${opt} in
87     h) header="${OPTARG}" ;;
88     y) height="${OPTARG}" ;;
89     x) width="${OPTARG}" ;;
90     esac
91     done
92     shift $((OPTIND-1))
93     text="$@"
94    
95   [[ -z ${header} ]] && die "no header given"   [[ -z ${header} ]] && die "no header given"
96   [[ -z ${text} ]] && die "no text given"   [[ -z ${text} ]] && die "no text given"
# Line 69  passwordbox() Line 108  passwordbox()
108    
109  gaugebox()  gaugebox()
110  {  {
111   local header="$1"   local header
112   local text="$2"   local text
113   local height="$3"   local height
114   local width="$4"   local width
115    
116     # very basic getops
117     local OPTIND opt
118     while getopts ":h:y:x:" opt
119     do
120     case ${opt} in
121     h) header="${OPTARG}" ;;
122     y) height="${OPTARG}" ;;
123     x) width="${OPTARG}" ;;
124     esac
125     done
126     shift $((OPTIND-1))
127     text="$@"
128    
129   [[ -z ${header} ]] && die "no header given"   [[ -z ${header} ]] && die "no header given"
130   [[ -z ${text} ]] && die "no text given"   [[ -z ${text} ]] && die "no text given"
# Line 88  gaugebox() Line 140  gaugebox()
140    
141  yesnobox()  yesnobox()
142  {  {
143   local header="$1"   local header
144   local text="$2"   local text
145   local height="$3"   local height
146   local width="$4"   local width
147    
148     # very basic getops
149     local OPTIND opt
150     while getopts ":h:y:x:" opt
151     do
152     case ${opt} in
153     h) header="${OPTARG}" ;;
154     y) height="${OPTARG}" ;;
155     x) width="${OPTARG}" ;;
156     esac
157     done
158     shift $((OPTIND-1))
159     text="$@"
160    
161   [[ -z ${header} ]] && die "no header given"   [[ -z ${header} ]] && die "no header given"
162   [[ -z ${text} ]] && die "no text given"   [[ -z ${text} ]] && die "no text given"

Legend:
Removed from v.2391  
changed lines
  Added in v.2392