#!/bin/bash

export TEXTDOMAIN="minino_actliza-ayuda"
export TEXTDOMAINDIR="/usr/local/share/locale" 

# Ahorrando escritura de código
# Títulos y mensajes
TIT1="$(gettext "«Help» updating")"
MSG1="$(gettext "Help pack is going to be updated.
It is automatic and with no user intervention.
Are you sure to continue?")"
TIT2="$(gettext "About...")"
MSG2="$(gettext "Done. Help files updated")"
TIT3="$(gettext "Cancel")"
MSG3="$(gettext "You cancelled the operation")"
TIT4="$(gettext "Quit")"
MSG4="$(gettext "Quit by your order or by a procedural error.
If you do not ordered to stop the procedural, please review the configuration.")"
TIT5="$(gettext "Downloading...")"
MSG5="$(gettext "From GALPon MiniNo repositories")"

Xdialog --title "$TIT1" --icon /usr/share/pixmaps/Xdialog/duda.xpm --fill --yesno "$MSG1" 0 0;

case $? in
        0)
       	        mkdir /home/Help
		cd /home/Help
		rm -r /home/Help/*
		wget -m -np -nH -r --cut-dirs=1 http://minino.galpon.org/Ayuda_MiniNo/ | \
			Xdialog --title "$TIT5" --icon /usr/share/pixmaps/Xdialog/go-down.xpm \
				--no-buttons --fill --infobox "$MSG5" 0 0 - && 
		#rm -r index.html*
		cd /home/Help/contents
		rm -r index.html*
		cd /home/Help/images
		rm -r index.html*

		Xdialog --title "$TIT2" --icon /usr/share/pixmaps/Xdialog/importante.xpm --fill --msgbox "$MSG2" 0 0 
       	        ;;
       	1)
       	        Xdialog --no-buttons --title "$TIT3" --infobox \
       	        "$MSG3" 0 0 1500
       	        ;;
       	255)
       	        Xdialog --title $TIT4 --infobox \
       	        "$MSG4" 0 0 7000
       	        ;;
esac


