#!/bin/bash



kdialog  --caption "AcetoneISO2" --msgbox "Be sure You have first added at least one GPG key\nAlso be sure to have write permission in the directory where the image is located"


OPENFILE=`kdialog --icon /usr/share/pixmaps/aiso2.png --caption "Select Image to be Encrypted" --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 $OPENFILE
then
exit
else
echo continua
fi

konsole -e gpg -c "$OPENFILE"

if test -e "$OPENFILE.gpg"
then
kdialog --caption "AcetoneISO2" --msgbox "Image Succesfully Encrypted"
else
kdialog --caption "AcetoneISO2" --sorry "It seems there has been a problem.\n1)maybe you didn't add at least one GPG Key\n2)maybe you inserted the wrong Key"

fi

exit
