#!/bin/bash

PLAYER=`kdialog --icon /usr/share/pixmaps/aiso2.png --caption "AcetoneISO2" --combobox "Select from where to extract Boot Image:" "CD-DVD" "ISO file"`

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


if test $PLAYER = CD-DVD
then

VAROUT=`kdialog --icon /usr/share/pixmaps/aiso2.png --caption "Select where to Save Boot Image and Name!" --getsavefilename $HOME/ `

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

konsole --noclose -e geteltorito -o "$VAROUT".boot /dev/cdrom
exit
else
echo continua
fi


OPENFILE=`kdialog --icon /usr/share/pixmaps/aiso2.png --caption "Select ISO to extract boot image from" --getopenfilename $HOME/ "*.iso |ISO Image"`

if test -z $OPENFILE
then
rm -rf $HOME/virtual-drives/tmp
exit
else
echo continua
fi

VAROUT2=`kdialog --icon /usr/share/pixmaps/aiso2.png --caption "Select where to Save Boot Image and Name!" --getsavefilename $HOME/ `

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

konsole --noclose -e geteltorito -o "$VAROUT2".boot "$OPENFILE"
exit
