slitaz-tools rev 438

Burnbox: improve gui & features; auto-install suggested features if invoked
author Rohit Joshi <jozee@slitaz.org>
date Mon Mar 15 13:18:35 2010 +0000 (2010-03-15)
parents 24e03edc5970
children 4274ddfbdcf6
files tinyutils/burnbox
line diff
     1.1 --- a/tinyutils/burnbox	Mon Mar 15 16:15:02 2010 +0100
     1.2 +++ b/tinyutils/burnbox	Mon Mar 15 13:18:35 2010 +0000
     1.3 @@ -8,7 +8,7 @@
     1.4  # Authors : Christophe Lincoln <pankso@slitaz.org>
     1.5  #           Rohit Joshi <jozee@slitaz.org>
     1.6  #
     1.7 -VERSION=20090722
     1.8 +VERSION=20100315
     1.9  TMPDIR="/tmp/burn-cd"
    1.10  
    1.11  chk_install()
    1.12 @@ -20,19 +20,35 @@
    1.13  		fi			
    1.14  	done 
    1.15  	if [ ! "$UNINSTALLED" = "" ] ; then
    1.16 -		xterm -bg gray93 -fg black -geometry 80x16 -title "INSTALL PACKAGE" \
    1.17 +		xterm -geometry 80x16 -title "INSTALL PACKAGE" \
    1.18  				-e "echo -n \"This option depends on $UNINSTALLED. Please install and try again..\"; sleep 4;"
    1.19  	fi	
    1.20  }
    1.21  
    1.22 +# Auto Install DEPENDS and/or SUGGESTED
    1.23 +install()
    1.24 +{
    1.25 +	#echo "pkgs to install: $1"
    1.26 +	for pkg in $1 ; do
    1.27 +	   # Avoid reinstall
    1.28 +		if [ ! -d /var/lib/tazpkg/installed/"$pkg" ]; then
    1.29 +			xterm -geometry 80x16 -title "INSTALL PACKAGE" \
    1.30 +				-e "	echo \"This option depends on $pkg. Installing $pkg as root: \" ;  subox tazpkg get-install $pkg --forced; sleep 2;
    1.31 +						echo -e \"----\nPress ENTER to close and PROCEED with decoding...\"; read i; exit 0;	"		
    1.32 +		fi
    1.33 +	done
    1.34 +	
    1.35 +}
    1.36 +
    1.37  
    1.38  # Check read write permission for device.
    1.39  chk_rw_permissions()
    1.40  {
    1.41 -	xterm -bg gray93 -fg black -geometry 80x16 -title "Check Permission" \
    1.42 +	xterm -geometry 80x16 -title "Check Permission" \
    1.43  		-e ' 
    1.44  			if [ ! -r "$DEVICE"  -o   ! -w "$DEVICE" ]; then
    1.45 -				echo "You dont have read write permission for $DEVICE; trying adding yourself to group cdrom."					 		
    1.46 +				echo "You dont have read write permission for $DEVICE;  "
    1.47 +				echo "Add yourself to group cdrom: addgroup tux cdrom"								 		
    1.48  			else
    1.49  				echo "You have read write permission for $DEVICE. You can proceed to burn."					
    1.50  			fi
    1.51 @@ -45,15 +61,7 @@
    1.52  {
    1.53  	AUDIO_CD_SIZE=`du -m $TMPDIR | awk '{print $1}'`
    1.54  	TRACK_NB=`ls -1 $TMPDIR | wc -l`
    1.55 -	echo -n "Total tracks: $AUDIO_CD_SIZE Mb"
    1.56 -}
    1.57 -
    1.58 -# Display cd/dvd size.
    1.59 -disc_stats()
    1.60 -{
    1.61 -	DISC_SIZE=`du -m $TMPDIR | awk '{print $1}'`
    1.62 -	TRACK_NB=`ls -1 $TMPDIR | wc -l`
    1.63 -	echo -n "Total size: $DISC_SIZE Mb"
    1.64 +	echo -n "Total $TRACK_NB tracks: $AUDIO_CD_SIZE Mb"
    1.65  }
    1.66  
    1.67  
    1.68 @@ -61,7 +69,7 @@
    1.69  {
    1.70  	if ls $TMPDIR | grep -q .ogg; then
    1.71  		cd $TMPDIR
    1.72 -		xterm -bg gray93 -fg black -geometry 80x16 -title "Oggdec" \
    1.73 +		xterm -geometry 80x16 -title "Oggdec" \
    1.74  			-e 'for i in *.ogg; do oggdec "$i" && rm "$i"; done; sleep 2'
    1.75  	fi
    1.76  }
    1.77 @@ -71,15 +79,12 @@
    1.78  	
    1.79  	if ls $TMPDIR | grep -q .mp3; then
    1.80  		cd $TMPDIR
    1.81 -		UNINSTALLED=""
    1.82 -		chk_install "mpg123"
    1.83 -		if [ "$UNINSTALLED" = "" ] ; then
    1.84 -			xterm -bg gray93 -fg black -geometry 80x16 -title "mpg123" \
    1.85 +		install "mpg123"
    1.86 +		
    1.87 +		xterm -geometry 80x16 -title "mpg123" \
    1.88  				-e 'for file in *.mp3; do 
    1.89 -						mpg123 --rate 44100 --stereo --buffer 3072 --resync -w  `basename "$file" .mp3`.wav "$file" && rm "$file"; 
    1.90 -				  done; sleep 2'
    1.91 -				  
    1.92 -		fi
    1.93 +						mpg123 --rate 44100 --stereo --buffer 3072 --resync -w  `basename "$file" .mp3`.wav "$file" && rm -f "$file"; 
    1.94 +				  done; sleep 2'			  	
    1.95  	fi
    1.96  }
    1.97  
    1.98 @@ -88,11 +93,9 @@
    1.99  	# convert videos into a VCD/SVCD/DVD compatible mpg video format
   1.100  	if ls $TMPDIR | grep -q ".avi\|.mov\|.wmv\|.flv"  ; then
   1.101  		cd $TMPDIR
   1.102 -		UNINSTALLED=""
   1.103 -		chk_install "ffmpeg"
   1.104 +		install "ffmpeg"
   1.105  				
   1.106 -		if [ "$UNINSTALLED" = "" ] ; then
   1.107 -			xterm -bg gray93 -fg black -geometry 80x16 -title "ffmpeg" \
   1.108 +		xterm -geometry 80x16 -title "ffmpeg" \
   1.109  				-e ' echo -n "Select target type (pal-vcd ntsc-vcd pal-svcd ntsc-svcd pal-dvd ntsc-dvd) "; read TARGET_OPTIONS
   1.110  					 for file in *.avi *.wmv *.mov *.flv; do
   1.111  						 ext=`echo "${file##*.}"`
   1.112 @@ -100,7 +103,6 @@
   1.113  					 	 ffmpeg -i "$file" -target "$TARGET_OPTIONS" "$output_file" && rm "$file";
   1.114  					 done; sleep 2;
   1.115  				   '
   1.116 -		fi
   1.117  	fi
   1.118  	
   1.119  
   1.120 @@ -202,7 +204,7 @@
   1.121  # =====ISO=====
   1.122  burn_iso()
   1.123  {
   1.124 -	xterm -bg gray93 -fg black -geometry 80x16 -title "Wodim" \
   1.125 +	xterm -geometry 80x16 -title "Wodim" \
   1.126  		-e "wodim -v speed=$SPEED dev=$DEVICE $OPTIONS $ISO_IMAGE; sleep 4			
   1.127  		"
   1.128  }
   1.129 @@ -210,89 +212,83 @@
   1.130  # Use -pad to avoid file size error.
   1.131  burn_audio()
   1.132  {
   1.133 -	UNINSTALLED=""
   1.134 -	chk_install "cdrkit"
   1.135 -	if [ "$UNINSTALLED" = "" ] ; then
   1.136 -		xterm -bg gray93 -fg black -geometry 80x16 -title "Wodim:AUDIO" \
   1.137 +
   1.138 +	install "cdrkit"
   1.139 +	xterm -geometry 80x16 -title "Wodim:AUDIO" \
   1.140  			-e " echo \"BURN TYPE SELECTED = $BURN_MODE \"; sleep 1;				
   1.141  			 wodim -v speed=$SPEED dev=$DEVICE $OPTIONS -pad -dao -audio $TMPDIR/*.wav; sleep 4 
   1.142  			 
   1.143  		"
   1.144 -	fi
   1.145  }
   1.146  # =====DATA=====
   1.147  burn_cddata()
   1.148  {
   1.149 -	UNINSTALLED=""
   1.150 -	chk_install "cdrkit"
   1.151 -	if [ "$UNINSTALLED" = "" ] ; then
   1.152 -		xterm -bg gray93 -fg black -geometry 80x16 -title "Wodim:CD DATA" \
   1.153 +	
   1.154 +	install "cdrkit"
   1.155 +
   1.156 +	xterm -geometry 80x16 -title "Wodim:CD DATA" \
   1.157  			-e " echo \"BURN TYPE SELECTED = $BURN_MODE \"; sleep 1;
   1.158  				wodim -v speed=$SPEED dev=$DEVICE $OPTIONS -pad -dao -data $TMPDIR/*; sleep 4 
   1.159  				
   1.160  			"
   1.161 -	fi	
   1.162  				
   1.163  }
   1.164  
   1.165  burn_dvddata()
   1.166  {
   1.167  	# For multisession support, remove --dvd-compat option
   1.168 -	UNINSTALLED=""
   1.169 -	chk_install "dvd+rw-tools"
   1.170 -	if [ "$UNINSTALLED" = "" ] ; then
   1.171 -		xterm -bg gray93 -fg black -geometry 80x16 -title "growisofs:DVD DATA" \
   1.172 +	install "dvd+rw-tools"
   1.173 +
   1.174 +	xterm -geometry 80x16 -title "growisofs:DVD DATA" \
   1.175  			-e " echo \"BURN TYPE SELECTED = $BURN_MODE \"; sleep 1;
   1.176  				# no iso-file available
   1.177  				growisofs -dvd-compat -speed=$SPEED -pad -J -r -f -Z  $DEVICE  $TMPDIR/*; sleep 4	
   1.178  				"
   1.179 -	fi	
   1.180  }
   1.181  
   1.182  # ====VIDEO=====
   1.183  burn_dvdvideo()
   1.184  {
   1.185 -	UNINSTALLED=""
   1.186 -	chk_install "dvd+rw-tools"
   1.187 +
   1.188 +	install "dvd+rw-tools"
   1.189  	
   1.190  	# current assumption: compatible dvd-video format
   1.191 -	if [ "$UNINSTALLED" = "" ] ; then
   1.192 -			xterm -bg gray93 -fg black -geometry 80x16 -title "growisofs:DVD VIDEO" \
   1.193 +	xterm -geometry 80x16 -title "growisofs:DVD VIDEO" \
   1.194  			-e " echo \"BURN TYPE SELECTED = $BURN_MODE\"; sleep 1;    
   1.195  			   	 growisofs -dvd-video -udf -pad -J -r -f -Z $DEVICE -speed=$SPEED  $TMPDIR/*; sleep 2
   1.196  				"	
   1.197 -	fi		
   1.198 +		
   1.199  }
   1.200  
   1.201  burn_vcd()
   1.202  {
   1.203 -	UNINSTALLED=""
   1.204 -	chk_install "vcdimager"
   1.205 -	if [ "$UNINSTALLED" = "" ] ; then
   1.206 -		mkdir -p $TMPDIR/vcd
   1.207 -		xterm -bg gray93 -fg black -geometry 80x16 -title "vcdimager:VCD" \
   1.208 +	
   1.209 +	install "vcdimager"
   1.210 +
   1.211 +	mkdir -p $TMPDIR/vcd
   1.212 +		xterm -geometry 80x16 -title "vcdimager:VCD" \
   1.213  			-e " echo \"BURN TYPE SELECTED = $BURN_MODE $UNINSTALLED \"; sleep 1;
   1.214 -				 vcdimager -t vcd2 -l VCD -c $TMPDIR/vcd/vcd.cue -b $TMPDIR/vcd/vcd.bin $TMPDIR/*.mpg; sleep 2; 
   1.215 +			   	 vcdimager -t vcd2 -l VCD -c $TMPDIR/vcd/vcd.cue -b $TMPDIR/vcd/vcd.bin $TMPDIR/*.mpg; sleep 2; 
   1.216  				# cdrdao write --device $DEVICE $TMPDIR/vcd/vcd.cue; sleep 2
   1.217  				  wodim -v speed=$SPEED dev=$DEVICE $OPTIONS -pad -dao cuefile=$TMPDIR/vcd/vcd.cue ; sleep 2				
   1.218  				"	
   1.219 -	fi	
   1.220 +	
   1.221  		
   1.222  }
   1.223  
   1.224  burn_svcd()
   1.225  {
   1.226 -	UNINSTALLED=""
   1.227 -	chk_install "vcdimager"
   1.228 -	if [ "$UNINSTALLED" = "" ] ; then
   1.229 -		mkdir -p $TMPDIR/svcd
   1.230 -		xterm -bg gray93 -fg black -geometry 80x16 -title "vcdimager:SVCD" \
   1.231 +	
   1.232 +	install "vcdimager"
   1.233 +
   1.234 +	mkdir -p $TMPDIR/svcd
   1.235 +		xterm -geometry 80x16 -title "vcdimager:SVCD" \
   1.236  			-e " echo \"BURN TYPE SELECTED = $BURN_MODE\"
   1.237  				  vcdimager -t svcd -l SVCD -c $TMPDIR/svcd/svcd.cue -b $TMPDIR/svcd/svcd.bin $TMPDIR/*.mpg; sleep 2; 
   1.238  				 # cdrdao write --device $DEVICE $TMPDIR/svcd/svcd.cue; sleep 2;
   1.239  				 wodim -v speed=$SPEED dev=$DEVICE $OPTIONS -pad -dao cuefile=$TMPDIR/svcd/svcd.cue ; sleep 2
   1.240  				"	
   1.241 -	fi	
   1.242 +	
   1.243  }
   1.244  
   1.245  # =====CLONE=====
   1.246 @@ -302,7 +298,7 @@
   1.247  	SUGGESTED="cdrkit-isoinfo"
   1.248  	if ! "$CHECKBOX_FOLDER" ; then SAVE_DISC="/tmp/burn-cd" ; fi	
   1.249  	if [ -d /var/lib/tazpkg/installed/${SUGGESTED} ]; then
   1.250 -		xterm -bg gray93 -fg black -geometry 80x16 -title "dd" \
   1.251 +		xterm -geometry 80x16 -title "dd" \
   1.252  			-e ' echo "RIPPING DISC $DEVICE AT $SAVE_DISC..."
   1.253  				 COUNT=`isoinfo -d -i $DEVICE | grep "^Volume size is:" | cut -d " " -f 4`
   1.254  				 BLOCK=`isoinfo -d -i $DEVICE | grep "^Logical block size is:" | cut -d " " -f 5`
   1.255 @@ -311,7 +307,7 @@
   1.256  				# eject ;
   1.257  			   '
   1.258  	else 
   1.259 -		xterm -bg gray93 -fg black -geometry 80x16 -title "dd" \
   1.260 +		xterm -geometry 80x16 -title "dd" \
   1.261  			-e '   echo "Though you dont have the cdrkit-isoinfo package installed, \
   1.262  				          you can still rip but it may be slower."
   1.263  					echo -n "Would you like to continue (y/N)? : "; read ans
   1.264 @@ -325,7 +321,7 @@
   1.265  	fi	
   1.266  	if ! "$CHECKBOX_FOLDER" ; then 
   1.267  				ISO_IMAGE="/tmp/burn-cd/image.iso"
   1.268 -				xterm -bg gray93 -fg black -geometry 80x16 -title "dd" \
   1.269 +				xterm -geometry 80x16 -title "dd" \
   1.270  			-e ' echo -e " ---Please insert EMPTY DISC at $DEVICE ---\n ---press ENTER to continue..." && read close;'
   1.271  				burn_iso
   1.272  	fi
   1.273 @@ -333,7 +329,7 @@
   1.274  
   1.275  blank_dvd()
   1.276  {
   1.277 -	xterm -bg gray93 -fg black -geometry 80x16 -title "growisofs:DVD ERASE" \
   1.278 +	xterm -geometry 80x16 -title "growisofs:DVD ERASE" \
   1.279  		-e "growisofs -Z $DEVICE=/dev/zero"
   1.280  }
   1.281  
   1.282 @@ -356,202 +352,33 @@
   1.283  		
   1.284  }
   1.285  
   1.286 +track_list()
   1.287 +{
   1.288 +	for file in `ls $TMPDIR` ; do
   1.289 +		track_size=`du -m $TMPDIR/$file | awk '{print $1}'`
   1.290 +		echo "$file | $track_size"	
   1.291 +	done
   1.292 +}
   1.293 +
   1.294 +export BIN=$0
   1.295  # Main GTK interface
   1.296  MAIN_DIALOG='
   1.297  <window title="SliTaz - Burnbox" icon-name="drive-optical">
   1.298  <vbox>
   1.299  
   1.300 -	<notebook labels="General|Burn ISO or Backup Disc| Burn CD/DVD (Audio,Video,Data)">
   1.301 +	<notebook labels=" Burn CD/DVD (Audio,Video,Data)| Backup Disc| Burn ISO | Help/Settings">
   1.302  	
   1.303 -	<vbox>
   1.304 -		<frame Information>
   1.305 -		
   1.306 -			<text width_request="250" use-markup="true">
   1.307 -				<label>
   1.308 -"Burns ISOs, backs up CD/DVDs, burns data CD/DVDs, audio CDs and video CDs (VCD/SVCD)
   1.309 -"
   1.310 -				</label>				
   1.311 -			</text>
   1.312 -			<hbox>
   1.313 -				<text use-markup="true">
   1.314 -					<label> "<b> Please consult HELP file if needed:  </b>"	</label>
   1.315 -				</text>
   1.316 -			  <button>
   1.317 -					<input file icon="help"></input>
   1.318 -					<action> firefox /usr/share/doc/burnbox/burnbox.html </action>
   1.319 -				</button>
   1.320 -				</hbox>
   1.321 -			
   1.322 -		</frame>
   1.323 -		<frame Settings>
   1.324 -		<text>
   1.325 -				<label>
   1.326 -"Before burning, please verify/change device writer settings below if needed.
   1.327 -"
   1.328 -				</label>
   1.329 -		</text>
   1.330 -		
   1.331 -			<hbox>
   1.332 -				<text use-markup="true">
   1.333 -					<label>"<b>Device:     </b>"</label>
   1.334 -				</text>
   1.335 -				<entry>
   1.336 -					<default>/dev/cdrom</default>
   1.337 -					<variable>DEVICE</variable>
   1.338 -				</entry>
   1.339 -			</hbox>
   1.340 -			<hbox>
   1.341 -				<text use-markup="true">
   1.342 -					<label>"<b>Speed:     </b>"</label>
   1.343 -				</text>
   1.344 -				<entry>
   1.345 -					<input>cat /proc/sys/dev/cdrom/info | grep "drive speed" | cut -f 3</input>
   1.346 -					<variable>SPEED</variable>
   1.347 -				</entry>
   1.348 -			</hbox>
   1.349 -			<hbox>
   1.350 -				<text use-markup="true">
   1.351 -					<label>"<b>Options:  </b>"</label>
   1.352 -				</text>
   1.353 -				<entry>
   1.354 -					<default>-eject -multi</default>
   1.355 -					<variable>OPTIONS</variable>
   1.356 -				</entry>
   1.357 -				<button>
   1.358 -					<input file icon="help"></input>
   1.359 -					<action>xterm -sb -bg gray93 -fg black -geometry 95x25 -title "wodim help" -e "wodim --help ; echo -e \"----\nENTER to continue...\" && read close"</action>
   1.360 -				</button>
   1.361 -			</hbox>	
   1.362 -			<hbox>
   1.363 -				<text use-markup="true">
   1.364 -					<label> "<b>Check Permissions for Device:  </b>"	</label>
   1.365 -				</text>' 
   1.366 -		MAIN_DIALOG=${MAIN_DIALOG}"	<button>				
   1.367 -					<input file icon=\"dialog-information\"></input>
   1.368 -					<action>$0 chk_rw_permissions</action>
   1.369 -				</button> "
   1.370 -	   MAIN_DIALOG=${MAIN_DIALOG}'</hbox>		
   1.371 -		</frame>
   1.372 -		<frame Blank CD/DVD-RW>
   1.373 -			<hbox>
   1.374 -				<text use-markup="true">
   1.375 -					<label>"<b>Option:   </b>"</label>
   1.376 -				</text>
   1.377 -				<entry>
   1.378 -					<variable>BLANK_OPTS</variable>
   1.379 -					<default>fast</default>
   1.380 -				</entry>
   1.381 -				<button>
   1.382 -					<input file icon="help"></input>
   1.383 -					<action>xterm -bg gray93 -fg black -geometry 80x15 -title "wodim blank=help" -e "wodim blank=help ; echo -e \"----\nENTER to continue...\" && read close"</action>
   1.384 -				</button>
   1.385 -				<button>
   1.386 -					<label>Blank disc</label>
   1.387 -					<input file icon="forward"></input>
   1.388 -					<action>xterm -bg gray93 -fg black -title "Wodim" -e "wodim -v -blank=$BLANK_OPTS dev=$DEVICE; sleep 2"</action>
   1.389 -				</button>
   1.390 -			</hbox>
   1.391 -		</frame>
   1.392 -	</vbox>
   1.393 -	
   1.394 -	<vbox>
   1.395 -		<frame Select ISO and burn>		
   1.396 -		<hbox>
   1.397 -		  <text>
   1.398 -		<label> 
   1.399 -			"  	" 
   1.400 -		</label>
   1.401 -		</text>
   1.402 -				<text use-markup="true">
   1.403 -					<label>"<b>ISO path:</b>"</label>
   1.404 -				</text>
   1.405 -				<entry>
   1.406 -					<variable>ISO_IMAGE</variable>
   1.407 -				</entry>
   1.408 -				<button>
   1.409 -				    <label>Browse</label>
   1.410 -					<input file stock="gtk-open"></input>
   1.411 -					<action type="fileselect">ISO_IMAGE</action>
   1.412 -				</button>
   1.413 -			'
   1.414 -# Burn iso button.
   1.415 -MAIN_DIALOG=${MAIN_DIALOG}"
   1.416 -				<button>
   1.417 -					<label>Burn ISO</label>
   1.418 -					<input file icon=\"forward\"></input>
   1.419 -					<action>$0 burn_iso</action>
   1.420 -				</button>
   1.421 -			</hbox>"
   1.422 -# Backup CD
   1.423 -MAIN_DIALOG=${MAIN_DIALOG}'
   1.424 -	</frame>
   1.425 -	
   1.426 - <frame Data CD/DVD backup >
   1.427 -   <text>
   1.428 -		<label> 
   1.429 -			"  " 
   1.430 -		</label>
   1.431 -	</text>
   1.432 -			<checkbox>
   1.433 -				<label>Save backup on Hard disk (Unselect to backup on CD disc) </label>
   1.434 -				<variable>CHECKBOX_FOLDER</variable>
   1.435 -				<default>true</default>
   1.436 -				<action>if true enable:SAVE_DISC</action>
   1.437 -				<action>if true enable:OPENBUTTON</action>
   1.438 -				<action>if false disable:SAVE_DISC</action>
   1.439 -				<action>if false disable:OPENBUTTON</action>				
   1.440 -			</checkbox>
   1.441 -			<hbox>
   1.442 -				<text use-markup="true">
   1.443 -					<label>"<b> Backup folder:</b>"</label>
   1.444 -				</text>
   1.445 -				<entry accept="directory">
   1.446 -				<label>Select a folder to save cloned disc to</label>
   1.447 -					<variable>SAVE_DISC</variable>
   1.448 -				</entry>
   1.449 -				<button>
   1.450 -				    <label>Browse</label>
   1.451 -					<input file stock="gtk-open"></input>
   1.452 -					<variable>OPENBUTTON</variable>
   1.453 -					<action type="fileselect">SAVE_DISC</action>
   1.454 -				</button>					
   1.455 -'
   1.456 -# Burn backup button.
   1.457 -MAIN_DIALOG=${MAIN_DIALOG}"
   1.458 -			<button>
   1.459 -					<label>Backup DataCD</label>
   1.460 -					<variable>DATA_RIP</variable>
   1.461 -					<input file icon=\"forward\"></input>
   1.462 -					<action>$0 rip_disc</action>
   1.463 -				</button>
   1.464 -			</hbox>"			
   1.465 -MAIN_DIALOG=${MAIN_DIALOG}'
   1.466 -		</frame>
   1.467 -	<frame Audio CD backup>	  				
   1.468 -			<hbox>
   1.469 -			<text>
   1.470 -				<label> "Clone audio CD using asunder " 	</label>
   1.471 -			</text>
   1.472 -				<button>					
   1.473 -				<label> Backup AudioCD</label>
   1.474 -				<variable>AUDIO_RIP</variable>
   1.475 -				<input file icon="forward"></input>
   1.476 -				<action>asunder</action>
   1.477 -				</button>
   1.478 -	        </hbox>
   1.479 - </frame>
   1.480 -		
   1.481 -	</vbox>
   1.482  	<vbox>	
   1.483  		<tree icon_name="audio-x-generic">
   1.484  			<width>500</width><height>200</height>
   1.485  			<variable>TRACKS_LIST</variable>
   1.486 -			<label>Track name (Double-click to remove a track)</label>
   1.487 -			<input>ls -1 /tmp/burn-cd</input>
   1.488 +			<label>Track name (Double-click to remove a track) | Track Size (Mb)</label>
   1.489 +			<input>$BIN track_list</input>
   1.490  			<action>rm "/tmp/burn-cd/$TRACKS_LIST"</action>
   1.491  			<action>refresh:TRACKS_LIST</action>
   1.492  			<action>refresh:TRACKS_SIZE</action>
   1.493  		</tree>'
   1.494 +		
   1.495  # Select burn audio-cd, data-cd, dvd-video or vcd/svcd		
   1.496  MAIN_DIALOG=${MAIN_DIALOG}'
   1.497     <frame>
   1.498 @@ -644,15 +471,227 @@
   1.499  		</hbox>
   1.500  		</frame>
   1.501  	</vbox> "
   1.502 +
   1.503 +# Backup CD
   1.504 +MAIN_DIALOG=${MAIN_DIALOG}'	
   1.505 +<vbox>	
   1.506 +	
   1.507 +		<text use-markup="true"> 
   1.508 +			<label>
   1.509 +			"
   1.510 +<b>Choose either the Data or the Audio CD backup frame </b>
   1.511 +"
   1.512 +		</label>
   1.513 +		</text> 
   1.514 +	
   1.515 + <frame Data CD/DVD backup >
   1.516 +   <text>
   1.517 +		<label> 
   1.518 +			"  " 
   1.519 +		</label>
   1.520 +	</text>
   1.521 +			<checkbox>
   1.522 +				<label>Save backup on Hard Disk Folder (Unselect to backup on CD disc)</label>
   1.523 +				<variable>CHECKBOX_FOLDER</variable>
   1.524 +				<default>true</default>
   1.525 +				<action>if true enable:SAVE_DISC</action>
   1.526 +				<action>if true enable:OPENBUTTON</action>
   1.527 +				<action>if false disable:SAVE_DISC</action>
   1.528 +				<action>if false disable:OPENBUTTON</action>				
   1.529 +			</checkbox>
   1.530 +			<hbox>
   1.531 +				<text use-markup="true">
   1.532 +					<label>"      Backup Folder Path:"</label>
   1.533 +				</text>
   1.534 +				<entry accept="directory">
   1.535 +				<label>Select a folder to save cloned disc to</label>
   1.536 +					<variable>SAVE_DISC</variable>
   1.537 +				</entry>
   1.538 +				<button>
   1.539 +				    <label>Browse</label>
   1.540 +					<input file stock="gtk-open"></input>
   1.541 +					<variable>OPENBUTTON</variable>
   1.542 +					<action type="fileselect">SAVE_DISC</action>
   1.543 +				</button>	
   1.544 +				</hbox>				
   1.545 +'
   1.546 +# Burn backup button.
   1.547 +MAIN_DIALOG=${MAIN_DIALOG}"
   1.548 +			<hbox>
   1.549 +			<text>
   1.550 +				<label>\"Proceed to backup your data CD: \" 	</label>
   1.551 +			</text>
   1.552 +			<button>
   1.553 +					<label>Backup DataCD</label>
   1.554 +					<variable>DATA_RIP</variable>
   1.555 +					<input file icon=\"forward\"></input>
   1.556 +					<action>$0 rip_disc</action>
   1.557 +				</button>
   1.558 +			</hbox>
   1.559 +			</frame>"			
   1.560 +MAIN_DIALOG=${MAIN_DIALOG}'		
   1.561 +	<frame Audio CD backup>	
   1.562 +		<text>
   1.563 +			<label> 
   1.564 +				"  " 
   1.565 +			</label>
   1.566 +		</text> 			 				
   1.567 +			<hbox>
   1.568 +			<text>
   1.569 +				<label> "Proceed to clone your audio CD:"</label>
   1.570 +			</text>
   1.571 +				<button>					
   1.572 +				<label> Backup AudioCD</label>
   1.573 +				<variable>AUDIO_RIP</variable>
   1.574 +				<input file icon="forward"></input>
   1.575 +				<action>asunder</action>
   1.576 +				</button>
   1.577 +	        </hbox>
   1.578 + </frame>
   1.579 +		
   1.580 +	</vbox>'
   1.581 +	
   1.582 +MAIN_DIALOG=${MAIN_DIALOG}'
   1.583 +	<vbox>
   1.584 +		<text use-markup="true"> 
   1.585 +			<label>
   1.586 +			"			 
   1.587 +			"
   1.588 +		</label>
   1.589 +		</text> 
   1.590 +		<frame Select ISO and burn>		
   1.591 +		<hbox>
   1.592 +		  <text>
   1.593 +		<label> 
   1.594 +			"  	" 
   1.595 +		</label>
   1.596 +		</text>
   1.597 +				<text use-markup="true">
   1.598 +					<label>"<b>ISO path:</b>"</label>
   1.599 +				</text>
   1.600 +				<entry>
   1.601 +					<variable>ISO_IMAGE</variable>
   1.602 +				</entry>
   1.603 +				<button>
   1.604 +				    <label>Browse</label>
   1.605 +					<input file stock="gtk-open"></input>
   1.606 +					<action type="fileselect">ISO_IMAGE</action>
   1.607 +				</button>
   1.608 +			</hbox>
   1.609 +			'
   1.610 +# Burn iso button.
   1.611 +MAIN_DIALOG=${MAIN_DIALOG}"
   1.612 +			<hbox>
   1.613 +				<button>
   1.614 +					<label>Burn ISO</label>
   1.615 +					<input file icon=\"forward\"></input>
   1.616 +					<action>$0 burn_iso</action>
   1.617 +				</button>
   1.618 +			</hbox>
   1.619 +			</frame>
   1.620 +			</vbox>"
   1.621 +
   1.622 +	
   1.623 +
   1.624  #
   1.625  #				
   1.626  # tmp3=	
   1.627 +MAIN_DIALOG=${MAIN_DIALOG}'
   1.628 +	<vbox>
   1.629 +		<frame Information>
   1.630 +		
   1.631 +			<text width_request="250" use-markup="true">
   1.632 +				<label>
   1.633 +"Burns ISOs, backs up CD/DVDs, burns data CD/DVDs, audio CDs and video CDs (VCD/SVCD)
   1.634 +"
   1.635 +				</label>				
   1.636 +			</text>
   1.637 +			<hbox>
   1.638 +				<text use-markup="true">
   1.639 +					<label> "<b> Please consult HELP file if needed:  </b>"	</label>
   1.640 +				</text>
   1.641 +			  <button>
   1.642 +					<input file icon="help"></input>
   1.643 +					<action> firefox /usr/share/doc/burnbox/burnbox.html </action>
   1.644 +				</button>
   1.645 +				</hbox>
   1.646 +			
   1.647 +		</frame>
   1.648 +		<frame Settings>
   1.649 +		<text>
   1.650 +				<label>
   1.651 +"Before burning, please verify/change device writer settings below if needed.
   1.652 +"
   1.653 +				</label>
   1.654 +		</text>
   1.655 +		
   1.656 +			<hbox>
   1.657 +				<text use-markup="true">
   1.658 +					<label>"<b>Device:     </b>"</label>
   1.659 +				</text>
   1.660 +				<entry>
   1.661 +					<default>/dev/cdrom</default>
   1.662 +					<variable>DEVICE</variable>
   1.663 +				</entry>
   1.664 +			</hbox>
   1.665 +			<hbox>
   1.666 +				<text use-markup="true">
   1.667 +					<label>"<b>Speed:     </b>"</label>
   1.668 +				</text>
   1.669 +				<entry>
   1.670 +					<input>cat /proc/sys/dev/cdrom/info | grep "drive speed" | cut -f 3</input>
   1.671 +					<variable>SPEED</variable>
   1.672 +				</entry>
   1.673 +			</hbox>
   1.674 +			<hbox>
   1.675 +				<text use-markup="true">
   1.676 +					<label>"<b>Options:  </b>"</label>
   1.677 +				</text>
   1.678 +				<entry>
   1.679 +					<default>-eject -multi</default>
   1.680 +					<variable>OPTIONS</variable>
   1.681 +				</entry>
   1.682 +				<button>
   1.683 +					<input file icon="help"></input>
   1.684 +					<action>xterm -sb -geometry 95x25 -title "wodim help" -e "wodim --help ; echo -e \"----\nENTER to continue...\" && read close"</action>
   1.685 +				</button>
   1.686 +			</hbox>	'
   1.687 +			
   1.688 +	   MAIN_DIALOG=${MAIN_DIALOG}'		
   1.689 +		</frame>
   1.690 +		<frame Blank CD/DVD-RW>
   1.691 +			<hbox>
   1.692 +				<text use-markup="true">
   1.693 +					<label>"<b>Option:   </b>"</label>
   1.694 +				</text>
   1.695 +				<entry>
   1.696 +					<variable>BLANK_OPTS</variable>
   1.697 +					<default>fast</default>
   1.698 +				</entry>
   1.699 +				<button>
   1.700 +					<input file icon="help"></input>
   1.701 +					<action>xterm -geometry 80x16 -title "wodim blank=help" -e "wodim blank=help ; echo -e \"----\nENTER to continue...\" && read close"</action>
   1.702 +				</button>
   1.703 +				<button>
   1.704 +					<label>Blank disc</label>
   1.705 +					<input file icon="forward"></input>
   1.706 +					<action>xterm -title "Wodim" -e "wodim -v -blank=$BLANK_OPTS dev=$DEVICE; sleep 2"</action>
   1.707 +				</button>
   1.708 +			</hbox>
   1.709 +		</frame>
   1.710 +	</vbox>'
   1.711  export MAIN_DIALOG=${MAIN_DIALOG}'
   1.712  	
   1.713 -	</notebook>
   1.714 -	
   1.715 -	<hbox>
   1.716 -		<button>
   1.717 +	</notebook>' 
   1.718 +	MAIN_DIALOG=${MAIN_DIALOG}"<hbox>
   1.719 +			<button>				
   1.720 +					<input file icon=\"dialog-information\"></input>
   1.721 +					<label> Check Permissions for Device</label>
   1.722 +					<action>$0 chk_rw_permissions</action>
   1.723 +				</button> 
   1.724 +				"
   1.725 +	MAIN_DIALOG=${MAIN_DIALOG}'
   1.726 +			<button>
   1.727  			<label>Exit</label>
   1.728  			<input file icon="exit"></input>
   1.729  			<action type="exit">Exit</action>