summaryrefslogtreecommitdiff
path: root/src/fifa.sh
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-11-01 13:31:08 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-11-01 13:31:08 +0100
commit6abc6238510e06734c2e3377d273970667d38c54 (patch)
tree311cbdb4563b44c37aa50c410c4b3624c37439b1 /src/fifa.sh
parent166ddfab7fe5d507d84e6d434c1b92f5b2091db4 (diff)
cleaned up mkinitcpio code. abstracted run_background, follow_progress, wait_for etc. implemented warning messages. + some fixes
Diffstat (limited to 'src/fifa.sh')
-rwxr-xr-xsrc/fifa.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/fifa.sh b/src/fifa.sh
index 818a1db..d0b1d75 100755
--- a/src/fifa.sh
+++ b/src/fifa.sh
@@ -31,6 +31,8 @@ usage ()
##### "These functions would fit more in lib-ui, but we need them immediately" functions ######
+
+# display error message and die
die_error ()
{
if [ "$var_UI_TYPE" = dia ]
@@ -43,6 +45,28 @@ die_error ()
}
+# display warning message
+# $1 title
+# $2 item to show
+# $3 type of item. msg or text if it's a file. (optional. defaults to msg)
+show_warning ()
+{
+ [ -z "$1" ] && die_error "show_warning needs a title"
+ [ -z "$2" ] && die_error "show_warning needs an item to show"
+ [ -n "$3" -a "$3" != msg -a "$3" != text ] && die_error "show_warning \$3 must be text or msg"
+ [ -z "$3" ] && 3=msg
+ if [ "$var_UI_TYPE" = dia ]
+ then
+ dialog --title "$1" --exit-label "Continue" --$3box "$2" 18 70 || die_error "dialog could not show --$3box $2. often this means a file does not exist"
+ else
+ echo "WARNING: $1"
+ [ "$3" = msg ] && echo $2
+ [ "$3" = text ] && cat $2 || die_error "Could not cat $2"
+ fi
+}
+
+
+#notify user
notify ()
{
if [ "$var_UI_TYPE" = dia ]