Magellan Linux

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

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

revision 2392 by niro, Tue Jan 7 12:54:43 2014 UTC revision 2395 by niro, Tue Jan 7 12:59:51 2014 UTC
# Line 24  messagebox() Line 24  messagebox()
24   shift $((OPTIND-1))   shift $((OPTIND-1))
25   text="$@"   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"
29   [[ -z ${height} ]] && height=0   [[ -z ${height} ]] && height=8
30   [[ -z ${width} ]] && width=0   [[ -z ${width} ]] && width=70
31    
32   [[ -z ${OK_LABEL} ]] && OK_LABEL="Next"   [[ -z ${OK_LABEL} ]] && OK_LABEL="Next"
33    
# Line 39  messagebox() Line 39  messagebox()
39   --msgbox "${text}" "${height}" "${width}"   --msgbox "${text}" "${height}" "${width}"
40  }  }
41    
42    infobox()
43    {
44     local header
45     local text
46     local height
47     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"
63     [[ -z ${text} ]] && die "no text given"
64     [[ -z ${height} ]] && height=3
65     [[ -z ${width} ]] && width=70
66    
67     dialog \
68     --colors \
69     --title "${header}" \
70     --backtitle "${TITLE}" \
71     --infobox "${text}" "${height}" "${width}"
72    }
73    
74  inputbox()  inputbox()
75  {  {
76   local header   local header
# Line 59  inputbox() Line 91  inputbox()
91   shift $((OPTIND-1))   shift $((OPTIND-1))
92   text="$@"   text="$@"
93    
94   [[ -z ${header} ]] && die "no header given"   #[[ -z ${header} ]] && die "no header given"
95   [[ -z ${text} ]] && die "no text given"   [[ -z ${text} ]] && die "no text given"
96   [[ -z ${height} ]] && height=0   [[ -z ${height} ]] && height=0
97   [[ -z ${width} ]] && width=0   [[ -z ${width} ]] && width=0
# Line 92  passwordbox() Line 124  passwordbox()
124   shift $((OPTIND-1))   shift $((OPTIND-1))
125   text="$@"   text="$@"
126    
127   [[ -z ${header} ]] && die "no header given"   #[[ -z ${header} ]] && die "no header given"
128   [[ -z ${text} ]] && die "no text given"   [[ -z ${text} ]] && die "no text given"
129   [[ -z ${height} ]] && height=0   [[ -z ${height} ]] && height=0
130   [[ -z ${width} ]] && width=0   [[ -z ${width} ]] && width=0
# Line 126  gaugebox() Line 158  gaugebox()
158   shift $((OPTIND-1))   shift $((OPTIND-1))
159   text="$@"   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"
163   [[ -z ${height} ]] && height=0   [[ -z ${height} ]] && height=0
164   [[ -z ${width} ]] && width=0   [[ -z ${width} ]] && width=70
165    
166   dialog \   dialog \
167   --colors \   --colors \
# Line 158  yesnobox() Line 190  yesnobox()
190   shift $((OPTIND-1))   shift $((OPTIND-1))
191   text="$@"   text="$@"
192    
193   [[ -z ${header} ]] && die "no header given"   #[[ -z ${header} ]] && die "no header given"
194   [[ -z ${text} ]] && die "no text given"   [[ -z ${text} ]] && die "no text given"
195   [[ -z ${height} ]] && height=0   [[ -z ${height} ]] && height=0
196   [[ -z ${width} ]] && width=0   [[ -z ${width} ]] && width=0

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