1#!/bin/sh
2# the next line restarts using /usr/local/bin/wish8.6 \
3exec /usr/local/bin/wish8.6 "$0" "$@"
4
5#    Copyright 2003,2008 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
23wm title . "TkDVD 4.0.9"
24wm geometry . 700x550
25wm protocol . WM_DELETE_WINDOW { save_options; destroy . }
26set burn_type "burn_dvd"
27set v_create_iso "no"
28set burning_device "/dev/cd0"
29#used when creating ISO to save CD/DVD device
30set temp_burning_device ""
31set dvd_burning_command "growisofs"
32set iso_creation_command "mkisofs"
33set cd_burning_command "cdrecord"
34#used when ckecking if genisoimage supports -allow-ilimited-size option
35set allow_limited_size "no"
36set volume_id ""
37set volume_id_o ""
38set option_udf_ext ""
39set option_joliet_ext "-J"
40set option_rr_ext "-r"
41set option_pad "-pad"
42set file_list ""
43set excluded_file_list ""
44set only_one_file ""
45set input ""
46set total_file_size_f "0 KB"
47set space_left_f "4.377 GB"
48set dvd_size "4589850"
49set selected_directory "[pwd]"
50set iso_file ""
51set t_session "-use-the-force-luke=tty -Z"
52set option_dvd_compat "-dvd-compat"
53set option_auto_refresh_space "1"
54set option_overburn ""
55set option_eject_cd ""
56set option_tao_dao_cd "-tao"
57set cd_session_type ""
58set burn_speed ""
59set language "English"
60set i18n_language_list ""
61set command_line "growisofs $t_session $burning_device $option_joliet_ext $option_rr_ext $burn_speed $option_dvd_compat $option_pad -graft-points"
62#needed to not have too large precision when showing total files size
63set tcl_precision 4
64
65#set fullpath to source scripts (if TkDVD not launch from it install direcotory)
66set source_directory "[info script]"
67if { [file pathtype $source_directory] == "absolute" } {
68	set source_directory [file dirname $source_directory]
69} else {
70	set source_directory "[file dirname [pwd]/[info script]]"
71}
72
73#we need to set a variable to fix compatibility problems between tcl 8.4 and 8.5
74# 8.5 has a tristate value for checkbuttons which is by default "" that conflits with offvalue for TkDVD advanced options
75# 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.
76set tristatecompatibility "no"
77if { [string equal -length 3 $tk_patchLevel "8.5"] == 1 } {
78  set tristatecompatibility "yes"
79}
80
81#we now check if cdrkit is present, we should use it
82# instead of cdrtools which has lower features
83if { [catch { exec -- which genisoimage } err] == 0 } {
84	#puts "cdrkit detected"
85	set iso_creation_command "genisoimage"
86	set cd_burning_command "wodim"
87	if { [catch { exec genisoimage -help |& grep allow-limited-size } err2] == 0 } {
88		#puts "cdrkit does allow limited size"
89		set allow_limited_size "yes"
90	}
91}
92
93#source combobox code
94if { [catch { package require combobox 2.3 } ] } {
95#do not leave space before the following line or install.tcl will not work
96source ${source_directory}/src/combobox.tcl
97}
98#source save/load config options procedure
99source ${source_directory}/src/save_load_options.tcl
100#load user default options
101load_options
102#change command line variable according to loaded values
103set command_line "growisofs $t_session $burning_device $option_joliet_ext $option_rr_ext $option_dvd_compat $option_pad -graft-points"
104#source internationalisation variables
105source ${source_directory}/src/internationalization.tcl
106#source of the total file size count procedure
107source ${source_directory}/src/proc_total_file_size.tcl
108#source of the refresh command line procedure (main procedure)
109source ${source_directory}/src/proc_refresh_cmd_line.tcl
110#source of excluded file window and its needed procedures
111source ${source_directory}/src/excluded_file_window.tcl
112#source advanced options window procedure
113source ${source_directory}/src/advanced_options_window.tcl
114#source main TkDVD window
115source ${source_directory}/src/main_window.tcl
116#source all procedures left
117source ${source_directory}/src/other_procedures.tcl
118#refresh space left for initial DVD size loaded from config file
119refresh_total_file_size
120#refresh cmd line (mkisofs for exemple if dvd size == CD size
121refresh_cmd_line
122
123