From 5aede6ec59bfe68eff4ef4b6d0f84c0ebb83aa1c Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Fri, 4 Jan 2013 20:43:49 +0000 Subject: [PATCH] Small adjustments and bug fixes in xorriso-tcltk --- frontend/xorriso-tcltk | 25 +++++++++++++++++++------ xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/frontend/xorriso-tcltk b/frontend/xorriso-tcltk index f99da58d..18686226 100755 --- a/frontend/xorriso-tcltk +++ b/frontend/xorriso-tcltk @@ -389,11 +389,11 @@ proc scan_info_for_event {line} { } if {[compare_sev $sev $highest_total_sev] >= 0} { set highest_total_sev $sev - set highest_total_sev_msg $line + set highest_total_sev_msg [escape_newline $line] } if {[compare_sev $sev $highest_cmd_sev] >= 0} { set highest_cmd_sev $sev - set highest_cmd_sev_msg $line + set highest_cmd_sev_msg [escape_newline $line] } } @@ -2332,7 +2332,9 @@ proc effectuate_command_logging {close_window} { if {$close_window == 1 && $browse_disk_window_is_active == 1} { destroy_browse_disk .browse_disk_window } - start_command_logging $cmd_log_target $cmd_logging_mode + if {$close_window == 1 || $cmd_logging_mode > 0} { + start_command_logging $cmd_log_target $cmd_logging_mode + } } @@ -2357,7 +2359,9 @@ proc effectuate_debug_logging {close_window} { if {$close_window == 1 && $browse_disk_window_is_active == 1} { destroy_browse_disk .browse_disk_window } - start_debug_logging $debug_log_file $debug_logging + if {$close_window == 1 || $debug_logging > 0} { + start_debug_logging $debug_log_file $debug_logging + } } @@ -2910,7 +2914,7 @@ proc set_display_msg {mode} { proc xorriso_tcltk_errmsg {msg} { global highest_cmd_sev_msg - set highest_cmd_sev_msg $msg + set highest_cmd_sev_msg [escape_newline $msg] display_msg $msg window_ack $msg "grey" "toplevel" update idletasks @@ -5509,6 +5513,7 @@ proc log_command {cmd} { if {$cmd_log_conn == ""} { effectuate_command_logging 0 + if {$cmd_logging_mode < 1} {return ""} } set prefix "" if {$cmd_logging_mode == 1} { @@ -5559,6 +5564,7 @@ proc start_command_logging {target mode} { } else { puts stderr $msg } + set cmd_logging_mode 0 return 0 } if {$mode > 0} { @@ -5632,7 +5638,7 @@ proc execute_script {close_window} { set errmsg "" set ret [catch {set execute_script_conn [open $execute_script_adr r]} errmsg] if {$ret != 0} { - xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : Failed to open command log script [make_text_shellsafe $execute_script_adr] :\n$errmsg" + xorriso_tcltk_errmsg "xorriso-tcltk : SORRY : Failed to open command script [make_text_shellsafe $execute_script_adr] :\n$errmsg" return "" } set line "" @@ -5674,6 +5680,13 @@ proc execute_script {close_window} { } +# Convert newline into \n +# +proc escape_newline {text} { + return [string map [list "\n" "\\n"] $text] +} + + # -------- start living diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index f228481f..82c6530d 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2013.01.04.192238" +#define Xorriso_timestamP "2013.01.04.204305"