#!/bin/bash


kdialog --caption "AcetoneISO2" --msgbox "WARNING!\nThis operation may take some time depending on your file dimension"

VARIN=`kdialog --icon /usr/share/pixmaps/aiso2.png --caption "AcetoneISO2" --getopenfilename $HOME/ "*.iso *.daa *.bin *.mdf *.ashdisc *.bwi *.b5i *.lcd *.img *.cdi *.cif *.p01 *.pdi *.nrg *.ncd *.pxi *.gi *.fcd *.vcd *.c2d |All supported Images"`

if test -z $VARIN
then
exit
else
echo continua
fi

OUTPUT=`kdialog --icon /usr/share/pixmaps/aiso2.png --caption "Select where to Save Generated Md5um File" --getsavefilename $HOME/ "*.md5 |MD5 FILE"`

if test -z $OUTPUT
then
exit
else
echo continua
fi
md5sum "$VARIN" > "$OUTPUT"

kdialog --caption "AcetoneISO2" --msgbox "Md5sum File Has been Succesfully Created"

if test -e /usr/bin/kate
then
kate "$OUTPUT"
else
konsole -e nano "$OUTPUT"
fi

exit
