From 4b29eeb727ed9caaa02aef6ac4af3ae89761d3eb Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 3 Jan 2013 16:02:21 +0000 Subject: [PATCH] Removed surplus quotes around variable evaluation --- libisoburn/trunk/frontend/xorriso-tcltk | 1533 +++++++++--------- libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 770 insertions(+), 765 deletions(-) diff --git a/libisoburn/trunk/frontend/xorriso-tcltk b/libisoburn/trunk/frontend/xorriso-tcltk index aed9712d..c9b5c131 100755 --- a/libisoburn/trunk/frontend/xorriso-tcltk +++ b/libisoburn/trunk/frontend/xorriso-tcltk @@ -196,11 +196,11 @@ proc init_frontend_named_pipes {cmd_pipe reply_pipe} { global cmd_conn global reply_conn - set cmd_conn [open "$cmd_pipe" w] - set reply_conn [open "$reply_pipe" r] + set cmd_conn [open $cmd_pipe w] + set reply_conn [open $reply_pipe r] # Note: disencouraged flags would be necessary for opening idle fifo - # set reply_conn [open "$reply_pipe" {RDONLY NONBLOCK}] + # set reply_conn [open $reply_pipe {RDONLY NONBLOCK}] } @@ -216,7 +216,7 @@ proc send_async_cmd {cmd} { log_puts " $cmd" display_msg "======> $cmd" incr cmd_sent - puts $cmd_conn "$cmd" + puts $cmd_conn $cmd flush $cmd_conn } @@ -227,11 +227,11 @@ proc send_async_cmd {cmd} { proc send_marked_cmd {cmd} { global cmd_conn mark_count - send_async_cmd "$cmd" + send_async_cmd $cmd incr mark_count set mark_cmd "-mark $mark_count" log_puts " $mark_cmd" - puts $cmd_conn "$mark_cmd" + puts $cmd_conn $mark_cmd flush $cmd_conn await_all_replies } @@ -248,16 +248,16 @@ proc await_all_replies {} { clear_reply_lists while {1} { - set ret [gets "$reply_conn" line] - if {"$ret" < 0} { - if {"$expect_broken_pipes" != 1} { + set ret [gets $reply_conn line] + if {$ret < 0} { + if {$expect_broken_pipes != 1} { puts stderr "EOF at reply pipe" } break } - log_puts "$line" - if {[string range "$line" 0 0] == "M"} { - if {[string range "$line" 5 end] == "$mark_count"} { + log_puts $line + if {[string range $line 0 0] == "M"} { + if {[string range $line 5 end] == $mark_count} { break } else { # outdated mark message @@ -265,7 +265,7 @@ proc await_all_replies {} { } } - de_pkt_line "$line" + de_pkt_line $line } display_busy 0 @@ -283,29 +283,29 @@ proc de_pkt_line {line} { global emerging_result # Distinguish R and I - set ch [string range "$line" 0 0] + set ch [string range $line 0 0] - set payload [string range "$line" 5 end] - if {"$ch" == "R"} { + set payload [string range $line 5 end] + if {$ch == "R"} { set emerging_result "$emerging_result$payload" - } else { if {"$ch" == "I"} { + } else { if {$ch == "I"} { set emerging_info "$emerging_info$payload" } else { return "" }} # if line end : add to list - if {[string range "$line" 2 2] == "1"} { - if {"$ch" == "R"} { - lappend result_list "$emerging_result" + if {[string range $line 2 2] == "1"} { + if {$ch == "R"} { + lappend result_list $emerging_result incr result_count - display_msg "$emerging_result" + display_msg $emerging_result set emerging_result "" } else { - lappend info_list "$emerging_info" + lappend info_list $emerging_info incr info_count - display_msg "$emerging_info" - scan_info_for_event "$emerging_info" + display_msg $emerging_info + scan_info_for_event $emerging_info set emerging_info "" } } @@ -321,34 +321,34 @@ proc scan_info_for_event {line} { global display_msg_enabled # check for word : CAPS : text ... - set ret [regexp {[a-z][a-z]*[ ]*: [A-Z][A-Z]* :} "$line"] + set ret [regexp {[a-z][a-z]*[ ]*: [A-Z][A-Z]* :} $line] - if {"$ret" != 1} {return ""} + if {$ret != 1} {return ""} # retrieve severity - set pos [string first ":" "$line"] - set sev [string range "$line" [expr $pos+2] end] - set pos [string first ":" "$sev"] - set sev [string range "$sev" 0 [expr $pos-2]]; + set pos [string first ":" $line] + set sev [string range $line [expr $pos+2] end] + set pos [string first ":" $sev] + set sev [string range $sev 0 [expr $pos-2]]; - if {[compare_sev "$sev" "$highest_seen_cmd_sev"] > 0} { - set highest_seen_cmd_sev "$sev" + if {[compare_sev $sev $highest_seen_cmd_sev] > 0} { + set highest_seen_cmd_sev $sev } - if {[compare_sev "$sev" "$scan_event_threshold"] < 0} {return ""} + if {[compare_sev $sev $scan_event_threshold] < 0} {return ""} - if {"$display_msg_enabled" == 0} { + if {$display_msg_enabled == 0} { set display_msg_enabled 1 - display_msg "$line" + display_msg $line set display_msg_enabled 0 } - if {[compare_sev "$sev" "$highest_total_sev"] >= 0} { - set highest_total_sev "$sev" - set highest_total_sev_msg "$line" + if {[compare_sev $sev $highest_total_sev] >= 0} { + set highest_total_sev $sev + set highest_total_sev_msg $line } - if {[compare_sev "$sev" "$highest_cmd_sev"] >= 0} { - set highest_cmd_sev "$sev" - set highest_cmd_sev_msg "$line" + if {[compare_sev $sev $highest_cmd_sev] >= 0} { + set highest_cmd_sev $sev + set highest_cmd_sev_msg $line } } @@ -360,27 +360,27 @@ proc de_sieve {} { global result_list global sieve_ret - set sieve_ret [lindex "$result_list" 0] - set sieve_result_count [lindex "$result_list" 1] + set sieve_ret [lindex $result_list 0] + set sieve_result_count [lindex $result_list 1] set payload "" set sieve_result_count 0 - for {set i 2} {$i < [llength "$result_list"]} {incr i} { + for {set i 2} {$i < [llength $result_list]} {incr i} { set line "" - set num_lines [lindex "$result_list" $i] - for {set j 0} {$j < "$num_lines"} {incr j} { + set num_lines [lindex $result_list $i] + for {set j 0} {$j < $num_lines} {incr j} { incr i - set line "$line[lindex "$result_list" $i]" - if {$j < "$num_lines" - 1} { + set line "$line[lindex $result_list $i]" + if {$j < $num_lines - 1} { set line "$line\n" } else { - lappend payload "$line" + lappend payload $line incr sieve_result_count } } } - set result_list "$payload" - set result_count "$sieve_result_count" + set result_list $payload + set result_count $sieve_result_count } @@ -392,37 +392,37 @@ proc de_sieve {} { proc wait_for_msg {prefix channel} { global reply_conn - if {"$channel" == "M"} { + if {$channel == "M"} { set channel_prefix "M:0: " } else { set channel_prefix "$channel:1: " } - set prefix_l [string length "$prefix"] + set prefix_l [string length $prefix] while {1} { # >>> Have a timeout - set ret [gets "$reply_conn" line] - if {"$ret" < 0} { + set ret [gets $reply_conn line] + if {$ret < 0} { break } - log_puts "$line" - if {[string length "$line"] < "$prefix_l"} { - display_msg "$line" + log_puts $line + if {[string length $line] < $prefix_l} { + display_msg $line continue } - if {[string range "$line" 0 [expr "$prefix_l - 1"]] == "$prefix"} { - return [string range "$line" "$prefix_l" end] + if {[string range $line 0 [expr $prefix_l-1]] == $prefix} { + return [string range $line $prefix_l end] } - if {[string length "$line"] >= [expr "$prefix_l + 5"]} { - if {[string range "$line" 0 4] == "$channel_prefix"} { - if {[string range "$line" 5 [expr "$prefix_l + 4"]] == "$prefix"} { - return [string range "$line" [expr "$prefix_l + 5"] end] + if {[string length $line] >= [expr $prefix_l+5]} { + if {[string range $line 0 4] == $channel_prefix} { + if {[string range $line 5 [expr $prefix_l+4]] == $prefix} { + return [string range $line [expr $prefix_l+5] end] } } } - display_msg "$line" + display_msg $line } } @@ -464,7 +464,7 @@ proc reset_highest_cmd_sev {} { proc clear_sieve {} { set disp_en_mem [set_display_msg 0] send_marked_cmd "-msg_op clear_sieve -" - set_display_msg "$disp_en_mem" + set_display_msg $disp_en_mem } @@ -473,7 +473,7 @@ proc clear_sieve {} { proc read_sieve {name} { set disp_en_mem [set_display_msg 0] send_marked_cmd "-msg_op read_sieve '$name'" - set_display_msg "$disp_en_mem" + set_display_msg $disp_en_mem de_sieve } @@ -491,7 +491,7 @@ proc obtain_drive_info {dev} { set line "" - if {"$dev" == "in"} { + if {$dev == "in"} { set indev_medium_status "missing" set indev_profile "" } else { @@ -499,46 +499,46 @@ proc obtain_drive_info {dev} { set outdev_profile "" } read_sieve "Media status :" - if {"$sieve_ret" > 0} { - set reply [lindex "$result_list" 0] + if {$sieve_ret > 0} { + set reply [lindex $result_list 0] foreach i {blank appendable closed} { - if {[string first "$i" "$reply"] != -1} { + if {[string first $i $reply] != -1} { set line "$i " - if {"$dev" == "in"} { - set indev_medium_status "$i" + if {$dev == "in"} { + set indev_medium_status $i } else { - set outdev_medium_status "$i" + set outdev_medium_status $i } break } } } read_sieve "Media current:" - if {"$sieve_ret" > 0} { - set profile [lindex "$result_list" 0] - if {"$profile" == "is not recognizable"} { + if {$sieve_ret > 0} { + set profile [lindex $result_list 0] + if {$profile == "is not recognizable"} { set profile "no recognizable medium" set line "$line$profile" - return "$line" + return $line } else { set line "$line$profile, " - if {"$dev" == "in"} { - set indev_profile "$profile" + if {$dev == "in"} { + set indev_profile $profile } else { - set outdev_profile "$profile" + set outdev_profile $profile } } } read_sieve "Media summary:" - if {"$sieve_ret" > 0} { - set line "$line[lindex "$result_list" 0] sessions, " - if {"$dev" == "in"} { - set line "$line[lindex "$result_list" 2] used" + if {$sieve_ret > 0} { + set line "$line[lindex $result_list 0] sessions, " + if {$dev == "in"} { + set line "$line[lindex $result_list 2] used" } else { - set line "$line[lindex "$result_list" 3] free" + set line "$line[lindex $result_list 3] free" } } - return "$line" + return $line } @@ -549,9 +549,9 @@ proc changes_are_pending {} { set disp_en_mem [set_display_msg 0] send_marked_cmd "-changes_pending show_status" - set_display_msg "$disp_en_mem" - if {"$result_count" >= 1} { - if {[lindex "$result_list" 0] == "-changes_pending no"} { + set_display_msg $disp_en_mem + if {$result_count >= 1} { + if {[lindex $result_list 0] == "-changes_pending no"} { return "0" } return "1" @@ -567,16 +567,16 @@ proc changes_are_pending {} { proc get_iso_filetype {adr} { global result_list result_count scan_event_threshold - set scan_event_mem "$scan_event_threshold" + set scan_event_mem $scan_event_threshold set scan_event_threshold "SORRY" set disp_en_mem [set_display_msg 0] - send_marked_cmd "-lsdl [make_text_shellsafe "$adr"] --" - set_display_msg "$disp_en_mem" - set scan_event_threshold "$scan_event_mem" - if {"$result_count" <= 0} { + send_marked_cmd "-lsdl [make_text_shellsafe $adr] --" + set_display_msg $disp_en_mem + set scan_event_threshold $scan_event_mem + if {$result_count <= 0} { return "" } - return [string range [lindex "$result_list" 0] 0 0] + return [string range [lindex $result_list 0] 0 0] } @@ -588,13 +588,13 @@ proc assert_iso_image {with_msg} { set disp_en_mem [set_display_msg 0] set highest_seen_cmd_sev "" - set set_mem "$scan_event_threshold" + set set_mem $scan_event_threshold set scan_event_threshold "FATAL" send_marked_cmd "-lsd / --" - set scan_event_threshold "$set_mem" - set_display_msg "$disp_en_mem" - if {[compare_sev "$highest_seen_cmd_sev" "FAILURE"] >= 0} { - if {"$with_msg" == 1} { + set scan_event_threshold $set_mem + set_display_msg $disp_en_mem + if {[compare_sev $highest_seen_cmd_sev "FAILURE"] >= 0} { + if {$with_msg == 1} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : First you need to create or load an ISO image by selecting a drive or an image file" } return "0" @@ -611,9 +611,9 @@ proc inquire_severity_list {} { set disp_en_mem [set_display_msg 0] send_marked_cmd "-msg_op list_sev -" - set_display_msg "$disp_en_mem" - if {[lindex "$result_list" 0] != ""} { - set xorriso_severity_list [split [lindex "$result_list" 0] " "] + set_display_msg $disp_en_mem + if {[lindex $result_list 0] != ""} { + set xorriso_severity_list [split [lindex $result_list 0] " "] } } @@ -623,13 +623,13 @@ proc inquire_severity_list {} { proc set_inquired_dev {} { global result_list eff_indev_adr eff_outdev_adr - if {[llength "$result_list"] < 2} {return ""} - set what [lindex "$result_list" 0] - if {"$what" == "-dev" || "$what" == "-indev"} { - set eff_indev_adr [lindex "$result_list" 1] + if {[llength $result_list] < 2} {return ""} + set what [lindex $result_list 0] + if {$what == "-dev" || $what == "-indev"} { + set eff_indev_adr [lindex $result_list 1] } - if {"$what" == "-dev" || "$what" == "-outdev"} { - set eff_outdev_adr [lindex "$result_list" 1] + if {$what == "-dev" || $what == "-outdev"} { + set eff_outdev_adr [lindex $result_list 1] } } @@ -644,7 +644,7 @@ proc inquire_dev {} { set disp_en_mem [set_display_msg 0] send_marked_cmd "-status -dev" handle_result_list set_inquired_dev "''" "''" 2 0 - set_display_msg "$disp_en_mem" + set_display_msg $disp_en_mem update idletasks return "" } @@ -657,8 +657,8 @@ proc update_dev_var {} { global result_list eff_indev_adr eff_outdev_adr indev_adr outdev_adr inquire_dev - set indev_adr "$eff_indev_adr" - set outdev_adr "$eff_outdev_adr" + set indev_adr $eff_indev_adr + set outdev_adr $eff_outdev_adr } @@ -667,9 +667,9 @@ proc update_dev_var {} { proc isofs_ls_handler {} { global result_list isofs_ls_result - if {[lindex "$result_list" 0] == "total"} {return ""} + if {[lindex $result_list 0] == "total"} {return ""} lappend isofs_ls_result \ - "[string range [lindex "$result_list" 0] 0 0] [lindex "$result_list" 8]" + "[string range [lindex $result_list 0] 0 0] [lindex $result_list 8]" } @@ -680,10 +680,10 @@ proc isofs_ls {dir} { set isofs_ls_result "" set disp_en_mem [set_display_msg 0] - send_marked_cmd "-lsl [make_text_shellsafe "$dir"]" + send_marked_cmd "-lsl [make_text_shellsafe $dir]" handle_result_list isofs_ls_handler "''" "''" 0 0 - set_display_msg "$disp_en_mem" - return "$isofs_ls_result" + set_display_msg $disp_en_mem + return $isofs_ls_result } @@ -694,10 +694,10 @@ proc isofs_filetype {path} { global result_list set disp_en_mem [set_display_msg 0] - send_marked_cmd "-lsdl [make_text_shellsafe "$path"]" - set_display_msg "$disp_en_mem" - if {[llength "$result_list"] < 1} {return ""} - return [string range [lindex "$result_list" 0] 0 0] + send_marked_cmd "-lsdl [make_text_shellsafe $path]" + set_display_msg $disp_en_mem + if {[llength $result_list] < 1} {return ""} + return [string range [lindex $result_list 0] 0 0] } @@ -716,16 +716,16 @@ proc check_xorriso_version {} { # set an individual -mark and use send_async_cmd set mark_text "xorriso-tcltk-version-check-[clock seconds]" - send_async_cmd "-mark [make_text_shellsafe "$mark_text"]" - set_display_msg "$disp_en_mem" - wait_for_msg "$mark_text" "M" + send_async_cmd "-mark [make_text_shellsafe $mark_text]" + set_display_msg $disp_en_mem + wait_for_msg $mark_text "M" set_display_msg 0 send_async_cmd "-version" set xorriso_version [wait_for_msg "xorriso version : " "R"] - if {"$xorriso_version" < "$min_xorriso_version"} { + if {$xorriso_version < $min_xorriso_version} { puts stderr "xorriso-tcltk: xorriso-$xorriso_version is too old." puts stderr "xorriso-tcltk: Need at least version $min_xorriso_version" window_ack \ @@ -733,7 +733,7 @@ proc check_xorriso_version {} { "red" "embedded" central_exit 2 } - set_display_msg "$disp_en_mem" + set_display_msg $disp_en_mem } @@ -773,7 +773,7 @@ proc setup_xorriso {} { set cmd "$cmd -disk_pattern off" set cmd "$cmd -follow mount:limit=100" - send_marked_cmd "$cmd" + send_marked_cmd $cmd inquire_severity_list } @@ -782,15 +782,15 @@ proc setup_xorriso {} { proc effectuate_permission_policy {} { global permission_policy - if {"$permission_policy" == "readable"} { + if {$permission_policy == "readable"} { send_marked_cmd \ "-find / -exec chmod a+r -- -find / -type d -exec chmod a+x --" } - if {"$permission_policy" == "readonly"} { + if {$permission_policy == "readonly"} { send_marked_cmd \ "-find / -exec chmod a=r -- -find / -type d -exec chmod a+x --" } - if {"$permission_policy" == "mkisofs_r"} { + if {$permission_policy == "mkisofs_r"} { send_marked_cmd \ "-find / -exec mkisofs_r" } @@ -815,16 +815,16 @@ proc start_bulkparse {prefix separators max_words flag num_lines} { global bulk_parse_mode bulk_parse_prefix bulk_parse_separators global bulk_parse_max_words bulk_parse_flag bulk_parse_num_texts - if {"$num_lines" <= 0} {return ""} + if {$num_lines <= 0} {return ""} - set bulk_parse_prefix "$prefix" - set bulk_parse_separators "$separators" - set bulk_parse_max_words "$max_words" - set bulk_parse_flag "$flag" - set bulk_parse_num_texts "$num_lines" - if {"$bulk_parse_mode" == 1} { + set bulk_parse_prefix $prefix + set bulk_parse_separators $separators + set bulk_parse_max_words $max_words + set bulk_parse_flag $flag + set bulk_parse_num_texts $num_lines + if {$bulk_parse_mode == 1} { set cmd "-msg_op parse_bulk \"$prefix $separators $max_words $flag $num_lines\"" - send_async_cmd "$cmd" + send_async_cmd $cmd # Do not wait for mark } } @@ -839,42 +839,42 @@ proc submit_bulkparse {text} { global bulk_parse_mode bulk_parse_prefix bulk_parse_separators global bulk_parse_max_words bulk_parse_flag - if {"$bulk_parse_mode" != 1} { + if {$bulk_parse_mode != 1} { clear_reply_lists } set disp_en_mem [set_display_msg 0] - set num_lines [expr [count_newlines "$text"] + 1] + set num_lines [expr [count_newlines $text] + 1] - if {"$bulk_parse_mode" == 0} { + if {$bulk_parse_mode == 0} { set cmd "-msg_op parse \"$bulk_parse_prefix $bulk_parse_separators $bulk_parse_max_words $bulk_parse_flag $num_lines\"" - send_async_cmd "$cmd" + send_async_cmd $cmd } else { log_puts ">>>>> $num_lines" - puts $cmd_conn "$num_lines" + puts $cmd_conn $num_lines } log_puts ">>>>> $text" - puts $cmd_conn "$text" + puts $cmd_conn $text flush $cmd_conn - if {"$bulk_parse_mode" != 1} { + if {$bulk_parse_mode != 1} { set loop_limit 2 - while {"$result_count" < "$loop_limit"} { - set ret [gets "$reply_conn" line] - if {"$ret" < 0} { return ""} - log_puts "$line" - de_pkt_line "$line" - if {"$result_count" == 1} { - set parse_ret [lindex "$result_list" 0] + while {$result_count < $loop_limit} { + set ret [gets $reply_conn line] + if {$ret < 0} { return ""} + log_puts $line + de_pkt_line $line + if {$result_count == 1} { + set parse_ret [lindex $result_list 0] } - if {"$result_count" == 2} { - set num_replies [lindex "$result_list" 1] + if {$result_count == 2} { + set num_replies [lindex $result_list 1] set loop_limit [expr "$num_replies * 2 + 2"] } } de_sieve } - set_display_msg "$disp_en_mem" + set_display_msg $disp_en_mem } @@ -885,15 +885,15 @@ proc submit_bulkparse {text} { proc read_bulkparse {handler_proc num_texts} { global bulk_parse_mode - if {"$bulk_parse_mode" != 1} { return ""} + if {$bulk_parse_mode != 1} { return ""} set disp_en_mem [set_display_msg 0] - for {set i 0} {"$i" < "$num_texts"} {incr i} { + for {set i 0} {$i < $num_texts} {incr i} { clear_reply_lists read_parse_reply $handler_proc } - set_display_msg "$disp_en_mem" + set_display_msg $disp_en_mem } @@ -904,16 +904,16 @@ proc read_parse_reply {} { global result_list result_count set loop_limit 2 - while {"$result_count" < "$loop_limit"} { - set ret [gets "$reply_conn" line] - if {"$ret" < 0} { return ""} - log_puts "$line" - de_pkt_line "$line" - if {"$result_count" == 1} { - set parse_ret [lindex "$result_list" 0] + while {$result_count < $loop_limit} { + set ret [gets $reply_conn line] + if {$ret < 0} { return ""} + log_puts $line + de_pkt_line $line + if {$result_count == 1} { + set parse_ret [lindex $result_list 0] } - if {"$result_count" == 2} { - set num_replies [lindex "$result_list" 1] + if {$result_count == 2} { + set num_replies [lindex $result_list 1] set loop_limit [expr "$num_replies * 2 + 2"] } } @@ -934,36 +934,36 @@ proc handle_result_list {handler_proc \ global result_list global bulk_parse_mode bulk_parse_max_chunk - set raw_list "$result_list" - set raw_line_count [expr [llength "$raw_list"]] - if {"$raw_line_count" > "$bulk_parse_max_chunk"} { - set chunk_size "$bulk_parse_max_chunk" + set raw_list $result_list + set raw_line_count [expr [llength $raw_list]] + if {$raw_line_count > $bulk_parse_max_chunk} { + set chunk_size $bulk_parse_max_chunk } else { - set chunk_size "$raw_line_count" + set chunk_size $raw_line_count } - start_bulkparse "$prefix" "$separators" "$max_words" "$flag" "$chunk_size" + start_bulkparse $prefix $separators $max_words $flag $chunk_size set submit_count 0 set submit_in_chunk_count 0 - foreach i "$raw_list" { - submit_bulkparse "$i" + foreach i $raw_list { + submit_bulkparse $i incr submit_count incr submit_in_chunk_count - if {"$bulk_parse_mode" != 1} { + if {$bulk_parse_mode != 1} { $handler_proc } - if {"$bulk_parse_mode" == 1 && "$submit_in_chunk_count" == "$chunk_size"} { - read_bulkparse "$handler_proc" "$chunk_size" - set todo [expr "$raw_line_count" - "$submit_count"] - if {"$todo" <= 0} { + if {$bulk_parse_mode == 1 && $submit_in_chunk_count == $chunk_size} { + read_bulkparse $handler_proc $chunk_size + set todo [expr "$raw_line_count - $submit_count"] + if {$todo <= 0} { break } - if {"$todo" > "$bulk_parse_max_chunk"} { - set chunk_size "$bulk_parse_max_chunk" + if {$todo > $bulk_parse_max_chunk} { + set chunk_size $bulk_parse_max_chunk } else { - set chunk_size "$todo" + set chunk_size $todo } - start_bulkparse "$prefix" "$separators" "$max_words" "$flag" \ - "$chunk_size" + start_bulkparse $prefix $separators $max_words $flag \ + $chunk_size set submit_in_chunk_count 0 } } @@ -1100,7 +1100,7 @@ proc cmdline_return {} { reset_highest_cmd_sev set_display_msg 1 - send_marked_cmd "$cmdline" + send_marked_cmd $cmdline set cmdline "" # To force display of GUI changes now and not some time later @@ -1122,7 +1122,7 @@ proc indev_return {} { } reset_highest_cmd_sev send_marked_cmd "-indev [make_text_shellsafe $indev_adr]" - set indev_mem_adr "$indev_adr" + set indev_mem_adr $indev_adr .indev_entry icursor 0 refresh_indev return "1" @@ -1149,7 +1149,7 @@ proc outdev_return {} { reset_highest_cmd_sev send_marked_cmd "-outdev [make_text_shellsafe $outdev_adr]" - set outdev_mem_adr "$outdev_adr" + set outdev_mem_adr $outdev_adr .outdev_entry icursor 0 refresh_outdev return "1" @@ -1161,7 +1161,7 @@ proc outdev_return {} { proc eject_outdev {} { global outdev_adr indev_adr - if {"$outdev_adr" == "$indev_adr"} { + if {$outdev_adr == $indev_adr} { if {[assert_no_changes] == 0} {return ""} } reset_highest_cmd_sev @@ -1177,7 +1177,7 @@ proc dev_return {} { global outdev_adr indev_adr global .outdev_entry .indev_entry - if {"$outdev_adr" != "$indev_adr"} { + if {$outdev_adr != $indev_adr} { if {[indev_return] == 0} {return "0"} outdev_return } else { @@ -1212,14 +1212,14 @@ proc refresh_indev {} { clear_sieve send_marked_cmd "-toc_of in:short" read_sieve "Drive current:" - set_display_msg "$disp_en_mem" - if {"$sieve_ret" > 0} { - set cmd [lindex "$result_list" 0] - if {"$cmd" == "-indev" || "$cmd" == "-dev"} { - set indev_adr [lindex "$result_list" 1] + set_display_msg $disp_en_mem + if {$sieve_ret > 0} { + set cmd [lindex $result_list 0] + if {$cmd == "-indev" || $cmd == "-dev"} { + set indev_adr [lindex $result_list 1] } set line [obtain_drive_info in] - .indev_summary configure -text "$line" + .indev_summary configure -text $line } .avail_label configure -text "" update idletasks @@ -1243,14 +1243,14 @@ proc refresh_outdev {} { clear_sieve send_marked_cmd "-toc_of out:short" read_sieve "Drive current:" - set_display_msg "$disp_en_mem" - if {"$sieve_ret" > 0} { - set cmd [lindex "$result_list" 0] - if {"$cmd" == "-outdev" || "$cmd" == "-dev"} { - set outdev_adr [lindex "$result_list" 1] + set_display_msg $disp_en_mem + if {$sieve_ret > 0} { + set cmd [lindex $result_list 0] + if {$cmd == "-outdev" || $cmd == "-dev"} { + set outdev_adr [lindex $result_list 1] } set line [obtain_drive_info out] - .outdev_summary configure -text "$line" + .outdev_summary configure -text $line } .avail_label configure -text "" update idletasks @@ -1265,14 +1265,14 @@ proc scan_for_drives {} { global sieve_ret result_list devlist devices_scanned indev_adr outdev_adr if {[assert_no_changes] == 0} {return ""} - if {"$indev_adr" != "" || "$outdev_adr" != ""} { + if {$indev_adr != "" || $outdev_adr != ""} { if {[window_yesno \ "Really give up aquired drives for scanning a new drive list ?"] \ != 1} { return "" } } set max_idx [.drivelist index end] - .drivelist delete 0 [expr "$max_idx-1"] + .drivelist delete 0 [expr $max_idx-1] set devlist "" reset_highest_cmd_sev @@ -1281,18 +1281,18 @@ proc scan_for_drives {} { set max_idx 0 while {1} { read_sieve "? -dev" - if {"$sieve_ret" > 0} { - .drivelist insert end "[lindex "$result_list" 0] : [lindex "$result_list" 2] [lindex "$result_list" 3]" - lappend devlist [lindex "$result_list" 0] + if {$sieve_ret > 0} { + .drivelist insert end "[lindex $result_list 0] : [lindex $result_list 2] [lindex $result_list 3]" + lappend devlist [lindex $result_list 0] } else { break } } while {1} { read_sieve "?? -dev" - if {"$sieve_ret" > 0} { - .drivelist insert end "[lindex "$result_list" 0] : [lindex "$result_list" 2] [lindex "$result_list" 3]" - lappend devlist [lindex "$result_list" 0] + if {$sieve_ret > 0} { + .drivelist insert end "[lindex $result_list 0] : [lindex $result_list 2] [lindex $result_list 3]" + lappend devlist [lindex $result_list 0] } else { break } @@ -1358,26 +1358,26 @@ proc pick_drive {role} { global highest_cmd_sev_msg outdev_adr indev_adr devices_scanned set selected [.drivelist curselection] - if {[llength "$selected"] != 1} { + if {[llength $selected] != 1} { set must_scan "" - if {"$devices_scanned" == 0} { set must_scan " scan and"} + if {$devices_scanned == 0} { set must_scan " scan and"} xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : First you must$must_scan select a single drive" return "" } - set drive_idx [lindex "$selected" 0] + set drive_idx [lindex $selected 0] - if {"$role" == "dev"} { - set outdev_adr [lindex "$devlist" "$drive_idx"] - set indev_adr [lindex "$devlist" "$drive_idx"] + if {$role == "dev"} { + set outdev_adr [lindex $devlist $drive_idx] + set indev_adr [lindex $devlist $drive_idx] dev_return } - if {"$role" == "outdev"} { - set outdev_adr [lindex "$devlist" "$drive_idx"] + if {$role == "outdev"} { + set outdev_adr [lindex $devlist $drive_idx] outdev_return } - if {"$role" == "indev"} { - set indev_adr [lindex "$devlist" "$drive_idx"] + if {$role == "indev"} { + set indev_adr [lindex $devlist $drive_idx] indev_return } .drivelist selection clear 0 end @@ -1419,37 +1419,37 @@ proc isodir_return {caller} { set isolist_types "" inquire_dev - if {"$eff_indev_adr" == "" && [changes_are_pending] == "0"} {return ""} + if {$eff_indev_adr == "" && [changes_are_pending] == "0"} {return ""} normalize_isodir_adr - set file_type [isofs_filetype "$isodir_adr"] - if {"$file_type" != "d" && "$file_type" != ""} { + set file_type [isofs_filetype $isodir_adr] + if {$file_type != "d" && $file_type != ""} { .isolist insert end "@@@ exists but is not a directory @@@" set isodir_is_pwd 0 return "" } set disp_en_mem [set_display_msg 0] - set highest_cmd_sev_mem "$highest_cmd_sev" - set highest_cmd_sev_msg_mem "$highest_cmd_sev_msg" + set highest_cmd_sev_mem $highest_cmd_sev + set highest_cmd_sev_msg_mem $highest_cmd_sev_msg reset_highest_cmd_sev - send_marked_cmd "-cd [make_text_shellsafe "$isodir_adr"]" - if {[compare_sev "$highest_cmd_sev" "WARNING"] < 0} { + send_marked_cmd "-cd [make_text_shellsafe $isodir_adr]" + if {[compare_sev $highest_cmd_sev "WARNING"] < 0} { send_marked_cmd "-lsl --" set isodir_is_pwd 1 } else { - send_marked_cmd "-lsl [make_text_shellsafe "$isodir_adr"] --" + send_marked_cmd "-lsl [make_text_shellsafe $isodir_adr] --" set isodir_is_pwd 0 } handle_result_list isolist_parse_handler "''" "''" 0 0 - set_display_msg "$disp_en_mem" - set highest_cmd_sev "$highest_cmd_sev_mem" - set highest_cmd_sev_msg "$highest_cmd_sev_msg_mem" + set_display_msg $disp_en_mem + set highest_cmd_sev $highest_cmd_sev_mem + set highest_cmd_sev_msg $highest_cmd_sev_msg_mem - if {"$isodir_return_name" != ""} { - set idx [lsearch -exact "$isolist_names" "$isodir_return_name"] - if {"$idx" != -1} { - .isolist see "$idx" - .isolist selection set "$idx" + if {$isodir_return_name != ""} { + set idx [lsearch -exact $isolist_names $isodir_return_name] + if {$idx != -1} { + .isolist see $idx + .isolist selection set $idx } set isodir_return_name "" } @@ -1466,11 +1466,11 @@ proc isolist_parse_handler {} { global result_list isolist_names isolist_types global .isolist - if {[lindex "$result_list" 0] == "total"} {return ""} - set name [lindex "$result_list" 8] - set ftype [string range [lindex "$result_list" 0] 0 0] - lappend isolist_names "$name" - lappend isolist_types "$ftype" + if {[lindex $result_list 0] == "total"} {return ""} + set name [lindex $result_list 8] + set ftype [string range [lindex $result_list 0] 0 0] + lappend isolist_names $name + lappend isolist_types $ftype .isolist insert end "$ftype $name" } @@ -1483,21 +1483,21 @@ proc pick_isodir {} { global .isolist set selected [.isolist curselection] - if {[llength "$selected"] != 1} { + if {[llength $selected] != 1} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : First you must select a single directory" return "" } - set idx [lindex "$selected" 0] - if {[lindex "$isolist_types" "$idx"] != "d"} { + set idx [lindex $selected 0] + if {[lindex $isolist_types $idx] != "d"} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : You may only double-click a directory" return "" } - if {"$isodir_adr" == "/"} { + if {$isodir_adr == "/"} { set isodir_adr "" } - set isodir_adr "$isodir_adr/[lindex $isolist_names "$idx"]" + set isodir_adr "$isodir_adr/[lindex $isolist_names $idx]" set isodir_return_name "" isodir_return "pick_isodir" } @@ -1510,21 +1510,21 @@ proc isodir_up {} { global isodir_adr isodir_return_name set isodir_return_name "" - set idx [string last "/" "$isodir_adr"] - set l [string length "$isodir_adr"] - if {"$idx" == -1} { - set isodir_return_name "$isodir_adr" + set idx [string last "/" $isodir_adr] + set l [string length $isodir_adr] + if {$idx == -1} { + set isodir_return_name $isodir_adr set isodir_adr "/" } else { - if {"$idx" > 0} { - if {"$idx" < [expr "$l" - 1]} { + if {$idx > 0} { + if {$idx < [expr $l - 1]} { set isodir_return_name \ - [string range "$isodir_adr" [expr "$idx" + 1] end] + [string range $isodir_adr [expr $idx+1] end] } - set isodir_adr [string range "$isodir_adr" 0 [expr "$idx" - 1]] + set isodir_adr [string range $isodir_adr 0 [expr $idx - 1]] } else { - if {"$l" > 1} { - set isodir_return_name [string range "$isodir_adr" 1 end] + if {$l > 1} { + set isodir_return_name [string range $isodir_adr 1 end] } set isodir_adr "/" } @@ -1542,37 +1542,37 @@ proc isomanip_mv {} { global isomanip_move_target isolist_names isodir_is_pwd isodir_adr global isodir_return_name - if {"$isomanip_move_target" == ""} { + if {$isomanip_move_target == ""} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : First you must enter a target address" return "" } set selected [.isolist curselection] - set num_selected [llength "$selected"] - if {"$num_selected" < 1} { + set num_selected [llength $selected] + if {$num_selected < 1} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : First you must select one or more ISO files" return "" } - set target "$isomanip_move_target" - if {"$isodir_is_pwd" == 0 && [string range "$target" 0 0] != "/"} { - set target [combine_dir_and_name "$isodir_adr" "$target"] + set target $isomanip_move_target + if {$isodir_is_pwd == 0 && [string range $target 0 0] != "/"} { + set target [combine_dir_and_name $isodir_adr $target] } - set target_ftype [get_iso_filetype "$target"] + set target_ftype [get_iso_filetype $target] # If more than one selected : target must be directory - if {"$num_selected" > 1} { - if {"$target_ftype" != "d" && "$target_ftype" != ""} { + if {$num_selected > 1} { + if {$target_ftype != "d" && $target_ftype != ""} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : If multiple files are selected then the target must be a directory" return "" } - if {"$target_ftype" == ""} { - set isomanip_move_target_mem "$isomanip_move_target" - set isomanip_move_target "$target" + if {$target_ftype == ""} { + set isomanip_move_target_mem $isomanip_move_target + set isomanip_move_target $target isomanip_mkdir - set isomanip_move_target "$isomanip_move_target_mem" + set isomanip_move_target $isomanip_move_target_mem } } @@ -1581,17 +1581,17 @@ proc isomanip_mv {} { reset_yesno_to_all set multi_source 0 if {[llength $selected] != 1} {set multi_source 1} - foreach i "$selected" { - set name [lindex "$isolist_names" "$i"] - if {"$isodir_is_pwd" == 0} { - set name [combine_dir_and_name "$isodir_adr" "$name"] + foreach i $selected { + set name [lindex $isolist_names $i] + if {$isodir_is_pwd == 0} { + set name [combine_dir_and_name $isodir_adr $name] } set name_ftype [isofs_filetype $name] # Ask for confirmation if overwriting is about to happen - if {"$target_ftype" == "d"} { - set eff_target [combine_dir_and_name "$target" "$name"] - set eff_target_ftype [get_iso_filetype "$eff_target"] + if {$target_ftype == "d"} { + set eff_target [combine_dir_and_name $target $name] + set eff_target_ftype [get_iso_filetype $eff_target] } else { set eff_target $target set eff_target_ftype $target_ftype @@ -1602,11 +1602,11 @@ proc isomanip_mv {} { if {$multi_source == 0} { return "" } continue } - send_marked_cmd "-mv [make_text_shellsafe "$name"] [make_text_shellsafe "$target"] --" + send_marked_cmd "-mv [make_text_shellsafe $name] [make_text_shellsafe $target] --" } - if {[llength "$selected"] == 1} { - set isodir_return_name [path_touches_isodir "$target"] + if {[llength $selected] == 1} { + set isodir_return_name [path_touches_isodir $target] } browse_iso_refresh isodir_return "isomanip_mv" @@ -1620,33 +1620,33 @@ proc isomanip_mv {} { proc isomanip_mkdir {} { global isomanip_move_target isodir_adr isodir_return_name - if {"$isomanip_move_target" == ""} { + if {$isomanip_move_target == ""} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : First you must enter a target address" return "" } - if {[string range "$isomanip_move_target" 0 0] == "/"} { - set abs_adr "$isomanip_move_target" + if {[string range $isomanip_move_target 0 0] == "/"} { + set abs_adr $isomanip_move_target } else { - set abs_adr [combine_dir_and_name "$isodir_adr" "$isomanip_move_target"] + set abs_adr [combine_dir_and_name $isodir_adr $isomanip_move_target] } reset_highest_cmd_sev - send_marked_cmd "-mkdir [make_text_shellsafe "$abs_adr"] --" + send_marked_cmd "-mkdir [make_text_shellsafe $abs_adr] --" # Refresh only if new dir in isodir_adr # or if a parent directory of new dir is created in isodir_adr - set touch_name [path_touches_isodir "$abs_adr"] - if {"$touch_name" != ""} { + set touch_name [path_touches_isodir $abs_adr] + if {$touch_name != ""} { if {[llength [.isolist curselection]] != 0} { memorize_isolist_selection set selection_memorized 1 } else { - set isodir_return_name "$touch_name" + set isodir_return_name $touch_name set selection_memorized 0 } isodir_return "isomanip_mkdir" - if {"$selection_memorized" != 0} { + if {$selection_memorized != 0} { restore_isolist_selection } } @@ -1662,7 +1662,7 @@ proc isomanip_rm_r {} { global isomanip_move_target isolist_names isodir_is_pwd isodir_adr set selected [.isolist curselection] - if {[llength "$selected"] < 1} { + if {[llength $selected] < 1} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : First you must select one or more ISO files" return "" @@ -1670,12 +1670,12 @@ proc isomanip_rm_r {} { if {[window_yesno "Really delete the selected files from ISO image ?"] \ != 1} { return "" } reset_highest_cmd_sev - foreach i "$selected" { - set name [lindex "$isolist_names" "$i"] - if {"$isodir_is_pwd" == 0} { - set name [combine_dir_and_name "$isodir_adr" "$name"] + foreach i $selected { + set name [lindex $isolist_names $i] + if {$isodir_is_pwd == 0} { + set name [combine_dir_and_name $isodir_adr $name] } - send_marked_cmd "-rm_r [make_text_shellsafe "$name"] --" + send_marked_cmd "-rm_r [make_text_shellsafe $name] --" } browse_iso_refresh isodir_return "isomanip_rm_r" @@ -1691,11 +1691,11 @@ proc burn_blank {} { if {[assert_outdev blanking] <= 0} {return ""} set victim "medium in" - if {[string first "stdio" "$outdev_profile"] == 0} { + if {[string first "stdio" $outdev_profile] == 0} { set victim "image file" } if {[window_yesno \ - "Really blank the $victim [make_text_shellsafe "$outdev_adr"] ?"] \ + "Really blank the $victim [make_text_shellsafe $outdev_adr] ?"] \ != 1} { return "" } reset_highest_cmd_sev send_marked_cmd "-blank as_needed" @@ -1712,7 +1712,7 @@ proc burn_format {} { if {[assert_outdev formatting] <= 0} {return ""} - if {[string first "stdio" "$outdev_profile"] == 0} { + if {[string first "stdio" $outdev_profile] == 0} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : Image files cannot be formatted" return "" @@ -1738,15 +1738,15 @@ proc burn_commit {} { global indev_adr outdev_adr permission_policy if {[assert_outdev "writing an ISO session"] <= 0} {return ""} - if {"$outdev_adr" == "$indev_adr"} { - if {"$outdev_medium_status" != "blank" && \ - "$outdev_medium_status" != "appendable"} { + if {$outdev_adr == $indev_adr} { + if {$outdev_medium_status != "blank" && \ + $outdev_medium_status != "appendable"} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : Medium in output drive is neither blank nor appendable" return "" } } else { - if {"$outdev_medium_status" != "blank"} { + if {$outdev_medium_status != "blank"} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : Medium in output drive is not blank" return "" @@ -1757,7 +1757,7 @@ proc burn_commit {} { "grey" "toplevel" return "" } - if {"$outdev_adr" == "$indev_adr"} { + if {$outdev_adr == $indev_adr} { if {[window_yesno "Really write ISO changes as session to $outdev_adr ?"] \ != 1} { return "" } } else { @@ -1769,25 +1769,25 @@ proc burn_commit {} { effectuate_permission_policy set cmd "" set cmd "$cmd -close" - if {"$burn_write_close" == 1} { + if {$burn_write_close == 1} { set cmd "$cmd on" } else { set cmd "$cmd off" } set cmd "$cmd -write_type" - if {"$burn_write_tao" == 1} { + if {$burn_write_tao == 1} { set cmd "$cmd tao" } else { set cmd "$cmd auto" } set cmd "$cmd -stream_recording" - if {"$burn_write_defect_mgt" == 1} { + if {$burn_write_defect_mgt == 1} { set cmd "$cmd off" } else { set cmd "$cmd data" } set cmd "$cmd -commit" - send_marked_cmd "$cmd" + send_marked_cmd $cmd refresh_indev refresh_outdev } @@ -1801,7 +1801,7 @@ proc isodir_verify {} { global isodir_adr reset_highest_cmd_sev - send_marked_cmd "-check_md5_r sorry [make_text_shellsafe "$isodir_adr"] --" + send_marked_cmd "-check_md5_r sorry [make_text_shellsafe $isodir_adr] --" # >>> select mismatching files or directories with mismatching files @@ -1817,16 +1817,16 @@ proc isomanip_verify {} { global isomanip_move_target isolist_names isodir_is_pwd isodir_adr set selected [.isolist curselection] - if {[llength "$selected"] < 1} { + if {[llength $selected] < 1} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : First you must select one or more ISO files" return "" } reset_highest_cmd_sev - foreach i "$selected" { - set name [combine_dir_and_name "$isodir_adr" \ - [lindex "$isolist_names" "$i"]] - send_marked_cmd "-check_md5_r sorry [make_text_shellsafe "$name"] --" + foreach i $selected { + set name [combine_dir_and_name $isodir_adr \ + [lindex $isolist_names $i]] + send_marked_cmd "-check_md5_r sorry [make_text_shellsafe $name] --" } # >>> select mismatching files or directories with mismatching files @@ -1851,27 +1851,27 @@ proc burn_write_image {} { global outdev_profile burn_write_tao burn_write_defect_mgt indev_adr update_dev_var - if {"$indev_adr" != ""} { + if {$indev_adr != ""} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : You may not have an input drive open when writing an image file" return "" } if {[assert_outdev "writing an image file"] <= 0} {return ""} - if {"$burn_write_image_adr" == ""} { + if {$burn_write_image_adr == ""} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : You have to set an image file address in the hard disk filesystem first" return "" } - if {"$outdev_medium_status" != "blank"} { + if {$outdev_medium_status != "blank"} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : You must have a blank medium in the output drive for burning an image data file" return "" } - if {[file readable "$burn_write_image_adr"] == 0 || \ - [file isfile "$burn_write_image_adr"] == 0 || - [file exists "$burn_write_image_adr"] == 0} { + if {[file readable $burn_write_image_adr] == 0 || \ + [file isfile $burn_write_image_adr] == 0 || + [file exists $burn_write_image_adr] == 0} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : Image file '$burn_write_image_adr' is not a readable data file" return "" @@ -1880,25 +1880,25 @@ proc burn_write_image {} { != 1} { return "" } set cmd "-as cdrecord -v" - if {[regexp "^CD" "$outdev_profile"] == 1 && \ - ( "$outdev_medium_status" == "appendable" || "$burn_write_tao" == 1 )} { + if {[regexp "^CD" $outdev_profile] == 1 && \ + ( $outdev_medium_status == "appendable" || $burn_write_tao == 1 )} { set cmd "$cmd padsize=150s" } - set cmd "$cmd dev=[make_text_shellsafe "$outdev_adr"]" - set cmd "$cmd [make_text_shellsafe "$burn_write_image_adr"]" - if {"$burn_write_tao" == 1} { + set cmd "$cmd dev=[make_text_shellsafe $outdev_adr]" + set cmd "$cmd [make_text_shellsafe $burn_write_image_adr]" + if {$burn_write_tao == 1} { set cmd "$cmd -tao" } - if {"$burn_write_close" != 1} { + if {$burn_write_close != 1} { set cmd "$cmd -multi" } - if {"$burn_write_defect_mgt" == 1} { + if {$burn_write_defect_mgt == 1} { set cmd "$cmd stream_recording=off" } else { set cmd "$cmd stream_recording=32s" } reset_highest_cmd_sev - send_marked_cmd "$cmd" + send_marked_cmd $cmd refresh_state } @@ -1931,16 +1931,16 @@ proc refresh_avail {} { reset_highest_cmd_sev clear_sieve send_marked_cmd "-tell_media_space" - if {[compare_sev "$highest_cmd_sev" "FAILURE"] < 0} { + if {[compare_sev $highest_cmd_sev "FAILURE"] < 0} { set ac "" read_sieve "After commit :" - if {"$sieve_ret" > 0} { - set ac [lindex "$result_list" 0] - set ac [string range "$ac" 0 [expr [string length "$ac"] - 2]] + if {$sieve_ret > 0} { + set ac [lindex $result_list 0] + set ac [string range $ac 0 [expr [string length $ac] - 2]] set line "[format "%7dm" [expr "$ac / 512"]]" } } - .avail_label configure -text "$line" + .avail_label configure -text $line } @@ -1953,16 +1953,16 @@ proc handle_overwriting {target_fs target target_ftype selected_adr selected_ftype} { global overwrite_iso_files overwrite_iso_dirs overwrite_disk_files - if {"$target_fs" == "localfs"} { + if {$target_fs == "localfs"} { set to_fs "hard disk" set overwrite_fs "disk" set overwrite_dirs 0 - set overwrite_files "$overwrite_disk_files" + set overwrite_files $overwrite_disk_files } else { set to_fs "ISO" set overwrite_fs "ISO" set overwrite_dirs $overwrite_iso_dirs - set overwrite_files "$overwrite_iso_files" + set overwrite_files $overwrite_iso_files } if {$source_fs == "localfs"} { set from_fs "hard disk" @@ -1979,18 +1979,18 @@ proc handle_overwriting {target_fs target target_ftype # >>> Check if any file will get overwritten. Not only the direct target. # >>> Then silently allow directories to be merged - if {"$target_ftype" != ""} { - if {"$target_ftype" == "d"} { - if {"$source_ftype" == "d"} { + if {$target_ftype != ""} { + if {$target_ftype == "d"} { + if {$source_ftype == "d"} { if {[$what_window \ "Really merge existing $to_fs directory\n\n[make_text_shellsafe $target]\n\nwith $from_fs directory\n[make_text_shellsafe $source]\n?"] \ != 1} { return "0" } } else { - if {"$target_fs" != "isofs"} { + if {$target_fs != "isofs"} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : Will not replace directories on hard disk by file of other type" return "0" } - if {"$overwrite_dirs" == 1} { + if {$overwrite_dirs == 1} { if {[$what_window \ "Really overwrite $to_fs directory\n\n[make_text_shellsafe $target]\n\nby $from_fs file\n[make_text_shellsafe $source]\n?"] \ != 1} { return "0" } @@ -2000,7 +2000,7 @@ proc handle_overwriting {target_fs target target_ftype } } } else { - if {"$overwrite_files" == 1} { + if {$overwrite_files == 1} { if {[$what_window \ "Really overwrite $to_fs file\n\n[make_text_shellsafe $target]\n\nby $from_fs file\n[make_text_shellsafe $source]\n?"] != 1} { return "0" @@ -2011,8 +2011,8 @@ proc handle_overwriting {target_fs target target_ftype } } } - if {"$selected_adr" != "$target" && "$selected_adr" != "" && \ - "$selected_ftype" != "d" && "$selected_ftype" != ""} { + if {$selected_adr != $target && $selected_adr != "" && \ + $selected_ftype != "d" && $selected_ftype != ""} { if {[$what_window \ "Really replace existing $to_fs file\n\n[make_text_shellsafe $target]\n\nby $from_fs directory\n[make_text_shellsafe $source]\n?"] != 1} { return "0" @@ -2031,54 +2031,54 @@ proc insert_from {} { global insert_at_selected insert_underneath if {[assert_iso_image 1] == 0} {return ""} - if {"$insert_from_adr" == ""} { + if {$insert_from_adr == ""} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : You have to set a source address in the hard disk filesystem first" return "" } set selected_ftype "" set selected_adr "" - if {"$insert_at_selected" == 1} { + if {$insert_at_selected == 1} { set selected [.isolist curselection] - if {[llength "$selected"] != 1} { + if {[llength $selected] != 1} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : You must select exactly one ISO file as insertion target" return "" } - set target "[lindex "$isolist_names" [lindex "$selected" 0]]" - set selected_ftype [get_iso_filetype "$target"] - set selected_adr "$target" + set target "[lindex $isolist_names [lindex $selected 0]]" + set selected_ftype [get_iso_filetype $target] + set selected_adr $target } else { - set target "$isodir_adr" + set target $isodir_adr } - set source_ftype [localfs_filetype "$insert_from_adr"] - set name [file tail "$insert_from_adr"] - if {"$insert_underneath" == 1 || $source_ftype == "d"} { - set target [combine_dir_and_name "$target" "$name"] + set source_ftype [localfs_filetype $insert_from_adr] + set name [file tail $insert_from_adr] + if {$insert_underneath == 1 || $source_ftype == "d"} { + set target [combine_dir_and_name $target $name] } - set target_ftype [get_iso_filetype "$target"] + set target_ftype [get_iso_filetype $target] reset_yesno_to_all - if {[handle_overwriting "isofs" "$target" "$target_ftype" \ + if {[handle_overwriting "isofs" $target $target_ftype \ "localfs" $insert_from_adr $source_ftype 0 \ - "$selected_adr" "$selected_ftype"] == "0"} { + $selected_adr $selected_ftype] == "0"} { return "" } set preserve_selection 0 - if {"$insert_underneath" + "$insert_at_selected" == 1} { - set isodir_return_name "$name" + if {$insert_underneath + $insert_at_selected == 1} { + set isodir_return_name $name } else { set preserve_selection 1 } reset_highest_cmd_sev enforce_overwrite_settings "isofs" - send_marked_cmd "-map [make_text_shellsafe "$insert_from_adr"] [make_text_shellsafe "$target"]" + send_marked_cmd "-map [make_text_shellsafe $insert_from_adr] [make_text_shellsafe $target]" - if {"$preserve_selection" == 1} { + if {$preserve_selection == 1} { memorize_isolist_selection } isodir_return "insert_from" - if {"$preserve_selection" == 1} { + if {$preserve_selection == 1} { restore_isolist_selection } browse_iso_refresh @@ -2096,7 +2096,7 @@ proc extract_to {} { global isodir_adr isolist_names if {[assert_iso_image 1] == 0} {return ""} - if {"$extract_to_adr" == ""} { + if {$extract_to_adr == ""} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : You have to set a target address in the hard disk filesystem first" return "" @@ -2104,26 +2104,26 @@ proc extract_to {} { set sources "" set selected_ftype "" set selected_adr "" - if {"$extract_from_selected" == 1} { + if {$extract_from_selected == 1} { set selected [.isolist curselection] - if {[llength "$selected"] < 1} { + if {[llength $selected] < 1} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : You must select at least one ISO file as extraction source" return "" } - foreach i "$selected" { - set path [combine_dir_and_name "$isodir_adr" \ - [lindex "$isolist_names" "$i"]] - lappend sources "$path" + foreach i $selected { + set path [combine_dir_and_name $isodir_adr \ + [lindex $isolist_names $i]] + lappend sources $path } } else { - set sources [list "$isodir_adr"] + set sources [list $isodir_adr] } reset_highest_cmd_sev reset_yesno_to_all enforce_overwrite_settings "localfs" set disp_en_mem [set_display_msg 0] - if {"$extract_auto_chmod" == 1} { + if {$extract_auto_chmod == 1} { send_marked_cmd "-osirrox on:sort_lba_on:auto_chmod_on" } else { send_marked_cmd "-osirrox on:sort_lba_off:auto_chmod_off" @@ -2161,7 +2161,7 @@ proc extract_to {} { # Send the currently chosen -overwrite settings of the checkbuttons -# "Overwrite ISO files", "Overwrite ISO dirs", "Overwrite disk files". +# "Overwrite ISO files", "Overwrite ISO dirs", "Overwrite hard disk files". # Called before operations which could overwrite files in ISO model # or in the hard disk filesystem. # I.e. any -overwrite command sent via the "Command:" text field will not @@ -2170,18 +2170,18 @@ proc extract_to {} { proc enforce_overwrite_settings {which_fs} { global overwrite_iso_files overwrite_iso_dirs overwrite_disk_files - if {"$which_fs" == "isofs"} { - if {"$overwrite_iso_files" == 0} { + if {$which_fs == "isofs"} { + if {$overwrite_iso_files == 0} { set mode "off" } else { - if {"$overwrite_iso_dirs" == 0} { + if {$overwrite_iso_dirs == 0} { set mode "nondir" } else { set mode "on" } } } else { - if {"$overwrite_disk_files" == 1} { + if {$overwrite_disk_files == 1} { set mode "on" } else { set mode "off" @@ -2189,7 +2189,7 @@ proc enforce_overwrite_settings {which_fs} { } set disp_en_mem [set_display_msg 0] send_marked_cmd "-overwrite $mode" - set_display_msg "$disp_en_mem" + set_display_msg $disp_en_mem } @@ -2221,7 +2221,7 @@ proc end_xorriso {} { proc assert_outdev {purpose} { global outdev_adr - if {"$outdev_adr" == ""} { + if {$outdev_adr == ""} { xorriso_tcltk_errmsg \ "xorriso-tcltk : SORRY : You must choose an output drive before $purpose" return "0" @@ -2248,11 +2248,11 @@ proc assert_no_changes {} { proc show_permission_policy {} { global permission_policy - set text "$permission_policy" - if {"$permission_policy" == "as_is"} { + set text $permission_policy + if {$permission_policy == "as_is"} { set text "as is" } - if {"$permission_policy" == "mkisofs_r"} { + if {$permission_policy == "mkisofs_r"} { set text "mkisofs -r" } .perm_policy configure -text "Permissions: $text" @@ -2265,22 +2265,22 @@ proc show_permission_policy {} { # proc browse_tree_fill_dir {tr parent children} { - if {"$parent" == "/"} { + if {$parent == "/"} { set parent_name root } else { - set parent_name "$parent" + set parent_name $parent } - if {[$tr exists "$parent_name"] == 0} {return ""} + if {[$tr exists $parent_name] == 0} {return ""} - $tr delete [$tr nodes "$parent_name"] + $tr delete [$tr nodes $parent_name] - foreach i "$children" { - set name [string range "$i" 2 end] - set adr [combine_dir_and_name "$parent" "$name"] - $tr insert end "$parent_name" "$adr" -text "$name" - if {[string range "$i" 0 0] == "d"} { - set dir_dummy [combine_dir_and_name "$adr" "_"] - $tr insert end "$adr" "$dir_dummy" -text " " + foreach i $children { + set name [string range $i 2 end] + set adr [combine_dir_and_name $parent $name] + $tr insert end $parent_name $adr -text $name + if {[string range $i 0 0] == "d"} { + set dir_dummy [combine_dir_and_name $adr "_"] + $tr insert end $adr $dir_dummy -text " " } } } @@ -2291,8 +2291,8 @@ proc browse_tree_fill_dir {tr parent children} { proc browse_tree_select {adr_var_name tr selected} { global browse_select_is_setvar - if {"$browse_select_is_setvar" == 0} {return ""} - browse_tree_accept "$adr_var_name" 0 "$tr" "$selected" + if {$browse_select_is_setvar == 0} {return ""} + browse_tree_accept $adr_var_name 0 $tr $selected } @@ -2302,38 +2302,38 @@ proc browse_tree_accept {adr_var_name do_return tr selected} { global extract_to_adr insert_from_adr burn_write_image_adr isodir_adr global isomanip_move_target indev_adr outdev_adr - if {[llength "$selected"] == 0} { + if {[llength $selected] == 0} { set value "" } else { - set value [lindex "$selected" 0] + set value [lindex $selected 0] } - if {"$adr_var_name" == "burn_write_image_adr"} { - set burn_write_image_adr "$value" - if {"$do_return" == 1} {burn_write_image} + if {$adr_var_name == "burn_write_image_adr"} { + set burn_write_image_adr $value + if {$do_return == 1} {burn_write_image} } - if {"$adr_var_name" == "extract_to_adr"} { - set extract_to_adr "$value" - if {"$do_return" == 1} {extract_to} + if {$adr_var_name == "extract_to_adr"} { + set extract_to_adr $value + if {$do_return == 1} {extract_to} } - if {"$adr_var_name" == "insert_from_adr"} { - set insert_from_adr "$value" - if {"$do_return" == 1} {insert_from} + if {$adr_var_name == "insert_from_adr"} { + set insert_from_adr $value + if {$do_return == 1} {insert_from} } - if {"$adr_var_name" == "isodir_adr"} { - set isodir_adr "$value" - if {"$do_return" == 1} {isodir_return "browse_tree_select"} + if {$adr_var_name == "isodir_adr"} { + set isodir_adr $value + if {$do_return == 1} {isodir_return "browse_tree_select"} } - if {"$adr_var_name" == "isomanip_move_target"} { - set isomanip_move_target "$value" + if {$adr_var_name == "isomanip_move_target"} { + set isomanip_move_target $value # No do_return because the field is shared between buttons } - if {"$adr_var_name" == "indev_adr"} { - set indev_adr "$value" - if {"$do_return" == 1} {indev_return} + if {$adr_var_name == "indev_adr"} { + set indev_adr $value + if {$do_return == 1} {indev_return} } - if {"$adr_var_name" == "outdev_adr"} { - set outdev_adr "$value" - if {"$do_return" == 1} {outdev_return} + if {$adr_var_name == "outdev_adr"} { + set outdev_adr $value + if {$do_return == 1} {outdev_return} } } @@ -2343,11 +2343,11 @@ proc browse_tree_accept {adr_var_name do_return tr selected} { # proc browse_tree_accept_sel {adr_var_name do_return tr} { set selected [$tr selection get] - if {[llength "$selected"] != 1} { + if {[llength $selected] != 1} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : You must select a single tree item before clicking the \"Accept\" button." return "" } - browse_tree_accept "$adr_var_name" "$do_return" "$tr" "$selected" + browse_tree_accept $adr_var_name $do_return $tr $selected } @@ -2358,18 +2358,18 @@ proc browse_tree_up {adr_var_name tr which_fs} { global isomanip_move_target indev_adr outdev_adr set selected [$tr selection get] - if {[llength "$selected"] != 1} { + if {[llength $selected] != 1} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : You must select a single tree item before clicking the \"Up\" button." return "" } - set adr [file dirname [lindex "$selected" 0]] + set adr [file dirname [lindex $selected 0]] eval set mem $$adr_var_name - set $adr_var_name "$adr" - browse_tree_populate "$which_fs" - set $adr_var_name "$mem" - if {"$adr" != "/" && "$adr" != ""} { + set $adr_var_name $adr + browse_tree_populate $which_fs + set $adr_var_name $mem + if {$adr != "/" && $adr != ""} { $tr selection clear - $tr selection set "$adr" + $tr selection set $adr } } @@ -2381,16 +2381,16 @@ proc browse_tree_down {adr_var_name tr which_fs} { global isomanip_move_target indev_adr outdev_adr set selected [$tr selection get] - if {[llength "$selected"] != 1} { + if {[llength $selected] != 1} { xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : You must select a single tree item before clicking the \"Down\" button." return "" } - set adr [lindex "$selected" 0] + set adr [lindex $selected 0] eval set mem $$adr_var_name - set $adr_var_name "$adr" - browse_tree_populate "$which_fs" - set $adr_var_name "$mem" - $tr selection set "$adr" + set $adr_var_name $adr + browse_tree_populate $which_fs + set $adr_var_name $mem + $tr selection set $adr } @@ -2398,7 +2398,7 @@ proc browse_tree_down {adr_var_name tr which_fs} { # It replaces the directory content list by a single dummy item. # proc browse_tree_close_dir {tr name} { - browse_tree_fill_dir $tr "$name" [list "? "] + browse_tree_fill_dir $tr $name [list "? "] } @@ -2411,16 +2411,16 @@ proc browse_tree_populate {which_fs} { global extract_to_adr insert_from_adr burn_write_image_adr isodir_adr global isomanip_move_target indev_adr outdev_adr - if {"$which_fs" == "isofs"} { - if {"$browse_iso_window_is_active" == 0} {return ""} + if {$which_fs == "isofs"} { + if {$browse_iso_window_is_active == 0} {return ""} set w {.browse_iso_window} set open_dir_cmd "browse_iso_open_dir" - set adr_var "$browse_iso_window_var" + set adr_var $browse_iso_window_var } else { - if {"$browse_disk_window_is_active" == 0} {return ""} + if {$browse_disk_window_is_active == 0} {return ""} set w {.browse_disk_window} set open_dir_cmd "browse_disk_open_dir" - set adr_var "$browse_disk_window_var" + set adr_var $browse_disk_window_var } # Variable indirection @@ -2430,18 +2430,18 @@ proc browse_tree_populate {which_fs} { $open_dir_cmd $w.tree "/" # Set $adr as current address - set comps [split "$adr" "/"] + set comps [split $adr "/"] # Install the stack of directories above current address set path "/" - foreach i "$comps" { - if {"$i" == ""} { + foreach i $comps { + if {$i == ""} { continue } - set path [combine_dir_and_name "$path" "$i"] - $open_dir_cmd $w.tree "$path" + set path [combine_dir_and_name $path $i] + $open_dir_cmd $w.tree $path catch { - $w.tree opentree "$path" 0 - $w.tree see "$path" + $w.tree opentree $path 0 + $w.tree see $path } } } @@ -2451,7 +2451,7 @@ proc browse_tree_populate {which_fs} { # It has to strip off the surplus parameter added by the Tree widget. # proc browse_tree_help {about_what button_color from_item} { - window_help "$about_what" "$button_color" + window_help $about_what $button_color } @@ -2459,9 +2459,9 @@ proc browse_tree_help {about_what button_color from_item} { # proc destroy_browse_disk {w} { global browse_disk_window_is_active browse_disk_window_geometry - if {"$w" != "" && "$browse_disk_window_is_active" == 1} { + if {$w != "" && $browse_disk_window_is_active == 1} { set browse_disk_window_geometry [wm geometry $w] - destroy "$w" + destroy $w } set browse_disk_window_is_active 0 } @@ -2471,9 +2471,9 @@ proc destroy_browse_disk {w} { # the hard disk filesystem. # proc browse_disk_open_dir {tr name} { - if {[localfs_filetype "$name"] != "d"} {return ""} - set lslist [localfs_ls "$name"] - browse_tree_fill_dir $tr "$name" "$lslist" + if {[localfs_filetype $name] != "d"} {return ""} + set lslist [localfs_ls $name] + browse_tree_fill_dir $tr $name $lslist } @@ -2488,9 +2488,9 @@ proc browse_disk_refresh {} { # the ISO model. # proc browse_iso_open_dir {tr name} { - if {[isofs_filetype "$name"] != "d"} {return ""} - set lslist [isofs_ls "$name"] - browse_tree_fill_dir $tr "$name" "$lslist" + if {[isofs_filetype $name] != "d"} {return ""} + set lslist [isofs_ls $name] + browse_tree_fill_dir $tr $name $lslist } @@ -2499,9 +2499,9 @@ proc browse_iso_open_dir {tr name} { proc destroy_browse_iso {w} { global browse_iso_window_is_active browse_iso_window_geometry - if {"$w" != "" && "$browse_iso_window_is_active" == 1} { + if {$w != "" && $browse_iso_window_is_active == 1} { set browse_iso_window_geometry [wm geometry $w] - destroy "$w" + destroy $w } set browse_iso_window_is_active 0 } @@ -2525,46 +2525,46 @@ proc browse_tree {adr_var which_fs} { set button_color "grey" - if {"$which_fs" == "isofs"} { + if {$which_fs == "isofs"} { set w {.browse_iso_window} - set window_is_active "$browse_iso_window_is_active" + set window_is_active $browse_iso_window_is_active set title_name "xorriso-tcltk ISO model browser" set open_dir_cmd "browse_iso_open_dir" set destroy_cmd "destroy_browse_iso" - if {"$browse_iso_window_var" != "$adr_var" && "$window_is_active" == 1} { + if {$browse_iso_window_var != $adr_var && $window_is_active == 1} { destroy_browse_iso $w set window_is_active 0 } - set browse_iso_window_var "$adr_var" - set old_geometry "$browse_iso_window_geometry" + set browse_iso_window_var $adr_var + set old_geometry $browse_iso_window_geometry set browse_iso_window_is_active 1 } else { set w {.browse_disk_window} - set window_is_active "$browse_disk_window_is_active" + set window_is_active $browse_disk_window_is_active set title_name "xorriso-tcltk hard disk filesystem browser" set open_dir_cmd "browse_disk_open_dir" set destroy_cmd "destroy_browse_disk" - if {"$browse_disk_window_var" != "$adr_var" && "$window_is_active" == 1} { + if {$browse_disk_window_var != $adr_var && $window_is_active == 1} { destroy_browse_disk $w set window_is_active 0 } - set browse_disk_window_var "$adr_var" - set old_geometry "$browse_disk_window_geometry" + set browse_disk_window_var $adr_var + set old_geometry $browse_disk_window_geometry set browse_disk_window_is_active 1 } set re_use_widgets 0 - if {"$window_is_active" == 0} { + if {$window_is_active == 0} { toplevel $w -borderwidth 10 -class Browser - wm title $w "$title_name" - set_window_position $w "$old_geometry" + wm title $w $title_name + set_window_position $w $old_geometry } else { set re_use_widgets 1 } - if {"$re_use_widgets" == 0} { + if {$re_use_widgets == 0} { # BWidget Tree frame $w.tree_frame frame $w.tree_frame_x - Tree $w.tree -width "$tree_window_width" -height "$tree_window_lines" \ + Tree $w.tree -width $tree_window_width -height $tree_window_lines \ -opencmd "$open_dir_cmd $w.tree" \ -closecmd "browse_tree_close_dir $w.tree" \ -selectcommand "browse_tree_select $adr_var" \ @@ -2588,24 +2588,24 @@ proc browse_tree {adr_var which_fs} { -side left -expand 1 -fill both frame $w.button_line - button $w.accept -text "Accept" -width "$tree_window_button_width" \ + button $w.accept -text "Accept" -width $tree_window_button_width \ -command "browse_tree_accept_sel $adr_var 1 $w.tree" bind_help $w.accept "Accept (browse tree)" - button $w.to_field -text "Edit" -width "$tree_window_button_width" \ + button $w.to_field -text "Edit" -width $tree_window_button_width \ -command "browse_tree_accept_sel $adr_var 0 $w.tree" bind_help $w.to_field "Edit (browse tree)" - button $w.up -text "Up" -width "$tree_window_button_width" \ + button $w.up -text "Up" -width $tree_window_button_width \ -command "browse_tree_up $adr_var $w.tree $which_fs" bind_help $w.up "Up (browse tree)" - button $w.down -text "Down" -width "$tree_window_button_width" \ + button $w.down -text "Down" -width $tree_window_button_width \ -command "browse_tree_down $adr_var $w.tree $which_fs" bind_help $w.down "Down (browse tree)" - button $w.help -text "Help" -width "$tree_window_button_width" \ + button $w.help -text "Help" -width $tree_window_button_width \ -command {window_help "Browse tree" grey} bind_help $w.help "Browse tree" - button $w.close -text "Close" -width "$tree_window_button_width" \ + button $w.close -text "Close" -width $tree_window_button_width \ -command "$destroy_cmd $w" \ - -background "$button_color" + -background $button_color bind_help $w.close "Close (browse tree)" pack $w.up $w.down $w.accept $w.to_field $w.help $w.close \ -in $w.button_line -side left -expand 0 @@ -2615,7 +2615,7 @@ proc browse_tree {adr_var which_fs} { } else { raise $w } - browse_tree_populate "$which_fs" + browse_tree_populate $which_fs } @@ -2628,18 +2628,18 @@ proc display_msg {msg} { global .msglist global msglist_max_fill msglist_running pre_msglist display_msg_enabled - if {"$display_msg_enabled" == 0} {return ""} - if {"$msg" == "============================" || \ -"$msg" == "==============================================================" || \ - "$msg" == "enter option and arguments :"} {return ""} + if {$display_msg_enabled == 0} {return ""} + if {$msg == "============================" || \ + $msg == "==============================================================" || \ + $msg == "enter option and arguments :"} {return ""} - if {"$msglist_running" == 0} { - lappend pre_msglist "$msg" + if {$msglist_running == 0} { + lappend pre_msglist $msg } else { - if {[.msglist index end] > "$msglist_max_fill"} { + if {[.msglist index end] > $msglist_max_fill} { .msglist delete 0 0 } - .msglist insert end "$msg" + .msglist insert end $msg .msglist see [expr "[.msglist index end]-1"] update idletasks } @@ -2653,13 +2653,13 @@ proc display_msg {msg} { proc set_display_msg {mode} { global display_msg_enabled - set old "$display_msg_enabled" - if {"$mode" == "0"} { + set old $display_msg_enabled + if {$mode == "0"} { set display_msg_enabled 0 } else { set display_msg_enabled "1" } - return "$old" + return $old } @@ -2668,9 +2668,9 @@ proc set_display_msg {mode} { proc xorriso_tcltk_errmsg {msg} { global highest_cmd_sev_msg - set highest_cmd_sev_msg "$msg" - display_msg "$msg" - window_ack "$msg" "grey" "toplevel" + set highest_cmd_sev_msg $msg + display_msg $msg + window_ack $msg "grey" "toplevel" update idletasks } @@ -2683,8 +2683,8 @@ proc memorize_isolist_selection {} { set memorized_isolist_selection "" set selected [.isolist curselection] - foreach i "$selected" { - lappend memorized_isolist_selection [lindex $isolist_names "$i"] + foreach i $selected { + lappend memorized_isolist_selection [lindex $isolist_names $i] } } @@ -2697,10 +2697,10 @@ proc restore_isolist_selection {} { global .isolist .isolist selection clear 0 end - foreach i "$memorized_isolist_selection" { - set idx [lsearch -exact "$isolist_names" "$i"] - if {"$idx" > -1} { - .isolist selection set "$idx" "$idx" + foreach i $memorized_isolist_selection { + set idx [lsearch -exact $isolist_names $i] + if {$idx > -1} { + .isolist selection set $idx $idx } } set memorized_isolist_selection "" @@ -2717,6 +2717,7 @@ proc destroy_yesno {w answer} { set yesno_window_geometry [wm geometry $w] grab release $w destroy $w + update idletasks } set yesno_window_is_active 0 set answer_of_yesno $answer @@ -2737,10 +2738,10 @@ proc window_yesno {question} { global answer_of_yesno yesno_window_is_active yesno_window_geometry set w {.yesno_window} - if {"$yesno_window_is_active" == 1} { + if {$yesno_window_is_active == 1} { set yesno_window_is_active [window_exists $w] } - if {"$yesno_window_is_active" == 1} { + if {$yesno_window_is_active == 1} { raise $w xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : You still need to answer an older yes/no question" return "0" @@ -2749,8 +2750,8 @@ proc window_yesno {question} { set answer_of_yesno "" toplevel $w -borderwidth 20 -class Dialog wm title $w "xorriso-tcltk yes/no" - set_window_position $w "$yesno_window_geometry" - label $w.question -text "$question" + set_window_position $w $yesno_window_geometry + label $w.question -text $question button $w.yes -text "yes" -command "destroy_yesno $w 1" \ -borderwidth 4 -padx 20 -pady 20 bind_help $w.yes "yes/no" @@ -2762,7 +2763,7 @@ proc window_yesno {question} { grab set $w tkwait variable answer_of_yesno - return "$answer_of_yesno" + return $answer_of_yesno } @@ -2774,10 +2775,10 @@ proc window_yesno_ever {question} { global yesno_to_all set w {.yesno_window} - if {"$yesno_window_is_active" == 1} { + if {$yesno_window_is_active == 1} { set yesno_window_is_active [window_exists $w] } - if {"$yesno_window_is_active" == 1} { + if {$yesno_window_is_active == 1} { raise $w xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : You still need to answer an older yes/no question" return "0" @@ -2792,11 +2793,11 @@ proc window_yesno_ever {question} { set answer_of_yesno "" toplevel $w -borderwidth 20 -class Dialog wm title $w "xorriso-tcltk yes/no" - set_window_position $w "$yesno_window_geometry" + set_window_position $w $yesno_window_geometry frame $w.yes_frame frame $w.no_frame - label $w.question -text "$question" + label $w.question -text $question button $w.yes -text "yes" -command "destroy_yesno $w 1" \ -borderwidth 4 -padx 20 -pady 20 -relief raised button $w.no -text "no" -command "destroy_yesno $w 0" \ @@ -2809,11 +2810,13 @@ proc window_yesno_ever {question} { pack $w.no $w.no_to_all -in $w.no_frame -side top -expand 1 -fill both pack $w.yes_frame $w.question $w.no_frame \ -in $w -side left -expand 1 -fill both + + raise $w update idletasks grab set $w tkwait variable answer_of_yesno - return "$answer_of_yesno" + return $answer_of_yesno } @@ -2829,11 +2832,12 @@ proc reset_yesno_to_all {} { proc destroy_ack {w had_focus} { global ack_window_is_active ack_window_geometry - if {"$w" != ""} { + if {$w != ""} { set ack_window_geometry [wm geometry $w] grab release $w - focus "$had_focus" - destroy "$w" + focus $had_focus + destroy $w + update idletasks } set ack_window_is_active 0 } @@ -2847,37 +2851,38 @@ proc window_ack {question button_color where} { set had_focus [focus] set re_use_widgets 0 - if {"$where" == "embedded"} { + if {$where == "embedded"} { set w "" set destroy_cmd "" } else { set w {.ack_window} - if {"$ack_window_is_active" == 1} { + if {$ack_window_is_active == 1} { set ack_window_is_active [window_exists $w] } - if {"$ack_window_is_active" == 0} { + if {$ack_window_is_active == 0} { toplevel $w -borderwidth 20 -class Dialog wm title $w "xorriso-tcltk acknowledge" set ack_window_is_active 1 } else { set re_use_widgets 1 } - set_window_position $w "$ack_window_geometry" + set_window_position $w $ack_window_geometry set destroy_cmd "destroy_ack $w $had_focus" } - if {"$re_use_widgets" == 1} { - $w.question configure -text "$question" - raise $w + if {$re_use_widgets == 1} { + $w.question configure -text $question } else { - label $w.question -text "$question" - button $w.ok -text "Continue" -command "$destroy_cmd" \ - -background "$button_color" - bind $w.ok "$destroy_cmd" + label $w.question -text $question + button $w.ok -text "Continue" -command $destroy_cmd \ + -background $button_color + bind $w.ok $destroy_cmd bind_help $w.ok "Continue" pack $w.question -side top -expand 1 -fill both pack $w.ok -side top } + raise $w + update idletasks focus $w.ok grab set $w tkwait variable ack_window_is_active @@ -2890,15 +2895,15 @@ proc destroy_help {w help_main} { global help_window_is_active help_window_has_scroll help_window_geometry global main_help_window_is_active main_help_window_geometry - if {"$w" != ""} { - if {"$help_main" == 1} { + if {$w != ""} { + if {$help_main == 1} { set main_help_window_geometry [wm geometry $w] } else { set help_window_geometry [wm geometry $w] } - destroy "$w" + destroy $w } - if {"$help_main" == 1} { + if {$help_main == 1} { set main_help_window_is_active 0 } else { set help_window_is_active 0 @@ -2908,7 +2913,7 @@ proc destroy_help {w help_main} { proc surround_text {text} { - return "\n\n [string map {\n "\n "} "$text"]\n" + return "\n\n [string map {\n "\n "} $text]\n" } @@ -2922,47 +2927,47 @@ proc window_help {about_what button_color} { global .help_window .main_help_window # The main help window is independent of the GUI element help window - if {"$about_what" == "Help"} { + if {$about_what == "Help"} { set help_main 1 set w {.main_help_window} - set window_is_active "$main_help_window_is_active" + set window_is_active $main_help_window_is_active set window_has_scroll 1 - set old_geometry "$main_help_window_geometry" - set window_lines "$main_help_window_lines" + set old_geometry $main_help_window_geometry + set window_lines $main_help_window_lines } else { set help_main 0 set w {.help_window} - set window_is_active "$help_window_is_active" - set window_has_scroll "$help_window_has_scroll" - set old_geometry "$help_window_geometry" - set window_lines "$help_window_lines" + set window_is_active $help_window_is_active + set window_has_scroll $help_window_has_scroll + set old_geometry $help_window_geometry + set window_lines $help_window_lines } - if {"$window_is_active" == 1} { + if {$window_is_active == 1} { set window_is_active [window_exists $w] } # Giving the help text some distance from the border decorations set line_width 82 - set helptext "\n\n [string map {\n "\n "} [tell_helptext "$about_what"]]\n" + set helptext "\n\n [string map {\n "\n "} [tell_helptext $about_what]]\n" - if {[count_newlines "$helptext"] >= "$window_lines"} { - if {"$window_is_active" == 1 && "$window_has_scroll" == 0} { - destroy_help $w "$help_main" + if {[count_newlines $helptext] >= $window_lines} { + if {$window_is_active == 1 && $window_has_scroll == 0} { + destroy_help $w $help_main set window_is_active 0 } - if {"$help_main" == 1} { - set old_geometry "$main_help_window_geometry" + if {$help_main == 1} { + set old_geometry $main_help_window_geometry } else { set help_window_has_scroll 1 set window_has_scroll 1 - set old_geometry "$help_window_geometry" + set old_geometry $help_window_geometry } } # Dealing with initiating windows that are grabbed set grabbed [grab current] if {$grabbed == ""} {set grabbed "-"} if {$grabbed != "-" && $window_is_active == 1} { - destroy_help $w "$help_main" + destroy_help $w $help_main set window_is_active 0 } if {$grabbed != "-"} { @@ -2975,7 +2980,7 @@ proc window_help {about_what button_color} { set height [string range $value [expr $height_idx+1] [expr $idx-1]] set x [string range $value [expr $idx+1] end] set idx [string first "+" $x] - if {"$idx" != -1} { + if {$idx != -1} { set y [string range $x [expr $idx+1] end] set x [string range $x 0 [expr $idx-1]] set y [expr $y+$height] @@ -2985,10 +2990,10 @@ proc window_help {about_what button_color} { } set re_use_widgets 0 - if {"$window_is_active" == 0} { - toplevel $w -borderwidth "$help_window_border_width" -class Help - set_window_position $w "$old_geometry" - if {"$help_main" == 1} { + if {$window_is_active == 0} { + toplevel $w -borderwidth $help_window_border_width -class Help + set_window_position $w $old_geometry + if {$help_main == 1} { wm title $w "xorriso-tcltk main help text" set main_help_window_is_active 1 reset_to_normal_background .help @@ -3001,28 +3006,28 @@ proc window_help {about_what button_color} { set re_use_widgets 1 } - if {"$re_use_widgets" == 1} { + if {$re_use_widgets == 1} { $w.text configure -state normal $w.text delete 1.0 end - $w.text insert end "$helptext" + $w.text insert end $helptext raise $w } else { set destroy_cmd "destroy_help $w $help_main" frame $w.text_frame - text $w.text -width "$line_width" -height "$window_lines" \ + text $w.text -width $line_width -height $window_lines \ -relief flat -borderwidth 0 - $w.text insert end "$helptext" + $w.text insert end $helptext pack $w.text -in $w.text_frame -side left -expand 1 -fill both - if {"$window_has_scroll" == 1} { + if {$window_has_scroll == 1} { scrollbar $w.scroll_y -command "$w.text yview" $w.text configure -yscrollcommand "$w.scroll_y set" - bind_listbox_keys $w.text "$window_lines" "text" + bind_listbox_keys $w.text $window_lines "text" pack $w.scroll_y -in $w.text_frame -side left -fill y } - button $w.close -text "Close" -command "$destroy_cmd" \ - -background "$button_color" + button $w.close -text "Close" -command $destroy_cmd \ + -background $button_color pack $w.text_frame -side top -expand 1 -fill both frame $w.middle_spacer -height 6 frame $w.bottom_spacer -height 6 @@ -3039,9 +3044,9 @@ proc display_busy {state} { global busy_text_exists global .busy_text - if {"$busy_text_exists" == 0} {return ""} + if {$busy_text_exists == 0} {return ""} - if {"$state" == 0} { + if {$state == 0} { .busy_text configure -text "ready" .busy_text configure -background "#D0D0D0" } else { @@ -3057,7 +3062,7 @@ proc display_busy {state} { proc check_for_bwidget {} { global have_bwidget bwidget_version - if {"$have_bwidget" == 0} { + if {$have_bwidget == 0} { catch { set bwidget_version [package require BWidget] set have_bwidget 1 @@ -3084,15 +3089,15 @@ proc get_window_geometry {w} { # Set the position of a window from a geometry string # proc set_window_position {w geometry} { - set value "$geometry" - set idx [string first "+" "$value"] - if {"$idx" == -1} { + set value $geometry + set idx [string first "+" $value] + if {$idx == -1} { set value [wm geometry .] - set idx [string first "+" "$value"] + set idx [string first "+" $value] } - if {"$idx" == -1} { return "" } - set pos [string range "$value" "$idx" end] - wm geometry $w "$pos" + if {$idx == -1} { return "" } + set pos [string range $value $idx end] + wm geometry $w $pos } @@ -3100,7 +3105,7 @@ proc set_window_position {w geometry} { # proc reset_to_normal_background {w} { set normal_color [.drive_drop_both cget -background] - $w configure -background "$normal_color" + $w configure -background $normal_color } @@ -3176,11 +3181,11 @@ proc init_gui {} { # Main grouping frames frame .connection_block \ - -relief "$main_framerelief" -borderwidth "$main_borderwidth" + -relief $main_framerelief -borderwidth $main_borderwidth frame .drive_block \ - -relief "$main_framerelief" -borderwidth "$main_borderwidth" + -relief $main_framerelief -borderwidth $main_borderwidth frame .iso_block \ - -relief "$main_framerelief" -borderwidth "$main_borderwidth" + -relief $main_framerelief -borderwidth $main_borderwidth init_input init_msgbox @@ -3224,8 +3229,8 @@ proc init_input {} { button .end_button -text "End" -command "end_xorriso" bind_help .end_button "End" - if {[string length "$xorriso_version"] > 10} { - set xorriso_version [string range "$xorriso_version" 0 9] + if {[string length $xorriso_version] > 10} { + set xorriso_version [string range $xorriso_version 0 9] } label .xorriso_version -text "xorriso-$xorriso_version" bind_help .xorriso_version "version" @@ -3293,11 +3298,11 @@ proc init_msgbox {} { listbox .msglist -height $msglist_lines -selectmode extended \ -yscrollcommand ".msgscroll set" \ -exportselection $export_msg_selection - bind_listbox_keys ".msglist" "$msglist_lines" "listbox" + bind_listbox_keys ".msglist" $msglist_lines "listbox" bind_help .msglist "message box" set msglist_running 1 - foreach i "$pre_msglist" { - display_msg "$i" + foreach i $pre_msglist { + display_msg $i } scrollbar .msgscroll -command ".msglist yview" pack .msglist -in .msgbox -side left -expand 1 -fill both @@ -3330,7 +3335,7 @@ proc init_cmd_errmsg {} { global borderwidth global .cmd_errmsg .cmd_errmsg_label .cmd_errmsg_msg - frame .cmd_errmsg -borderwidth "$borderwidth" + frame .cmd_errmsg -borderwidth $borderwidth label .cmd_errmsg_label -width 14 -text "Recent problem:" -anchor w bind_help .cmd_errmsg_label "Recent problem:" @@ -3351,7 +3356,7 @@ proc init_total_errmsg {} { global .total_errmsg .total_errmsg_label .total_errmsg_msg global .total_errmsg_clear - frame .total_errmsg -borderwidth "$borderwidth" + frame .total_errmsg -borderwidth $borderwidth label .total_errmsg_label -text "Worst problem:" -width 14 -anchor w bind_help .total_errmsg_label "Worst problem:" @@ -3386,7 +3391,7 @@ proc init_drivebox {} { listbox .drivelist -height $drivelist_lines -selectmode extended \ -yscrollcommand ".drivescroll set" \ -exportselection $export_selection - bind_listbox_keys ".drivelist" "$drivelist_lines" "listbox" + bind_listbox_keys ".drivelist" $drivelist_lines "listbox" bind_help .drivelist "drivelist" scrollbar .drivescroll -command ".drivelist yview" @@ -3614,8 +3619,8 @@ proc init_isobox {} { -yscrollcommand ".isoscroll_y set" \ -xscrollcommand ".isoscroll_x set" \ -exportselection $export_selection + bind_listbox_keys ".isolist" $isolist_lines "listbox" bind_help .isolist "isolist" - bind_listbox_keys ".isolist" "$isolist_lines" "listbox" scrollbar .isoscroll_y -command ".isolist yview" scrollbar .isoscroll_x -orient horizontal -command ".isolist xview" pack .isolist -in .isolistbox -side left -expand 1 -fill both @@ -3755,7 +3760,7 @@ proc init_localfs_aux {} { bind_help .overwriting "Overwriting:" set_overwriting_label set m ".overwriting.menu" - menu $m -tearoff 0 + menu $m $m add checkbutton -label "Overwrite ISO files" \ -indicatoron 1 -selectcolor "" \ -command set_overwriting_label \ @@ -3766,7 +3771,7 @@ proc init_localfs_aux {} { -command set_overwriting_label \ -variable overwrite_iso_dirs \ -onvalue 1 -offvalue 0 - $m add checkbutton -label "Overwrite disk files" \ + $m add checkbutton -label "Overwrite hard disk files" \ -indicatoron 1 -selectcolor "" \ -command set_overwriting_label \ -variable overwrite_disk_files \ @@ -3779,7 +3784,7 @@ proc init_localfs_aux {} { pack .overwriting -in .localfs_aux_frame -side left - if {"$have_bwidget" == 1} { + if {$have_bwidget == 1} { checkbutton .browse_select_is_setvar -text "File browser text field" \ -indicatoron 1 -selectcolor "" \ -relief ridge -borderwidth 2 \ @@ -3855,7 +3860,7 @@ proc init_insert {} { proc bind_listbox_keys {box height what_widget} { global click_to_focus - if {"$click_to_focus" == 1} { + if {$click_to_focus == 1} { bind $box <1> "focus \"$box\"" bind $box <2> "focus \"$box\"" bind $box <3> "focus \"$box\"" @@ -3864,7 +3869,7 @@ proc bind_listbox_keys {box height what_widget} { } # No underlining - if {"$what_widget" == "listbox"} { + if {$what_widget == "listbox"} { $box configure -activestyle "none" } @@ -3904,11 +3909,11 @@ proc bind_listbox_keys {box height what_widget} { proc bind_entry_keys {entry return_cmd} { global click_to_focus - if {"$click_to_focus" != 1} { + if {$click_to_focus != 1} { bind $entry "focus \"$entry\"" } - if {"$return_cmd" != ""} { - bind $entry "$return_cmd" + if {$return_cmd != ""} { + bind $entry $return_cmd } } @@ -3925,12 +3930,12 @@ proc bind_help {to_what help_name} { proc create_browser_button {button_name var_name which_fs help_name} { global have_bwidget - if {"$have_bwidget" == 1} { + if {$have_bwidget == 1} { button $button_name -text "/" -command "browse_tree $var_name $which_fs" - bind_help $button_name "$help_name" + bind_help $button_name $help_name } else { button $button_name -text "/" -command "browser_dummy" - if {"$which_fs" == "localfs"} { + if {$which_fs == "localfs"} { bind_help $button_name "Browse disk (dummy)" } else { bind_help $button_name "Browse ISO (dummy)" @@ -3954,7 +3959,7 @@ proc set_overwriting_label {} { set fdw "-" if {$extract_auto_chmod == 1} {set fdw "w"} set otext "Overwriting: ${oif}${oid}${ohf}${fdw}" - .overwriting configure -text "$otext" + .overwriting configure -text $otext } @@ -3963,7 +3968,7 @@ proc set_overwriting_label {} { proc tell_helptext {what} { global own_version argv0 bwidget_version - if {"$what" == "Help"} { + if {$what == "Help"} { return \ "For getting particular help texts: @@ -4111,7 +4116,7 @@ The GUI window is separated into three main areas: browser to initiate the extraction run. If a \"yes/no\" window pops up, consider well whether you are up to to shooting your own foot right now. - Enable the \"Overwrite disk files\" switch only if you are really + Enable the \"Overwrite hard disk files\" switch only if you are really sure that the files from ISO are better than the ones on hard disk. ----------------------------------------------------------------------------- @@ -4129,11 +4134,11 @@ Copyright (C) 2012 - 2013 Thomas Schmitt , libburnia-project.org Provided under BSD license: Use, modify, and distribute as you like." } - if {"$what" == "End"} { + if {$what == "End"} { return \ "The \"End\" button leads to the end of frontend and xorriso process." } - if {"$what" == "version"} { + if {$what == "version"} { return \ "The field between \"End\" button and ready/busy field displays the version of the serving xorriso program. @@ -4160,23 +4165,23 @@ do i/o via standard input and standard output or via named pipes. Further it has to perform integer arithmetics and string manipulations. And, well, a graphical widget set would be nice." } - if {"$what" == "Refresh disp"} { + if {$what == "Refresh disp"} { return \ "The \"Refresh disp\" button causes several text fields and list boxes to update their display after manually transmitted commands may have changed the state of drives or ISO model." } - if {"$what" == "ready/busy"} { + if {$what == "ready/busy"} { return \ "The ready/busy field indicates whether a xorriso command is being executed and the frontend is still waiting for its reply messages." } - if {"$what" == "Command:"} { + if {$what == "Command:"} { return \ "The \"Command:\" field can be used to send commands to xorriso. See the manual page of xorriso for its concepts and commands." } - if {"$what" == "Log pipes"} { + if {$what == "Log pipes"} { return \ "The \"Log pipes\" switch controls whether all xorriso commands and replies shall be logged to standard error resp. to the file that has been given @@ -4184,7 +4189,7 @@ with program argument --log_file. Caution: This log is verbous." } - if {"$what" == "message box"} { + if {$what == "message box"} { return \ "The message box displays commands sent to xorriso and messages received from xorriso. @@ -4193,7 +4198,7 @@ Many commands which are emitted by the GUI will hide themselves and their replies from this display. All event messages with severity WARNING or higher will show up, nevertheless." } - if {"$what" == "Recent problem:"} { + if {$what == "Recent problem:"} { return \ "The \"Recent problem:\" field shows the most severe event message that occured during the execution of the most recent command. It also displays the most @@ -4203,16 +4208,16 @@ Several commands emitted by the GUI will not clear this display. But any manually transmitted command and the major GUI gestures will do. " } - if {"$what" == "Worst problem:"} { + if {$what == "Worst problem:"} { return \ "The \"Worst problem:\" field shows the most severe event message that occured since last time the \"Clear\" button was hit. It will not clear automatically." } - if {"$what" == "Clear"} { + if {$what == "Clear"} { return \ "The \"Clear\" button removes the message from the \"Worst problem:\" field." } - if {"$what" == "Scan for drives"} { + if {$what == "Scan for drives"} { return \ "The \"Scan for drives\" button executes command -devices and puts the list of found optical drives into the box beneath the button. @@ -4229,7 +4234,7 @@ Then apply to the listed device files. (Consider to use finer means of permission granting for a permanent solution.)" } - if {"$what" == "Pick input drive"} { + if {$what == "Pick input drive"} { return \ "The \"Pick input drive\" button executes command -indev and obtains some information about the medium status. This info is displayed in the @@ -4245,7 +4250,7 @@ then its directory tree gets loaded underneath that model root directory. The input drive may also be a data file on hard disk if that file contains an ISO 9660 filesystem image. See field \"Input drive/image\"." } - if {"$what" == "Pick output drive"} { + if {$what == "Pick output drive"} { return \ "The \"Pick output drive\" button executes command -outdev and obtains some information about the medium status. This info is displayed in the @@ -4263,7 +4268,7 @@ It is considered appendable if it contains an ISO 9660 filesystem image. It is considered blank if it is empty or marked as blank by button \"Blank\". It is considered closed if it contains other data." } - if {"$what" == "Pick drive for both roles"} { + if {$what == "Pick drive for both roles"} { return \ "The \"Pick drive for both roles\" button executes command -dev and obtains some information about the medium status. This info is displayed in the @@ -4284,24 +4289,24 @@ It is considered appendable if it contains an ISO 9660 filesystem image. It is considered blank if it is empty or marked as blank by button \"Blank\". It is considered closed if it contains other data." } - if {"$what" == "Give up drives"} { + if {$what == "Give up drives"} { return \ "The \"Give up drives\" button executes commands -indev \"\" -outdev \"\" and clears both \"... drive/image\" lines, as well as the ISO model." } - if {"$what" == "Calm drives"} { + if {$what == "Calm drives"} { return \ "The \"Calm drives\" button executes command -calm_drives which tells the aquired optical drives to stop spinning until the next drive activity gets triggered." } - if {"$what" == "Rollback"} { + if {$what == "Rollback"} { return \ "The \"Rollback\" button executes command -rollback which drops all pending changes of the ISO model and reloads it from the input drive, if one is aquired." } - if {"$what" == "drivelist"} { + if {$what == "drivelist"} { return \ "The box beneath the \"Scan for drives\" button shows the optical drives which were found by the most recent scan run. @@ -4310,7 +4315,7 @@ A double-click on a drive item has the same effect as button \"Pick drive for both roles\". " } - if {"$what" == "Input drive/image"} { + if {$what == "Input drive/image"} { return \ "The \"Input drive/image\" field displays the address of the input drive. Editing the drive address and pressing the Return key causes the execution @@ -4321,18 +4326,18 @@ It is of course permissible that input image and output image are the same file. " } - if {"$what" == "input drive info"} { + if {$what == "input drive info"} { return \ "The text field beneath the \"Input drive/image\" field displays the medium status of the input drive. It tells about the writability, the medium type, the number of ISO sessions, and the amount of readable data." } - if {"$what" == "Eject (indev)"} { + if {$what == "Eject (indev)"} { return \ "The \"Eject\" button beneath the \"Input drive/image\" field excutes command -eject \"in\"." } - if {"$what" == "Output drive/image"} { + if {$what == "Output drive/image"} { return \ "The \"Output drive/image\" field displays the address of the output drive. Editing the drive address and pressing the Return key causes the execution @@ -4343,18 +4348,18 @@ It is of course permissible that input image and output image are the same file. " } - if {"$what" == "output drive info"} { + if {$what == "output drive info"} { return \ "The text beneath the \"Output drive/image\" field displays the medium status of the output drive. It tells about the writability, the medium type, the number of ISO sessions, and the amount of free space." } - if {"$what" == "Eject (outdev)"} { + if {$what == "Eject (outdev)"} { return \ "The \"Eject\" button beneath the \"Output drive/image\" field excutes command -eject \"out\"." } - if {"$what" == "Blank"} { + if {$what == "Blank"} { return \ "The \"Blank\" button executes command -blank \"as_needed\" on the output drive in order to make a re-usable medium or an ISO image data file writable from @@ -4368,7 +4373,7 @@ write operation which invalidates their existing ISO filesystem. One-time writable media CD-R, DVD-R, DVD+R, and BD-R cannot be blanked." } - if {"$what" == "Format"} { + if {$what == "Format"} { return \ "The \"Format\" button executes -format \"as_needed\". @@ -4382,7 +4387,7 @@ being quickly blankable while maintaining the capability for multi-session. Formatted BD-R can perform Defect Management, which is of questionable value." } - if {"$what" == "Write ISO session"} { + if {$what == "Write ISO session"} { return \ "The \"Write ISO session\" executes command -commit, which writes a session with all pending changes to the output drive. @@ -4398,7 +4403,7 @@ manipulations, and then click \"Write ISO session\" to let xorriso write the data to medium or ISO image file. " } - if {"$what" == "Close"} { + if {$what == "Close"} { return \ "The \"Close\" switch controls whether command -close \"on\" is emitted with \"Write ISO session\" or whether -as cdrecord option -multi is omitted with @@ -4408,7 +4413,7 @@ Closed optical media cannot be written any more unless they get blanked, which is not possible with CD-R, DVD-R, DVD+R, and BD-R. " } - if {"$what" == "TAO"} { + if {$what == "TAO"} { return \ "The \"TAO\" switch controls whether an incremental MMC write type shall be enforced with write commands. See xorriso command -write_type. @@ -4417,13 +4422,13 @@ Normally xorriso will decide by medium status and job parameters which MMC write type to choose. Some drives at the edge of failure might work with the one write type while already failing with the other." } - if {"$what" == "Defect Mgt"} { + if {$what == "Defect Mgt"} { return \ "The \"Defect Mgt\" switch controls whether slow and error-prone drive internal check-reading shall be enabled when writing to formatted BD-R or BD-RE. See xorriso command -stream_recording." } - if {"$what" == "Burn image file:"} { + if {$what == "Burn image file:"} { return \ "The \"Burn image file:\" button executes command -as \"cdrecord\" to burn a data file from hard disk onto the output drive. @@ -4437,7 +4442,7 @@ as well use one of the command line tools for burning the result. E.g. xorriso -as cdrecord -v dev=/dev/sr0 -multi stream_recording=32s image.iso )" } - if {"$what" == "Extract to disk:"} { + if {$what == "Extract to disk:"} { return \ "The \"Extract to disk:\" button executes command -extract with the whole tree of the current ISO directory or with the selected items of the box @@ -4447,15 +4452,15 @@ This copies the selected files or directory trees from the input drive to the address on hard disk which is given by the text field right of the button." } - if {"$what" == "Browse tree"} { + if {$what == "Browse tree"} { return "[tell_file_browser_help 0]" } - if {"$what" == "Close (browse tree)"} { + if {$what == "Close (browse tree)"} { return \ "The \"Close\" button in the file browser closes the browser window without performing other actions." } - if {"$what" == "Up (browse tree)"} { + if {$what == "Up (browse tree)"} { return \ "The \"Up\" button in the file browser brings you to the parent directory of the currently selected file tree item. @@ -4463,14 +4468,14 @@ of the currently selected file tree item. The parent directory will be opened and become the selected item. All opened directory trees underneath the parent will be closed." } - if {"$what" == "Down (browse tree)"} { + if {$what == "Down (browse tree)"} { return \ "The \"Down\" button in the file browser opens the directory underneath the currently selected file tree item. It has the same effect as clicking the \"+\" node of the selected item." } - if {"$what" == "Accept (browse tree)"} { + if {$what == "Accept (browse tree)"} { return \ "The \"Accept\" button in the file browser brings the single selected item from the file browser tree into effect with the associated text field. @@ -4478,7 +4483,7 @@ I.e. it hits the Return key of the field. It works as if the item had been double clicked." } - if {"$what" == "Edit (browse tree)"} { + if {$what == "Edit (browse tree)"} { return \ "The \"Edit\" button in the file browser brings the single selected item from the file browser tree into the associated text field. @@ -4489,56 +4494,56 @@ to edit the file address. (This is done automatically with every selection if the switch \"File browser text field\" is enabled.)" } - if {"$what" == "Browse disk (extract)"} { + if {$what == "Browse disk (extract)"} { return \ "The \"/\" button in the \"Extract to disk:\" line pops up a file tree browser to select a target address in the hard disk filesystem. [tell_file_browser_help 1]" } - if {"$what" == "Browse disk (burn image)"} { + if {$what == "Browse disk (burn image)"} { return \ "The \"/\" button beneath the \"Burn image file\" field pops up a file tree browser to select a source address in the hard disk filesystem. [tell_file_browser_help 1]" } - if {"$what" == "Browse disk (insert)"} { + if {$what == "Browse disk (insert)"} { return \ "The \"/\" button beneath the \"Insert from disk\" field pops up a file tree browser to select a source address in the hard disk filesystem. [tell_file_browser_help 1]" } - if {"$what" == "Browse disk (indev)"} { + if {$what == "Browse disk (indev)"} { return \ "The \"/\" button in the \"Input drive/image\" line pops up a file tree browser to select a source address in the hard disk filesystem. [tell_file_browser_help 1]" } - if {"$what" == "Browse disk (outdev)"} { + if {$what == "Browse disk (outdev)"} { return \ "The \"/\" button in the \"Output drive/image\" line pops up a file tree browser to select a source address in the hard disk filesystem. [tell_file_browser_help 1]" } - if {"$what" == "Browse ISO (isodir)"} { + if {$what == "Browse ISO (isodir)"} { return \ "The \"/\" button in the \"ISO directory\" line pops up a file tree browser to select the current directory in the ISO filesystem model. [tell_file_browser_help 1]" } - if {"$what" == "Browse ISO (move target)"} { + if {$what == "Browse ISO (move target)"} { return \ "The \"/\" button in the \"Selection:\" line pops up a file tree browser to select the current directory in the ISO filesystem model. [tell_file_browser_help 1]" } - if {"$what" == "Browse disk (dummy)"} { + if {$what == "Browse disk (dummy)"} { return \ "Normally this button would start a file browser to select a file or directory on hard disk. @@ -4546,7 +4551,7 @@ directory on hard disk. But the browser cannot be displayed because Tcl/Tk package \"BWidget\" is not loaded." } - if {"$what" == "Browse ISO (dummy)"} { + if {$what == "Browse ISO (dummy)"} { return \ "Normally this button would start a file browser to select a file or directory in the ISO model. @@ -4554,7 +4559,7 @@ directory in the ISO model. But the browser cannot be displayed because Tcl/Tk package \"BWidget\" is not loaded." } - if {"$what" == "Underneath (extract)"} { + if {$what == "Underneath (extract)"} { return \ "The \"Underneath\" switch controls the effective hard disk target address of an item if the address in the \"Extract to disk:\" field points to a @@ -4576,13 +4581,13 @@ Address for hard disk is \"/tmp/from_iso\". Switch \"Selected\" is enabled. -extract /iso_file /tmp/from_iso The last command will fail because /tmp/from_iso already exists as directory." } - if {"$what" == "Selected (extract)"} { + if {$what == "Selected (extract)"} { return \ "The \"Selected\" switch controls whether the whole current ISO directory, or only the selected items shall be copied to hard disk. " } - if {"$what" == "Overwriting:"} { + if {$what == "Overwriting:"} { return \ "The \"Overwriting\" menu bundles several switches which control whether existing files or directories may be overwritten. @@ -4602,7 +4607,7 @@ an ISO directory by a non-directory file. See xorriso command -overwrite \"on\". ---------------------------------------------------------------------------- -The \"Overwrite disk files\" switch controls whether existing files may be +The \"Overwrite hard disk files\" switch controls whether existing files may be overwritten by extraction to hard disk. See xorriso command -overwrite \"on\". This is DANGEROUS, of course, but comes in handy with restoring of backups. @@ -4622,7 +4627,7 @@ speed up extraction substantially. It is bound to \"auto_chmod_on\" because else it might get into trouble when restoring ISO directories which offer no w-permission." } - if {"$what" == "File browser text field"} { + if {$what == "File browser text field"} { return \ "The \"File browser text field\" switch controls whether a single click or cursor movement in the file browser shall bring the selected file @@ -4635,7 +4640,7 @@ In any case, double clicked addresses get treated as if the Return key had been hit in the text field. The same happens with the selected item and button \"Accept\"." } - if {"$what" == "Permissions:"} { + if {$what == "Permissions:"} { return \ "The \"Permissions\" menu allows to choose a global policy to adjust the access permissions of the files when an ISO session gets written. @@ -4657,7 +4662,7 @@ If there is any x-permission, then all three x get granted. s- and t-bits get removed. " } - if {"$what" == "Avail:"} { + if {$what == "Avail:"} { return \ "The \"Avail:\" button triggers command -tell_media_space. It makes a time consuming exact prediction of the free space on the medium in the @@ -4667,7 +4672,7 @@ changes is computed. With image files rather than real optical drives, the free space of the hosting filesystem is displayed." } - if {"$what" == "Insert from disk:"} { + if {$what == "Insert from disk:"} { return \ "The \"Insert from disk:\" button executes command -map with the disk file address that is given by the text field right to the button. @@ -4680,7 +4685,7 @@ the inserted files shall have. You may use buttons \"Delete\" and \"Move to:\" for further adjustments. " } - if {"$what" == "Underneath (insert)"} { + if {$what == "Underneath (insert)"} { return \ "The \"Underneath\" switch controls the effective ISO target address if the address in the \"Insert from disk:\" field points to a hard disk @@ -4693,13 +4698,13 @@ leaf name." If \"Underneath\" is disabled then the directory itself will not show up in the ISO image but only its files and sub directories will do." } - if {"$what" == "Selected (insert)"} { + if {$what == "Selected (insert)"} { return \ "If the switch \"Selected\" is enabled, then the given disk file or tree will be inserted at or underneath the only selected item in the box underneath \"ISO directory:\"." } - if {"$what" == "ISO directory:"} { + if {$what == "ISO directory:"} { return \ "The current ISO directory shall be used to navigate in the ISO image model of xorriso. By default it is the target of file insertions and the source @@ -4714,11 +4719,11 @@ It is possible to choose the ISO directory by double-clicking an item in the box underneath the \"ISO directory:\" line. " } - if {"$what" == "Up"} { + if {$what == "Up"} { return \ "The \"Up\" buttons move the current ISO directory one directory level up." } - if {"$what" == "Verify"} { + if {$what == "Verify"} { return \ "The \"Verify\" button executes -md5_check_r \"SORRY\" with the current ISO directory. @@ -4729,7 +4734,7 @@ ISO images bear MD5 checksums for each data file if they were produced by xorriso with -md5 \"on\" resp. -for_backup. This frontend enables this feature on startup." } - if {"$what" == "isolist"} { + if {$what == "isolist"} { return \ "The list box underneath the \"ISO directory:\" line displays the files in the current ISO directory. One or more item can be selected and play a @@ -4738,7 +4743,7 @@ role with extraction or insertion of files. Most of the buttons underneath the box operate on the selected items unconditionally." } - if {"$what" == "Selection:"} { + if {$what == "Selection:"} { return \ "The ISO selection consists of the items which are selected in the list box above the \"Selection:\" line. @@ -4749,7 +4754,7 @@ is source of file extraction and target of file insertion. In any case it is the old nome of the \"Move to:\" button, the victim of the \"Delete\" button, and the subject of the \"Verify\" button." } - if {"$what" == "Verify (selection)"} { + if {$what == "Verify (selection)"} { return \ "The \"Verify\" button in the \"Selection:\" line executes command -md5_check_r \"SORRY\" with each of the selected items. @@ -4760,7 +4765,7 @@ ISO images bear MD5 checksums for each data file if they were produced by xorriso with -md5 \"on\" resp. -for_backup. This frontend enables this feature on startup." } - if {"$what" == "Delete"} { + if {$what == "Delete"} { return \ "The \"Delete\" button executes command -rm_r with each of the selected items. @@ -4771,7 +4776,7 @@ in earlier sessions if they were not freshly inserted after loading the ISO model from the input drive. " } - if {"$what" == "Move to:"} { + if {$what == "Move to:"} { return \ "The \"Move to:\" button uses command -mv to move each of the selected items to the address that is given by the text field right to the button. @@ -4781,20 +4786,20 @@ be moved underneath that directory and keep their leaf names. Else there may be only one selected item which will be renamed to the given address." } - if {"$what" == "Make dir"} { + if {$what == "Make dir"} { return \ "The \"Make dir\" button executes command -mkdir with the address in the text field to its left (the same as used by \"Move to:\"). Useful to create a target directory before moving the selection." } - if {"$what" == "rename and mkdir target"} { + if {$what == "rename and mkdir target"} { return \ "The text field between the \"Move to:\" button and the \"Make dir\" button serves both buttons by providing the target address for renaming resp. directory creation." } - if {"$what" == "yes to all"} { + if {$what == "yes to all"} { return \ "The \"yes to all\" button appears in the yes/no window if a GUI action is about to overwrite a file object and more such overwrite situations are @@ -4805,7 +4810,7 @@ action will be answered automatically with yes. [about_help_for_yesno]" } - if {"$what" == "no to all"} { + if {$what == "no to all"} { return \ "The \"no to all\" button appears in the yes/no window if a GUI action is about to overwrite a file object and more such overwrite situations are @@ -4816,7 +4821,7 @@ action will be answered automatically with no. [about_help_for_yesno]" } - if {"$what" == "Continue"} { + if {$what == "Continue"} { return \ "The \"Continue\" button appears in the notification windows which tell about a failed or rejected GUI action. @@ -4829,7 +4834,7 @@ or hit the Return key. You cannot even close this help window before you did that." } - if {"$what" == "yes/no"} { + if {$what == "yes/no"} { return \ "The \"yes\" and \"no\" buttons appear in the confirmation window which tells about a potentially dangerous GUI action and demands a user decision whether @@ -4846,7 +4851,7 @@ to really perform this action. # proc tell_file_browser_help {with_separator} { set sep "" - if {"$with_separator" == 1} { + if {$with_separator == 1} { set sep \ "-------------------------------------------------------------------------\n\n" } @@ -4900,21 +4905,21 @@ You cannot even close this help window before you clicked one of the buttons." # proc make_text_shellsafe {text} { set result "'" - set rest "$text" - while {[string length "$rest"]} { - set idx [string first "'" "$rest"] - if {"$idx" == -1} { + set rest $text + while {[string length $rest]} { + set idx [string first "'" $rest] + if {$idx == -1} { set result "$result$rest" break } else { - if {"$idx" > 0} { - set result "$result[string range "$rest" 0 [expr "$idx" - 1]]" + if {$idx > 0} { + set result "$result[string range $rest 0 [expr $idx - 1]]" } set result "$result'\"'\"'" - if {"$idx" == [expr [string length "$rest"] - 1]} { + if {$idx == [expr [string length $rest] - 1]} { break } - set rest [string range "$rest" [expr "$idx" + 1] end] + set rest [string range $rest [expr $idx + 1] end] } } set result "$result'" @@ -4924,21 +4929,21 @@ proc make_text_shellsafe {text} { # Count the number of newline chracters in text. # proc count_newlines {text} { - set rest "$text" + set rest $text set count 0 - while {[string length "$rest"]} { - set idx [string first "\n" "$rest"] - if {"$idx" == -1} { + while {[string length $rest]} { + set idx [string first "\n" $rest] + if {$idx == -1} { break } else { - set count [expr "$count" + 1] - if {"$idx" == [expr [string length "$rest"] - 1]} { + set count [expr $count + 1] + if {$idx == [expr [string length $rest] - 1]} { break } - set rest [string range "$rest" [expr "$idx" + 1] end] + set rest [string range $rest [expr $idx + 1] end] } } - return "$count" + return $count } @@ -4946,20 +4951,20 @@ proc count_newlines {text} { # proc combine_dir_and_name {dir name} { set has_slash 0 - if {"$name" == ""} { - return "$dir" + if {$name == ""} { + return $dir } - if {[string range "$name" 0 0] == "/"} { + if {[string range $name 0 0] == "/"} { incr has_slash } - if {[string last "/" "$dir"] == [expr [string length "$dir"] - 1] && - "$dir" != ""} { + if {[string last "/" $dir] == [expr [string length $dir] - 1] && + $dir != ""} { incr has_slash 1 } - if {"$has_slash" == 2} { + if {$has_slash == 2} { return "$dir[string range $name" 1 end]" } - if {"$has_slash" == 1} { + if {$has_slash == 1} { return "$dir$name" } return "$dir/$name" @@ -4971,10 +4976,10 @@ proc combine_dir_and_name {dir name} { proc normalize_isodir_adr {} { global isodir_adr - if {"$isodir_adr" == ""} { + if {$isodir_adr == ""} { set isodir_adr "/" } - if {[string range "$isodir_adr" 0 0] != "/"} { + if {[string range $isodir_adr 0 0] != "/"} { set isodir_adr "/$isodir_adr" } } @@ -4987,38 +4992,38 @@ proc path_touches_isodir {path} { normalize_isodir_adr set cmp_start 0 - if {"$isodir_adr" == "/"} { + if {$isodir_adr == "/"} { set cmp_start 1 } - if {[string range "$path" 0 0] != "/"} { - if {[string first "/" "$path"] == -1} { - return "$path" + if {[string range $path 0 0] != "/"} { + if {[string first "/" $path] == -1} { + return $path } else { - return [file dirname "$path"] + return [file dirname $path] } } - set l [expr {[string length "$isodir_adr"] - $cmp_start}] - if {[string length "$path"] < [expr {$l + 2}]} { + set l [expr {[string length $isodir_adr] - $cmp_start}] + if {[string length $path] < [expr {$l + 2}]} { return "" } if {$l > 0} { - if {[string range "$path" $cmp_start [expr {$l - 1}]] != \ - [string range "$isodir_adr" $cmp_start end]} { + if {[string range $path $cmp_start [expr {$l - 1}]] != \ + [string range $isodir_adr $cmp_start end]} { return "" } } - if {[string range "$path" "$l" "$l"] != "/"} { + if {[string range $path $l $l] != "/"} { return "" } - set subpath [string range "$path" [expr {$l + 1}] end] - set slash [string first "/" "$subpath"] - if {"$slash" == -1} { - return "$subpath" + set subpath [string range $path [expr {$l + 1}] end] + set slash [string first "/" $subpath] + if {$slash == -1} { + return $subpath } - if {"$slash" == 0} { + if {$slash == 0} { return "" } - return [string range "$subpath" 0 [expr {$slash - 1}]] + return [string range $subpath 0 [expr {$slash - 1}]] } @@ -5028,8 +5033,8 @@ proc path_touches_isodir {path} { proc compare_sev {sev1 sev2} { global xorriso_severity_list - set idx1 [lsearch -exact "$xorriso_severity_list" "$sev1"] - set idx2 [lsearch -exact "$xorriso_severity_list" "$sev2"] + set idx1 [lsearch -exact $xorriso_severity_list $sev1] + set idx2 [lsearch -exact $xorriso_severity_list $sev2] if {$idx1 < $idx2} {return -1} if {$idx1 > $idx2} {return 1} return 0 @@ -5041,8 +5046,8 @@ proc compare_sev {sev1 sev2} { proc log_puts {text} { global logging log_conn - if {"$logging" == 1} { - puts $log_conn "$text" + if {$logging == 1} { + puts $log_conn $text } } @@ -5062,32 +5067,32 @@ proc start_xorriso {} { global argv0 argv set self "" - if {[string first "/" "$argv0"] != -1} { - set self "$argv0" + if {[string first "/" $argv0] != -1} { + set self $argv0 } - if {"$self" == ""} { + if {$self == ""} { set self "/usr/bin/xorriso-tcltk" - if {[file executable "$self"] == 0} {set self ""} + if {[file executable $self] == 0} {set self ""} } - if {"$self" == ""} { + if {$self == ""} { set self "/usr/local/bin/xorriso-tcltk" - if {[file executable "$self"] == 0} {set self ""} + if {[file executable $self] == 0} {set self ""} } - if {"$self" == ""} { + if {$self == ""} { catch { set conn [open "|which xorriso-tcltk" r] set self [gets $conn] close $conn } } - if {"$self" == ""} { + if {$self == ""} { catch { set conn [open "|sh -c \"type -p xorriso-tcltk\"" r] set self [gets $conn] close $conn } } - if {"$self" == ""} { + if {$self == ""} { puts stderr "$argv0 :\n Cannot locate address of script xorriso-tcltk in filesystem.\n" puts stderr "You will have to use --stdio or --named_pipes." puts stderr "See $argv0 --help\n" @@ -5106,8 +5111,8 @@ proc start_xorriso {} { proc yell_xorriso_tcltk {} { global argv own_version - if {[llength "$argv"] > 0} { - if {[lindex "$argv" 0] == "--silent_start"} {return ""} + if {[llength $argv] > 0} { + if {[lindex $argv 0] == "--silent_start"} {return ""} } puts stderr "xorriso-tcltk $own_version : Proof of concept for GUI frontends of xorriso\n" } @@ -5116,12 +5121,12 @@ proc yell_xorriso_tcltk {} { # Tells whether an absolute path leads to a directory on hard disk # proc localfs_filetype {path} { - catch {file lstat "$path" stbuf} + catch {file lstat $path stbuf} if {[info exists stbuf] == 1} { set t [string range $stbuf(type) 0 0] - if {[string first "$t" "bcdls"] != -1} {return "$t"} - if {"$stbuf(type)" == "file"} {return "-"} - if {"$stbuf(type)" == "fifo"} {return "p"} + if {[string first $t "bcdls"] != -1} {return $t} + if {$stbuf(type) == "file"} {return "-"} + if {$stbuf(type) == "fifo"} {return "p"} return "?" } return "" @@ -5133,20 +5138,20 @@ proc localfs_filetype {path} { proc localfs_ls {dir} { set result "" - if {[localfs_filetype "$dir"] != "d"} {return ""} + if {[localfs_filetype $dir] != "d"} {return ""} set conn [open "|ls {$dir}" r] while {1} { set ret [gets $conn line] - if {"$ret" == -1} { + if {$ret == -1} { break } - set adr [combine_dir_and_name "$dir" "$line"] - set filetype [localfs_filetype "$adr"] - if {"$filetype" == ""} {set filetype "?"} + set adr [combine_dir_and_name $dir $line] + set filetype [localfs_filetype $adr] + if {$filetype == ""} {set filetype "?"} lappend result "$filetype $line" } catch {close $conn} - return "$result" + return $result } @@ -5160,97 +5165,97 @@ proc setup_by_args {argv0 argv} { global geometry stdout stdin # wish normally eats the -geometry option and puts the result into $geometry - catch {set main_window_geometry "$geometry"} + catch {set main_window_geometry $geometry} set connection_defined 0 - set loop_limit [llength "$argv"] - for {set i 0} {"$i" < "$loop_limit"} {incr i} { + set loop_limit [llength $argv] + for {set i 0} {$i < $loop_limit} {incr i} { set ok "0" - set opt [lrange "$argv" "$i" "$i"] - if {"$opt" == "--help"} { + set opt [lrange $argv $i $i] + if {$opt == "--help"} { set ok "1" - print_usage "$argv0" + print_usage $argv0 central_exit 0 } - if {"$opt" == "--silent_start"} { + if {$opt == "--silent_start"} { set ok "1" } - if {"$opt" == "--stdio"} { + if {$opt == "--stdio"} { set ok "1" set connection_defined 1 } - if {"$opt" == "--named_pipes"} { + if {$opt == "--named_pipes"} { set ok "1" incr i - set cmd_pipe_adr [lrange "$argv" "$i" "$i"] + set cmd_pipe_adr [lrange $argv $i $i] incr i - set reply_pipe_adr [lrange "$argv" "$i" "$i"] - if {"$cmd_pipe_adr" != "" && "$reply_pipe_adr" != "" && - "$cmd_pipe_adr" != "-" && "$reply_pipe_adr" != "-"} { - init_frontend_named_pipes "$cmd_pipe_adr" "$reply_pipe_adr" + set reply_pipe_adr [lrange $argv $i $i] + if {$cmd_pipe_adr != "" && $reply_pipe_adr != "" && + $cmd_pipe_adr != "-" && $reply_pipe_adr != "-"} { + init_frontend_named_pipes $cmd_pipe_adr $reply_pipe_adr } set connection_defined 1 } - if {"$opt" == "--geometry" || "$opt" == "-geometry"} { + if {$opt == "--geometry" || $opt == "-geometry"} { set ok "1" # Just in case -geometry does not get eaten by wish incr i - set main_window_geometry [lrange "$argv" "$i" "$i"] - set give_geometry [lrange "$argv" "$i" "$i"] + set main_window_geometry [lrange $argv $i $i] + set give_geometry [lrange $argv $i $i] } - if {"$opt" == "--click_to_focus"} { + if {$opt == "--click_to_focus"} { set ok "1" set click_to_focus "1" } - if {"$opt" == "--auto_focus"} { + if {$opt == "--auto_focus"} { set ok "1" set click_to_focus "0" } - if {"$opt" == "--log_file"} { + if {$opt == "--log_file"} { set ok "1" incr i - set log_file [lrange "$argv" "$i" "$i"] - if {"$log_file" == "" || "$log_file" == "-"} { + set log_file [lrange $argv $i $i] + if {$log_file == "" || $log_file == "-"} { set log_conn stderr } else { set log_conn "" - catch {set log_conn [open "$log_file" a]} - if {"$log_conn" == ""} { + catch {set log_conn [open $log_file a]} + if {$log_conn == ""} { puts stderr "$argv0 : Cannot open -log_file '$log_file' for writing" central_exit 2 } } set logging "1" } - if {"$opt" == "--no_bwidget"} { + if {$opt == "--no_bwidget"} { set ok "1" set have_bwidget "-1" } - if {"$ok" == 0} { + if {$ok == 0} { puts stderr "$argv0 : Unknown option '$opt'" - print_usage "$argv0" + print_usage $argv0 central_exit 1 } } - if {"$connection_defined" == 0} { + if {$connection_defined == 0} { start_xorriso } - if {"$cmd_pipe_adr" == "" || "$reply_pipe_adr" == "" || - "$cmd_pipe_adr" == "-" || "$reply_pipe_adr" == "-"} { + if {$cmd_pipe_adr == "" || $reply_pipe_adr == "" || + $cmd_pipe_adr == "-" || $reply_pipe_adr == "-"} { set cmd_conn stdout set reply_conn stdin } - if {"$main_window_geometry" != ""} { - wm geometry . "$main_window_geometry" + if {$main_window_geometry != ""} { + wm geometry . $main_window_geometry } } yell_xorriso_tcltk -setup_by_args "$argv0" "$argv" +setup_by_args $argv0 $argv check_xorriso_version setup_xorriso diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index 303c4907..130c4935 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2013.01.03.134011" +#define Xorriso_timestamP "2013.01.03.160118"