From fc876bad5f909ab3142bdfa1da5c52e79c73fbd7 Mon Sep 17 00:00:00 2001 From: Siep Kroonenberg Date: Fri, 15 Jan 2021 17:04:30 +0000 Subject: List only binaries installed platforms; revised marking logic; various cosmetic git-svn-id: svn://tug.org/texlive/trunk@57426 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/tlshell/tlshell.tcl | 478 +++++++++++++++----------- 1 file changed, 272 insertions(+), 206 deletions(-) (limited to 'Master/texmf-dist/scripts') diff --git a/Master/texmf-dist/scripts/tlshell/tlshell.tcl b/Master/texmf-dist/scripts/tlshell/tlshell.tcl index 6b363dbb884..0522d505c16 100755 --- a/Master/texmf-dist/scripts/tlshell/tlshell.tcl +++ b/Master/texmf-dist/scripts/tlshell/tlshell.tcl @@ -683,11 +683,12 @@ proc update_globals {} { proc display_packages_info {} { # do_debug [get_stacktrace] - set curr [.pksearch.e get] + set curr [.pkfilter.search_e get] .pkglist delete [.pkglist children {}] dict for {nm pk} $::filtered { set do_show 0 if {$curr eq ""} { + # empty search string set do_show 1 } elseif {[search_nocase $curr $nm] >= 0} { set do_show 1 @@ -701,19 +702,37 @@ proc display_packages_info {} { } } ; # display_packages_info -# (re)create ::filtered dictionary; disregard search string. +proc for_other_platform {nm} { + set r [string last "." $nm] + if {$r < 0} { + return 0 + } else { + set n [string range $nm 0 [expr {$r-1}]] + set p [string range $nm [expr {$r+1}] end] + # p a platform identifier of an installed platform? + if [dict exists $::platforms $p] { + return [expr {! [dict get $::platforms $p "cur"]}] + } else { + return 0 + } + } +} + +# (re)create ::filtered dictionary; disregard search string in selection # The value associated with each key/package is a list, not another dict. proc collect_filtered {} { do_debug \ "collect_filtered for $::stat_opt and $::dtl_opt" - # test this beforehand if {$::stat_opt ne "inst" && ! $::have_remote} { + # have_remote should have been ensured when changing stat_opt from inst err_exit "collect_filtered should not have been invoked at this time" } foreach nm [dict keys $::filtered] { dict unset ::filtered $nm } foreach nm [lsort [dict keys $::pkgs]] { + # do not list packages for platforms which are not installed + if [for_other_platform $nm] continue set pk [dict get $::pkgs $nm] set do_show 1 set mrk [mark_sym [dict get $pk marked]] @@ -722,6 +741,8 @@ proc collect_filtered {} { set ct [dict get $pk category] if {$::stat_opt eq "inst" && $lr == 0} { set do_show 0 + } elseif {$::stat_opt eq "notins" && $lr > 0} { + set do_show 0 } elseif {$::stat_opt eq "upd" && ($lr == 0 || $rr == 0 || $rr <= $lr)} { set do_show 0 } @@ -740,7 +761,7 @@ proc collect_filtered {} { set v [dict get $pk localrev] set lv [dict get $pk lcatv] if {$v eq "0" || $v == 0} { - set v "" + set v "" ; # can this happen? } elseif {$lv != 0 && $lv ne ""} { set v "$v ($lv)" } @@ -766,14 +787,16 @@ proc get_platforms {} { # guarantee fresh start foreach k $::platforms {dict unset ::platforms $k} set ::platforms [dict create] - run_cmd_waiting "platform list" - foreach l $::out_log { - if [regexp {^\(i\)\s+(\S+)\s*$} $l dum plname] { - set pl [dict create "cur" 1 "fut" 1] - dict set ::platforms $plname $pl - } elseif [regexp {^\s+(\S+)\s*$} $l dum plname] { - set pl [dict create "cur" 0 "fut" 0] - dict set ::platforms $plname $pl + # find binary packages for pdftex; 'platform list' not available on windows + foreach k [dict keys $::pkgs {pdftex.*}] { + # {pdftex.*} is a glob pattern, not a regexp: '.' is a literal + set plname [string range $k 7 end] + if {[dict get $::pkgs $k localrev] > 0} { + dict set ::platforms $plname "cur" 1 + #dict set ::platforms $plname "fut" 1 + } else { + dict set ::platforms $plname "cur" 0 + #dict set ::platforms $plname "fut" 0 } } } @@ -842,7 +865,7 @@ proc splash_loading {} { wm title .loading [__ "Loading"] # wallpaper - pack [ttk::frame .loading.bg -padding 3] -fill both -expand 1 + pack [ttk::frame .loading.bg -padding 3pt] -fill both -expand 1 set lbl [__ \ "If loading takes too long, press Abort and choose another repository."] @@ -944,9 +967,7 @@ proc get_packages_info_remote {} { ## update ::pkgs after installing packages without going online again. proc update_local_revnumbers {} { do_debug "update_local_revnumbers" - set catv "lcat-version" - if {[dict get $::pkgs texlive.infra localrev] < 56458} { set catv "cat-version" } - run_cmd_waiting "info --only-installed --data name,localrev,$catv" + run_cmd_waiting "info --only-installed --data name,localrev,lcat-version" set re {^([^,]+),([0-9]+),(.*)$} dict for {pk pk_dict} $::pkgs { do_debug "zeroing local data for $pk" @@ -1150,8 +1171,12 @@ proc show_repos {} { foreach ch [winfo children $w] {destroy $ch} set nms [array names ::repos] set c [llength $nms] - grid [ttk::label $w.head -font TkHeadingFont] \ - -row 0 -column 0 -columnspan 2 -sticky w + grid [ttk::frame $w.repoheadframe] \ + -row 0 -column 0 -columnspan 3 -sticky w + pack [ttk::label $w.head -font hfont] \ + -in $w.repoheadframe -side left + pack [ttk::label $w.load -text ""] \ + -in $w.repoheadframe -side left -anchor sw if {$c <= 0} { $w.head configure -text [__ "No repositories"] return @@ -1161,8 +1186,7 @@ proc show_repos {} { $w.head configure -text [__ "Multiple repositories"] } if {! $::have_remote} { - pgrid [ttk::label $w.load -text [__ "Not loaded"]] \ - -sticky nw -row 0 -column 1 + $w.load configure -text " ([__ "Not loaded"])" } set repodict [dict create] if $::have_remote { @@ -1318,10 +1342,10 @@ proc repository_dialog {} { ### add/remove tlcontrib ### ttk::label .tlr.contribt -text [__ "tlcontrib additional repository"] \ -font bfont - pack .tlr.contribt -in .tlr.bg -anchor w -padx 3 -pady [list 10 3] - pack [ttk::label .tlr.contribl] -in .tlr.bg -anchor w -padx 3 -pady 3 + pack .tlr.contribt -in .tlr.bg -anchor w -padx 3pt -pady [list 10pt 3pt] + pack [ttk::label .tlr.contribl] -in .tlr.bg -anchor w -padx 3pt -pady 3pt ttk::checkbutton .tlr.contribb -variable ::toggle_contrib - pack .tlr.contribb -in .tlr.bg -anchor w -padx 3 -pady [list 3 10] + pack .tlr.contribb -in .tlr.bg -anchor w -padx 3pt -pady [list 3pt 10pt] set ::toggle_contrib 0 set has_contrib 0 foreach nm [array names ::repos] { @@ -1340,7 +1364,7 @@ proc repository_dialog {} { } # two ways to close the dialog - pack [ttk::frame .tlr.closebuttons] -pady [list 10 0] -in .tlr.bg -fill x + pack [ttk::frame .tlr.closebuttons] -pady [list 10pt 0pt] -in .tlr.bg -fill x ttk::button .tlr.save -text [__ "Save and Load"] -command save_load_repo ppack .tlr.save -in .tlr.closebuttons -side right dis_enable_reposave @@ -1356,122 +1380,132 @@ proc repository_dialog {} { ### platforms -if {$::tcl_platform(platform) ne "windows"} { +# ::platforms is a dictionary of dictionaries. +# each element dictionary has keys cur and fut indicating +# current and future status (i.e. being installed), +# with values 0 meaning 'not installed' and 1 meaning 'installed'. +# elsewhere, we shall only be interested in cur. +# within the treeview list, we shall use the usual unicode mark symbols. - proc toggle_pl_marked {pl cl} { - # toggle_pl_marked is triggered by a mouse click only in column #1. - # 'fut'[ure] should get updated in ::platforms _and_ in .tlpl.pl. - - if {$cl ne "#1"} return - if {$pl eq $::our_platform} { - tk_messageBox -message \ - [__ "Cannot remove own platform %s" $::our_platform] \ - -parent .tlpl - return - } - # $mrk: negation of current value of marked for $pl - set m1 [expr {[dict get $::platforms $pl "fut"] ? 0 : 1}] - dict set ::platforms $pl "fut" $m1 - set m0 [dict get $::platforms $pl "cur"] - if {$m0 == $m1} { - .tlpl.pl set $pl "sup" [mark_sym $m0] - } else { - .tlpl.pl set $pl "sup" "[mark_sym $m0] \u21d2 [mark_sym $m1]" - } - .tlpl.do state disabled - dict for {p mrks} $::platforms { - if {[dict get $mrks "fut"] ne [dict get $mrks "cur"]} { - .tlpl.do state !disabled - break - } +# for windows, there is no platforms menu entry, +# and the platforms dialog returns immediately, i.e. is a no-op. + +proc toggle_pl_marked {pl cl} { + # toggle_pl_marked is triggered by a mouse click only in column #1. + # 'fut'[ure] should get updated in ::platforms _and_ in .tlpl.pl. + + if {$cl ne "#1"} return + if {$pl eq $::our_platform} { + tk_messageBox -message \ + [__ "Cannot remove own platform %s" $::our_platform] -parent .tlpl + return + } + set m1 [expr {[dict get $::platforms $pl "fut"] ? 0 : 1}] + dict set ::platforms $pl "fut" $m1 + set m0 [dict get $::platforms $pl "cur"] + if {$m0 == $m1} { + .tlpl.pl set $pl "stat" [mark_sym $m0] + } else { + .tlpl.pl set $pl "stat" "[mark_sym $m0] \u21d2 [mark_sym $m1]" + } + # any changes to apply? + .tlpl.do state disabled + dict for {pname pdict} $::platforms { + if {[dict get $pdict "fut"] ne [dict get $pdict "cur"]} { + .tlpl.do state !disabled + break } - } ; # toggle_pl_marked - - proc platforms_commit {} { - set pl_add {} - set pl_remove {} - dict for {p pd} $::platforms { - if {[dict get $pd "cur"] ne [dict get $pd "fut"]} { - if {[dict get $pd "fut"]} { - lappend pl_add $p - } else { - lappend pl_remove $p - } + } +} ; # toggle_pl_marked + +proc platforms_commit {} { + set pl_add {} + set pl_remove {} + dict for {pname pdict} $::platforms { + if {[dict get $pdict "cur"] ne [dict get $pdict "fut"]} { + if {[dict get $pdict "fut"]} { + lappend pl_add $pname + } else { + lappend pl_remove $pname } } - if {[llength $pl_add] == 0 && [llength $pl_remove] == 0} return - set cmds {} - if {[llength $pl_add] > 0} { - set cmd "platform add " - append cmd [join $pl_add " "] - lappend cmds $cmd - } - if {[llength $pl_remove] > 0} { - set cmd "platform remove " - append cmd [join $pl_remove " "] - lappend cmds $cmd - } - run_cmds $cmds 1 - vwait ::done_waiting - update_local_revnumbers - collect_and_display_filtered + } + if {[llength $pl_add] == 0 && [llength $pl_remove] == 0} return + set cmds {} + if {[llength $pl_add] > 0} { + set cmd "platform add " + append cmd [join $pl_add " "] + lappend cmds $cmd + } + if {[llength $pl_remove] > 0} { + set cmd "platform remove " + append cmd [join $pl_remove " "] + lappend cmds $cmd + } + run_cmds $cmds 1 + vwait ::done_waiting + update_local_revnumbers + collect_and_display_filtered - } ; # platforms_do +} ; # platforms_commit # the platforms dialog - proc platforms_select {} { - create_dlg .tlpl - wm title .tlpl [__ "Platforms"] - if $::plain_unix {wm attributes .tlpl -type dialog} - - # wallpaper frame - pack [ttk::frame .tlpl.bg] -expand 1 -fill both - - # buttons - pack [ttk::frame .tlpl.but] -in .tlpl.bg -side bottom -fill x - ttk::button .tlpl.do -text [__ "Apply and close"] -command { - disable_dlg .tlpl - platforms_commit - end_dlg "" .tlpl - } - ttk::button .tlpl.dont -text [__ "Close"] -command \ - {end_dlg "" .tlpl} - ppack .tlpl.do -in .tlpl.but -side right - #.tlpl.do state disabled - ppack .tlpl.dont -in .tlpl.but -side right - bind .tlpl {.tlpl.dont invoke} - - # platforms treeview; do we need a scrollbar? - pack [ttk::frame .tlpl.fpl] -in .tlpl.bg -fill both -expand 1 - ttk::treeview .tlpl.pl -columns {sup plat} -show headings \ - -height [dict size $::platforms] -yscrollcommand {.tlpl.plsb set} - ppack .tlpl.pl -in .tlpl.fpl -side left -fill both -expand 1 - ttk::scrollbar .tlpl.plsb -orient vertical \ - -command {.tlpl.pl yview} - ppack .tlpl.plsb -in .tlpl.fpl -side right -fill y -expand 1 - #.tlpl.pl heading sup -text "" - .tlpl.pl column sup -width [expr {$::cw * 8}] - .tlpl.pl heading plat -text [__ "platform"] -anchor w - .tlpl.pl column plat -width [expr {$::cw * 20}] - dict for {p mks} $::platforms { - .tlpl.pl insert {} end -id $p -values \ - [list [mark_sym [dict get $mks "cur"]] $p] - } - - # "#2" refers to the second column, with editable mark symbols - bind .tlpl.pl {toggle_pl_marked [.tlpl.pl focus] "#1"} - bind .tlpl.pl {toggle_pl_marked [.tlpl.pl focus] "#1"} - # only toggle when column is "sup" i.e. #1 - bind .tlpl.pl \ - {toggle_pl_marked \ - [.tlpl.pl identify item %x %y] \ - [.tlpl.pl identify column %x %y]} - - wm resizable .tlpl 0 1 - place_dlg .tlpl . - } ; # platforms_select - -} ; # $::tcl_platform(platform) ne "windows" +proc platforms_select {} { + if {$::tcl_platform(platform) eq "windows"} return + + create_dlg .tlpl + wm title .tlpl [__ "Platforms"] + if $::plain_unix {wm attributes .tlpl -type dialog} + + # wallpaper frame + pack [ttk::frame .tlpl.bg] -expand 1 -fill both + + # buttons + pack [ttk::frame .tlpl.but] -in .tlpl.bg -side bottom -fill x + ttk::button .tlpl.do -text [__ "Apply and close"] -command { + disable_dlg .tlpl + platforms_commit + end_dlg "" .tlpl + } + ttk::button .tlpl.dont -text [__ "Close"] -command \ + {end_dlg "" .tlpl} + ppack .tlpl.do -in .tlpl.but -side right + ppack .tlpl.dont -in .tlpl.but -side right + bind .tlpl {.tlpl.dont invoke} + + # platforms treeview; do we need a scrollbar? + pack [ttk::frame .tlpl.fpl] -in .tlpl.bg -fill both -expand 1 + ttk::treeview .tlpl.pl -columns {stat plat} -show headings \ + -height [dict size $::platforms] -yscrollcommand {.tlpl.plsb set} + ppack .tlpl.pl -in .tlpl.fpl -side left -fill both -expand 1 + ttk::scrollbar .tlpl.plsb -orient vertical \ + -command {.tlpl.pl yview} + ppack .tlpl.plsb -in .tlpl.fpl -side right -fill y -expand 1 + .tlpl.pl column stat -width [expr {$::cw * 8}] + .tlpl.pl heading plat -text [__ "platform"] -anchor w + .tlpl.pl column plat -width [expr {$::cw * 20}] + dict for {pname pdict} $::platforms { + dict set ::platforms $pname "fut" [dict get $pdict "cur"] + } + foreach pname [lsort [dict keys $::platforms]] { + .tlpl.pl insert {} end -id $pname -values \ + [list [mark_sym [dict get $::platforms $pname "cur"]] $pname] + } + + bind .tlpl.pl {toggle_pl_marked [.tlpl.pl focus] "#1"} + bind .tlpl.pl {toggle_pl_marked [.tlpl.pl focus] "#1"} + # only toggle when column is #1 + bind .tlpl.pl \ + {toggle_pl_marked \ + [.tlpl.pl identify item %x %y] \ + [.tlpl.pl identify column %x %y]} + + # enable commit button only if changes are requested + .tlpl.do state disabled + wm resizable .tlpl 0 1 + place_dlg .tlpl . +} ; # platforms_select + ##### restore from backup ##### @@ -1772,7 +1806,7 @@ proc install_pkgs {sel_opt {pk ""}} { show_err_log } update_local_revnumbers - if {$sel_opt eq "marked"} {mark_all 0} + if {$sel_opt eq "marked"} unmark_all collect_and_display_filtered } ; # install_pkgs @@ -1845,7 +1879,7 @@ proc update_pkgs {sel_opt {pk ""}} { show_err_log } update_local_revnumbers - if {$sel_opt eq "marked"} {mark_all 0} + if {$sel_opt eq "marked"} unmark_all collect_and_display_filtered } ; # update_pkgs @@ -1906,7 +1940,7 @@ proc remove_pkgs {sel_opt {pk ""}} { show_err_log } update_local_revnumbers - if {$sel_opt eq "marked"} {mark_all 0} + if {$sel_opt eq "marked"} unmark_all collect_and_display_filtered } ; # remove_pkgs @@ -1934,6 +1968,8 @@ proc toggle_marked_pkg {itm cl} { # 'marked' should get updated in ::pkgs, ::filtered and in .pkglist. if {$cl ne "#1"} return + # clicking in the header: + if {$itm eq ""} return # $mrk: negation of current value of marked for $itm set mrk [expr {[dict get $::pkgs $itm "marked"] ? 0 : 1}] dict set ::pkgs $itm "marked" $mrk @@ -1942,19 +1978,27 @@ proc toggle_marked_pkg {itm cl} { .pkglist set $itm mk $m } ; # toggle_marked_pkg -proc mark_all {mrk} { +proc unmark_all {} { foreach nm [dict keys $::pkgs] { - dict set ::pkgs $nm "marked" $mrk + dict set ::pkgs $nm "marked" 0 } - set m [mark_sym $mrk] + set m [mark_sym 0] foreach nm [dict keys $::filtered] { dict set ::filtered $nm [lreplace [dict get $::filtered $nm] 0 0 $m] } foreach nm [.pkglist children {}] { .pkglist set $nm mk $m } - # alternatively: regenerate ::filtered and .pkglist from ::pkgs -} ; # mark_all +} ; # unmark_all + +proc mark_displayed {} { + set m [mark_sym 1] + foreach nm [.pkglist children {}] { + dict set ::pkgs $nm "marked" 1 + dict set ::filtered $nm [lreplace [dict get $::filtered $nm] 0 0 $m] + .pkglist set $nm mk $m + } +} ; # mark_displayed ##### package popup ##### @@ -2110,7 +2154,7 @@ proc populate_main {} { menu .mn_empty .mn_empty add cascade -label [__ "File"] -menu .mn_empty.file -underline 0 if $::plain_unix { - .mn_empty configure -borderwidth 1 + .mn_empty configure -borderwidth 0 .mn_empty configure -background $::default_bg menu .mn_empty.file } @@ -2118,7 +2162,7 @@ proc populate_main {} { menu .mn . configure -menu .mn if $::plain_unix { - .mn configure -borderwidth 1 + .mn configure -borderwidth 0 .mn configure -background $::default_bg # plain_unix: avoid a possible RenderBadPicture error on quitting @@ -2130,7 +2174,7 @@ proc populate_main {} { } } - # inx: keeping count to record indices where needed, + # inx: keeping count to record submenu indices where needed, # i.e. when an entry needs to be referenced. # not all submenus need this. @@ -2230,11 +2274,11 @@ proc populate_main {} { # with the default ttk::frame color, which seems to work # everywhere. pack [ttk::frame .bg] -expand 1 -fill both - .bg configure -padding 5 + .bg configure -padding 5pt # bottom of main window pack [ttk::frame .endbuttons] -in .bg -side bottom -fill x - ttk::label .busy -textvariable ::busy -font TkHeadingFont -anchor w + ttk::label .busy -textvariable ::busy -font hfont -anchor w ppack .busy -in .endbuttons -side left ppack [ttk::button .q -text [__ Quit] -command {destroy .}] \ -in .endbuttons -side right @@ -2256,27 +2300,27 @@ proc populate_main {} { [string range $::env(PATH) 0 59]] } - # left frame + # left info frame pack [ttk::frame .topfl] -in .topf -side left -anchor nw # subframe for repositories, to be filled by show_repos pack [ttk::frame .toprepo] -in .topfl -side top -anchor w - # various info, left frame - pack [ttk::frame .topfll] -in .topfl -side top -anchor nw -pady [list 6 0] + # various info (left frame) + pack [ttk::frame .topfll] -in .topfl -side top -anchor nw -pady {6pt 0pt} ttk::label .topfll.lluptodate -text [__ "TL Manager up to date?"] -anchor w pgrid .topfll.lluptodate -row 2 -column 0 -sticky w ttk::label .topfll.luptodate -text [__ "Unknown"] -anchor w pgrid .topfll.luptodate -row 2 -column 1 -sticky w - ttk::label .topfll.llcmd -text [__ "Last tlmgr command:"] -anchor w \ + ttk::label .topfll.llcmd -text [__ "Last tlmgr command:"] -anchor w pgrid .topfll.llcmd -row 3 -column 0 -sticky w ttk::label .topfll.lcmd -textvariable ::last_cmd \ -wraplength [expr {60*$::cw}] -justify left -anchor w pgrid .topfll.lcmd -row 3 -column 1 -sticky w - # various info, right frame + # right info frame ppack [ttk::frame .topfr] -in .topf -side right -anchor ne if {$::tcl_platform(platform) eq "windows"} { pack [ttk::label .topfr.ladmin] -side top -anchor e @@ -2287,21 +2331,39 @@ proc populate_main {} { pack [ttk::label .topfr.lshell] -side top -anchor e pack [ttk::separator .sp -orient horizontal] \ - -in .bg -side top -fill x -pady 6 + -in .bg -side top -fill x -pady 3pt + + # controls frame, between info frame and package list + pack [ttk::frame .middle] -in .bg -side top -fill x + pack [ttk::frame .pkcontrol] \ + -in .middle -side left -anchor nw -fill x + + # package list display options + ttk::label .lpack -text [string toupper [__ "Package list"]] \ + -font hfont + pack .lpack -in .pkcontrol -side top -padx 3pt -pady {6pt 6pt} -anchor w + + pack [ttk::frame .pkfilter -relief groove -borderwidth 2 -padding 3pt] \ + -in .pkcontrol -side top -anchor nw + # on my current linux, groove works only with a dimensionless borderwidth + + # separator columns + grid columnconfigure .pkfilter 1 -minsize 20pt + grid [ttk::separator .pkfilter.sep1 -orient vertical] \ + -column 1 -row 0 -rowspan 5 -sticky ns + grid columnconfigure .pkfilter 3 -minsize 20pt + grid [ttk::separator .pkfilter.sep3 -orient vertical] \ + -column 3 -row 0 -rowspan 5 -sticky ns - # package list - ttk::label .lpack -text [__ "Package list"] -font TkHeadingFont -anchor w - pack .lpack -in .bg -side top -padx 3 -pady [list 15 3] -fill x - - # controlling package list - ttk::frame .pkfilter - pack .pkfilter -in .bg -side top -fill x - grid columnconfigure .pkfilter 3 -weight 1 - # column #3 is empty, but that is allright # filter on status: inst, all, upd - ttk::label .pkfilter.lstat -font TkHeadingFont -text [__ "Status"] + ttk::label .pkfilter.lstat -font bfont -text [__ "Status"] ttk::radiobutton .pkfilter.inst -text [__ "Installed"] -value inst \ -variable ::stat_opt -command collect_and_display_filtered + ttk::radiobutton .pkfilter.notins -text [__ "Not installed"] -value notins \ + -variable ::stat_opt -command { + if {! $::have_remote} get_packages_info_remote + collect_and_display_filtered + } ttk::radiobutton .pkfilter.alls -text [__ "All"] -value all \ -variable ::stat_opt -command { if {! $::have_remote} get_packages_info_remote @@ -2312,70 +2374,74 @@ proc populate_main {} { if {! $::have_remote} get_packages_info_remote collect_and_display_filtered } - grid .pkfilter.lstat -column 0 -row 0 -sticky w -padx {3 50} - pgrid .pkfilter.inst -column 0 -row 1 -sticky w - pgrid .pkfilter.alls -column 0 -row 2 -sticky w - pgrid .pkfilter.upd -column 0 -row 3 -sticky w + grid .pkfilter.lstat -column 0 -row 0 -sticky w -padx {3pt 50pt} + pgrid .pkfilter.inst -column 0 -row 1 -sticky w + pgrid .pkfilter.notins -column 0 -row 2 -sticky w + pgrid .pkfilter.alls -column 0 -row 3 -sticky w + pgrid .pkfilter.upd -column 0 -row 4 -sticky w # filter on detail level: all, coll, schm - ttk::label .pkfilter.ldtl -font TkHeadingFont -text [__ "Detail >> Global"] + ttk::label .pkfilter.ldtl -font bfont -text [__ "Detail >> Global"] ttk::radiobutton .pkfilter.alld -text [__ All] -value all \ -variable ::dtl_opt -command collect_and_display_filtered ttk::radiobutton .pkfilter.coll -text [__ "Collections and schemes"] \ -value coll -variable ::dtl_opt -command collect_and_display_filtered ttk::radiobutton .pkfilter.schm -text [__ "Only schemes"] -value schm \ -variable ::dtl_opt -command collect_and_display_filtered - pgrid .pkfilter.ldtl -column 1 -row 0 -sticky w - pgrid .pkfilter.alld -column 1 -row 1 -sticky w - pgrid .pkfilter.coll -column 1 -row 2 -sticky w - pgrid .pkfilter.schm -column 1 -row 3 -sticky w - - # marks - grid [ttk::button .mrk_all -text [__ "Mark all"] -command {mark_all 1}] \ - -in .pkfilter -column 2 -row 1 -sticky w -padx {50 3} -pady 3 - grid [ttk::button .mrk_none -text [__ "Mark none"] -command {mark_all 0}] \ - -in .pkfilter -column 2 -row 2 -sticky w -padx {50 3} -pady 3 + pgrid .pkfilter.ldtl -column 2 -row 0 -sticky w + pgrid .pkfilter.alld -column 2 -row 1 -sticky w + pgrid .pkfilter.coll -column 2 -row 2 -sticky w + pgrid .pkfilter.schm -column 2 -row 3 -sticky w + + # search interface + ttk::label .pkfilter.search_l -font bfont -text [__ "Search"] + ttk::entry .pkfilter.search_e -width 30 + ttk::radiobutton .pkfilter.search_n -variable ::search_desc \ + -value 0 -text [__ "By name"] + ttk::radiobutton .pkfilter.search_d -variable ::search_desc \ + -value 1 -text [__ "By name and description"] + pgrid .pkfilter.search_l -column 4 -row 0 -sticky w + pgrid .pkfilter.search_e -column 4 -row 1 -sticky w + pgrid .pkfilter.search_n -column 4 -row 2 -sticky w + pgrid .pkfilter.search_d -column 4 -row 3 -sticky w + + bind .pkfilter.search_e display_packages_info + bind .pkfilter.search_n \ + {set ::search_desc 0; display_packages_info} + bind .pkfilter.search_d \ + {set ::search_desc 1; display_packages_info} # actions - set rw -1 - incr rw + pack [ttk::frame .pkact] -in .middle -side right -anchor ne ttk::button .mrk_inst -text [__ "Install marked"] -command { install_pkgs "marked"} - pgrid .mrk_inst -in .pkfilter -column 4 -row $rw -sticky ew - incr rw + ppack .mrk_inst -in .pkact -side top -fill x ttk::button .mrk_upd -text [__ "Update marked"] -command { update_pkgs "marked"} - pgrid .mrk_upd -in .pkfilter -column 4 -row $rw -sticky ew - incr rw + ppack .mrk_upd -in .pkact -side top -fill x ttk::button .mrk_rem -text [__ "Remove marked"] -command { remove_pkgs "marked"} - pgrid .mrk_rem -in .pkfilter -column 4 -row $rw -sticky ew + ppack .mrk_rem -in .pkact -side top -fill x if $::do_restore { - incr rw ttk::button .mrk_rest -text "[__ "Restore from backup"] ..." -command \ restore_backups_dialog - pgrid .mrk_rest -in .pkfilter -column 4 -row $rw -sticky ew + ppack .mrk_rest -in .pkact -side top -fill x } - incr rw ttk::button .upd_tlmgr -text [__ "Update tlmgr"] -command update_tlmgr - pgrid .upd_tlmgr -in .pkfilter -column 4 -row $rw -sticky ew - incr rw + ppack .upd_tlmgr -in .pkact -side top -fill x ttk::button .upd_all -text [__ "Update all"] -command update_all - pgrid .upd_all -in .pkfilter -column 4 -row $rw -sticky ew - - # search interface; no new row - grid [ttk::frame .pksearch] -in .pkfilter -row $rw \ - -column 0 -columnspan 4 -sticky w - ppack [ttk::label .pksearch.l \ - -text [__ "Search"]] -side left - pack [ttk::entry .pksearch.e -width 30] -side left -padx {3 0} -pady 3 - ppack [ttk::radiobutton .pksearch.n -variable ::search_desc \ - -value 0 -text [__ "By name"]] -side left - ppack [ttk::radiobutton .pksearch.d -variable ::search_desc \ - -value 1 -text [__ "By name and description"]] -side left - bind .pksearch.e display_packages_info - bind .pksearch.n {set ::search_desc 0; display_packages_info} - bind .pksearch.d {set ::search_desc 1; display_packages_info} + ppack .upd_all -in .pkact -side top -fill x + + # marking all/none + pack [ttk::frame .pksel] \ + -in .bg -pady 6pt -side top -fill x + pack [ttk::button .mrk_all -text [__ "Mark all displayed"] \ + -command mark_displayed] -in .pksel -side left + pack [ttk::button .mrk_none -text [__ "Mark none"] -command unmark_all] \ + -in .pksel -padx 6pt -side left + ttk::label .binwarn \ + -text [__ "Only packages for installed platforms are displayed"] + pack .binwarn -in .pksel -padx 3pt -side right -anchor s # packages list itself pack [ttk::frame .fpkg] -in .bg -side top -fill both -expand 1 @@ -2423,7 +2489,7 @@ proc display_all_data {} { .topfr.ladmin configure -text \ [expr {$::multiuser ? [__ "Multi-user"] : [__ "Single-user"]}] } - # svns for tlmgr and tlshell + # revision numbers for tlmgr and tlshell .topfr.linfra configure -text \ "tlmgr: r[dict get $::pkgs texlive.infra localrev]" .topfr.lshell configure -text \ @@ -2433,7 +2499,7 @@ proc display_all_data {} { display_updated_globals } -# to be invoked at initialization and after a font scaling change +# to be invoked at initialization and after a font scaling- or language change proc rebuild_interface {} { foreach c [winfo children .] {catch {destroy $c}} -- cgit v1.2.3