home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 September - Disc 1 / PCNET_CD_2006_09.iso / linux / puppy-barebones-2.01r2.iso / pup_201.sfs / usr / local / bin / tkdvd < prev    next >
Encoding:
Text File  |  2006-07-08  |  84.7 KB  |  1,685 lines

  1. #!/bin/sh
  2. # the next line restarts using wish \
  3. exec wish "$0" "$@"
  4.  
  5. #    Copyright 2003 Regis Damongeot
  6.  
  7. #    This program is free software; you can redistribute it and/or modify
  8. #    it under the terms of the GNU General Public License as published by
  9. #    the Free Software Foundation; either version 2 of the License, or
  10. #    (at your option) any later version.
  11. #
  12. #    This program is distributed in the hope that it will be useful,
  13. #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. #    GNU General Public License for more details.
  16. #
  17. #    You should have received a copy of the GNU General Public License
  18. #    along with this program; if not, write to the Free Software
  19. #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  20.  
  21.  
  22. #window title
  23. wm title . "TkDVD 4.0.1"
  24. wm geometry . 700x550
  25. wm protocol . WM_DELETE_WINDOW { save_options; destroy . }
  26. set burn_type "burn_dvd"
  27. set v_create_iso "no"
  28. set burning_device "/dev/sr0"
  29. #used when creating ISO to save CD/DVD device
  30. set temp_burning_device ""
  31. set burn_command "growisofs"
  32. set volume_id ""
  33. set volume_id_o ""
  34. set option_udf_ext ""
  35. set option_joliet_ext "-J"
  36. set option_rr_ext "-r"
  37. set option_pad "-pad"
  38. set file_list ""
  39. set excluded_file_list ""
  40. set only_one_file ""
  41. set input ""
  42. set total_file_size_f "0 KB"
  43. set space_left_f "4.377 GB"
  44. set dvd_size "4589850"
  45. set selected_directory "[pwd]"
  46. set iso_file ""
  47. set t_session "-use-the-force-luke=tty -Z"
  48. set option_dvd_compat "-dvd-compat"
  49. set option_auto_refresh_space "1"
  50. set option_overburn ""
  51. set option_eject_cd ""
  52. set burn_speed ""
  53. set language "English"
  54. set i18n_language_list ""
  55. set command_line "growisofs $t_session $burning_device $option_joliet_ext $option_rr_ext $burn_speed $option_dvd_compat $option_pad -graft-points"
  56. #needed to not have too large precision when showing total files size
  57. set tcl_precision 4
  58.  
  59. #set fullpath to source scripts (if TkDVD not launch from it install direcotory)
  60. set source_directory "[info script]"
  61. if { [file pathtype $source_directory] == "absolute" } {
  62.     set source_directory [file dirname $source_directory]
  63. } else {
  64.     set source_directory "[file dirname [pwd]/[info script]]"
  65. }
  66.  
  67. #we need to set a variable to fix compatibility problems between tcl 8.4 and 8.5
  68. # 8.5 has a tristate value for checkbuttons which is by default "" that conflits with offvalue for TkDVD advanced options
  69. # so we need to set a different tristate value with -tristatevalue option but, as tk 8.4 doesn't have this option, we must not set this option in this case. So a global variable set to "" when tk 8.4 is detected and set to "-tristatevalue "tristate"" will do the job.
  70. set tristatecompatibility "no"
  71. if { [string equal -length 3 $tk_patchLevel "8.5"] == 1 } {
  72.   set tristatecompatibility "yes"
  73. }
  74.  
  75. #source combobox code
  76. # BK if { [catch { package require combobox 2.3 } ] } {
  77. # BK }
  78. catch { package require combobox 2.3 }
  79.  
  80. #source save/load config options procedure
  81.  #    Copyright 2003 Regis Damongeot
  82.  
  83. #    This program is free software; you can redistribute it and/or modify
  84. #    it under the terms of the GNU General Public License as published by
  85. #    the Free Software Foundation; either version 2 of the License, or
  86. #    (at your option) any later version.
  87. #
  88. #    This program is distributed in the hope that it will be useful,
  89. #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  90. #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  91. #    GNU General Public License for more details.
  92. #
  93. #    You should have received a copy of the GNU General Public License
  94. #    along with this program; if not, write to the Free Software
  95. #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  96.  
  97. set current_version "3.8"
  98.  
  99. proc save_options {} {
  100.     global current_version dvd_size env burning_device option_auto_refresh_space language
  101.     #puts "saving ver $current_version and dvdsize $dvd_size"
  102.     check_config_file_exist
  103.     set config_file [open $env(HOME)/.tkdvd/config w]
  104.     puts $config_file "version = $current_version"
  105.     puts $config_file "dvd_size = $dvd_size"
  106.     puts $config_file "option_auto_refresh_space = $option_auto_refresh_space"
  107.     puts $config_file "language = $language"
  108.     #when "create iso image" is selected, burning_device is equal to the path of the image and so it should not be saved
  109.     if {![string compare -length 3 $burning_device "/dev"]} {
  110.         puts $config_file "burning_device = $burning_device"
  111.     } else {
  112.         puts $config_file "burning_device = /dev/sr0"
  113.     }
  114.     close $config_file
  115. }
  116.  
  117. proc load_options {} {
  118.     global env current_version space_left_f dvd_size burning_device temp_burning_device option_auto_refresh_space language
  119.     set config_version ""
  120.     set string_temp ""
  121.     check_config_file_exist
  122.     set config_file [open $env(HOME)/.tkdvd/config r]
  123.     while { ! [eof $config_file] } {
  124.         gets $config_file string_temp
  125.         if { [lindex $string_temp 0] == "version" } {
  126.             if {([lindex $string_temp end] == $current_version) || ([lindex $string_temp end] == "3.6") } {
  127.                 set config_version $current_version
  128.             } else {
  129.                 update_version_config_file [lindex $string_temp end]
  130.                 set config_version [lindex $string_temp end]
  131.             }
  132.         }
  133.         if {[lindex $string_temp 0] == "dvd_size"} {
  134.             set dvd_size [lindex $string_temp end]
  135.             #puts "dvd size found when loading settings: $dvd_size"
  136.         }
  137.         if {[lindex $string_temp 0] == "burning_device"} {
  138.             set burning_device [lindex $string_temp end]
  139.             set temp_burning_device "$burning_device"
  140.         }
  141.         if {[lindex $string_temp 0] == "option_auto_refresh_space"} {
  142.             set option_auto_refresh_space [lindex $string_temp end]
  143.         }
  144.         if {[lindex $string_temp 0] == "language"} {
  145.             set language [lindex $string_temp end]
  146.         }
  147.  
  148.     }
  149.     if { [eof $config_file] && (($dvd_size != "4589850") && ($dvd_size != "8300790") && ($dvd_size != "665600") && ($dvd_size != "716800") ) } {
  150.         #puts "cant find dvd_size variable in config file, setting to default"
  151.         set dvd_size "4589850"
  152.     }
  153.     #puts "found tkdvd config ver $config_version and dvdsize $dvd_size"
  154.  
  155.     close $config_file
  156. }
  157.  
  158. proc check_config_file_exist {} {
  159.     global env current_version
  160.     if { ! [file exists "$env(HOME)/.tkdvd/config"] } {
  161.         if { ! [file isdirectory "$env(HOME)/.tkdvd"] } {
  162.             #puts "creating ~/.tkdvd"
  163.             exec mkdir $env(HOME)/.tkdvd
  164.         }
  165.         if { ! [file exists "$env(HOME)/.tkdvd/config"] } {
  166.             #puts "tkdvd config file doesnt exist, creating it"
  167.             exec touch $env(HOME)/.tkdvd/config
  168.         }
  169.         save_options
  170.         #set config_file [open $env(HOME)/.tkdvd/config w]
  171.         #puts $config_file "version = $current_version"
  172.         #puts $config_file "dvd_size = 4589850"
  173.         #close $config_file
  174.     }
  175. }
  176.  
  177. proc update_version_config_file { old_version } {
  178.     global current_version env dvd_size
  179.     #puts "updating config file from $old_version to $current_version"
  180.     #for updating, just load previous version options and call save_options proc
  181.     if { $old_version == "2.8" } {
  182.         set config_file [open $env(HOME)/.tkdvd/config r]
  183.         set string_temp ""
  184.         while {! [eof $config_file]} {
  185.             gets $config_file string_temp
  186.             puts "$string_temp"
  187.             if {[lindex $string_temp 0] == "dvd_size"} {
  188.                 set dvd_size [lindex $string_temp end]
  189.             }
  190.         }
  191.         close $config_file
  192.         save_options
  193.     } elseif { $old_version == "3.2" } {
  194.         #no special change so we load option classically
  195.     }
  196. }
  197. #load user default options
  198. load_options
  199. #change command line variable according to loaded values
  200. set command_line "growisofs $t_session $burning_device $option_joliet_ext $option_rr_ext $option_dvd_compat $option_pad -graft-points"
  201. #source internationalisation variables
  202.  #    Copyright 2003 Regis Damongeot
  203.  
  204. #    This program is free software; you can redistribute it and/or modify
  205. #    it under the terms of the GNU General Public License as published by
  206. #    the Free Software Foundation; either version 2 of the License, or
  207. #    (at your option) any later version.
  208. #
  209. #    This program is distributed in the hope that it will be useful,
  210. #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  211. #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  212. #    GNU General Public License for more details.
  213. #
  214. #    You should have received a copy of the GNU General Public License
  215. #    along with this program; if not, write to the Free Software
  216. #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  217.  
  218.  
  219. # If you want to add your langage, just add langage name to i18n_langage_list and repeat what is done for french langage
  220.  
  221.  
  222. lset i18n_language_list "English"
  223.  
  224. set i18n_step1 "Step 1: Select Files and Folders"
  225. set i18n_step2 "Customize Burning"
  226. set i18n_burn_files_and_folders_on_a_dvd "Burn files and folders on a CD/DVD"
  227. set i18n_only_create_iso9660_image "Only create iso9660 image"
  228. set i18n_burn_iso9660_image "Burn iso9660 image"
  229. set i18n_add_files "Add Files..."
  230. set i18n_add_directory "Add Directory..."
  231. set i18n_delete_file_dir "Delete File/Dir"
  232. set i18n_clear_list "Clear List"
  233. set i18n_excluded_files_dir "Excluded Files..."
  234. set i18n_close "Close"
  235. set i18n_used_space "Used space:"
  236. set i18n_free_space "Free space:"
  237. set i18n_burning_device "Burning device:"
  238. set i18n_volume_name "Volume name:"
  239. set i18n_command "Command:"
  240. set i18n_erase_dvdrw "Erase DVD RW"
  241. set i18n_erase_cdrw "Erase CD-RW"
  242. set i18n_advanced_options_b "Advanced Options..."
  243. set i18n_advanced_options_t "Advanced Options"
  244. set i18n_burn "Burn"
  245. set i18n_filesystem_extensions "Filesystem extensions:"
  246. set i18n_add_joliet_extensions "Add Joliet extensions (-J)"
  247. set i18n_rock_ridge_extensions "Rock Ridge extensions:"
  248. set i18n_off "Off"
  249. set i18n_rr_extensions "RR extensions (-R)"
  250. set i18n_anonymous_rr_extensions "Anonymous RR extensions (all files set to r--r--r-- or +x if executable) (-r)"
  251. set i18n_udf_extensions "UDF extensions:"
  252. set i18n_udf_extensions_radiobutton "UDF extensions (-udf)"
  253. set i18n_dvd_video_compliant_udf_filesystem "DVD Video complient UDF filesystem (-dvd-video)"
  254. set i18n_dvd_size "CD/DVD size:"
  255. set i18n_other_options "Other options:"
  256. set i18n_burning_speed "Burning speed, leave blank for maximum speed (-speed=X)"
  257. set i18n_overburn "Overburn (-overburn)"
  258. set i18n_pad "Pad (-pad)"
  259. set i18n_add_session_to_disc "Add session to disc (-M)"
  260. set i18n_maximum_media_compatibility "Maximum media compatibility (if DVD R => create single session closed disc) (-dvd-compat)"
  261. set i18n_eject_cd_after_burning "Eject CD after burning"
  262. set i18n_automaticaly_refresh_used_space "Automaticaly refresh used space (may take a lot of time)"
  263. set i18n_open "Open..."
  264. set i18n_growisofs_mkisofs_output "growisofs/mkisofs/cdrecord output"
  265. set i18n_update "Update"
  266. set i18n_select_iso_image "Select ISO Image"
  267. set i18n_erase "Erase"
  268. set i18n_full_format "Full format (-blank=full)"
  269. set i18n_full_format_cd "Full format (blank=all)"
  270. set i18n_normal_format "Normal format (-force)"
  271. set i18n_quick_format "Quick format"
  272. set i18n_quick_format_cd "Quick format (blank=fast)"
  273. set i18n_writing_finished "Writing finished"
  274. set i18n_load_file_list "Load file list"
  275. set i18n_save_file_list "Save file list"
  276. set i18n_error_filelist_empty "File list is empty"
  277. set i18n_error "Error"
  278. set i18n_dvd_copy "DVD Copy"
  279. set i18n_cd_copy "CD Copy"
  280. set i18n_copy "Copy"
  281. set i18n_choose_source_device "Choose source device:"
  282. set i18n_quit "Quit"
  283. set i18n_create_iso_from_dvd "Create ISO image from DVD"
  284. set i18n_create_iso_from_cd "Create ISO image from CD"
  285. set i18n_choose_target_file "Choose target file..."
  286. set i18n_create "Create"
  287. set i18n_error_target_file_ns "Target file not specified"
  288. set i18n_error_directory_already_present "This directory is already present in file list"
  289. set i18n_quest_directory_contained "This directory is already contained in another directory in the file list. Add it anyway?"
  290. set i18n_quest_directory_contains "This directory contains files or directorys already present in file list. Add it anyway?"
  291. set i18n_error_file_already_present "The following file is already present in file list"
  292. set i18n_quest_file_contained "The following file is already contained in a directory of the file list. Add it anyway?"
  293. set i18n_error_directory_not_present "This directory is not present in file list"
  294. set i18n_error_file_not_present "This file is not present in file list"
  295. set i18n_error_adding_ef "This file or directory  is already in excluded file list, contains already added files or directory in this list or is contained by an already added directory"
  296.  
  297.  
  298.  
  299. lappend i18n_language_list "French"
  300. if { "$language" == "French" } {
  301.     set i18n_step1 "Etape 1: Selection des fichiers et des dossiers"
  302.     set i18n_step2 "Options de gravure"
  303.     set i18n_burn_files_and_folders_on_a_dvd "Graver les fichiers et les dossiers sur un CD/DVD"
  304.     set i18n_only_create_iso9660_image "Cr├⌐er une image ISO"
  305.     set i18n_burn_iso9660_image "Graver une image ISO"
  306.     set i18n_add_files "Ajouter fichiers..."
  307.     set i18n_add_directory "Ajouter dossier..."
  308.     set i18n_delete_file_dir "Supprimer"
  309.     set i18n_clear_list "Vider la liste"
  310.     set i18n_excluded_files_dir "Fichiers exclus..."
  311.     set i18n_close "Fermer"
  312.     set i18n_used_space "Espace utilis├⌐:"
  313.     set i18n_free_space "Espace libre:"
  314.     set i18n_burning_device "P├⌐riph├⌐rique:"
  315.     set i18n_volume_name "Nom de volume:"
  316.     set i18n_command "Commande:"
  317.     set i18n_erase_dvdrw "Effacer un DVD RW"
  318.     set i18n_erase_cdrw "Effacer un CD-RW"
  319.     set i18n_advanced_options_b "Options avanc├⌐es..."
  320.     set i18n_advanced_options_t "Options avanc├⌐es"
  321.     set i18n_burn "Graver"
  322.     set i18n_filesystem_extensions "Extensions du syst├¿me de fichier:"
  323.     set i18n_add_joliet_extensions "Ajouter les extensions Joliet (-J)"
  324.     set i18n_rock_ridge_extensions "Extensions Rock Ridge:"
  325.     set i18n_off "D├⌐sactiver"
  326.     set i18n_rr_extensions "Extensions RR (-R)"
  327.     set i18n_anonymous_rr_extensions "Extensions RR anonymes (droits r--r--r-- ou +x si executable) (-r)"
  328.     set i18n_udf_extensions "Extensions UDF:"
  329.     set i18n_udf_extensions_radiobutton "Extensions UDF (-udf)"
  330.     set i18n_dvd_video_compliant_udf_filesystem "Extensions UDF en conformance avec le standard DVD Video (-dvd-video)"
  331.     set i18n_dvd_size "Taille des CD/DVD:"
  332.     set i18n_other_options "Autres options:"
  333.     set i18n_burning_speed "Vitesse de gravure, laisser vide pour vitesse maximum (-speed=X)"
  334.     set i18n_overburn "Overburn (-overburn)"
  335.     set i18n_pad "Pad (-pad)"
  336.     set i18n_add_session_to_disc "Ajouter une session au disque courant (-M)"
  337.     set i18n_maximum_media_compatibility "Compatibilit├⌐ maximum (si DVD R => cr├⌐ation d'un disque monosession ferm├⌐) (-dvd-compat)"
  338.     set i18n_eject_cd_after_burning "Ejecter le CD apr├¿s la gravure"
  339.     set i18n_automaticaly_refresh_used_space "Rafraichissement automatique de l'espace disque utilis├⌐ (peut prendre beaucoup de temps)"
  340.     set i18n_open "Ouvrir..."
  341.     set i18n_growisofs_mkisofs_output "Sortie de growisofs/mkisofs/cdrecord"
  342.     set i18n_update "Rafraichir"
  343.     set i18n_select_iso_image "Selectionner l'image ISO"
  344.     set i18n_erase "Effacer"
  345.     set i18n_full_format "Formattage complet (-blank=full)"
  346.     set i18n_full_format_cd "Formattage complet (blank=all)"
  347.     set i18n_normal_format "Formattage normal (-force)"
  348.     set i18n_quick_format "Formattage rapide"
  349.     set i18n_quick_format_cd "Formattage rapide (blank=fast)"
  350.     set i18n_writing_finished "Op├⌐ration termin├⌐e"
  351.     set i18n_load_file_list "Charger une liste de fichiers"
  352.     set i18n_save_file_list "Sauvegarder la liste de fichiers"
  353.     set i18n_error_filelist_empty "La liste des fichiers ├á graver est vide"
  354.     set i18n_error "Erreur"
  355.     set i18n_dvd_copy "Copier un DVD"
  356.     set i18n_cd_copy "Copier un CD"
  357.     set i18n_copy "Copier"
  358.     set i18n_choose_source_device "Choisissez le p├⌐riph├⌐rique source:"
  359.     set i18n_quit "Quitter"
  360.     set i18n_create_iso_from_dvd "Cr├⌐er une image ISO ├á partir d'un DVD"
  361.     set i18n_create_iso_from_cd "Cr├⌐er une image ISO ├á partir d'un CD"
  362.     set i18n_choose_target_file "Choisir le fichier cible..."
  363.     set i18n_create "Cr├⌐er"
  364.     set i18n_error_target_file_ns "Fichier cible non pr├⌐cis├⌐"
  365.     set  i18n_error_directory_already_present "Ce dossier est d├⌐j├á pr├⌐sent dans la liste des fichiers"
  366.     set  i18n_quest_directory_contained "Ce dossier est d├⌐j├á contenu dans un autre dossier de la liste des fichiers. Voulez-vous l'ajouter tout de m├¬me?"
  367.     set  i18n_quest_directory_contains "Ce dossier contient certains fichiers ou dossiers d├⌐j├á pr├⌐sent dans la liste des fichiers. Voulez-vous l'ajouter tout de m├¬me?"
  368.     set  i18n_error_file_already_present "Le fichier suivant est d├⌐j├á pr├⌐sent dans la liste des fichiers"
  369.     set  i18n_quest_file_contained "Le fichier suivant est d├⌐j├á contenu dans un dossier de la liste des fichiers. Voulez-vous l'ajouter tout de m├¬me?"
  370.     set i18n_error_directory_not_present "Ce fichier n'est pas pr├⌐sent dans la liste"
  371.     set i18n_error_file_not_present "Ce fichier n'est pas pr├⌐sent dans la liste"
  372.     set i18n_error_adding_ef "Ce fichier/dossier est d├⌐j├á dans la liste des fichiers exclus, ou bien contient des fichiers d├⌐j├á ajout├⌐ ├á cette liste, ou alors est contenu dans un dossier d├⌐j├á pr├⌐cedement ajout├⌐"
  373. }
  374.  
  375. lappend i18n_language_list "Italian"
  376. if { "$language" == "Italian" } {
  377.     set i18n_step1 "Passo 1: Selezionare File e Directory"
  378.     set i18n_step2 "Personalizza Scrittura"
  379.     set i18n_burn_files_and_folders_on_a_dvd "Scrive file e directory sul CD/DVD"
  380.     set i18n_only_create_iso9660_image "Crea solo immagine iso9660"
  381.     set i18n_burn_iso9660_image "Scrivi immagine iso9660"
  382.     set i18n_add_files "Aggiungi File..."
  383.     set i18n_add_directory "Aggiungi Dir..."
  384.     set i18n_delete_file_dir "Elimina File/Dir"
  385.     set i18n_clear_list "Cancella Lista"
  386.     set i18n_excluded_files_dir "Escludi Files..."
  387.     set i18n_close "Chiudi"
  388.     set i18n_used_space "Spazio Usato:"
  389.     set i18n_free_space "Spazio Libero:"
  390.     set i18n_burning_device "Dispositivo di scrittura:"
  391.     set i18n_volume_name "Nome Volume:"
  392.     set i18n_command "Comando:"
  393.     set i18n_erase_dvdrw "Cancella DVD RW"
  394.     set i18n_erase_cdrw "Cancella CD-RW"
  395.     set i18n_advanced_options_b "Opzioni Avanzate..."
  396.     set i18n_advanced_options_t "Opzioni Avanzate"
  397.     set i18n_burn "Scrivi"
  398.     set i18n_filesystem_extensions "Estensioni del Filesystem:"
  399.     set i18n_add_joliet_extensions "Aggiungi Estesioni Joliet (-J)"
  400.     set i18n_rock_ridge_extensions "Estensioni Rock Ridge:"
  401.     set i18n_off "Inattivo"
  402.     set i18n_rr_extensions "Estensioni RR (-R)"
  403.     set i18n_anonymous_rr_extensions "Estensioni RR Anonime (tutti i file impostati a r--r--r-- o +x se eseguibile) (-r)"
  404.     set i18n_udf_extensions "Estensioni UDF:"
  405.     set i18n_udf_extensions_radiobutton "Estensioni UDF (-udf)"
  406.     set i18n_dvd_video_compliant_udf_filesystem "Filesystem DVD Video compatibile UDF (-dvd-video)"
  407.     set i18n_dvd_size "Dimensione CD/DVD:"
  408.     set i18n_other_options "Altre Opzioni:"
  409.     set i18n_overburn "Overburn (-overburn)"
  410.     set i18n_pad "Pad (-pad)"
  411.     set i18n_add_session_to_disc "Aggiungi sessione al disco (-M)"
  412.     set i18n_maximum_media_compatibility "Massima compatibilita' con i supporti (se DVD R => crea un disco con una sola sessione) (-dvd-compat)"
  413.     set i18n_automaticaly_refresh_used_space "Aggiorna automaticamente lo spazio usato (puo' richiedere molto tempo)"
  414.     set i18n_open "Apri..."
  415.     set i18n_growisofs_mkisofs_output "Output di growisofs/mkisofs/cdrecord"
  416.     set i18n_update "Aggiorna"
  417.     set i18n_select_iso_image "Seleziona un'immagine ISO"
  418.     set i18n_erase "Cancella"
  419.     set i18n_full_format "Formattazione completa (-blank=full)"
  420.     set i18n_full_format_cd "Formattazione completa (blank=all)"
  421.     set i18n_normal_format "Formattazione normale (-force)"
  422.     set i18n_quick_format "Formattazione rapida"
  423.     set i18n_quick_format_cd "Formattazione rapida (blank=fast)"
  424.     set i18n_writing_finished "Scrittura Completata"
  425.     set i18n_load_file_list "Carica lista file"
  426.     set i18n_save_file_list "Salva lista file"
  427.     set i18n_error_filelist_empty "lista file vuota"
  428.     set i18n_error "Errore"
  429.     set i18n_dvd_copy "Copia DVD"
  430.     set i18n_cd_copy "Copia CD"
  431.     set i18n_copy "Copia"
  432.     set i18n_choose_source_device "Scegli periferica di origine:"
  433.     set i18n_quit "Esci"
  434.     set i18n_create_iso_from_dvd "Crea immagineISO da un DVD"
  435.     set i18n_create_iso_from_cd "Crea immagineISO da un CD"
  436.     set i18n_choose_target_file "Scegli file destinazione..."
  437.     set i18n_create "Crea"
  438.     set i18n_error_target_file_ns "File destinazioen non specificato"
  439.     set i18n_error_directory_already_present "Questa direcotry e' gia' presente nella lista"
  440.     set i18n_quest_directory_contained "Questa directory e' gia' contenuta in un'altra presente nella lista. Continuare lo stesso?"
  441.     set i18n_quest_directory_contains "Questa directory contiene file o directory gia' presenti nella lista. Aggiungerla lo stesso?"
  442.     set i18n_error_file_already_present "Il file seguente e' gia' presente nella lista"
  443.     set i18n_quest_file_contained "Il file seguente e' gia' contenuto in una directry della lista. Aggiugnerlo lo stesso?"
  444.     set i18n_error_directory_not_present "Questa directory non e' presente nella lista"
  445.     set i18n_error_file_not_present "Questo file non e' presente nella lista"
  446.     set i18n_error_adding_ef "Questo file/directory e' gia' nella lista delle esclusioni, contiene dei file/directory gia' aggiunti a questa lista o e' contenuto in una directory gia' inserita"
  447. }
  448.  
  449. lappend i18n_language_list "Spanish"
  450. if { "$language" == "Spanish" } {
  451.     set i18n_step1 "Paso 1: Seleccionar archivos y directorios"
  452.     set i18n_step2 "Paso 2: Grabaci├│n personalizada"
  453.     set i18n_burn_files_and_folders_on_a_dvd "Grabar archivos y directorios en el CD/DVD"
  454.     set i18n_only_create_iso9660_image "Solamente crear la imagen ISO9660"
  455.     set i18n_burn_iso9660_image "Grabar la imagen ISO9660"
  456.     set i18n_add_files "A├▒adir archivos"
  457.     set i18n_add_directory "A├▒adir directorios"
  458.     set i18n_delete_file_dir "Borrar archivo"
  459.     set i18n_clear_list "Limpiar lista"
  460.     set i18n_excluded_files_dir "Excluir archivos"
  461.     set i18n_close "Cerrar"
  462.     set i18n_used_space "Espacio usado:"
  463.     set i18n_free_space "Espacio libre:"
  464.     set i18n_burning_device "Dispositivo grabaci├│n:"
  465.     set i18n_volume_name "Nombre del volumen:"
  466.     set i18n_command "Orden:"
  467.     set i18n_erase_dvdrw "Borrar DVD RW"
  468.     set i18n_erase_cdrw "Borrar CD-RW"
  469.     set i18n_advanced_options_b "Opciones avanzadas"
  470.     set i18n_advanced_options_t "Opciones avanzadas"
  471.     set i18n_burn "Grabar"
  472.     set i18n_filesystem_extensions "Opciones detalladas:"
  473.     set i18n_add_joliet_extensions "A├▒adir Joliet (para Windows) (-J)"
  474.     set i18n_rock_ridge_extensions "Rock Ridge:"
  475.     set i18n_off "Apagado"
  476.     set i18n_rr_extensions "RR (-R)"
  477.     set i18n_anonymous_rr_extensions "An├│nimo RR (todos archivos son lecture fija o ejecutable) (-r)"
  478.     set i18n_udf_extensions "UDF:"
  479.     set i18n_udf_extensions_radiobutton "UDF (-udf)"
  480.     set i18n_dvd_video_compliant_udf_filesystem "DVD video UDF (-dvd-video)"
  481.     set i18n_dvd_size "Tama├▒o de CD/DVD:"
  482.     set i18n_other_options "Otras opciones:"
  483.     set i18n_overburn "Permitir overburning (-overburn)"
  484.     set i18n_pad "Pad (-pad)"
  485.     set i18n_add_session_to_disc "A├▒adir sesi├│n a disco (-M)"
  486.     set i18n_maximum_media_compatibility "M├íximo tama├▒o del medio (si DVD R => crear unisesi├│n disco cerrado) (-dvd-compat)"
  487.     set i18n_open "Abrir..."
  488.     set i18n_select_iso_image "Seleccionar la imagen ISO"
  489.     set i18n_erase "Borrar"
  490.     set i18n_full_format "Formato completo (-blank=full)"
  491.     set i18n_full_format_cd "Formato completo (blank=all)"
  492.     set i18n_normal_format "Formato normal (-force)"
  493.     set i18n_quick_format "Formato r├ípido"
  494.     set i18n_quick_format_cd "Formato r├ípido (blank=fast)"
  495.     set i18n_writing_finished "Grabando completo"
  496. }
  497. #source of the total file size count procedure
  498. #    Copyright 2003 Regis Damongeot
  499.  
  500. #    This program is free software; you can redistribute it and/or modify
  501. #    it under the terms of the GNU General Public License as published by
  502. #    the Free Software Foundation; either version 2 of the License, or
  503. #    (at your option) any later version.
  504. #
  505. #    This program is distributed in the hope that it will be useful,
  506. #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  507. #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  508. #    GNU General Public License for more details.
  509. #
  510. #    You should have received a copy of the GNU General Public License
  511. #    along with this program; if not, write to the Free Software
  512. #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  513.  
  514.  
  515. proc refresh_total_file_size {} {
  516.     global file_list total_file_size_f space_left_f command_line t_session excluded_file_list dvd_size 
  517.     #set local var total_file_size_type cause if total_file_size < 1024 octets, total_file_size isnt set
  518.     set total_file_size_type "KB"
  519.     #set local var total_file_size cause if llength $file_list > 1 then $total_file_size is not set for the fisrt iteration of "for"
  520.     set total_file_size 0
  521.     #attention: $total_file_size is in KB to prevent overflow if $total_file_size > 2go
  522.     if {[llength $file_list] == 0} {
  523.         set total_file_size 0
  524.     } elseif { [llength $file_list] == 1 } {
  525.         if {[file isdirectory [lindex $file_list 0]]} {
  526.             set total_file_size [expr [lindex [exec du -ks -- [lindex $file_list 0]] 0] - [file size [lindex $file_list 0]]/1024]
  527.         } else { set total_file_size [expr [file size [lindex $file_list 0]]/1024.] }
  528.     } else {
  529.         for { set i 0 } {$i < [llength $file_list]} {incr i} {
  530.             if {[file isdirectory [lindex $file_list $i]]} {
  531.                 set total_file_size [expr $total_file_size + [expr [lindex [exec du -ks -- [lindex $file_list $i]] 0] - [file size [lindex $file_list 0]]/1024]]
  532.             } else { set total_file_size [expr ($total_file_size + [expr ([file size [lindex $file_list $i]])/1024.])] }
  533.         }
  534.     }
  535.     
  536.     
  537.     foreach i $excluded_file_list {
  538.         if { [file isdirectory $i] } {
  539.             set total_file_size [expr $total_file_size - [exec du -ks $i | cut -f1 ] ]
  540.         } elseif { [file isfile $i] } {
  541.             set total_file_size [expr $total_file_size - ([ file size $i ] / 1024.) ]
  542.         }
  543.     }
  544.     
  545.     
  546.     # save total_file_size in order to reuse it to calculate space_left more easily
  547.     set space_left $total_file_size
  548.     if { $total_file_size > 1048576 } {
  549.         set total_file_size [expr (($total_file_size)/1024.)/1024.]
  550.         set total_file_size_type "GB"
  551.     } elseif { $total_file_size > 1024 } {
  552.         set total_file_size [expr ($total_file_size)/1024.]
  553.         set total_file_size_type "MB"
  554.     } else {
  555.         set total_file_size $total_file_size
  556.         set total_file_size_type "KB"
  557.     }
  558.     set total_file_size_f "$total_file_size $total_file_size_type"
  559.     switch $total_file_size_type  {
  560.         GB {
  561.             set space_left [expr ($dvd_size - $space_left)/1024.]
  562.             set space_left_type "MB"
  563.         }
  564.         MB {
  565.             #if we burn CD we don't want space left to be in GB
  566.             if { $dvd_size == "665600" || $dvd_size == "716800"} {
  567.                 set space_left [expr ($dvd_size - $space_left)/1024.]
  568.                 set space_left_type "MB"
  569.             } else {
  570.                 set space_left [expr (($dvd_size - $space_left)/1024.)/1024.]
  571.                 set space_left_type "GB"
  572.             }
  573.         }
  574.         KB {
  575.             #if we burn CD we don't want space left to be in GB
  576.             if { $dvd_size == "665600" || $dvd_size == "716800"} {
  577.                 set space_left [expr ($dvd_size - $space_left)/1024.]
  578.                 set space_left_type "MB"
  579.             } else {
  580.                 set space_left [expr (($dvd_size - $space_left)/1024.)/1024.]
  581.                 set space_left_type "GB"
  582.             }
  583.         }
  584.     }
  585.     #if {$t_session == "-use-the-force-luke=tty -Z"} {set space_left_f "$space_left $space_left_type"
  586.     #} else {set space_left_f "N/A"}
  587.     set space_left_f "$space_left $space_left_type"
  588. }
  589. #source of the refresh command line procedure (main procedure)
  590. #    Copyright 2003 Regis Damongeot
  591.  
  592. #    This program is free software; you can redistribute it and/or modify
  593. #    it under the terms of the GNU General Public License as published by
  594. #    the Free Software Foundation; either version 2 of the License, or
  595. #    (at your option) any later version.
  596. #
  597. #    This program is distributed in the hope that it will be useful,
  598. #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  599. #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  600. #    GNU General Public License for more details.
  601. #
  602. #    You should have received a copy of the GNU General Public License
  603. #    along with this program; if not, write to the Free Software
  604. #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  605.  
  606.  
  607. proc refresh_cmd_line {} {
  608.     global total_file_size_f option_udf_ext option_joliet_ext option_rr_ext burn_speed file_list volume_id option_pad burn_type command_line t_session burning_device iso_file space_left_f burn_command option_dvd_compat option_overburn excluded_file_list dvd_size v_create_iso option_eject_cd option_tao_dao_cd
  609.     refresh_burning_variables
  610.     set_visible_options
  611.     if { [catch { exec ps -A | grep -v "grep -E" | grep -E "growisofs|cdrecord" }] != 0} {
  612.         if { ($burn_type == "burn_dvd") || ($v_create_iso == "yes") } {
  613.             check_volume_id
  614.             if { [lindex $space_left_f 0] <0 && $option_overburn == "" && $burn_type == "burn_dvd" && $v_create_iso == "no" } {
  615.                 #exact maximum size: 4.37721610069. Although it should be oversized because "du" return > real file size due to indirect blocks its undersized to prevent disallowing burning when beleving overburn is needed while its no the case (anyway growisofs check it)
  616.                 set command_line "You need to enable overburning if you want to burn all theses files"
  617.                 .f_burn.go_button configure -state disabled
  618.             } else {
  619.                 #create list containing excluded files and directories prefixed with -m option
  620.                 set excluded_file_list_t ""
  621.                 foreach i $excluded_file_list {
  622.                     append excluded_file_list_t "-m {$i} "
  623.                     
  624.                 }
  625.  
  626.                 #create local variable that are copy of global ones, used to remove unused option
  627.                 #for exemple, when creating ISO, no need of overburn option
  628.                 #we create local variables to prevent using a lot of "if/else" that only remove theses options when needed because there is already a lot of if else only for CD/DVDs :-(
  629.                 set local_option_overburn "$option_overburn"
  630.                 set local_t_session "$t_session"
  631.                 set local_burn_speed "$burn_speed"
  632.                 set local_option_dvd_compat "$option_dvd_compat"
  633.                 if { $v_create_iso == "yes" } {
  634.                     set local_option_overburn ""
  635.                     set local_t_session ""
  636.                     set local_burn_speed ""
  637.                     set local_option_dvd_compat ""
  638.                 } else {
  639.                     if { $burn_speed != "" } {
  640.                         #for growisofs there is a "-" before speed option while cdrecord doesn't take one
  641.                         if { $dvd_size > 716800 } {
  642.                             set local_burn_speed "-speed=$burn_speed"
  643.                         } else {
  644.                             set local_burn_speed "speed=$burn_speed"
  645.                         }
  646.                     } else {
  647.                         set local_burn_speed ""
  648.                     }
  649.                 }
  650.  
  651.                 #if we burn a DVD-Video UDF complient we need to not modify directory with graft points
  652.                 if {$option_udf_ext != "-dvd-video" } {
  653.                     #if burning a CD, command line is different (pipe between mkisofs and cdrecord)
  654.                     if { $dvd_size <= 716800 &&  $v_create_iso == "no" } {
  655.                         set command_line "[concat $burn_command $volume_id $option_udf_ext $option_joliet_ext $option_rr_ext $option_pad -graft-points $excluded_file_list_t [file_list_w_modif_dir $file_list]] | cdrecord dev=$burning_device $local_burn_speed $option_overburn $option_eject_cd -"
  656.                     } else {
  657.                         set command_line "[concat $burn_command $local_t_session $burning_device $volume_id $option_udf_ext $option_joliet_ext $option_rr_ext $local_burn_speed $local_option_dvd_compat $local_option_overburn $option_pad -graft-points $excluded_file_list_t [file_list_w_modif_dir $file_list]]"
  658.                     }
  659.                 } else {
  660.                     if { $dvd_size <= 716800  && $v_create_iso == "no" } {
  661.                         set command_line "[concat $burn_command $volume_id $option_udf_ext $excluded_file_list_t $file_list] | cdrecord dev=$burning_device $local_burn_speed $option_overburn $option_eject_cd -"
  662.                     } else {
  663.                         set command_line "[concat $burn_command $local_t_session $burning_device $volume_id $option_udf_ext $local_burn_speed $local_option_dvd_compat $local_option_overburn $excluded_file_list_t $file_list]"
  664.                     }
  665.                 }
  666.                 #enable burn button if all OK
  667.                 if { [.f_burn.go_button cget -state] == "disabled" } { .f_burn.go_button configure -state normal }
  668.             }
  669.         } elseif { $burn_type == "burn_iso" } {
  670.             if { $burn_speed != "" } {
  671.                 #for growisofs there is a "-" before speed option while cdrecord doesn't take one
  672.                 if { $dvd_size > 716800 } {
  673.                     set local_burn_speed "-speed=$burn_speed"
  674.                 } else {
  675.                     set local_burn_speed "speed=$burn_speed"
  676.                 }
  677.             } else {
  678.                 set local_burn_speed ""
  679.             }
  680.             if { $dvd_size <= 716800 } {
  681.                 set command_line "$burn_command $option_overburn $local_burn_speed $option_eject_cd  $option_tao_dao_cd dev=$burning_device $iso_file"
  682.             } else {
  683.                 set command_line "$burn_command $option_dvd_compat $local_burn_speed $option_overburn $t_session $burning_device=$iso_file"
  684.             }
  685.             if { [.f_burn.go_button cget -state] == "disabled" } { .f_burn.go_button configure -state normal }
  686.         }
  687.     } else { set command_line "growisofs/cdrecord is currently working" }
  688.     if {($t_session == "-M" && $space_left_f != "N/A") || ($t_session == "-use-the-force-luke=tty -Z" && $space_left_f == "N/A") } { refresh_total_file_size }
  689.     return 1
  690. }
  691. #source of excluded file window and its needed procedures
  692. #    Copyright 2003 Regis Damongeot
  693.  
  694. #    This program is free software; you can redistribute it and/or modify
  695. #    it under the terms of the GNU General Public License as published by
  696. #    the Free Software Foundation; either version 2 of the License, or
  697. #    (at your option) any later version.
  698. #
  699. #    This program is distributed in the hope that it will be useful,
  700. #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  701. #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  702. #    GNU General Public License for more details.
  703. #
  704. #    You should have received a copy of the GNU General Public License
  705. #    along with this program; if not, write to the Free Software
  706. #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  707.  
  708. proc proc_add_excluded_f_d { files_list } {
  709.     global excluded_file_list option_auto_refresh_space i18n_error i18n_error_file_not_present i18n_error_directory_not_present i18n_error_adding_ef
  710.     #if user click on cancel, returned list = ""
  711.     if { $files_list != "" } {
  712.         #foreach needed for multiple files selection
  713.         foreach i $files_list {
  714.             set file_present [file_is_present_or_conatained "$i"]
  715.             set file_present_efl [file_is_present_or_conatained_in_efl "$i"]
  716.             if { $file_present == "no" } {
  717.                 if { [file isfile $i] } {
  718.                     tk_messageBox -icon error -message "$i18n_error_file_not_present" -type ok -title $i18n_error
  719.                 } elseif { [file isdirectory $i] } {
  720.                     tk_messageBox -icon error -message "$i18n_error_directory_not_present" -type ok -title $i18n_error
  721.                 }
  722.             } else {
  723.                 #check if file is not already in excluded file list or contains/contained in (see ile_is_present_or_conatained_in_efl procedure)
  724.                 if { $file_present_efl != "no" } {
  725.                     tk_messageBox -icon error -message "$i18n_error_adding_ef: $i" -type ok -title $i18n_error
  726.                 } else {
  727.                     lappend excluded_file_list $i
  728.                 }
  729.             }
  730.         }
  731.         
  732.         if { $option_auto_refresh_space == "1" } {
  733.             refresh_total_file_size
  734.         }
  735.         refresh_cmd_line
  736.     } else {
  737.     #puts "No file or dir chosen"
  738.     }
  739. }
  740.  
  741. proc delete_excluded_files {} {
  742.     global excluded_file_list option_auto_refresh_space
  743.     if { "[.excluded_file_window.file_list.list curselection]" == "" } {
  744.     } else {
  745.         set excluded_file_list [lreplace $excluded_file_list [.excluded_file_window.file_list.list curselection] [.excluded_file_window.file_list.list curselection]]
  746.         #refresh command line entry after checking space used to check overburn condition
  747.         if { $option_auto_refresh_space == "1" } {
  748.             refresh_total_file_size
  749.         }
  750.         refresh_cmd_line
  751.     }
  752. }
  753.  
  754. proc excluded_file_window {} {
  755.     global excluded_file_list
  756.     #i18n
  757.     global i18n_add_files i18n_add_directory i18n_delete_file_dir i18n_clear_list i18n_close
  758. if { ! [winfo exists .excluded_file_window] } {
  759.     toplevel .excluded_file_window -highlightthickness 1 -highlightcolor blue -background #f5f5f5
  760.     wm title .excluded_file_window "Excluded Files And Directories"
  761.     frame .excluded_file_window.f_buttons
  762.     button .excluded_file_window.f_buttons.b_add_files -highlightbackground red -width 13 -text "$i18n_add_files" -command { proc_add_excluded_f_d [tk_getOpenFile -multiple 1] }
  763.     button .excluded_file_window.f_buttons.b_add_dir -highlightbackground red -width 13 -text "$i18n_add_directory" -command { proc_add_excluded_f_d "{[tk_chooseDirectory -mustexist true]}" }
  764.     button .excluded_file_window.f_buttons.b_del -highlightbackground red -width 13 -text "$i18n_delete_file_dir" -command { delete_excluded_files }
  765.     button .excluded_file_window.f_buttons.b_clear -highlightbackground red -width 13 -text "$i18n_clear_list" -command { set excluded_file_list ""; refresh_total_file_size; refresh_cmd_line }
  766.     button .excluded_file_window.f_buttons.b_close -highlightbackground red -width 13 -text "$i18n_close" -command {destroy .excluded_file_window}
  767.     pack .excluded_file_window.f_buttons.b_add_files .excluded_file_window.f_buttons.b_add_dir .excluded_file_window.f_buttons.b_del .excluded_file_window.f_buttons.b_clear .excluded_file_window.f_buttons.b_close -side left
  768.     pack .excluded_file_window.f_buttons -side top
  769.     
  770.     frame .excluded_file_window.file_list
  771.     listbox .excluded_file_window.file_list.list -bg #f5f5f5 -listvariable excluded_file_list -heigh 15 -yscrollcommand { .excluded_file_window.file_list.scroll_bar set }
  772.     scrollbar .excluded_file_window.file_list.scroll_bar -command { .file_list.list yview }
  773.     pack .excluded_file_window.file_list.scroll_bar -side right -fill y
  774.     pack .excluded_file_window.file_list.list -fill x
  775.     pack .excluded_file_window.file_list -fill both -expand false -side bottom
  776. }
  777. }
  778.  
  779. #source advanced options window procedure
  780. #    Copyright 2003 Regis Damongeot
  781.  
  782. #    This program is free software; you can redistribute it and/or modify
  783. #    it under the terms of the GNU General Public License as published by
  784. #    the Free Software Foundation; either version 2 of the License, or
  785. #    (at your option) any later version.
  786. #
  787. #    This program is distributed in the hope that it will be useful,
  788. #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  789. #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  790. #    GNU General Public License for more details.
  791. #
  792. #    You should have received a copy of the GNU General Public License
  793. #    along with this program; if not, write to the Free Software
  794. #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  795.  
  796. proc advanced_options_window {} {
  797.     global burn_type v_create_iso dvd_size option_auto_refresh_space burn_speed langage tristatecompatibility option_tao_dao_cd
  798.     #i18n variables
  799.     global i18n_filesystem_extensions i18n_add_joliet_extensions i18n_rock_ridge_extensions i18n_off i18n_rr_extensions i18n_anonymous_rr_extensions i18n_udf_extensions i18n_udf_extensions_radiobutton i18n_dvd_video_compliant_udf_filesystem i18n_dvd_size i18n_other_options i18n_burning_speed i18n_overburn i18n_pad i18n_add_session_to_disc i18n_maximum_media_compatibility i18n_automaticaly_refresh_used_space i18n_close i18n_advanced_options_t i18n_eject_cd_after_burning
  800. if { ! [winfo exists .advanced_options_window] } {
  801.     toplevel .advanced_options_window -highlightthickness 1 -highlightcolor blue -background #f5f5f5
  802.     wm title .advanced_options_window "$i18n_advanced_options_t"
  803.     
  804.     #create frame for options buttons
  805.     frame .advanced_options_window.f_fs_ext -background #f5f5f5
  806.     frame .advanced_options_window.options_fs -background #f5f5f5
  807.     frame .advanced_options_window.f_options_rr -background #f5f5f5
  808.     frame .advanced_options_window.f_options_udf -background #f5f5f5
  809.     frame .advanced_options_window.rr_radiobuttons -background #f5f5f5
  810.     frame .advanced_options_window.udf_radiobuttons -background #f5f5f5
  811.     frame .advanced_options_window.f_opts_dvd_size -background #f5f5f5
  812.     frame .advanced_options_window.f_dvd_size -background #f5f5f5
  813.     frame .advanced_options_window.f_opts_dvd -background #f5f5f5
  814.     frame .advanced_options_window.f_opts_cd -background #f5f5f5
  815.     frame .advanced_options_window.f_oth_opts -background #f5f5f5
  816.     frame .advanced_options_window.options_oth -background #f5f5f5
  817.     frame .advanced_options_window.f_langage -background #f5f5f5
  818.     
  819.     label .advanced_options_window.f_fs_ext.label_fs_ext -bg #f5f5f5 -text "$i18n_filesystem_extensions"
  820.     label .advanced_options_window.f_options_rr.label_fs_rr -bg #f5f5f5 -text "$i18n_rock_ridge_extensions"
  821.     label .advanced_options_window.f_options_udf.label_fs_udf -bg #f5f5f5 -text "$i18n_udf_extensions"
  822.     label .advanced_options_window.f_opts_dvd_size.label_dvd_size -bg #f5f5f5 -text "$i18n_dvd_size"
  823.     label .advanced_options_window.f_oth_opts.label_oth_opts -bg #f5f5f5 -text "$i18n_other_options"
  824.     label .advanced_options_window.f_langage.label_langage -bg #f5f5f5 -text "Langage:"
  825.  
  826.     label .advanced_options_window.f_opts_dvd.label_dvd -bg #f5f5f5 -text "DVD:"
  827.     label .advanced_options_window.f_opts_cd.label_cd -bg #f5f5f5 -text "CD:"
  828.     
  829.     checkbutton .advanced_options_window.options_fs.joliet_ext -bg #f5f5f5 -activebackground #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_add_joliet_extensions" -variable option_joliet_ext -offvalue "" -onvalue "-J" -command refresh_cmd_line
  830.     
  831.     checkbutton .advanced_options_window.options_oth.pad -bg #f5f5f5 -activebackground #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_pad" -variable option_pad -offvalue "" -onvalue "-pad"  -command refresh_cmd_line
  832.  
  833.     radiobutton .advanced_options_window.rr_radiobuttons.rr_ext_off -bg #f5f5f5 -activebackground #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_off" -variable option_rr_ext -value "" -command refresh_cmd_line
  834.  
  835.     radiobutton .advanced_options_window.rr_radiobuttons.rr_ext -bg #f5f5f5 -activebackground #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_rr_extensions" -variable option_rr_ext -value "-R"  -command refresh_cmd_line
  836.     
  837.     radiobutton .advanced_options_window.rr_radiobuttons.rra_ext -bg #f5f5f5 -activebackground #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_anonymous_rr_extensions" -variable option_rr_ext -value "-r" -command refresh_cmd_line
  838.     
  839.     radiobutton .advanced_options_window.udf_radiobuttons.udf_ext_off -bg #f5f5f5 -activebackground #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_off" -variable option_udf_ext -value "" -command refresh_cmd_line
  840.     
  841.     radiobutton .advanced_options_window.udf_radiobuttons.udf_ext -bg #f5f5f5 -activebackground #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_udf_extensions_radiobutton" -variable option_udf_ext -value "-udf" -command refresh_cmd_line
  842.     
  843.     radiobutton .advanced_options_window.udf_radiobuttons.dvd_video_ext -bg #f5f5f5 -activebackground #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_dvd_video_compliant_udf_filesystem" -variable option_udf_ext -value "-dvd-video" -command refresh_cmd_line
  844.     
  845.     label .advanced_options_window.options_oth.label_burn_speed -bg #f5f5f5 -activebackground #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_burning_speed"
  846.  
  847.     entry .advanced_options_window.options_oth.entry_burn_speed -relief flat -bg white -highlightbackground blue -highlightcolor blue -disabledbackground #f5f5f5 -state normal -textvariable burn_speed -width 3
  848.  
  849.     checkbutton .advanced_options_window.options_oth.overburn -bg #f5f5f5 -activebackground #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_overburn" -variable option_overburn -offvalue "" -onvalue "-overburn" -command refresh_cmd_line
  850.     
  851.     checkbutton .advanced_options_window.f_opts_dvd.multisession -bg #f5f5f5 -activebackground #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_add_session_to_disc" -variable t_session -offvalue "-use-the-force-luke=tty -Z" -onvalue "-use-the-force-luke=tty -Z -M"  -command refresh_cmd_line
  852.     
  853.     checkbutton .advanced_options_window.f_opts_dvd.monosession -bg #f5f5f5 -activebackground #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_maximum_media_compatibility" -variable option_dvd_compat -offvalue "" -onvalue "-dvd-compat"  -command refresh_cmd_line
  854.     
  855.     radiobutton .advanced_options_window.f_opts_cd.radio_tao  -activebackground #f5f5f5 -background #f5f5f5 -highlightbackground #f5f5f5 -command { refresh_cmd_line } -text "Track at once (-tao)" -variable option_tao_dao_cd  -value "-tao"
  856.  
  857.     radiobutton .advanced_options_window.f_opts_cd.radio_dao  -activebackground #f5f5f5 -background #f5f5f5 -highlightbackground #f5f5f5 -command { refresh_cmd_line } -text "Disk/Session at once (-dao)" -variable option_tao_dao_cd  -value "-dao"
  858.  
  859.     checkbutton .advanced_options_window.f_opts_cd.eject_cd -bg #f5f5f5 -activebackground #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_eject_cd_after_burning" -variable option_eject_cd -offvalue "" -onvalue "-eject"  -command refresh_cmd_line
  860.  
  861.     checkbutton .advanced_options_window.options_oth.auto_refresh_space -bg #f5f5f5 -activebackground #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_automaticaly_refresh_used_space" -variable option_auto_refresh_space -offvalue "0" -onvalue "1" -command {if { $option_auto_refresh_space == "1" } { pack forget .f_upper_file_list.b_update }  else { pack .f_upper_file_list.b_update -side left } }
  862.     
  863.     radiobutton .advanced_options_window.f_dvd_size.cd6  -activebackground #f5f5f5 -background #f5f5f5 -highlightbackground #f5f5f5 -command { refresh_total_file_size; refresh_cmd_line } -text "650 MB" -variable dvd_size -value 665600
  864.  
  865.     radiobutton .advanced_options_window.f_dvd_size.cd7 -activebackground #f5f5f5 -background #f5f5f5 -highlightbackground #f5f5f5 -command { refresh_total_file_size; refresh_cmd_line } -text "700 MB" -variable dvd_size -value 716800
  866.  
  867.     radiobutton .advanced_options_window.f_dvd_size.single_layer  -activebackground #f5f5f5 -background #f5f5f5 -highlightbackground #f5f5f5 -command { refresh_total_file_size; refresh_cmd_line } -text "4.7 GB" -variable dvd_size -value 4589850
  868.     
  869.     radiobutton .advanced_options_window.f_dvd_size.dual_layer  -activebackground #f5f5f5 -background #f5f5f5 -highlightbackground #f5f5f5 -command { refresh_total_file_size; refresh_cmd_line }  -text "8.5 GB (DL)" -variable dvd_size -value 8300790
  870.  
  871.     ::combobox::combobox .advanced_options_window.f_langage.langage_list -listvar i18n_language_list -editable false -textvariable language
  872.     
  873.     
  874.     #button .advanced_options_window.f_dvd_size.b_save -highlightbackground red -text "Save" -command { save_options }
  875.     
  876.     button .advanced_options_window.b_close -highlightbackground red -text "$i18n_close" -command { destroy .advanced_options_window; refresh_cmd_line }
  877.     
  878.     #see TkDVD.sh comments about Tk 8.4/8.5 compatibility and tristate option
  879.     if { $tristatecompatibility == yes } {
  880.       #checkbuttons
  881.       .advanced_options_window.options_fs.joliet_ext configure -tristatevalue "tristate"
  882.       .advanced_options_window.options_oth.pad configure -tristatevalue "tristate"
  883.       .advanced_options_window.options_oth.overburn configure -tristatevalue "tristate"
  884.       .advanced_options_window.f_opts_dvd.multisession configure -tristatevalue "tristate"
  885.       .advanced_options_window.f_opts_dvd.monosession configure -tristatevalue "tristate"
  886.       .advanced_options_window.f_opts_cd.eject_cd configure -tristatevalue "tristate"
  887.       .advanced_options_window.options_oth.auto_refresh_space configure -tristatevalue "tristate"
  888.       #radiobuttons
  889.       .advanced_options_window.rr_radiobuttons.rr_ext_off configure -tristatevalue "tristate"
  890.       .advanced_options_window.rr_radiobuttons.rr_ext configure -tristatevalue "tristate"
  891.       .advanced_options_window.rr_radiobuttons.rra_ext configure -tristatevalue "tristate"
  892.       .advanced_options_window.udf_radiobuttons.udf_ext_off configure -tristatevalue "tristate"
  893.       .advanced_options_window.udf_radiobuttons.udf_ext configure -tristatevalue "tristate"
  894.       .advanced_options_window.udf_radiobuttons.dvd_video_ext configure -tristatevalue "tristate"
  895.     }
  896.  
  897.     set_visible_options
  898.     
  899.     
  900.     #pack buttons and labels
  901.     pack .advanced_options_window.f_fs_ext.label_fs_ext -side left
  902.     pack .advanced_options_window.f_options_rr.label_fs_rr -side left
  903.     pack .advanced_options_window.f_options_udf.label_fs_udf -side left
  904.     pack .advanced_options_window.f_opts_dvd_size.label_dvd_size -side left
  905.     pack .advanced_options_window.f_oth_opts.label_oth_opts -side left
  906.     pack .advanced_options_window.options_fs.joliet_ext -side top -anchor w -padx {12 0}
  907.     pack .advanced_options_window.f_dvd_size.cd6 .advanced_options_window.f_dvd_size.cd7 .advanced_options_window.f_dvd_size.single_layer .advanced_options_window.f_dvd_size.dual_layer -side left -anchor w -padx {12 0}
  908.     #DVD section
  909.     pack .advanced_options_window.f_opts_dvd.label_dvd -side top -anchor w
  910.     pack .advanced_options_window.f_opts_dvd.multisession .advanced_options_window.f_opts_dvd.monosession -side top -anchor w -padx {12 0}
  911.     #CD section
  912.     pack .advanced_options_window.f_opts_cd.label_cd -side top -anchor w
  913.     pack .advanced_options_window.f_opts_cd.eject_cd -side top -anchor w -padx {12 0}
  914.     pack .advanced_options_window.f_opts_cd.radio_tao .advanced_options_window.f_opts_cd.radio_dao -side left -anchor w -padx {12 0}
  915.     #other options
  916.     pack .advanced_options_window.options_oth.overburn .advanced_options_window.options_oth.pad -side top -anchor w -padx {12 0}
  917.     pack .advanced_options_window.options_oth.auto_refresh_space  -side top -anchor w -padx {12 0}
  918.     pack .advanced_options_window.options_oth.label_burn_speed .advanced_options_window.options_oth.entry_burn_speed -side left -anchor w -padx {12 0}
  919.     #langage
  920.     pack .advanced_options_window.f_langage.label_langage -side top -anchor w
  921.     pack .advanced_options_window.f_langage.langage_list -side top -anchor w -padx {12 0}  -pady {6 0}
  922.     #pack .advanced_options_window.f_dvd_size.b_save -side right -padx {0 12}
  923.     pack .advanced_options_window.rr_radiobuttons.rr_ext_off -side left -padx {24 0}
  924.     pack .advanced_options_window.rr_radiobuttons.rr_ext .advanced_options_window.rr_radiobuttons.rra_ext  -side left
  925.     pack .advanced_options_window.udf_radiobuttons.udf_ext_off .advanced_options_window.udf_radiobuttons.udf_ext .advanced_options_window.udf_radiobuttons.dvd_video_ext -side left -padx {24 0}
  926.     #packing frames
  927.     pack .advanced_options_window.f_fs_ext -fill x
  928.     pack .advanced_options_window.options_fs -fill x
  929.     pack .advanced_options_window.f_options_rr -fill x -padx {12 0}
  930.     pack .advanced_options_window.rr_radiobuttons -fill x
  931.     pack .advanced_options_window.f_options_udf -fill x -padx {12 0}
  932.     pack .advanced_options_window.udf_radiobuttons -fill x
  933.     pack .advanced_options_window.f_opts_dvd_size -fill x -pady {6 0}
  934.     pack .advanced_options_window.f_dvd_size -fill x
  935.     pack .advanced_options_window.f_opts_dvd -fill x -pady {6 0}
  936.     pack .advanced_options_window.f_opts_cd -fill x -pady {6 0}
  937.     pack .advanced_options_window.f_oth_opts -fill x -pady {6 0}
  938.     pack .advanced_options_window.options_oth -fill x
  939.     pack .advanced_options_window.f_langage -fill x -pady {6 0}
  940.     pack .advanced_options_window.b_close -side right -padx {0 12} -pady {0 6}
  941. }
  942. }
  943. #source main TkDVD window
  944. #    Copyright 2003 Regis Damongeot
  945.  
  946. #    This program is free software; you can redistribute it and/or modify
  947. #    it under the terms of the GNU General Public License as published by
  948. #    the Free Software Foundation; either version 2 of the License, or
  949. #    (at your option) any later version.
  950. #
  951. #    This program is distributed in the hope that it will be useful,
  952. #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  953. #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  954. #    GNU General Public License for more details.
  955. #
  956. #    You should have received a copy of the GNU General Public License
  957. #    along with this program; if not, write to the Free Software
  958. #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  959.  
  960. . configure -background #f5f5f5
  961.  
  962. #fill the  top menu
  963. frame .f_menubar
  964. menubutton .f_menubar.file -text File -underline 0 -menu .f_menubar.file.menu
  965. menubutton .f_menubar.cd -text CD -underline 0 -menu .f_menubar.cd.menu
  966. menubutton .f_menubar.dvd -text DVD -underline 0 -menu .f_menubar.dvd.menu
  967. menu .f_menubar.file.menu -tearoff 0
  968. menu .f_menubar.cd.menu -tearoff 0
  969. menu .f_menubar.dvd.menu -tearoff 0
  970. .f_menubar.file.menu add command -label "$i18n_load_file_list" -command {load_file_list }
  971. .f_menubar.file.menu add command -label "$i18n_save_file_list" -command {save_file_list }
  972. .f_menubar.file.menu add command -label "$i18n_quit" -command {save_options ; exit }
  973. .f_menubar.cd.menu add command -label "$i18n_cd_copy" -command { disc_copy "cd" }
  974. .f_menubar.cd.menu add command -label "$i18n_create_iso_from_cd" -command { disc_to_iso "cd" }
  975. .f_menubar.cd.menu add command -label "$i18n_erase_cdrw" -command { cd_choose_format }
  976. .f_menubar.dvd.menu add command -label "$i18n_dvd_copy" -command { disc_copy "dvd" }
  977. .f_menubar.dvd.menu add command -label "$i18n_create_iso_from_dvd" -command { disc_to_iso "dvd" }
  978. .f_menubar.dvd.menu add command -label "$i18n_erase_dvdrw" -command { dvd_choose_format }
  979. pack .f_menubar.file .f_menubar.cd .f_menubar.dvd -side left
  980. pack .f_menubar -fill x
  981.  
  982. frame .f_label_first_step -background #c7d1d1
  983. label .f_label_first_step.l_first_step -bg #c7d1d1 -text "$i18n_step1"
  984.  
  985. frame .f_first_step -background #f5f5f5
  986. radiobutton .f_first_step.burn_dvd -activebackground #f5f5f5 -background #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_burn_files_and_folders_on_a_dvd" -command refresh_cmd_line -variable burn_type -value burn_dvd
  987. .f_first_step.burn_dvd select
  988.  
  989. frame .f_first_step_b -background #f5f5f5
  990. button .f_first_step_b.add -highlightbackground blue -text "$i18n_add_files" -width 12 -command { add_file [tk_getOpenFile -multiple 1] }
  991. button .f_first_step_b.add_d -highlightbackground blue -text "$i18n_add_directory" -width 12 -command add_d
  992. button .f_first_step_b.delete -highlightbackground blue -text "$i18n_delete_file_dir" -width 12 -command delete_files
  993. button .f_first_step_b.clear -highlightbackground blue -text "$i18n_clear_list" -width 12 -command { set file_list ""; refresh_total_file_size; refresh_cmd_line }
  994. button .f_first_step_b.excluded_files -highlightbackground blue -width 12 -text "$i18n_excluded_files_dir" -command { excluded_file_window }
  995.  
  996. frame .f_upper_file_list -background #f5f5f5
  997. label .f_upper_file_list.l_file_size -bg #f5f5f5 -text "$i18n_used_space"
  998. entry .f_upper_file_list.show_file_size -relief flat -highlightbackground #f5f5f5 -highlightcolor #f5f5f5 -readonlybackground #f5f5f5 -state readonly -textvariable total_file_size_f -width 10
  999. label .f_upper_file_list.l_space_left -bg #f5f5f5 -text "$i18n_free_space"
  1000. entry .f_upper_file_list.show_space_left -relief flat -highlightbackground #f5f5f5 -highlightcolor #f5f5f5 -readonlybackground #f5f5f5 -state readonly -textvariable space_left_f -width 10
  1001. button .f_upper_file_list.b_update -highlightbackground blue -text "$i18n_update" -command { refresh_total_file_size }
  1002.  
  1003. frame .file_list -bg #f5f5f5
  1004. #seems to be necessary to fix an height (for Puppy a least)
  1005. listbox .file_list.file_list -bg white -height 8 -listvariable file_list -yscrollcommand { .file_list.scroll_bar set }
  1006. scrollbar .file_list.scroll_bar -command { .file_list.file_list yview }
  1007.  
  1008. frame .f_only_create_iso -bg #f5f5f5
  1009. checkbutton .f_only_create_iso.only_create_iso -activebackground #f5f5f5 -background #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_only_create_iso9660_image" -command refresh_cmd_line -variable v_create_iso -onvalue "yes" -offvalue "no"
  1010.  
  1011. frame .f_first_step_iso -background #f5f5f5
  1012. radiobutton .f_first_step_iso.b_burn_iso -activebackground #f5f5f5 -background #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_burn_iso9660_image" -command refresh_cmd_line -variable burn_type -value burn_iso
  1013. button  .f_first_step_iso.b_open_iso -highlightbackground blue -text "$i18n_open" -state disabled -command choose_iso_file -width 7
  1014. entry .f_first_step_iso.iso_file -relief flat -highlightbackground blue -highlightcolor blue -readonlybackground #f5f5f5 -state readonly -textvariable iso_file -width 57
  1015.  
  1016. frame .f_label_second_step -background #c7d1d1
  1017. label .f_label_second_step.l_second_step -bg #c7d1d1 -text "$i18n_step2"
  1018.  
  1019. frame .f_burn_dev -background #f5f5f5
  1020. label .f_burn_dev.l_burn_device -bg #f5f5f5 -width 20 -anchor w -text "$i18n_burning_device"
  1021. entry .f_burn_dev.burn_device -relief flat -bg white -highlightbackground blue -highlightcolor blue -disabledbackground #f5f5f5 -state normal -textvariable burning_device
  1022. .f_burn_dev.burn_device configure -validate focus -validatecommand refresh_cmd_line
  1023.  
  1024. frame .f_vol_name -background #f5f5f5
  1025. label .f_vol_name.label_vname -bg #f5f5f5 -width 20 -anchor w -text "$i18n_volume_name"
  1026. entry .f_vol_name.volume_name -relief flat -bg white -highlightbackground blue -highlightcolor blue  -disabledbackground #f5f5f5 -state normal -textvariable volume_id_o
  1027. button .f_vol_name.b_advanced_options -highlightbackground blue -width 15 -text "$i18n_advanced_options_b" -command { advanced_options_window }
  1028.  
  1029. frame .f_cmd_line -background #f5f5f5
  1030. label .f_cmd_line.label_vid -bg #f5f5f5 -width 20 -anchor w -text "$i18n_command"
  1031. entry .f_cmd_line.cmd_line -relief flat -highlightbackground blue -highlightcolor blue -readonlybackground #f5f5f5 -state readonly -textvariable command_line -width 150
  1032.  
  1033. frame .f_burn -background #c7d1d1
  1034. button .f_burn.go_button -text "$i18n_burn" -highlightbackground red -command { refresh_total_file_size; refresh_cmd_line; launch "burn" "" } -width 7
  1035.  
  1036.  
  1037. pack .f_label_first_step.l_first_step -side left
  1038. pack .f_label_first_step -fill x
  1039.  
  1040. pack .f_first_step.burn_dvd -side left
  1041. pack .f_first_step -fill x
  1042.  
  1043. pack .f_first_step_b.add -side left -padx {0 10}
  1044. pack .f_first_step_b.add_d .f_first_step_b.delete .f_first_step_b.clear .f_first_step_b.excluded_files -side left -padx {10 10} -expand 0
  1045. pack .f_first_step_b.excluded_files -side right -padx {10 0}
  1046. pack .f_first_step_b -fill x -padx {50 15} -pady {7 3}
  1047.  
  1048. pack .f_upper_file_list.l_file_size .f_upper_file_list.show_file_size .f_upper_file_list.l_space_left .f_upper_file_list.show_space_left -side left
  1049. if { $option_auto_refresh_space == "0" } { pack .f_upper_file_list.b_update -side left }
  1050. pack .f_upper_file_list -fill x -padx {50 0}
  1051.  
  1052. pack .file_list.scroll_bar -fill y -side right
  1053. pack .file_list.file_list -fill both -expand 1
  1054. pack .file_list -fill both -padx {50 15} -expand 1
  1055.  
  1056. pack .f_only_create_iso.only_create_iso -side left
  1057. pack .f_only_create_iso -fill x -padx {50 0} -pady {0 4}
  1058.  
  1059. pack .f_first_step_iso.b_burn_iso -side left
  1060. pack .f_first_step_iso.iso_file -side right -padx {12 0}
  1061. pack .f_first_step_iso.b_open_iso -side right
  1062. pack .f_first_step_iso -fill x -padx {0 15}
  1063.  
  1064. pack .f_label_second_step.l_second_step -side left
  1065. pack .f_label_second_step -fill x  -pady {12 12}
  1066.  
  1067. pack .f_burn_dev.l_burn_device -side left
  1068. pack .f_burn_dev.burn_device -side left -padx {0 0}
  1069. pack .f_burn_dev -fill x -padx {20 15} -pady {0 10}
  1070.  
  1071. pack .f_vol_name.label_vname -side left
  1072. pack .f_vol_name.volume_name -side left -padx {0 0}
  1073. pack .f_vol_name.b_advanced_options -side right -padx {0 0}
  1074. pack .f_vol_name -fill x -padx {20 15} -pady {0 10}
  1075.  
  1076. pack .f_cmd_line.label_vid -side left
  1077. pack .f_cmd_line.cmd_line -side left -padx {0 0}
  1078. pack .f_cmd_line -fill x  -pady {0 10} -padx {20 15}
  1079.  
  1080. pack .f_burn.go_button -pady {2 2}
  1081. pack .f_burn -fill x
  1082.  
  1083. #source all procedures left
  1084.  #    Copyright 2003 Regis Damongeot
  1085.  
  1086. #    This program is free software; you can redistribute it and/or modify
  1087. #    it under the terms of the GNU General Public License as published by
  1088. #    the Free Software Foundation; either version 2 of the License, or
  1089. #    (at your option) any later version.
  1090. #
  1091. #    This program is distributed in the hope that it will be useful,
  1092. #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1093. #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1094. #    GNU General Public License for more details.
  1095. #
  1096. #    You should have received a copy of the GNU General Public License
  1097. #    along with this program; if not, write to the Free Software
  1098. #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  1099.  
  1100. proc file_list_w_modif_dir { file_list_to_modif } {
  1101.     #puts "$file_list_to_modif"
  1102.     set file_list_to_modif_f ""
  1103.     #set modified false
  1104.     for { set i 0 } { $i < [llength $file_list_to_modif]} { incr i } {
  1105.         if { [file isdirectory [lindex $file_list_to_modif $i]] } {
  1106.             set file_list_to_modif [lreplace $file_list_to_modif $i $i "[lindex [split [lindex $file_list_to_modif $i] /] end]/=[lindex $file_list_to_modif $i]"]
  1107.         } else {
  1108.         }
  1109.     }
  1110.     #if { $modified == true } { return [eval concat $file_list_to_modif] } else { return $file_list_to_modif }
  1111.     return $file_list_to_modif
  1112. }
  1113.  
  1114.  
  1115.  
  1116. proc choose_iso_file {} {
  1117.     global iso_file burn_type burning_device i18n_select_iso_image
  1118.     set iso_file_o ""
  1119.     if { $burn_type == "burn_iso" } {
  1120.         set iso_file_o [tk_getOpenFile -defaultextension .iso -title "$i18n_select_iso_image"]
  1121.         if { [llength $iso_file_o] > 1} {
  1122.             set iso_file [lindex $iso_file_o 0]
  1123.             for { set i 1} {$i < [llength $iso_file_o]} {incr i} {
  1124.                 set iso_file "$iso_file\\ [lindex $iso_file_o $i]"
  1125.             }
  1126.         } else {
  1127.             set iso_file $iso_file_o
  1128.         }
  1129.     } else {
  1130.         set burning_device ""
  1131.         #set iso_file [tk_chooseDirectory -mustexist 0]
  1132.         set iso_file [tk_getSaveFile]
  1133.         set burning_device "-o"
  1134.         lappend burning_device $iso_file
  1135.     }
  1136.     refresh_cmd_line
  1137. }
  1138.  
  1139. proc check_volume_id {} {
  1140.     global volume_id volume_id_o
  1141.     set volume_id ""
  1142.     if { $volume_id_o == "" } {
  1143.         set volume_id ""
  1144.     } elseif { [llength $volume_id_o] > 1} {
  1145.             set volume_id [lindex $volume_id_o 0]
  1146.             for { set i 1} {$i < [llength $volume_id_o]} {incr i} {
  1147.                 set volume_id "$volume_id\\ [lindex $volume_id_o $i]"
  1148.             }
  1149.             set volume_id "-V $volume_id"
  1150.         } else { set volume_id "-V $volume_id_o" }
  1151. }
  1152.  
  1153. proc add_file {files} {
  1154.     global file_list option_auto_refresh_space i18n_error i18n_error_file_already_present i18n_quest_file_contained
  1155.     
  1156.     if { $files != "" } {
  1157.         #foreach needed for multiple files selection
  1158.         foreach i $files {
  1159.             set answer "yes"
  1160.             set file_present [file_is_present_or_conatained "$i"]
  1161.             if { "$file_present" == "yes" } {
  1162.                 set answer "no"
  1163.                 tk_messageBox -icon error -message "$i18n_error_file_already_present: $i" -type ok -title $i18n_error
  1164.             } elseif { "$file_present" == "yes_c" } {
  1165.                 set answer [tk_messageBox -icon error -message "$i18n_quest_file_contained $i" -type yesno -default no -title $i18n_error]
  1166.             }
  1167.         
  1168.             if { $answer == "yes" } {
  1169.                 lappend file_list $i
  1170.             }
  1171.         }
  1172.         if { $option_auto_refresh_space == "1" } {
  1173.             refresh_total_file_size
  1174.         }
  1175.         refresh_cmd_line
  1176.     }
  1177. }
  1178.  
  1179. proc add_d {} {
  1180.     global file_list option_auto_refresh_space i18n_error i18n_error_directory_already_present i18n_quest_directory_contained i18n_quest_directory_contains
  1181.     set temp [tk_chooseDirectory]
  1182.     set answer "yes"
  1183.     if { $temp != "" } {
  1184.         set file_present [file_is_present_or_conatained "$temp"]
  1185.         if { "$file_present" == "yes" } {
  1186.             set answer "no"
  1187.             tk_messageBox -icon error -message "$i18n_error_directory_already_present" -type ok -title $i18n_error
  1188.         } elseif { "$file_present" == "yes_c" } {
  1189.             set answer [tk_messageBox -icon error -message "$i18n_quest_directory_contained" -type yesno -default no -title $i18n_error]
  1190.         } elseif { "$file_present" == "will_contains" } {
  1191.             set answer [tk_messageBox -icon error -message "$i18n_quest_directory_contains" -type yesno -default no -title $i18n_error]
  1192.         }
  1193.         
  1194.         if { $answer == "yes" } {
  1195.             lappend file_list $temp
  1196.             #refresh command line entry after checking space used to check overburn condition
  1197.             if { $option_auto_refresh_space == "1" } {
  1198.                 refresh_total_file_size
  1199.             }
  1200.             refresh_cmd_line
  1201.         }
  1202.     }
  1203. }
  1204.  
  1205. proc delete_files {} {
  1206.     global file_list option_auto_refresh_space
  1207.     if { "[.file_list.file_list curselection]" == "" } {
  1208.     } else {
  1209.         set file_list [lreplace $file_list [.file_list.file_list curselection] [.file_list.file_list curselection]]
  1210.         #refresh command line entry after checking space used to check overburn condition
  1211.         if { $option_auto_refresh_space == "1" } {
  1212.             refresh_total_file_size
  1213.         }
  1214.         refresh_cmd_line
  1215.     }
  1216. }
  1217.  
  1218. proc launch {burn_type burn_opt} {
  1219.     global input command_line burning_device i18n_growisofs_mkisofs_output i18n_close burn_speed option_overburn
  1220.     #if output window not already created, we create it
  1221.     if { ! [winfo exists .output_window] } {
  1222.         toplevel .output_window -highlightthickness 1 -highlightcolor blue -background #f5f5f5
  1223.         wm title .output_window "$i18n_growisofs_mkisofs_output"
  1224.         frame .output_window.f_main
  1225.         text .output_window.f_main.log -heigh 10 -bg #f5f5f5 -relief ridge -setgrid true -yscrollcommand { .output_window.f_main.scroll_bar set }
  1226.         scrollbar .output_window.f_main.scroll_bar -command { .output_window.f_main.log yview }
  1227.         button .output_window.b_close -highlightbackground blue -width 7 -text "$i18n_close" -command { destroy .output_window; refresh_cmd_line }
  1228.         
  1229.         pack .output_window.f_main.log -fill both -side left -expand 1
  1230.         pack .output_window.f_main.scroll_bar -fill y -side right
  1231.         pack .output_window.f_main -fill both -expand 1
  1232.         pack .output_window.b_close
  1233.     }
  1234.     .f_burn.go_button configure -state disabled
  1235.     if { $burn_type == "burn" } {
  1236.         if {[catch {open "|$command_line |& cat"} input]} {
  1237.             #one blank line to increase readability
  1238.             .output_window.f_main.log insert end "$command_line\n\n"
  1239.         } else {
  1240.             fileevent $input readable log_proc
  1241.             #one blank line to increase readability
  1242.             .output_window.f_main.log insert end "$command_line\n\n"
  1243.         }
  1244.     } elseif { $burn_type == "dvd_copy" } {
  1245.         #burn_opt contains source device from which we copy
  1246.         if {[catch {open "|growisofs -Z $burning_device=$burn_opt |& cat"} input]} {
  1247.             #one blank line to increase readability
  1248.             .output_window.f_main.log insert end "growisofs -Z $burning_device=$burn_opt\n\n"
  1249.         } else {
  1250.             fileevent $input readable log_proc
  1251.             #one blank line to increase readability
  1252.             .output_window.f_main.log insert end "growisofs -Z $burning_device=$burn_opt\n\n"
  1253.         }
  1254.     } elseif { $burn_type == "cd_copy" } {
  1255.         #burn_opt contains source device from which we copy
  1256.         if {[catch {open "|cdrecord dev=$burning_device $burn_speed $option_overburn -isosize $burn_opt |& cat"} input]} {
  1257.             #one blank line to increase readability
  1258.             .output_window.f_main.log insert end "cdrecord dev=$burning_device $burn_speed $option_overburn -isosize $burn_opt\n\n"
  1259.         } else {
  1260.             fileevent $input readable log_proc
  1261.             #one blank line to increase readability
  1262.             .output_window.f_main.log insert end "cdrecord dev=$burning_device $burn_speed $option_overburn -isosize $burn_opt\n\n"
  1263.         }
  1264.     } elseif { $burn_type == "create_iso" } {
  1265.         # burn_opt contains destination file for ISO image
  1266.         if {[catch {open "|dd if=$burning_device of=$burn_opt |& cat"} input]} {
  1267.             #one blank line to increase readability
  1268.             .output_window.f_main.log insert end "dd if=$burning_device of=$burn_opt\n\n"
  1269.         } else {
  1270.             fileevent $input readable log_proc
  1271.             #one blank line to increase readability
  1272.             .output_window.f_main.log insert end "dd if=$burning_device of=$burn_opt\n\n"
  1273.         }
  1274.     } elseif { $burn_type == "erase_dvd" } {
  1275.         # $burn_opt= "" or "force" or "blank"
  1276.         if {[catch {open "|dvd+rw-format $burn_opt $burning_device |& cat"} input]} {
  1277.             #one blank line to increase readability
  1278.             .output_window.f_main.log insert end "dvd+rw-format $burn_type $burning_device\n\n"
  1279.         } else {
  1280.             fileevent $input readable log_proc
  1281.             #one blank line to increase readability
  1282.             .output_window.f_main.log insert end "dvd+rw-format $burn_type $burning_device\n\n"
  1283.         }
  1284.     } elseif { $burn_type == "erase_cd" } {
  1285.         # $burn_opt= "blank=fast" or "blank=full"
  1286.         if {[catch {open "|cdrecord $burn_opt dev=$burning_device |& cat"} input]} {
  1287.             #one blank line to increase readability
  1288.             .output_window.f_main.log insert end "cdrecord $burn_opt dev=$burning_device\n\n"
  1289.         } else {
  1290.             fileevent $input readable log_proc
  1291.             #one blank line to increase readability
  1292.             .output_window.f_main.log insert end "cdrecord $burn_opt dev=$burning_device\n\n"
  1293.         }
  1294.     }
  1295.     catch {fconfigure $input -blocking 0}
  1296.     after 4000 refresh_cmd_line
  1297. }
  1298.  
  1299. proc dvd_choose_format {} {
  1300. #i18n
  1301. global i18n_erase i18n_close i18n_full_format i18n_normal_format i18n_quick_format i18n_erase_dvdrw
  1302.     if { ! [winfo exists .format_window] } {
  1303.         
  1304.         toplevel .format_window -highlightthickness 1 -highlightcolor blue -background #f5f5f5
  1305.         wm title .format_window "$i18n_erase_dvdrw"
  1306.         
  1307.         frame .format_window.f_format_type -background #f5f5f5
  1308.         
  1309.         radiobutton .format_window.f_format_type.options_full_f -bg #f5f5f5 -activebackground #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_full_format" -variable format_type -value "-blank"
  1310.         radiobutton .format_window.f_format_type.options_normal_f -bg #f5f5f5 -activebackground #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_normal_format" -variable format_type -value "-force"
  1311.         radiobutton .format_window.f_format_type.options_quick_f -bg #f5f5f5 -activebackground #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_quick_format" -variable format_type -value ""
  1312.         
  1313.         button .format_window.b_erase -highlightbackground red -text "$i18n_erase" -command { launch "erase_dvd" $format_type; destroy .format_window}
  1314.         button .format_window.b_close -highlightbackground red -text "$i18n_close" -command { destroy .format_window}
  1315.         
  1316.         pack .format_window.f_format_type.options_quick_f -side left
  1317.         pack .format_window.f_format_type.options_normal_f -side left
  1318.         pack .format_window.f_format_type.options_full_f -side left
  1319.         pack .format_window.f_format_type -fill x -padx {0 12}
  1320.         pack .format_window.b_close .format_window.b_erase -fill x -side right -padx {0 12} -pady {6 6}
  1321.         
  1322.         .format_window.f_format_type.options_quick_f select
  1323.     }
  1324. }
  1325.  
  1326. proc cd_choose_format {} {
  1327. #i18n
  1328. global i18n_erase i18n_close i18n_full_format_cd i18n_quick_format_cd i18n_erase_cdrw
  1329.     if { ! [winfo exists .format_window] } {
  1330.         
  1331.         toplevel .format_window -highlightthickness 1 -highlightcolor blue -background #f5f5f5
  1332.         wm title .format_window "$i18n_erase_cdrw"
  1333.         
  1334.         frame .format_window.f_format_type -background #f5f5f5
  1335.         
  1336.         radiobutton .format_window.f_format_type.options_full_f -bg #f5f5f5 -activebackground #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_full_format_cd" -variable format_type -value "blank=all"
  1337.         radiobutton .format_window.f_format_type.options_quick_f -bg #f5f5f5 -activebackground #f5f5f5 -highlightbackground #f5f5f5 -text "$i18n_quick_format_cd" -variable format_type -value "blank=fast"
  1338.         
  1339.         button .format_window.b_erase -highlightbackground red -text "$i18n_erase" -command { launch "erase_cd" $format_type; destroy .format_window}
  1340.         button .format_window.b_close -highlightbackground red -text "$i18n_close" -command { destroy .format_window}
  1341.         
  1342.         pack .format_window.f_format_type.options_quick_f -side left
  1343.         pack .format_window.f_format_type.options_full_f -side left
  1344.         pack .format_window.f_format_type -fill x -padx {0 12}
  1345.         pack .format_window.b_close .format_window.b_erase -fill x -side right -padx {0 12} -pady {6 6}
  1346.         
  1347.         .format_window.f_format_type.options_quick_f select
  1348.     }
  1349. }
  1350.  
  1351. proc log_proc {} {
  1352.     global input i18n_writing_finished
  1353.     if { [gets $input line] > 0 } {
  1354.         if { [winfo exists .output_window] } {
  1355.             .output_window.f_main.log insert end $line\n
  1356.             .output_window.f_main.log see end
  1357.         }
  1358.     } elseif { [eof $input] } {
  1359.         catch { close $input }
  1360.         if { [winfo exists .output_window] } {
  1361.             .output_window.f_main.log insert end "$i18n_writing_finished"
  1362.             .output_window.f_main.log see end
  1363.         }
  1364.     }
  1365. }
  1366.  
  1367. proc set_visible_options {} {
  1368.     global burn_type v_create_iso dvd_size
  1369.     if { $burn_type == "burn_dvd" &&  $v_create_iso == "no" } {
  1370.         .f_first_step_iso.b_open_iso configure -state disabled
  1371.         .f_only_create_iso.only_create_iso configure -state normal
  1372.         .f_vol_name.label_vname configure -state normal
  1373.         .f_vol_name.volume_name configure -state normal
  1374.         .f_first_step_b.add configure -state normal
  1375.         .f_first_step_b.add_d configure -state normal
  1376.         .f_first_step_b.delete configure -state normal
  1377.         .f_first_step_b.clear configure -state normal
  1378.         .f_first_step_b.excluded_files configure -state normal
  1379.         .file_list.file_list configure -state normal
  1380.         .f_upper_file_list.l_file_size configure -state normal
  1381.         .f_upper_file_list.l_space_left configure -state normal
  1382.         .f_burn_dev.l_burn_device configure -state normal
  1383.         .f_burn_dev.burn_device configure -state normal
  1384.         if { [winfo exists .advanced_options_window] } {
  1385.             .advanced_options_window.options_oth.pad configure -state normal
  1386.             .advanced_options_window.udf_radiobuttons.udf_ext configure -state normal
  1387.             .advanced_options_window.udf_radiobuttons.dvd_video_ext configure -state normal
  1388.             .advanced_options_window.udf_radiobuttons.udf_ext_off configure -state normal
  1389.             .advanced_options_window.rr_radiobuttons.rr_ext_off configure -state normal
  1390.             .advanced_options_window.rr_radiobuttons.rra_ext configure -state normal
  1391.             .advanced_options_window.rr_radiobuttons.rr_ext configure -state normal
  1392.             .advanced_options_window.options_fs.joliet_ext configure -state normal
  1393.             .advanced_options_window.options_oth.label_burn_speed configure -state normal
  1394.             .advanced_options_window.options_oth.entry_burn_speed configure -state normal
  1395.             .advanced_options_window.options_oth.overburn configure -state normal
  1396.             .advanced_options_window.f_opts_cd.radio_tao configure -state disabled
  1397.             .advanced_options_window.f_opts_cd.radio_dao configure -state disabled
  1398.             if { $dvd_size <= 716800 } {
  1399.                 .advanced_options_window.f_opts_dvd.multisession configure -state disabled
  1400.                 .advanced_options_window.f_opts_dvd.monosession configure -state disabled
  1401.                 .advanced_options_window.f_opts_cd.eject_cd configure -state normal
  1402.             } else {
  1403.                 .advanced_options_window.f_opts_dvd.multisession configure -state normal
  1404.                 .advanced_options_window.f_opts_dvd.monosession configure -state normal
  1405.                 .advanced_options_window.f_opts_cd.eject_cd configure -state disabled
  1406.             }
  1407.             .advanced_options_window.options_oth.auto_refresh_space configure -state normal
  1408.         }
  1409.     } elseif { $burn_type == "burn_dvd" && $v_create_iso == "yes" } {
  1410.         .f_first_step_iso.b_open_iso configure -state normal
  1411.         .f_burn_dev.l_burn_device configure -state disabled
  1412.         .f_burn_dev.burn_device configure -state disabled
  1413.         if { [winfo exists .advanced_options_window] } {
  1414.             .advanced_options_window.options_oth.pad configure -state normal
  1415.             .advanced_options_window.options_fs.joliet_ext configure -state normal
  1416.             .advanced_options_window.udf_radiobuttons.udf_ext configure -state normal
  1417.             .advanced_options_window.udf_radiobuttons.udf_ext_off configure -state normal
  1418.             .advanced_options_window.udf_radiobuttons.dvd_video_ext configure -state normal
  1419.             .advanced_options_window.rr_radiobuttons.rr_ext_off configure -state normal
  1420.             .advanced_options_window.rr_radiobuttons.rr_ext configure -state normal
  1421.             .advanced_options_window.rr_radiobuttons.rra_ext configure -state normal
  1422.             .advanced_options_window.options_oth.label_burn_speed configure -state disabled
  1423.             .advanced_options_window.options_oth.entry_burn_speed configure -state disabled
  1424.             .advanced_options_window.options_oth.overburn configure -state disabled
  1425.             .advanced_options_window.f_opts_dvd.multisession configure -state disabled
  1426.             .advanced_options_window.f_opts_dvd.monosession configure -state disabled
  1427.             .advanced_options_window.f_opts_cd.eject_cd configure -state disabled
  1428.             .advanced_options_window.f_opts_cd.radio_tao configure -state disabled
  1429.             .advanced_options_window.f_opts_cd.radio_dao configure -state disabled
  1430.             .advanced_options_window.options_oth.auto_refresh_space configure -state normal
  1431.         }
  1432.     } elseif { $burn_type == "burn_iso" } {
  1433.         .f_first_step_iso.b_open_iso configure -state normal
  1434.         .f_only_create_iso.only_create_iso configure -state disabled
  1435.         .f_vol_name.label_vname configure -state disabled
  1436.         .f_vol_name.volume_name configure -state disabled
  1437.         .f_first_step_b.add configure -state disabled
  1438.         .f_first_step_b.add_d configure -state disabled
  1439.         .f_first_step_b.delete configure -state disabled
  1440.         .f_first_step_b.clear configure -state disabled
  1441.         .f_first_step_b.excluded_files configure -state disabled
  1442.         .file_list.file_list configure -state disabled
  1443.         .f_upper_file_list.l_file_size configure -state disabled
  1444.         .f_upper_file_list.l_space_left configure -state disabled
  1445.         .f_burn_dev.l_burn_device configure -state normal
  1446.         .f_burn_dev.burn_device configure -state normal
  1447.         if { [winfo exists .advanced_options_window] } {
  1448.             .advanced_options_window.options_oth.pad configure -state disabled
  1449.             .advanced_options_window.udf_radiobuttons.udf_ext configure -state disabled
  1450.             .advanced_options_window.udf_radiobuttons.udf_ext_off configure -state disabled
  1451.             .advanced_options_window.udf_radiobuttons.dvd_video_ext configure -state disabled
  1452.             .advanced_options_window.rr_radiobuttons.rr_ext_off configure -state disabled
  1453.             .advanced_options_window.rr_radiobuttons.rra_ext configure -state disabled
  1454.             .advanced_options_window.rr_radiobuttons.rr_ext configure -state disabled
  1455.             .advanced_options_window.options_fs.joliet_ext configure -state disabled
  1456.             .advanced_options_window.options_oth.label_burn_speed configure -state normal
  1457.             .advanced_options_window.options_oth.entry_burn_speed configure -state normal
  1458.             .advanced_options_window.options_oth.overburn configure -state normal
  1459.             .advanced_options_window.f_opts_dvd.multisession configure -state disabled
  1460.             .advanced_options_window.f_opts_dvd.monosession configure -state disabled
  1461.             .advanced_options_window.options_oth.auto_refresh_space configure -state disabled
  1462.             if { $dvd_size <= 716800 } {
  1463.                 .advanced_options_window.f_opts_cd.eject_cd configure -state normal
  1464.                 .advanced_options_window.f_opts_cd.radio_tao configure -state normal
  1465.                 .advanced_options_window.f_opts_cd.radio_dao configure -state normal
  1466.             } else {
  1467.                 .advanced_options_window.f_opts_cd.eject_cd configure -state disabled
  1468.                 .advanced_options_window.f_opts_cd.radio_tao configure -state disabled
  1469.                 .advanced_options_window.f_opts_cd.radio_dao configure -state disabled
  1470.             }
  1471.         }
  1472.     }
  1473. }
  1474.  
  1475. proc refresh_burning_variables {} {
  1476.     global burn_command t_session burning_device temp_burning_device option_dvd_compat option_overburn v_create_iso v_create_iso dvd_size burn_type iso_file
  1477.     if { "$burn_type" == "burn_iso" } {
  1478.         #burning of an ISO image
  1479.         if { $temp_burning_device != "" } {
  1480.             #in this case, we just changed burning type to burning ISO, so we restore burning device
  1481.             set burning_device "$temp_burning_device"
  1482.             set temp_burning_device ""
  1483.         }
  1484.         if { $dvd_size <= 716800 } {
  1485.             set burn_command "cdrecord"
  1486.         } else {
  1487.             set burn_command "growisofs"
  1488.         }
  1489.         set v_create_iso "no"
  1490.         set volume_id ""
  1491.     } elseif {$burn_type == "burn_dvd" && $v_create_iso == "no"} {
  1492.         #DVD burning without ISO creation
  1493.         if { $temp_burning_device != "" } {
  1494.             #in this case, we just changed burning type to burning CD/DVD, so we restore burning device
  1495.             set burning_device "$temp_burning_device"
  1496.             set temp_burning_device ""
  1497.         }
  1498.         if { $dvd_size <= 716800 } {
  1499.             set burn_command "mkisofs"
  1500.         } else {
  1501.             set burn_command "growisofs"
  1502.         }
  1503.         set iso_file ""
  1504.     } else {
  1505.         #ISO creation
  1506.         set burn_command "mkisofs"
  1507.         if { $temp_burning_device == "" } {
  1508.             #in this case, we just change burning type to ISO creation so we need to save the previous real burning device
  1509.             set temp_burning_device "$burning_device"
  1510.             set burning_device ""
  1511.         }
  1512.     }
  1513. }
  1514.  
  1515.  
  1516.  
  1517. proc disc_copy { disc_type } {
  1518.     #disc_type == "dvd" or "cd"
  1519.     global i18n_dvd_copy i18n_cd_copy i18n_copy i18n_close i18n_choose_source_device
  1520.     #seems necessary to declare a second variable for -command launch and not with "set", only variable works...
  1521.     variable disc_type_g "$disc_type"
  1522.     if { ! [winfo exists .dvd_copy_window] } {
  1523.         toplevel .dvd_copy_window -highlightthickness 1 -highlightcolor blue -background #f5f5f5
  1524.         if { $disc_type == "dvd" } {
  1525.             wm title .dvd_copy_window "$i18n_dvd_copy"
  1526.         } else {
  1527.             wm title .dvd_copy_window "$i18n_cd_copy"
  1528.         }
  1529.  
  1530.         frame .dvd_copy_window.f_source_device -background #f5f5f5
  1531.         label .dvd_copy_window.f_source_device.l_mess -bg #f5f5f5 -text "$i18n_choose_source_device"
  1532.         entry .dvd_copy_window.f_source_device.e_bd -relief flat -bg white -highlightbackground blue -highlightcolor blue -disabledbackground #f5f5f5 -state normal -textvariable source_device
  1533.         
  1534.         button .dvd_copy_window.b_copy -highlightbackground red -text "$i18n_copy" -command { launch "${disc_type_g}_copy" "$source_device"; destroy .dvd_copy_window}
  1535.         button .dvd_copy_window.b_close -highlightbackground red -text "$i18n_close" -command { destroy .dvd_copy_window}
  1536.     
  1537.         pack .dvd_copy_window.f_source_device.l_mess -side left
  1538.         pack .dvd_copy_window.f_source_device.e_bd -side left
  1539.         pack  .dvd_copy_window.f_source_device -fill x -padx {0 12} -pady {12 12}
  1540.         pack .dvd_copy_window.b_close .dvd_copy_window.b_copy -fill x -side right -padx {0 12} -pady {6 6}
  1541.     }    
  1542. }
  1543.  
  1544. proc disc_to_iso { disc_type } {
  1545.     #disc_type == "dvd" or "cd"
  1546.     global i18n_close i18n_create_iso_from_dvd i18n_create_iso_from_cd i18n_create i18n_choose_target_file i18n_error i18n_error_target_file_ns
  1547.     set dest_file ""
  1548.     if { ! [winfo exists .create_iso_window] } {
  1549.     
  1550.         toplevel .create_iso_window -highlightthickness 1 -highlightcolor blue -background #f5f5f5
  1551.         if { $disc_type == "dvd" } {
  1552.             wm title .create_iso_window "$i18n_create_iso_from_dvd"
  1553.         } else {
  1554.             wm title .create_iso_window "$i18n_create_iso_from_cd"
  1555.         }
  1556.  
  1557.         frame .create_iso_window.f_dest_file -background #f5f5f5
  1558.         button .create_iso_window.f_dest_file.b_mess -highlightbackground blue -text "$i18n_choose_target_file" -command { set dest_file [tk_getSaveFile -filetypes {{ {ISO Image} { .iso } } {{All Files}  * } } -defaultextension .iso] }
  1559.         entry .create_iso_window.f_dest_file.e_fp  -relief flat -highlightbackground blue -highlightcolor blue -readonlybackground #f5f5f5 -state readonly -textvariable dest_file -width 57
  1560.     
  1561.         button .create_iso_window.b_create -highlightbackground red -text "$i18n_create" -command { if { $dest_file == "" } { tk_messageBox -icon error -message $i18n_error_target_file_ns -type ok -title $i18n_error } else {launch "create_iso" "$dest_file"; destroy .create_iso_window} }
  1562.         button .create_iso_window.b_close -highlightbackground red -text "$i18n_close" -command { destroy .create_iso_window}
  1563.     
  1564.         pack .create_iso_window.f_dest_file.b_mess -side left -padx {12 12}
  1565.         pack .create_iso_window.f_dest_file.e_fp -side left
  1566.         pack  .create_iso_window.f_dest_file -fill x -padx {0 12} -pady {12 12}
  1567.         pack .create_iso_window.b_close .create_iso_window.b_create -fill x -side right -padx {0 12} -pady {6 6}
  1568.     }    
  1569. }
  1570.  
  1571. proc save_file_list {} {
  1572.     global file_list excluded_file_list i18n_error_filelist_empty i18n_error
  1573.     #we first check that file list is not empty
  1574.     if { $file_list == "" } {
  1575.         tk_messageBox -icon error -message $i18n_error_filelist_empty -type ok -title $i18n_error
  1576.         return
  1577.     }
  1578.     set output_file_s [tk_getSaveFile -filetypes {{ {TkDVD file list} { .tkdvd } } {{All Files}  * } } -defaultextension .tkdvd]
  1579.     if { $output_file_s != "" } {
  1580.         set output_file [open $output_file_s w]
  1581.         puts $output_file $file_list
  1582.         puts $output_file $excluded_file_list
  1583.         close $output_file
  1584.     }
  1585. }
  1586.  
  1587. proc load_file_list {} {
  1588.     global file_list excluded_file_list option_auto_refresh_space
  1589.     set temp_fl ""
  1590.     set temp_efl ""
  1591.     set input_file_s [tk_getOpenFile -filetypes {{ {TkDVD file list} { .tkdvd } } {{All Files}  * } } -defaultextension .tkdvd]
  1592.     if { $input_file_s != "" } {
  1593.         set input_file [open $input_file_s r]
  1594.         gets $input_file temp_fl
  1595.         gets $input_file temp_efl
  1596.         #check if each file/dir loaded is not already in file list
  1597.         foreach i $temp_fl {
  1598.             if { [file_is_present_or_conatained "$i"] == "no"} {
  1599.                 lappend file_list $i
  1600.             }
  1601.         }
  1602.         #same check for excluded file
  1603.         foreach i $temp_efl {
  1604.             if { ([file_is_present_or_conatained "$i"] != "no") && ([file_is_present_or_conatained_in_efl "$i"] == "no")} {
  1605.                 lappend excluded_file_list $i
  1606.             }
  1607.         }
  1608.         close $input_file
  1609.         if { $option_auto_refresh_space == "1" } {
  1610.             refresh_total_file_size
  1611.         }
  1612.         refresh_cmd_line
  1613.     }
  1614. }
  1615.  
  1616. proc file_is_present_or_conatained { this_file } {
  1617.     #return "yes" if $this_file is already in file list or "yes_c" if it is contained, returns "will_contains" if this_file will contains other files already present, else return "no"
  1618.     global file_list
  1619.     if { [file isfile "$this_file"] } {
  1620.         #in this case we check that file given in parameter is not equal to another file already in FL or contains in a directory in FL
  1621.         foreach i $file_list {
  1622.             if { [file isfile "$i"] } {
  1623.                 #same file
  1624.                 if { "$i" == "$this_file" } { return "yes" }
  1625.             } elseif { [file isdirectory "$i"] } {
  1626.                 #file contained in already present directory
  1627.                 if { [string compare -length [string length $i] "$i" "$this_file"] == 0 } { return "yes_c" }
  1628.             }
  1629.         }
  1630.     } elseif { [file isdirectory "$this_file"] } {
  1631.         foreach i $file_list {
  1632.             if { [file isdirectory "$i"] } {
  1633.                 #same directory
  1634.                 if { "$i" == "$this_file" } { return "yes" }
  1635.                 #new directory will contains another already rpesent in FL
  1636.                 if { [string compare -length [string length $this_file] "$this_file" "$i"] == 0} { return "will_contains" }
  1637.                 #new directory is contained by another directory in FL
  1638.                 if { [string compare -length [string length $i] "$i" "$this_file"]==0 } { return "yes_c" }
  1639.             } elseif { [file isfile "$i"] } {
  1640.                 #check that new directory doesnt contains files already present
  1641.                 if { [string compare -length [string length $this_file] "$this_file" "$i"] == 0} { return "will_contains" }
  1642.             }
  1643.         }
  1644.     }
  1645.     return "no"
  1646. }
  1647.  
  1648. proc file_is_present_or_conatained_in_efl { this_file } {
  1649.     #return "yes" if $this_file is already in excluded file list or "yes_c" if it is contained, returns "will_contains" if this_file will contains other files already present, else return "no"
  1650.     global excluded_file_list
  1651.     if { [file isfile "$this_file"] } {
  1652.         #in this case we check that file given in parameter is not equal to another file already in FL or contains in a directory in FL
  1653.         foreach i $excluded_file_list {
  1654.             if { [file isfile "$i"] } {
  1655.                 #same file
  1656.                 if { "$i" == "$this_file" } { return "yes" }
  1657.             } elseif { [file isdirectory "$i"] } {
  1658.                 #file contained in already present directory
  1659.                 if { [string compare -length [string length $i] "$i" "$this_file"] == 0 } { return "yes_c" }
  1660.             }
  1661.         }
  1662.     } elseif { [file isdirectory "$this_file"] } {
  1663.         foreach i $excluded_file_list {
  1664.             if { [file isdirectory "$i"] } {
  1665.                 #same directory
  1666.                 if { "$i" == "$this_file" } { return "yes" }
  1667.                 #new directory will contains another already rpesent in FL
  1668.                 if { [string compare -length [string length $this_file] "$this_file" "$i"] == 0} { return "will_contains" }
  1669.                 #new directory is contained by another directory in FL
  1670.                 if { [string compare -length [string length $i] "$i" "$this_file"]==0 } { return "yes_c" }
  1671.             } elseif { [file isfile "$i"] } {
  1672.                 #check that new directory doesnt contains files already present
  1673.                 if { [string compare -length [string length $this_file] "$this_file" "$i"] == 0} { return "will_contains" }
  1674.             }
  1675.         }
  1676.     }
  1677.     return "no"
  1678. }
  1679. #refresh space left for initial DVD size loaded from config file
  1680. refresh_total_file_size
  1681. #refresh cmd line (mkisofs for exemple if dvd size == CD size
  1682. refresh_cmd_line
  1683.  
  1684.  
  1685.