#!/bin/bash

case $LANG in
    es*)
	MSG1="Debe seleccionar un archivo para cortarlo"
	MSG2="¿Qué tamaño tendrá cada trozo?"
	MSG3="MB"
	MSG4="Disquete 1.44MB"
	MSG5="CD-ROM 700MB"
	MSG6="1GB"
	MSG7="Manual"
	MSG8="¿Qué tamaño desea que tenga cada trozo?"
	MSG9="100m"
    ;;
    gl*)
	MSG1="Debe escoller un ficheiro para cortalo"
	MSG2="Qué tamaño terá cada anaco?"
	MSG3="Megas"
	MSG4="Disquete 1.44MB"
	MSG5="CD-ROM 700MB"
	MSG6="1GB"
	MSG7="Manual"
	MSG8="Qué tamaño desexa que teña cada anaco?"
	MSG9="100m"
    ;;
    *)
	MSG1="You must select a file to cut it"
	MSG2="What size would each piece have?"
	MSG3="MB"
	MSG4="Diskette 1.44MB"
	MSG5="CD-ROM 700MB"
	MSG6="1GB"
	MSG7="Manual"
	MSG8="What size would you like each piece had?"
	MSG9="100m"
    ;;
esac

file="$1"

if [ -z "$1" ];then
	file=`zenity --file-selection --title="$MSG1"`
fi

radiolist=$(zenity  --list  --text "$MSG2" --radiolist  --column "" --column "$MSG3" TRUE "$MSG4" FALSE "$MSG5" FALSE "$MSG6" FALSE "$MSG7")
echo $radiolist

if [ "$radiolist" == "$MSG4" ];then
	hacha s -s 1440k "$file"|zenity --progress --pulsate
fi

if [ "$radiolist" == "$MSG5" ];then
	hacha s -s 700m "$file"|zenity --progress --pulsate
fi

if [ "$radiolist" == "$MSG6" ];then
	hacha s -s 1000m "$file"|zenity --progress --pulsate
fi

if [ "$radiolist" == "$MSG7" ];then
	manual=$(zenity --entry --text "$MSG8" --entry-text "$MSG9")
	hacha s -s $manual "$file"|zenity --progress --pulsate
fi


