From c5ec55ddd5edadbaf892d9f0551e0ea8e4332854 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 3 Jan 2013 13:40:59 +0000 Subject: [PATCH] Consolidated overwrite switches in a single menu burron --- frontend/xorriso-tcltk | 127 +++++++++++++++++++++--------------- xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 75 insertions(+), 54 deletions(-) diff --git a/frontend/xorriso-tcltk b/frontend/xorriso-tcltk index f7ec5ed6..aed9712d 100755 --- a/frontend/xorriso-tcltk +++ b/frontend/xorriso-tcltk @@ -3748,33 +3748,37 @@ proc init_localfs_aux {} { global .overwrite_iso_files_button .overwrite_dir_button .extract_auto_chmod frame .localfs_aux_frame -borderwidth 0 - checkbutton .overwrite_iso_files_button -text "Overwrite ISO files" \ - -indicatoron 1 -selectcolor "" \ - -relief ridge -borderwidth 2 \ - -variable overwrite_iso_files \ - -onvalue 1 -offvalue 0 - bind_help .overwrite_iso_files_button "Overwrite ISO files" - checkbutton .overwrite_dir_button -text "Overwrite ISO dirs" \ - -indicatoron 1 -selectcolor "" \ - -relief ridge -borderwidth 2 \ - -variable overwrite_iso_dirs \ - -onvalue 1 -offvalue 0 - bind_help .overwrite_dir_button "Overwrite ISO dirs" - checkbutton .extract_auto_chmod -text "Enforce disk dir write access" \ - -indicatoron 1 -selectcolor "" \ - -relief ridge -borderwidth 2 \ - -variable extract_auto_chmod \ - -onvalue 1 -offvalue 0 - bind_help .extract_auto_chmod "Enforce disk dir write access" - checkbutton .overwrite_disk_files_button -text "Overwrite disk files" \ - -indicatoron 1 -selectcolor "" \ - -relief ridge -borderwidth 2 \ - -variable overwrite_disk_files \ - -onvalue 1 -offvalue 0 - bind_help .overwrite_disk_files_button "Overwrite disk files" - pack .overwrite_iso_files_button .overwrite_dir_button .extract_auto_chmod \ - .overwrite_disk_files_button \ - -in .localfs_aux_frame -side left + + menubutton .overwriting -text "Overwriting:" -width 16 -anchor w \ + -direction above -relief ridge -indicatoron 1 \ + -menu .overwriting.menu + bind_help .overwriting "Overwriting:" + set_overwriting_label + set m ".overwriting.menu" + menu $m -tearoff 0 + $m add checkbutton -label "Overwrite ISO files" \ + -indicatoron 1 -selectcolor "" \ + -command set_overwriting_label \ + -variable overwrite_iso_files \ + -onvalue 1 -offvalue 0 + $m add checkbutton -label "Overwrite ISO dirs" \ + -indicatoron 1 -selectcolor "" \ + -command set_overwriting_label \ + -variable overwrite_iso_dirs \ + -onvalue 1 -offvalue 0 + $m add checkbutton -label "Overwrite disk files" \ + -indicatoron 1 -selectcolor "" \ + -command set_overwriting_label \ + -variable overwrite_disk_files \ + -onvalue 1 -offvalue 0 + $m add checkbutton -label "Enforce disk dir write access" \ + -indicatoron 1 -selectcolor "" \ + -command set_overwriting_label \ + -variable extract_auto_chmod \ + -onvalue 1 -offvalue 0 + + pack .overwriting -in .localfs_aux_frame -side left + if {"$have_bwidget" == 1} { checkbutton .browse_select_is_setvar -text "File browser text field" \ -indicatoron 1 -selectcolor "" \ @@ -3935,6 +3939,25 @@ proc create_browser_button {button_name var_name which_fs help_name} { } +proc set_overwriting_label {} { + global overwrite_iso_files overwrite_iso_dirs overwrite_disk_files + global extract_auto_chmod + global .overwriting + + # Determine text suffix for menubutton from overwrite variables + set oif "-" + if {$overwrite_iso_files == 1} {set oif "f"} + set oid "-" + if {$overwrite_iso_dirs == 1} {set oid "d"} + set ohf "-" + if {$overwrite_disk_files == 1} {set ohf "h"} + set fdw "-" + if {$extract_auto_chmod == 1} {set fdw "w"} + set otext "Overwriting: ${oif}${oid}${ohf}${fdw}" + .overwriting configure -text "$otext" +} + + # The central storage for help texts. # proc tell_helptext {what} { @@ -4559,26 +4582,34 @@ The last command will fail because /tmp/from_iso already exists as directory." or only the selected items shall be copied to hard disk. " } - if {"$what" == "Overwrite ISO files"} { + if {"$what" == "Overwriting:"} { return \ -"The \"Overwrite ISO files\" switch controls whether existing files may be -overwritten in the ISO image. See xorriso command -overwrite \"nondir\". +"The \"Overwriting\" menu bundles several switches which control whether +existing files or directories may be overwritten. The frontend program will only detect the most obvious name collisions, -but xorriso will reliably refuse to overwrite files if this is banned." - } - if {"$what" == "Overwrite ISO dirs"} { - return \ -"The \"Overwrite ISO dirs\" switch controls whether it is allowed to replace +but xorriso will reliably refuse to overwrite files if this is banned. + +---------------------------------------------------------------------------- + +The \"Overwrite ISO files\" switch controls whether existing files may be +overwritten in the ISO image. See xorriso command -overwrite \"nondir\". + +---------------------------------------------------------------------------- + +The \"Overwrite ISO dirs\" switch controls whether it is allowed to replace an ISO directory by a non-directory file. See xorriso command -overwrite \"on\". -If a directory is copied to a directory, then both directory trees will -be merged. So this switch applies only to situations where non-directories -hit directories." - } - if {"$what" == "Enforce disk dir write access"} { - return \ -"The \"Enforce disk dir write access\" switch enables the -osirrox options +---------------------------------------------------------------------------- + +The \"Overwrite 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. + +---------------------------------------------------------------------------- + +The \"Enforce disk dir write access\" switch enables the -osirrox options \"auto_chmod_on\" and \"sort_lba_on\" which influence file extraction. \"auto_chmod_on\" allows xorriso to give itself temporariy w-permission to @@ -4588,18 +4619,8 @@ This is DANGEROUS, of course, but comes in handy with restoring of backups. Option \"sort_lba_on\" reduces head-moves of optical drives and thus can speed up extraction substantially. It is bound to \"auto_chmod_on\" because -else it might get in trouble when restoring ISO directories which offer +else it might get into trouble when restoring ISO directories which offer no w-permission." - } - if {"$what" == "Overwrite disk files"} { - return \ -"The \"Overwrite 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. - -The frontend program will only detect the most obvious name collisions, -but xorriso will reliably refuse to overwrite files if this is banned." } if {"$what" == "File browser text field"} { return \ diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index cd9f8af8..303c4907 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2013.01.03.125535" +#define Xorriso_timestamP "2013.01.03.134011"