diff options
author | Siep Kroonenberg <siepo@cybercomm.nl> | 2019-02-12 15:54:14 +0000 |
---|---|---|
committer | Siep Kroonenberg <siepo@cybercomm.nl> | 2019-02-12 15:54:14 +0000 |
commit | 92282b7146d4f326e917545a7f638f8d3bc6e739 (patch) | |
tree | a96106d277a248313d867b3cbecddf2e4766d8fe | |
parent | 6374b6c9a6407a7952180a7fd2899dcfd379e814 (diff) |
Sort collections; all trees configurable; undo mixup sysvar/sysconfig
git-svn-id: svn://tug.org/texlive/trunk@50008 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-x | Master/tlpkg/installer/install-tl-gui.tcl | 67 |
1 files changed, 64 insertions, 3 deletions
diff --git a/Master/tlpkg/installer/install-tl-gui.tcl b/Master/tlpkg/installer/install-tl-gui.tcl index d9b1abdf80a..8812a14101e 100755 --- a/Master/tlpkg/installer/install-tl-gui.tcl +++ b/Master/tlpkg/installer/install-tl-gui.tcl @@ -62,6 +62,10 @@ if {$::tcl_platform(platform) eq "windows"} { set ::perlbin "${::instroot}/tlpkg/tlperl/bin/wperl.exe" } +# menu modes +set ::advanced 0 +set ::alltrees 0 + ### procedures, mostly organized bottom-up ### # the procedures which provide the menu with the necessary backend data, @@ -382,7 +386,7 @@ proc commit_canonical_local {} { proc commit_root {} { set ::vars(TEXDIR) [forward_slashify [.tltd.path_l cget -text]] set ::vars(TEXMFSYSVAR) "$::vars(TEXDIR)/texmf-var" - set ::vars(TEXMFSYSCONFIG) "$::vars(TEXDIR)/texmf-var" + set ::vars(TEXMFSYSCONFIG) "$::vars(TEXDIR)/texmf-config" commit_canonical_local if {$::vars(instopt_portable)} reset_personal_dirs @@ -813,6 +817,10 @@ proc save_coll_selections {} { show_stats }; # save_coll_selections +proc sort_colls_by_value {n m} { + return [string compare [__ $::coll_descs($n)] [__ $::coll_descs($m)]] +} + proc select_collections {} { # 2018: more than 40 collections # The tcl installer acquires collections from install-menu-extl.pl, @@ -885,7 +893,7 @@ proc select_collections {} { grid rowconfigure .tlcoll.both 1 -weight 1 - foreach c [array names ::coll_descs] { + foreach c [lsort -command sort_colls_by_value [array names ::coll_descs]] { if [string equal -length 15 "collection-lang" $c] { set wgt ".tlcoll.lang" } else { @@ -1061,7 +1069,8 @@ if {$::tcl_platform(platform) ne "windows"} { proc run_menu {} { if [info exists ::env(dbgui)] { - puts "dbgui: run_menu: advanced is now $::advanced" + puts "\ndbgui: run_menu: advanced is now $::advanced" + puts "dbgui: run_menu: alltrees is now $::alltrees" } wm withdraw . foreach c [winfo children .] { @@ -1135,6 +1144,23 @@ proc run_menu {} { -in .dirf -row $rw -column 2 -sticky new if $::advanced { + if $::alltrees { + incr rw + pgrid [ttk::label .tsysvll -text "TEXMFSYSVAR"] \ + -in .dirf -row $rw -column 0 -sticky nw + pgrid [ttk::label .tsysvvl -textvariable ::vars(TEXMFSYSVAR)] \ + -in .dirf -row $rw -column 1 -sticky nw + ttk::button .tsysvb -text [__ "Change"] -command {edit_dir "TEXMFSYSVAR"} + pgrid .tsysvb -in .dirf -row $rw -column 2 -sticky new + incr rw + pgrid [ttk::label .tsyscll -text "TEXMFSYSCONFIG"] \ + -in .dirf -row $rw -column 0 -sticky nw + pgrid [ttk::label .tsyscvl -textvariable ::vars(TEXMFSYSCONFIG)] \ + -in .dirf -row $rw -column 1 -sticky nw + ttk::button .tsyscb -text [__ "Change"] \ + -command {edit_dir "TEXMFSYSCONFIG"} + pgrid .tsyscb -in .dirf -row $rw -column 2 -sticky new + } incr rw set s [__ "Local additions"] pgrid [ttk::label .tlocll -text "TEXMFLOCAL:\n$s"] \ @@ -1152,6 +1178,32 @@ proc run_menu {} { -in .dirf -row $rw -column 1 -sticky nw ttk::button .thomeb -text [__ "Change"] -command {edit_dir "TEXMFHOME"} pgrid .thomeb -in .dirf -row $rw -column 2 -sticky ne + if $::alltrees { + incr rw + pgrid [ttk::label .tvll -text "TEXMFVAR"] \ + -in .dirf -row $rw -column 0 -sticky nw + pgrid [ttk::label .tvvl -textvariable ::vars(TEXMFVAR)] \ + -in .dirf -row $rw -column 1 -sticky nw + ttk::button .tvb -text [__ "Change"] -command {edit_dir "TEXMFVAR"} + pgrid .tvb -in .dirf -row $rw -column 2 -sticky new + incr rw + pgrid [ttk::label .tcll -text "TEXMFCONFIG"] \ + -in .dirf -row $rw -column 0 -sticky nw + pgrid [ttk::label .tcvl -textvariable ::vars(TEXMFCONFIG)] \ + -in .dirf -row $rw -column 1 -sticky nw + ttk::button .tcb -text [__ "Change"] \ + -command {edit_dir "TEXMFCONFIG"} + pgrid .tcb -in .dirf -row $rw -column 2 -sticky new + } + + incr rw + if {!$::alltrees} { + ttk::button .tmoreb -text [__ "More..."] -command { + set ::menu_ans "alltrees" + if [info exists ::env(dbgui)] {puts "dbgui: requested alltrees"} + } + pgrid .tmoreb -in .dirf -row $rw -column 2 -sticky ne + } incr rw pgrid [ttk::label .dirportll \ @@ -1392,8 +1444,10 @@ proc run_menu {} { update wm state . normal raise . + if [info exists ::env(dbgui)] {puts "dbgui: unsetting menu_ans"} unset -nocomplain ::menu_ans vwait ::menu_ans + if [info exists ::env(dbgui)] {puts "dbgui0: menu_ans is $::menu_ans"} return $::menu_ans }; # run_menu @@ -1630,12 +1684,19 @@ proc main_prog {} { read_menu_data show_time "read menu data from perl" set ::advanced 0 + set ::alltrees 0 set answer [run_menu] + if [info exists ::env(dbgui)] {puts "dbgui1: menu_ans is $::menu_ans"} if {$answer eq "advanced"} { # this could only happen if $::advanced was 0 set ::advanced 1 if [info exists ::env(dbgui)] {puts "dbgui: Setting advanced to 1"} set answer [run_menu] + if {$answer eq "alltrees"} { + set ::alltrees 1 + if [info exists ::env(dbgui)] {puts "dbgui: Setting alltrees to 1"} + set answer [run_menu] + } } set ::did_gui 1 break |