#needed to not have too large precision when showing total files size
set tcl_precision 4
#set fullpath to source scripts (if TkDVD not launch from it install direcotory)
set source_directory "[info script]"
if { [file pathtype $source_directory] == "absolute" } {
set source_directory [file dirname $source_directory]
} else {
set source_directory "[file dirname [pwd]/[info script]]"
}
#we need to set a variable to fix compatibility problems between tcl 8.4 and 8.5
# 8.5 has a tristate value for checkbuttons which is by default "" that conflits with offvalue for TkDVD advanced options
# 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.
#puts "updating config file from $old_version to $current_version"
#for updating, just load previous version options and call save_options proc
if { $old_version == "2.8" } {
set config_file [open $env(HOME)/.tkdvd/config r]
set string_temp ""
while {! [eof $config_file]} {
gets $config_file string_temp
puts "$string_temp"
if {[lindex $string_temp 0] == "dvd_size"} {
set dvd_size [lindex $string_temp end]
}
}
close $config_file
save_options
} elseif { $old_version == "3.2" } {
#no special change so we load option classically
}
}
#load user default options
load_options
#change command line variable according to loaded values
set command_line "growisofs $t_session $burning_device $option_joliet_ext $option_rr_ext $option_dvd_compat $option_pad -graft-points"
#source internationalisation variables
# Copyright 2003 Regis Damongeot
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# If you want to add your langage, just add langage name to i18n_langage_list and repeat what is done for french langage
lset i18n_language_list "English"
set i18n_step1 "Step 1: Select Files and Folders"
set i18n_step2 "Customize Burning"
set i18n_burn_files_and_folders_on_a_dvd "Burn files and folders on a CD/DVD"
set i18n_only_create_iso9660_image "Only create iso9660 image"
set i18n_burn_iso9660_image "Burn iso9660 image"
set i18n_add_files "Add Files..."
set i18n_add_directory "Add Directory..."
set i18n_delete_file_dir "Delete File/Dir"
set i18n_clear_list "Clear List"
set i18n_excluded_files_dir "Excluded Files..."
set i18n_close "Close"
set i18n_used_space "Used space:"
set i18n_free_space "Free space:"
set i18n_burning_device "Burning device:"
set i18n_volume_name "Volume name:"
set i18n_command "Command:"
set i18n_erase_dvdrw "Erase DVD RW"
set i18n_erase_cdrw "Erase CD-RW"
set i18n_advanced_options_b "Advanced Options..."
set i18n_advanced_options_t "Advanced Options"
set i18n_burn "Burn"
set i18n_filesystem_extensions "Filesystem extensions:"
set i18n_add_joliet_extensions "Add Joliet extensions (-J)"
set i18n_rock_ridge_extensions "Rock Ridge extensions:"
set i18n_off "Off"
set i18n_rr_extensions "RR extensions (-R)"
set i18n_anonymous_rr_extensions "Anonymous RR extensions (all files set to r--r--r-- or +x if executable) (-r)"
set i18n_udf_extensions "UDF extensions:"
set i18n_udf_extensions_radiobutton "UDF extensions (-udf)"
set i18n_dvd_video_compliant_udf_filesystem "DVD Video complient UDF filesystem (-dvd-video)"
set i18n_dvd_size "CD/DVD size:"
set i18n_other_options "Other options:"
set i18n_burning_speed "Burning speed, leave blank for maximum speed (-speed=X)"
set i18n_overburn "Overburn (-overburn)"
set i18n_pad "Pad (-pad)"
set i18n_add_session_to_disc "Add session to disc (-M)"
set i18n_maximum_media_compatibility "Maximum media compatibility (if DVD R => create single session closed disc) (-dvd-compat)"
set i18n_eject_cd_after_burning "Eject CD after burning"
set i18n_automaticaly_refresh_used_space "Automaticaly refresh used space (may take a lot of time)"
set i18n_open "Open..."
set i18n_growisofs_mkisofs_output "growisofs/mkisofs/cdrecord output"
set i18n_update "Update"
set i18n_select_iso_image "Select ISO Image"
set i18n_erase "Erase"
set i18n_full_format "Full format (-blank=full)"
set i18n_full_format_cd "Full format (blank=all)"
set i18n_normal_format "Normal format (-force)"
set i18n_quick_format "Quick format"
set i18n_quick_format_cd "Quick format (blank=fast)"
set i18n_writing_finished "Writing finished"
set i18n_load_file_list "Load file list"
set i18n_save_file_list "Save file list"
set i18n_error_filelist_empty "File list is empty"
set i18n_error "Error"
set i18n_dvd_copy "DVD Copy"
set i18n_cd_copy "CD Copy"
set i18n_copy "Copy"
set i18n_choose_source_device "Choose source device:"
set i18n_quit "Quit"
set i18n_create_iso_from_dvd "Create ISO image from DVD"
set i18n_create_iso_from_cd "Create ISO image from CD"
set i18n_choose_target_file "Choose target file..."
set i18n_create "Create"
set i18n_error_target_file_ns "Target file not specified"
set i18n_error_directory_already_present "This directory is already present in file list"
set i18n_quest_directory_contained "This directory is already contained in another directory in the file list. Add it anyway?"
set i18n_quest_directory_contains "This directory contains files or directorys already present in file list. Add it anyway?"
set i18n_error_file_already_present "The following file is already present in file list"
set i18n_quest_file_contained "The following file is already contained in a directory of the file list. Add it anyway?"
set i18n_error_directory_not_present "This directory is not present in file list"
set i18n_error_file_not_present "This file is not present in file list"
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"
lappend i18n_language_list "French"
if { "$language" == "French" } {
set i18n_step1 "Etape 1: Selection des fichiers et des dossiers"
set i18n_step2 "Options de gravure"
set i18n_burn_files_and_folders_on_a_dvd "Graver les fichiers et les dossiers sur un CD/DVD"
set i18n_only_create_iso9660_image "Créer une image ISO"
set i18n_burn_iso9660_image "Graver une image ISO"
set i18n_add_files "Ajouter fichiers..."
set i18n_add_directory "Ajouter dossier..."
set i18n_delete_file_dir "Supprimer"
set i18n_clear_list "Vider la liste"
set i18n_excluded_files_dir "Fichiers exclus..."
set i18n_close "Fermer"
set i18n_used_space "Espace utilisé:"
set i18n_free_space "Espace libre:"
set i18n_burning_device "Périphérique:"
set i18n_volume_name "Nom de volume:"
set i18n_command "Commande:"
set i18n_erase_dvdrw "Effacer un DVD RW"
set i18n_erase_cdrw "Effacer un CD-RW"
set i18n_advanced_options_b "Options avancées..."
set i18n_advanced_options_t "Options avancées"
set i18n_burn "Graver"
set i18n_filesystem_extensions "Extensions du système de fichier:"
set i18n_add_joliet_extensions "Ajouter les extensions Joliet (-J)"
set i18n_rock_ridge_extensions "Extensions Rock Ridge:"
set i18n_off "Désactiver"
set i18n_rr_extensions "Extensions RR (-R)"
set i18n_anonymous_rr_extensions "Extensions RR anonymes (droits r--r--r-- ou +x si executable) (-r)"
set i18n_udf_extensions "Extensions UDF:"
set i18n_udf_extensions_radiobutton "Extensions UDF (-udf)"
set i18n_dvd_video_compliant_udf_filesystem "Extensions UDF en conformance avec le standard DVD Video (-dvd-video)"
set i18n_dvd_size "Taille des CD/DVD:"
set i18n_other_options "Autres options:"
set i18n_burning_speed "Vitesse de gravure, laisser vide pour vitesse maximum (-speed=X)"
set i18n_overburn "Overburn (-overburn)"
set i18n_pad "Pad (-pad)"
set i18n_add_session_to_disc "Ajouter une session au disque courant (-M)"
set i18n_maximum_media_compatibility "Compatibilité maximum (si DVD R => création d'un disque monosession fermé) (-dvd-compat)"
set i18n_eject_cd_after_burning "Ejecter le CD après la gravure"
set i18n_automaticaly_refresh_used_space "Rafraichissement automatique de l'espace disque utilisé (peut prendre beaucoup de temps)"
set i18n_open "Ouvrir..."
set i18n_growisofs_mkisofs_output "Sortie de growisofs/mkisofs/cdrecord"
set i18n_update "Rafraichir"
set i18n_select_iso_image "Selectionner l'image ISO"
set i18n_erase "Effacer"
set i18n_full_format "Formattage complet (-blank=full)"
set i18n_full_format_cd "Formattage complet (blank=all)"
set i18n_normal_format "Formattage normal (-force)"
set i18n_quick_format "Formattage rapide"
set i18n_quick_format_cd "Formattage rapide (blank=fast)"
set i18n_writing_finished "Opération terminée"
set i18n_load_file_list "Charger une liste de fichiers"
set i18n_save_file_list "Sauvegarder la liste de fichiers"
set i18n_error_filelist_empty "La liste des fichiers à graver est vide"
set i18n_error "Erreur"
set i18n_dvd_copy "Copier un DVD"
set i18n_cd_copy "Copier un CD"
set i18n_copy "Copier"
set i18n_choose_source_device "Choisissez le périphérique source:"
set i18n_quit "Quitter"
set i18n_create_iso_from_dvd "Créer une image ISO à partir d'un DVD"
set i18n_create_iso_from_cd "Créer une image ISO à partir d'un CD"
set i18n_choose_target_file "Choisir le fichier cible..."
set i18n_create "Créer"
set i18n_error_target_file_ns "Fichier cible non précisé"
set i18n_error_directory_already_present "Ce dossier est déjà présent dans la liste des fichiers"
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?"
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?"
set i18n_error_file_already_present "Le fichier suivant est déjà présent dans la liste des fichiers"
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?"
set i18n_error_directory_not_present "Ce fichier n'est pas présent dans la liste"
set i18n_error_file_not_present "Ce fichier n'est pas présent dans la liste"
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é"
}
lappend i18n_language_list "Italian"
if { "$language" == "Italian" } {
set i18n_step1 "Passo 1: Selezionare File e Directory"
set i18n_step2 "Personalizza Scrittura"
set i18n_burn_files_and_folders_on_a_dvd "Scrive file e directory sul CD/DVD"
set i18n_only_create_iso9660_image "Crea solo immagine iso9660"
set i18n_burn_iso9660_image "Scrivi immagine iso9660"
set i18n_add_files "Aggiungi File..."
set i18n_add_directory "Aggiungi Dir..."
set i18n_delete_file_dir "Elimina File/Dir"
set i18n_clear_list "Cancella Lista"
set i18n_excluded_files_dir "Escludi Files..."
set i18n_close "Chiudi"
set i18n_used_space "Spazio Usato:"
set i18n_free_space "Spazio Libero:"
set i18n_burning_device "Dispositivo di scrittura:"
set i18n_volume_name "Nome Volume:"
set i18n_command "Comando:"
set i18n_erase_dvdrw "Cancella DVD RW"
set i18n_erase_cdrw "Cancella CD-RW"
set i18n_advanced_options_b "Opzioni Avanzate..."
set i18n_advanced_options_t "Opzioni Avanzate"
set i18n_burn "Scrivi"
set i18n_filesystem_extensions "Estensioni del Filesystem:"
set i18n_add_joliet_extensions "Aggiungi Estesioni Joliet (-J)"
set i18n_rock_ridge_extensions "Estensioni Rock Ridge:"
set i18n_off "Inattivo"
set i18n_rr_extensions "Estensioni RR (-R)"
set i18n_anonymous_rr_extensions "Estensioni RR Anonime (tutti i file impostati a r--r--r-- o +x se eseguibile) (-r)"
set i18n_udf_extensions "Estensioni UDF:"
set i18n_udf_extensions_radiobutton "Estensioni UDF (-udf)"
set i18n_dvd_video_compliant_udf_filesystem "Filesystem DVD Video compatibile UDF (-dvd-video)"
set i18n_dvd_size "Dimensione CD/DVD:"
set i18n_other_options "Altre Opzioni:"
set i18n_overburn "Overburn (-overburn)"
set i18n_pad "Pad (-pad)"
set i18n_add_session_to_disc "Aggiungi sessione al disco (-M)"
set i18n_maximum_media_compatibility "Massima compatibilita' con i supporti (se DVD R => crea un disco con una sola sessione) (-dvd-compat)"
set i18n_automaticaly_refresh_used_space "Aggiorna automaticamente lo spazio usato (puo' richiedere molto tempo)"
set i18n_open "Apri..."
set i18n_growisofs_mkisofs_output "Output di growisofs/mkisofs/cdrecord"
set i18n_update "Aggiorna"
set i18n_select_iso_image "Seleziona un'immagine ISO"
set i18n_erase "Cancella"
set i18n_full_format "Formattazione completa (-blank=full)"
set i18n_full_format_cd "Formattazione completa (blank=all)"
set i18n_normal_format "Formattazione normale (-force)"
set i18n_quick_format "Formattazione rapida"
set i18n_quick_format_cd "Formattazione rapida (blank=fast)"
set i18n_writing_finished "Scrittura Completata"
set i18n_load_file_list "Carica lista file"
set i18n_save_file_list "Salva lista file"
set i18n_error_filelist_empty "lista file vuota"
set i18n_error "Errore"
set i18n_dvd_copy "Copia DVD"
set i18n_cd_copy "Copia CD"
set i18n_copy "Copia"
set i18n_choose_source_device "Scegli periferica di origine:"
set i18n_quit "Esci"
set i18n_create_iso_from_dvd "Crea immagineISO da un DVD"
set i18n_create_iso_from_cd "Crea immagineISO da un CD"
set i18n_choose_target_file "Scegli file destinazione..."
set i18n_create "Crea"
set i18n_error_target_file_ns "File destinazioen non specificato"
set i18n_error_directory_already_present "Questa direcotry e' gia' presente nella lista"
set i18n_quest_directory_contained "Questa directory e' gia' contenuta in un'altra presente nella lista. Continuare lo stesso?"
set i18n_quest_directory_contains "Questa directory contiene file o directory gia' presenti nella lista. Aggiungerla lo stesso?"
set i18n_error_file_already_present "Il file seguente e' gia' presente nella lista"
set i18n_quest_file_contained "Il file seguente e' gia' contenuto in una directry della lista. Aggiugnerlo lo stesso?"
set i18n_error_directory_not_present "Questa directory non e' presente nella lista"
set i18n_error_file_not_present "Questo file non e' presente nella lista"
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"
}
lappend i18n_language_list "Spanish"
if { "$language" == "Spanish" } {
set i18n_step1 "Paso 1: Seleccionar archivos y directorios"
set i18n_step2 "Paso 2: Grabaci├│n personalizada"
set i18n_burn_files_and_folders_on_a_dvd "Grabar archivos y directorios en el CD/DVD"
set i18n_only_create_iso9660_image "Solamente crear la imagen ISO9660"
set i18n_burn_iso9660_image "Grabar la imagen ISO9660"
set i18n_add_files "A├▒adir archivos"
set i18n_add_directory "A├▒adir directorios"
set i18n_delete_file_dir "Borrar archivo"
set i18n_clear_list "Limpiar lista"
set i18n_excluded_files_dir "Excluir archivos"
set i18n_close "Cerrar"
set i18n_used_space "Espacio usado:"
set i18n_free_space "Espacio libre:"
set i18n_burning_device "Dispositivo grabaci├│n:"
set i18n_volume_name "Nombre del volumen:"
set i18n_command "Orden:"
set i18n_erase_dvdrw "Borrar DVD RW"
set i18n_erase_cdrw "Borrar CD-RW"
set i18n_advanced_options_b "Opciones avanzadas"
set i18n_advanced_options_t "Opciones avanzadas"
set i18n_burn "Grabar"
set i18n_filesystem_extensions "Opciones detalladas:"
set i18n_add_joliet_extensions "A├▒adir Joliet (para Windows) (-J)"
set i18n_rock_ridge_extensions "Rock Ridge:"
set i18n_off "Apagado"
set i18n_rr_extensions "RR (-R)"
set i18n_anonymous_rr_extensions "An├│nimo RR (todos archivos son lecture fija o ejecutable) (-r)"
set i18n_udf_extensions "UDF:"
set i18n_udf_extensions_radiobutton "UDF (-udf)"
set i18n_dvd_video_compliant_udf_filesystem "DVD video UDF (-dvd-video)"
set i18n_dvd_size "Tama├▒o de CD/DVD:"
set i18n_other_options "Otras opciones:"
set i18n_overburn "Permitir overburning (-overburn)"
set i18n_pad "Pad (-pad)"
set i18n_add_session_to_disc "A├▒adir sesi├│n a disco (-M)"
set i18n_maximum_media_compatibility "Máximo tamaño del medio (si DVD R => crear unisesión disco cerrado) (-dvd-compat)"
set i18n_open "Abrir..."
set i18n_select_iso_image "Seleccionar la imagen ISO"
set i18n_erase "Borrar"
set i18n_full_format "Formato completo (-blank=full)"
set i18n_full_format_cd "Formato completo (blank=all)"
set i18n_normal_format "Formato normal (-force)"
set i18n_quick_format "Formato rápido"
set i18n_quick_format_cd "Formato rápido (blank=fast)"
set i18n_writing_finished "Grabando completo"
}
#source of the total file size count procedure
# Copyright 2003 Regis Damongeot
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
proc refresh_total_file_size {} {
global file_list total_file_size_f space_left_f command_line t_session excluded_file_list dvd_size
#set local var total_file_size_type cause if total_file_size < 1024 octets, total_file_size isnt set
set total_file_size_type "KB"
#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"
set total_file_size 0
#attention: $total_file_size is in KB to prevent overflow if $total_file_size > 2go
if {[llength $file_list] == 0} {
set total_file_size 0
} elseif { [llength $file_list] == 1 } {
if {[file isdirectory [lindex $file_list 0]]} {
set total_file_size [expr [lindex [exec du -ks -- [lindex $file_list 0]] 0] - [file size [lindex $file_list 0]]/1024]
#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)
set command_line "You need to enable overburning if you want to burn all theses files"
.f_burn.go_button configure -state disabled
} else {
#create list containing excluded files and directories prefixed with -m option
set excluded_file_list_t ""
foreach i $excluded_file_list {
append excluded_file_list_t "-m {$i} "
}
#create local variable that are copy of global ones, used to remove unused option
#for exemple, when creating ISO, no need of overburn option
#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 :-(
set local_option_overburn "$option_overburn"
set local_t_session "$t_session"
set local_burn_speed "$burn_speed"
set local_option_dvd_compat "$option_dvd_compat"
if { $v_create_iso == "yes" } {
set local_option_overburn ""
set local_t_session ""
set local_burn_speed ""
set local_option_dvd_compat ""
} else {
if { $burn_speed != "" } {
#for growisofs there is a "-" before speed option while cdrecord doesn't take one
if { $dvd_size > 716800 } {
set local_burn_speed "-speed=$burn_speed"
} else {
set local_burn_speed "speed=$burn_speed"
}
} else {
set local_burn_speed ""
}
}
#if we burn a DVD-Video UDF complient we need to not modify directory with graft points
if {$option_udf_ext != "-dvd-video" } {
#if burning a CD, command line is different (pipe between mkisofs and cdrecord)
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
label .f_burn_dev.l_burn_device -bg #f5f5f5 -width 20 -anchor w -text "$i18n_burning_device"
entry .f_burn_dev.burn_device -relief flat -bg white -highlightbackground blue -highlightcolor blue -disabledbackground #f5f5f5 -state normal -textvariable burning_device
label .f_vol_name.label_vname -bg #f5f5f5 -width 20 -anchor w -text "$i18n_volume_name"
entry .f_vol_name.volume_name -relief flat -bg white -highlightbackground blue -highlightcolor blue -disabledbackground #f5f5f5 -state normal -textvariable volume_id_o
entry .dvd_copy_window.f_source_device.e_bd -relief flat -bg white -highlightbackground blue -highlightcolor blue -disabledbackground #f5f5f5 -state normal -textvariable source_device
#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"
global file_list
if { [file isfile "$this_file"] } {
#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
#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"
global excluded_file_list
if { [file isfile "$this_file"] } {
#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