slitaz-tools diff tinyutils/burnbox @ rev 366
Burnbox: gui changes, help file and other improvements
author | Rohit Joshi <jozee@slitaz.org> |
---|---|
date | Wed Jul 22 13:26:31 2009 +0000 (2009-07-22) |
parents | cb6c487bb8c3 |
children | a54075776256 |
line diff
1.1 --- a/tinyutils/burnbox Mon May 18 20:23:50 2009 +0000 1.2 +++ b/tinyutils/burnbox Wed Jul 22 13:26:31 2009 +0000 1.3 @@ -8,10 +8,9 @@ 1.4 # Authors : Christophe Lincoln <pankso@slitaz.org> 1.5 # Rohit Joshi <jozee@slitaz.org> 1.6 # 1.7 -VERSION=20090504 1.8 +VERSION=20090529 1.9 TMPDIR="/tmp/burn-cd" 1.10 1.11 - 1.12 chk_install() 1.13 { 1.14 for pkg in $@ 1.15 @@ -26,6 +25,21 @@ 1.16 fi 1.17 } 1.18 1.19 + 1.20 +# Check read write permission for device. 1.21 +chk_rw_permissions() 1.22 +{ 1.23 + xterm -bg gray93 -fg black -geometry 80x16 -title "Check Permission" \ 1.24 + -e ' 1.25 + if [ ! -r "$DEVICE" -o ! -w "$DEVICE" ]; then 1.26 + echo "you dont have read write permission for $DEVICE; trying adding yourself to group cdrom." 1.27 + else 1.28 + echo "you have read write permission for $DEVICE. You can proceed to burn." 1.29 + fi 1.30 + sleep 3; 1.31 + ' 1.32 +} 1.33 + 1.34 # Display audio cd size. 1.35 audio_cd_stats() 1.36 { 1.37 @@ -35,13 +49,14 @@ 1.38 } 1.39 1.40 # Display cd/dvd size. 1.41 -disk_stats() 1.42 +disc_stats() 1.43 { 1.44 - DISK_SIZE=`du -m $TMPDIR | awk '{print $1}'` 1.45 + DISC_SIZE=`du -m $TMPDIR | awk '{print $1}'` 1.46 TRACK_NB=`ls -1 $TMPDIR | wc -l` 1.47 - echo -n "Total size: $DISK_SIZE Mb" 1.48 + echo -n "Total size: $DISC_SIZE Mb" 1.49 } 1.50 1.51 + 1.52 decode_ogg() 1.53 { 1.54 if ls $TMPDIR | grep -q .ogg; then 1.55 @@ -188,7 +203,8 @@ 1.56 burn_iso() 1.57 { 1.58 xterm -bg gray93 -fg black -geometry 80x16 -title "Wodim" \ 1.59 - -e "wodim -v speed=$SPEED dev=$DEVICE $OPTIONS $ISO_IMAGE; sleep 4" 1.60 + -e "wodim -v speed=$SPEED dev=$DEVICE $OPTIONS $ISO_IMAGE; sleep 4 1.61 + " 1.62 } 1.63 # =====AUDIO===== 1.64 # Use -pad to avoid file size error. 1.65 @@ -199,7 +215,8 @@ 1.66 if [ "$UNINSTALLED" = "" ] ; then 1.67 xterm -bg gray93 -fg black -geometry 80x16 -title "Wodim:AUDIO" \ 1.68 -e " echo \"BURN TYPE SELECTED = $BURN_MODE \"; sleep 1; 1.69 - wodim -v speed=$SPEED dev=$DEVICE $OPTIONS -pad -dao -audio $TMPDIR/*.wav; sleep 4 1.70 + wodim -v speed=$SPEED dev=$DEVICE $OPTIONS -pad -dao -audio $TMPDIR/*.wav; sleep 4 1.71 + 1.72 " 1.73 fi 1.74 } 1.75 @@ -211,13 +228,16 @@ 1.76 if [ "$UNINSTALLED" = "" ] ; then 1.77 xterm -bg gray93 -fg black -geometry 80x16 -title "Wodim:CD DATA" \ 1.78 -e " echo \"BURN TYPE SELECTED = $BURN_MODE \"; sleep 1; 1.79 - wodim -v speed=$SPEED dev=$DEVICE $OPTIONS -pad -dao -data $TMPDIR/*; sleep 4 1.80 + wodim -v speed=$SPEED dev=$DEVICE $OPTIONS -pad -dao -data $TMPDIR/*; sleep 4 1.81 + 1.82 " 1.83 - fi 1.84 + fi 1.85 + 1.86 } 1.87 1.88 burn_dvddata() 1.89 { 1.90 + # For multisession support, remove --dvd-compat option 1.91 UNINSTALLED="" 1.92 chk_install "dvd+rw-tools" 1.93 if [ "$UNINSTALLED" = "" ] ; then 1.94 @@ -243,6 +263,7 @@ 1.95 " 1.96 fi 1.97 } 1.98 + 1.99 burn_vcd() 1.100 { 1.101 UNINSTALLED="" 1.102 @@ -275,33 +296,37 @@ 1.103 } 1.104 1.105 # =====CLONE===== 1.106 + 1.107 rip_disc() 1.108 { 1.109 SUGGESTED="cdrkit-isoinfo" 1.110 if ! "$CHECKBOX_FOLDER" ; then SAVE_DISC="/tmp/burn-cd" ; fi 1.111 if [ -d /var/lib/tazpkg/installed/${SUGGESTED} ]; then 1.112 xterm -bg gray93 -fg black -geometry 80x16 -title "dd" \ 1.113 - -e ' echo "RIPPING DISK AT $SAVE_DISC..." 1.114 + -e ' echo "RIPPING DISC $DEVICE AT $SAVE_DISC..." 1.115 COUNT=`isoinfo -d -i $DEVICE | grep "^Volume size is:" | cut -d " " -f 4` 1.116 BLOCK=`isoinfo -d -i $DEVICE | grep "^Logical block size is:" | cut -d " " -f 5` 1.117 dd if=$DEVICE of=$SAVE_DISC/image.iso bs=$BLOCK count=$COUNT; sleep 4 1.118 - sleep 2;' 1.119 + sleep 2; 1.120 + # eject ; 1.121 + ' 1.122 else 1.123 xterm -bg gray93 -fg black -geometry 80x16 -title "dd" \ 1.124 - -e ' echo " Though you dont have the cdrkit-extras package installed, \ 1.125 + -e ' echo " Though you dont have the cdrkit-isoinfo package installed, \ 1.126 you can still rip but it may be slower" 1.127 echo -n "would you like to continue (y/N)? : "; read ans 1.128 if [ "$ans" = "y" ]; then 1.129 - echo "RIPPING DISK AT $SAVE_DISC...." 1.130 + echo "RIPPING DISC $DEVICE AT $SAVE_DISC...." 1.131 dd if=$DEVICE of=$SAVE_DISC/image.iso; 1.132 sleep 2; 1.133 + #eject ; 1.134 fi 1.135 - ' 1.136 + ' 1.137 fi 1.138 if ! "$CHECKBOX_FOLDER" ; then 1.139 ISO_IMAGE="/tmp/burn-cd/image.iso" 1.140 xterm -bg gray93 -fg black -geometry 80x16 -title "dd" \ 1.141 - -e ' echo -e " ---Please insert EMPTY DISK at $DEVICE ---\n ---press ENTER to continue..." && read close;' 1.142 + -e ' echo -e " ---Please insert EMPTY DISC at $DEVICE ---\n ---press ENTER to continue..." && read close;' 1.143 burn_iso 1.144 fi 1.145 } 1.146 @@ -330,27 +355,42 @@ 1.147 esac 1.148 1.149 } 1.150 + 1.151 # Main GTK interface 1.152 MAIN_DIALOG=' 1.153 <window title="SliTaz - Burnbox" icon-name="drive-optical"> 1.154 <vbox> 1.155 1.156 - <notebook labels="General|ISO image or rip| Burn CD/DVD (Audio,Video,Data)"> 1.157 + <notebook labels="General|Burn ISO or Backup Disc| Burn CD/DVD (Audio,Video,Data)"> 1.158 1.159 <vbox> 1.160 <frame Information> 1.161 - <text> 1.162 + 1.163 + <text width_request="250" use-markup="true"> 1.164 <label> 1.165 -"Burn CD, Video CD and DVD using Wodim, Vcdimager and Growisofs. 1.166 - 1.167 -Audio CD use uncompressed WAV (OGG, MP3 are decoded). 1.168 -VCD/SVCD use MPG files (AVI, FLV, MOV, WMV are decoded). 1.169 - 1.170 -Before burning, please verify device writer settings or add options if needed." 1.171 - </label> 1.172 +"Burns iso, backs up CD/DVD, burns data CD/DVD, audio CD, video CD (VCD/SVCD) 1.173 +" 1.174 + </label> 1.175 </text> 1.176 + <hbox> 1.177 + <text use-markup="true"> 1.178 + <label> "<b> Please consult HELP file if needed: </b>" </label> 1.179 + </text> 1.180 + <button> 1.181 + <input file icon="help"></input> 1.182 + <action> firefox /usr/share/doc/burnbox/burnbox.html </action> 1.183 + </button> 1.184 + </hbox> 1.185 + 1.186 </frame> 1.187 <frame Settings> 1.188 + <text> 1.189 + <label> 1.190 +" Before burning, please verify/change device writer settings below if needed. 1.191 +" 1.192 + </label> 1.193 + </text> 1.194 + 1.195 <hbox> 1.196 <text use-markup="true"> 1.197 <label>"<b>Device: </b>"</label> 1.198 @@ -381,7 +421,16 @@ 1.199 <input file icon="help"></input> 1.200 <action>xterm -sb -bg gray93 -fg black -geometry 95x25 -title "wodim help" -e "wodim --help ; echo -e \"----\nENTER to continue...\" && read close"</action> 1.201 </button> 1.202 - </hbox> 1.203 + </hbox> 1.204 + <hbox> 1.205 + <text use-markup="true"> 1.206 + <label> "<b>Check Permission for Device: </b>" </label> 1.207 + </text>' 1.208 + MAIN_DIALOG=${MAIN_DIALOG}" <button> 1.209 + <input file icon=\"dialog-information\"></input> 1.210 + <action>$0 chk_rw_permissions</action> 1.211 + </button> " 1.212 + MAIN_DIALOG=${MAIN_DIALOG}'</hbox> 1.213 </frame> 1.214 <frame Blank CD/DVD-RW> 1.215 <hbox> 1.216 @@ -397,7 +446,7 @@ 1.217 <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.218 </button> 1.219 <button> 1.220 - <label>Blank disk</label> 1.221 + <label>Blank disc</label> 1.222 <input file icon="forward"></input> 1.223 <action>xterm -bg gray93 -fg black -title "Wodim" -e "wodim -v -blank=$BLANK_OPTS dev=$DEVICE; sleep 2"</action> 1.224 </button> 1.225 @@ -406,18 +455,13 @@ 1.226 </vbox> 1.227 1.228 <vbox> 1.229 - <frame Select ISO and burn> 1.230 - 1.231 - <text> 1.232 - <label> 1.233 -" 1.234 -You can create or manipulate ISO images with ISO Master utility 1.235 -or use genisoimage from the command line. 1.236 -" 1.237 - </label> 1.238 - </text> 1.239 - 1.240 - <hbox> 1.241 + <frame Select ISO and burn> 1.242 + <hbox> 1.243 + <text> 1.244 + <label> 1.245 + " " 1.246 + </label> 1.247 + </text> 1.248 <text use-markup="true"> 1.249 <label>"<b>ISO path:</b>"</label> 1.250 </text> 1.251 @@ -425,15 +469,15 @@ 1.252 <variable>ISO_IMAGE</variable> 1.253 </entry> 1.254 <button> 1.255 - <input file stock="gtk-cdrom"></input> 1.256 + <label>Browse</label> 1.257 + <input file stock="gtk-open"></input> 1.258 <action type="fileselect">ISO_IMAGE</action> 1.259 </button> 1.260 - </hbox>' 1.261 + ' 1.262 # Burn iso button. 1.263 MAIN_DIALOG=${MAIN_DIALOG}" 1.264 - <hbox> 1.265 <button> 1.266 - <label>Burn disk</label> 1.267 + <label>Burn ISO</label> 1.268 <input file icon=\"forward\"></input> 1.269 <action>$0 burn_iso</action> 1.270 </button> 1.271 @@ -441,15 +485,15 @@ 1.272 # Backup CD 1.273 MAIN_DIALOG=${MAIN_DIALOG}' 1.274 </frame> 1.275 - <frame Select CD/DVD-RW and rip> 1.276 - <text> 1.277 - <label> 1.278 -"You can also clone or rip a CD/DVD. Just specify the path and click rip disk or use dd from the command line. Input is taken from the DEVICE settings 1.279 -" 1.280 - </label> 1.281 - </text> 1.282 + 1.283 + <frame Data CD/DVD backup > 1.284 + <text> 1.285 + <label> 1.286 + " " 1.287 + </label> 1.288 + </text> 1.289 <checkbox> 1.290 - <label>Save output in folder (Unselect to backup on disc) </label> 1.291 + <label>Save backup on Hard disk (Unselect to backup on CD disc) </label> 1.292 <variable>CHECKBOX_FOLDER</variable> 1.293 <default>true</default> 1.294 <action>if true enable:SAVE_DISC</action> 1.295 @@ -459,30 +503,43 @@ 1.296 </checkbox> 1.297 <hbox> 1.298 <text use-markup="true"> 1.299 - <label>"<b>Output CD/DVD rip at:</b>"</label> 1.300 + <label>"<b> Backup folder:</b>"</label> 1.301 </text> 1.302 <entry accept="directory"> 1.303 - <label>Select a folder to save cloned disk to</label> 1.304 + <label>Select a folder to save cloned disc to</label> 1.305 <variable>SAVE_DISC</variable> 1.306 </entry> 1.307 <button> 1.308 + <label>Browse</label> 1.309 <input file stock="gtk-open"></input> 1.310 <variable>OPENBUTTON</variable> 1.311 <action type="fileselect">SAVE_DISC</action> 1.312 - </button> 1.313 - </hbox> 1.314 + </button> 1.315 ' 1.316 # Burn backup button. 1.317 MAIN_DIALOG=${MAIN_DIALOG}" 1.318 - <hbox> 1.319 - <button> 1.320 - <label>Rip disk</label> 1.321 + <button> 1.322 + <label>Backup DataCD</label> 1.323 + <variable>DATA_RIP</variable> 1.324 <input file icon=\"forward\"></input> 1.325 <action>$0 rip_disc</action> 1.326 </button> 1.327 </hbox>" 1.328 MAIN_DIALOG=${MAIN_DIALOG}' 1.329 </frame> 1.330 + <frame Audio CD backup> 1.331 + <hbox> 1.332 + <text> 1.333 + <label> " audio CD clone using asunder " </label> 1.334 + </text> 1.335 + <button> 1.336 + <label> Backup AudioCD</label> 1.337 + <variable>AUDIO_RIP</variable> 1.338 + <input file icon="forward"></input> 1.339 + <action>asunder</action> 1.340 + </button> 1.341 + </hbox> 1.342 + </frame> 1.343 1.344 </vbox> 1.345 <vbox> 1.346 @@ -500,7 +557,7 @@ 1.347 <frame> 1.348 <hbox> 1.349 <text> 1.350 - <label> Burn type: </label> 1.351 + <label> Select Burn type: </label> 1.352 </text> 1.353 <combobox>' 1.354 tmp2="${MAIN_DIALOG}" 1.355 @@ -529,6 +586,7 @@ 1.356 <variable>NEW_TRACK</variable> 1.357 </entry> 1.358 <button> 1.359 + <label>Browse</label> 1.360 <input file stock=\"gtk-open\"></input> 1.361 <action type=\"fileselect\">NEW_TRACK</action> 1.362 </button> 1.363 @@ -549,6 +607,7 @@ 1.364 <variable>NEW_DIR</variable> 1.365 </entry> 1.366 <button> 1.367 + <label>Browse</label> 1.368 <input file stock=\"gtk-open\"></input> 1.369 <action type=\"fileselect\">NEW_DIR</action> 1.370 </button> 1.371 @@ -578,7 +637,7 @@ 1.372 <action>clear:NEW_DIR</action> 1.373 </button> 1.374 <button> 1.375 - <label>Burn disk</label> 1.376 + <label>Burn disc</label> 1.377 <input file icon=\"forward\"></input> 1.378 <action>$0 burn_disc</action> 1.379 </button>