summaryrefslogtreecommitdiff
path: root/src/core/libs/lib-ui.sh
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-11-10 18:27:57 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-11-10 18:27:57 +0100
commitfc3809dec26d21eb18a568b9ec018ed0f042f901 (patch)
tree772dafa989cf431ba48723cf54887913a8295af7 /src/core/libs/lib-ui.sh
parentce72829ec480acdbcd0d853377b895854feea80d (diff)
several small stupid thingies
Diffstat (limited to 'src/core/libs/lib-ui.sh')
-rw-r--r--src/core/libs/lib-ui.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh
index b718b03..927ba96 100644
--- a/src/core/libs/lib-ui.sh
+++ b/src/core/libs/lib-ui.sh
@@ -26,14 +26,15 @@ 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
+ type=msg
+ [ -n "$3" ] && type=$3
if [ "$var_UI_TYPE" = dia ]
then
- _dia_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"
+ _dia_DIALOG --title "$1" --exit-label "Continue" --${type}box "$2" 18 70 || die_error "dialog could not show --${type}box $2. often this means a file does not exist"
else
echo "WARNING: $1"
- [ "$3" = msg ] && echo -e "$2"
- [ "$3" = text ] && cat $2 || die_error "Could not cat $2"
+ [ "${type}" = msg ] && echo -e "$2"
+ [ "${type}" = text ] && cat $2 || die_error "Could not cat $2"
fi
}
@@ -50,6 +51,7 @@ notify ()
}
+# like notify, but user does not need to confirm explicitly when in dia mode
infofy ()
{
if [ "$var_UI_TYPE" = dia ]