#!/bin/bash

OPENFILE=`cat $HOME/acetonesm`

rm $HOME/acetonesm

if test ! -e /usr/bin/fuseiso
then
	if test ! -e /usr/local/bin/fuseiso
		then
		kdialog --caption "AcetoneISO2" --error "Please launch AcetoneISO2 and run 'compatibility'"
		exit
		else
		echo continua
		fi
else
echo continua
fi

OPENFILE2=`kdialog --icon /usr/share/pixmaps/aiso2.png --caption "Select Image to be Mounted" --getopenfilename $HOME/ "*.iso *.bin *.img *.mdf *.nrg |All supported Images"`

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


fuseiso "$OPENFILE2" "$OPENFILE" -o nonempty

mkdir "$OPENFILE"/test

if test -e "$OPENFILE"/test
then
rm -rf "$OPENFILE"/test
kdialog --caption "AcetoneISO" --error "Image was not mounted"
exit
else
echo continua
fi

konqueror "$OPENFILE"
exit