Added DisplayToolTip

This commit is contained in:
Michael Boelen 2016-07-05 17:25:19 +02:00
parent cb73cbb968
commit 75786a1c80

View File

@ -39,6 +39,7 @@
# DiscoverProfiles Determine available profiles on system # DiscoverProfiles Determine available profiles on system
# Display Output text to screen with colors and identation # Display Output text to screen with colors and identation
# DisplayManual Output text to screen without any layout # DisplayManual Output text to screen without any layout
# DisplayToolTip Show a tip for improving usage of the tool
# ExitClean Stop the program (cleanly), with exit code 0 # ExitClean Stop the program (cleanly), with exit code 0
# ExitCustom Stop the program (cleanly), with custom exit code # ExitCustom Stop the program (cleanly), with custom exit code
# ExitFatal Stop the program (cleanly), with exit code 1 # ExitFatal Stop the program (cleanly), with exit code 1
@ -443,6 +444,27 @@
} }
################################################################################
# Name : DisplayToolTip()
# Description : Show tooltip on screen
#
# Input : $1 = text
# Returns : <nothing>
################################################################################
DisplayToolTip() {
if [ ${SHOW_TOOL_TIPS} -eq 1 ]; then
if [ ${CRONJOB} -eq 0 ]; then
# Check if we already have already discovered a proper echo command tool. It not, set it default to 'echo'.
if [ "${ECHOCMD}" = "" ]; then ECHOCMD="echo"; fi
${ECHOCMD} "${WHITE}[${BLUE}Tool Tip${NORMAL}${WHITE}]${NORMAL}: $1"
else
echo "${TEXT}${RESULTPART}"
fi
fi
}
################################################################################ ################################################################################
# Name : Display() # Name : Display()
# Description : Show text on screen, with markup # Description : Show text on screen, with markup
@ -536,6 +558,27 @@
} }
################################################################################
# Name : DisplayToolTip()
# Description : Show tooltip on screen
#
# Input : $1 = text
# Returns : <nothing>
################################################################################
DisplayToolTip() {
if [ ${SHOW_TOOL_TIPS} -eq 1 ]; then
if [ ${CRONJOB} -eq 0 ]; then
# Check if we already have already discovered a proper echo command tool. It not, set it default to 'echo'.
if [ "${ECHOCMD}" = "" ]; then ECHOCMD="echo"; fi
${ECHOCMD} "${WHITE}[${BLUE}TOOLTIP${NORMAL}${WHITE}]${NORMAL} ${WHITE}$1${NORMAL}"
else
echo "${TEXT}${RESULTPART}"
fi
fi
}
################################################################################ ################################################################################
# Name : ExitClean() # Name : ExitClean()
# Description : Perform a normal exit of the program, and clean up resources # Description : Perform a normal exit of the program, and clean up resources