Some polishing of xorriso-tcltk

This commit is contained in:
Thomas Schmitt 2013-01-07 19:10:30 +00:00
parent 88c4571160
commit 5006d3da49
2 changed files with 39 additions and 54 deletions

View File

@ -84,7 +84,7 @@ proc print_usage {argv0} {
# ------------------------------- the frontend ---------------------------- # ------------------------------- the frontend ----------------------------
# #
# Starts xorriso, connects to it, sends commands, receives replies, # Connects to a xorriso process, sends commands, receives replies,
# prepares replies for GUI # prepares replies for GUI
# Connection to xorriso # Connection to xorriso
@ -586,6 +586,8 @@ proc obtain_drive_info {dev} {
# Inquire whether changes of the ISO image are pending. # Inquire whether changes of the ISO image are pending.
# This is a precondition for writing the session. Vice versa pending changes
# block a change of the input drive or the program end.
# #
proc changes_are_pending {} { proc changes_are_pending {} {
global result_count result_list global result_count result_list
@ -601,24 +603,6 @@ proc changes_are_pending {} {
} }
# Inquire the file type of an address in the xorriso ISO image tree.
# This is a precondition for writing the session. Vice versa pending changes
# block a change of the input drive or the program end.
#
proc get_iso_filetype {adr} {
global result_list result_count scan_event_threshold
set scan_event_mem $scan_event_threshold
set scan_event_threshold "SORRY"
send_silent_cmd "-lsdl [make_text_shellsafe $adr] --"
set scan_event_threshold $scan_event_mem
if {$result_count <= 0} {
return ""
}
return [string range [lindex $result_list 0] 0 0]
}
# Inquire whether an ISO image model has been created inside xorriso. # Inquire whether an ISO image model has been created inside xorriso.
# This is a precondition for inserting files into the ISO tree model. # This is a precondition for inserting files into the ISO tree model.
# #
@ -728,12 +712,13 @@ proc isofs_ls {dir} {
# Indicator characters like with ls -l. Empty text means non existing file. # Indicator characters like with ls -l. Empty text means non existing file.
# #
proc isofs_filetype {path} { proc isofs_filetype {path} {
global result_list global result_list result_count scan_event_threshold
set disp_en_mem [set_display_msg 0] set scan_event_mem $scan_event_threshold
send_marked_cmd "-lsdl [make_text_shellsafe $path]" set scan_event_threshold "SORRY"
set_display_msg $disp_en_mem send_silent_cmd "-lsdl [make_text_shellsafe $path]"
if {[llength $result_list] < 1} {return ""} set scan_event_threshold $scan_event_mem
if {$result_count < 1} {return ""}
return [string range [lindex $result_list 0] 0 0] return [string range [lindex $result_list 0] 0 0]
} }
@ -774,11 +759,12 @@ proc localfs_ls {dir} {
# Indicator characters like with ls -l. Empty text means non existing file. # Indicator characters like with ls -l. Empty text means non existing file.
# #
proc localfs_filetype {path} { proc localfs_filetype {path} {
global result_list global result_list result_count scan_event_threshold
set disp_en_mem [set_display_msg 0] set scan_event_mem $scan_event_threshold
send_marked_cmd "-lsdlx [make_text_shellsafe $path]" set scan_event_threshold "SORRY"
set_display_msg $disp_en_mem send_silent_cmd "-lsdlx [make_text_shellsafe $path]"
set scan_event_threshold $scan_event_mem
if {[llength $result_list] < 1} {return ""} if {[llength $result_list] < 1} {return ""}
return [string range [lindex $result_list 0] 0 0] return [string range [lindex $result_list 0] 0 0]
} }
@ -905,8 +891,8 @@ proc effectuate_permission_policy {} {
# Only NUL characters cannot be part of names. # Only NUL characters cannot be part of names.
# If enabled: Start a bulk parser job by which xorriso shall split the output # Start a bulk parser job by which xorriso shall split the output of e.g. -lsl
# of e.g. -lsl into single words from which this frontend can pick information. # into single words from which this frontend can pick information.
# #
proc start_bulkparse {prefix separators max_words flag num_lines} { proc start_bulkparse {prefix separators max_words flag num_lines} {
global bulk_parse_prefix bulk_parse_separators global bulk_parse_prefix bulk_parse_separators
@ -925,8 +911,7 @@ proc start_bulkparse {prefix separators max_words flag num_lines} {
} }
# Submit a new input line to the xorriso parser. If no bulk parser job was # Submit a new input line to the xorriso bulk parser job.
# started then submit a single line parser command.
# #
proc submit_bulkparse {text} { proc submit_bulkparse {text} {
global cmd_conn reply_conn global cmd_conn reply_conn
@ -947,8 +932,8 @@ proc submit_bulkparse {text} {
} }
# If a bulk parsing job was started, then read the expected number of # Read the expected number of bulk parsing replies into the result buffer
# replies into the result buffer and call handler_proc to inspect them. # and call handler_proc to inspect them.
# Each input line of the parser yields one reply buffer full of parsed words. # Each input line of the parser yields one reply buffer full of parsed words.
# #
proc read_bulkparse {handler_proc num_texts} { proc read_bulkparse {handler_proc num_texts} {
@ -1643,7 +1628,7 @@ proc isomanip_mv {} {
if {$isodir_is_pwd == 0 && [string range $target 0 0] != "/"} { if {$isodir_is_pwd == 0 && [string range $target 0 0] != "/"} {
set target [combine_dir_and_name $isodir_adr $target] set target [combine_dir_and_name $isodir_adr $target]
} }
set target_ftype [get_iso_filetype $target] set target_ftype [isofs_filetype $target]
# If more than one selected : target must be directory # If more than one selected : target must be directory
if {$num_selected > 1} { if {$num_selected > 1} {
@ -1675,7 +1660,7 @@ proc isomanip_mv {} {
# Ask for confirmation if overwriting is about to happen # Ask for confirmation if overwriting is about to happen
if {$target_ftype == "d"} { if {$target_ftype == "d"} {
set eff_target [combine_dir_and_name $target $name] set eff_target [combine_dir_and_name $target $name]
set eff_target_ftype [get_iso_filetype $eff_target] set eff_target_ftype [isofs_filetype $eff_target]
} else { } else {
set eff_target $target set eff_target $target
set eff_target_ftype $target_ftype set eff_target_ftype $target_ftype
@ -2136,7 +2121,7 @@ proc insert_from {} {
return "" return ""
} }
set target "[lindex $isolist_names [lindex $selected 0]]" set target "[lindex $isolist_names [lindex $selected 0]]"
set selected_ftype [get_iso_filetype $target] set selected_ftype [isofs_filetype $target]
set selected_adr $target set selected_adr $target
} else { } else {
set target $isodir_adr set target $isodir_adr
@ -2146,7 +2131,7 @@ proc insert_from {} {
if {$insert_underneath == 1 || $source_ftype == "d"} { if {$insert_underneath == 1 || $source_ftype == "d"} {
set target [combine_dir_and_name $target $name] set target [combine_dir_and_name $target $name]
} }
set target_ftype [get_iso_filetype $target] set target_ftype [isofs_filetype $target]
reset_yesno_to_all reset_yesno_to_all
if {[handle_overwriting "isofs" $target $target_ftype \ if {[handle_overwriting "isofs" $target $target_ftype \
@ -4390,11 +4375,11 @@ The GUI window is separated into three main areas:
Either toggle in the address of the hard disk directory, Either toggle in the address of the hard disk directory,
or click on the \"/\" button to the right of the text field to get or click on the \"/\" button to the right of the text field to get
a file browser. a file browser.
- Hit the Return key in the text field or double click on a name in the - Hit the Return key in the text field resp. double click on a name in the
browser to schedule the disk directory for writing to the medium. browser to schedule the disk directory for writing to the medium.
(You may of course insert several directories or files that way.) You may of course insert several directories or files that way.
- Click the \"Write ISO session\" button in the middle area. - Close the browser and click the \"Write ISO session\" button in the
Confirm in the \"yes/no\" window that pops up. middle area. Confirm in the \"yes/no\" window that pops up.
Burning will begin (or refuse on unsuitable medium status). Burning will begin (or refuse on unsuitable medium status).
- When the \"busy\" field displays \"ready\" again, you may click \"Eject\". - When the \"busy\" field displays \"ready\" again, you may click \"Eject\".
Desktop drives should then put out the tray with the medium. Desktop drives should then put out the tray with the medium.
@ -4463,17 +4448,17 @@ The GUI window is separated into three main areas:
- Like above, \"Scan for drives\" but click button \"Pick input drive\" - Like above, \"Scan for drives\" but click button \"Pick input drive\"
in order to load the directory tree of the existing ISO filesystem. in order to load the directory tree of the existing ISO filesystem.
For an ISO image data file, bring its name into the input field of the For an ISO image data file, bring its name into the input field of the
lines \"Input drive/image\" and \"Output drive/image\". line \"Input drive/image\". You should now see in its info field a text
You should now see in both info fields texts which begin by \"appendable\". which begins by \"appendable\" or \"closed\".
- Go to the \"ISO directory:\" line in the lower area. - Go to the \"ISO directory:\" line and list box in the lower area and
Either toggle in the address of the directory you want to extract or select the directory or file you want to copy to hard disk.
click the \"/\" button to get a file browser. - To get to see the desired file items, either toggle the address of their
- Hit the Return key in the text field or double click on a name in the parent directory into the text field and hit Return, or double click items
browser to determine the ISO directory for writing to the medium. to open them as directories, or click the \"/\" button to get a file browser.
- Go to the \"Extract to disk:\" line in the lower area. Select the item in the list box of the main window by a single click.
Either toggle in the address of the hard disk directory, - Go to the \"Extract to disk:\" line and choose the target address on disk.
or click on the \"/\" button to the right of the text field to get Either toggle in the address of the hard disk directory, or click on the
a file browser. \"/\" button to the right of the text field to get a file browser.
- Hit the Return key in the text field or double click on a name in the - Hit the Return key in the text field or double click on a name in the
browser to initiate the extraction run. browser to initiate the extraction run.
If a \"yes/no\" window pops up, consider well whether you are up to If a \"yes/no\" window pops up, consider well whether you are up to

View File

@ -1 +1 @@
#define Xorriso_timestamP "2013.01.06.205810" #define Xorriso_timestamP "2013.01.07.190934"