diff options
author | Norbert Preining <preining@logic.at> | 2009-12-13 12:55:24 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2009-12-13 12:55:24 +0000 |
commit | 82ca15b67052499338dad06c9c1f91d91e4c6eba (patch) | |
tree | 55329becc3a1bac8f934dbc724c63b038a03ea1d /Master/tlpkg/dev | |
parent | 3ca7c79bc411aba20d578513921ee909812c4905 (diff) |
many changes to tlmgrgui2:
- sort platforms
- unify the "General options" <-> "Default options"
- show a + More details button on the package info window and make it
show the list of files and dependencies.
- rename some things according to Karl's suggestions
git-svn-id: svn://tug.org/texlive/trunk@16385 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/dev')
-rw-r--r-- | Master/tlpkg/dev/tlmgrgui2.pl | 184 |
1 files changed, 142 insertions, 42 deletions
diff --git a/Master/tlpkg/dev/tlmgrgui2.pl b/Master/tlpkg/dev/tlmgrgui2.pl index fbb019a779c..cc92e0d9386 100644 --- a/Master/tlpkg/dev/tlmgrgui2.pl +++ b/Master/tlpkg/dev/tlmgrgui2.pl @@ -8,8 +8,6 @@ # GUI for tlmgr # version 2, completely rewritten GUI # -# TODO: details window for a package should have a "Details" button -# to show the list of files etc (like --list on tlmgr cmd line) # TODO: Fix return codes of execute_action sub items and execute_action # so that we can give a decent warning window @@ -215,7 +213,7 @@ $menu_options->add('checkbutton', -label => __("Debug"), # # Actions menu # -$menu_actions->add('command', -label => __("Re-initialize file database"), +$menu_actions->add('command', -label => __("Update filename database"), -state => $::action_button_state, -command => sub { $mw->Busy(-recurse => 1); @@ -223,7 +221,7 @@ $menu_actions->add('command', -label => __("Re-initialize file database"), info(`mktexlsr 2>&1`); $mw->Unbusy; }); -$menu_actions->add('command', -label => __("Re-create all formats"), +$menu_actions->add('command', -label => __("Rebuild all formats"), -state => $::action_button_state, -command => sub { $mw->Busy(-recurse => 1); @@ -281,7 +279,7 @@ if (!win32()) { exit(0); } }); - $sw->add("Label", -text => __("Really remove the complete TeX Live %s installation?\nYour last chance to change your mind!", $TeXLive::TLConfig::ReleaseYear))->pack(@p_iii); + $sw->add("Label", -text => __("Really remove (uninstall) the COMPLETE TeX Live %s installation?\nYour last chance to change your mind!", $TeXLive::TLConfig::ReleaseYear))->pack(@p_iii); $sw->Show; }); } @@ -466,49 +464,145 @@ sub show_extended_info { my $p = shift; $g->selectionClear; $g->anchorClear; - my $sw = $mw->Toplevel(-title => __("Details on:") . $p); + my $sw = $mw->Toplevel(-title => __("Details on:") . $p, @p_ii); $sw->transient($mw); - $sw->Label(-text => __("Package:"))->grid( - $sw->Label(-text => $p), -sticky => "nw"); - $sw->Label(-text => __("Category:"))->grid( - $sw->Label(-text => $Packages{$p}{'tlp'}->category), - -sticky => "nw"); - $sw->Label(-text => __("Short description:"))->grid( - $sw->Label(-wraplength => '500', -justify => 'left', - -text => $Packages{$p}{'tlp'}->shortdesc), - -sticky => "nw"); + my $tlp = $Packages{$p}{'tlp'}; + + our $tf = $sw->Frame; + my $bf = $sw->Frame; + $tf->pack; + $bf->pack(-pady => '3m'); + + $tf->Label(-text => __("Package:"))->grid( + $tf->Label(-text => $p), -sticky => "nw"); + $tf->Label(-text => __("Category:"))->grid( + $tf->Label(-text => $tlp->category), -sticky => "nw"); + $tf->Label(-text => __("Short description:"))->grid( + $tf->Label(-wraplength => '500', -justify => 'left', + -text => $tlp->shortdesc), -sticky => "nw"); # old version with ROText #my $t = $sw->Scrolled('ROText', -scrollbars => "oe", -height => 10, # -width => 50, -wrap => 'word', -relief => 'flat'); - #$t->insert("1.0", $Packages{$p}{'tlp'}->longdesc); + #$t->insert("1.0", $tlp->longdesc); #$sw->Label(-text => "Long Desc:")->grid($t, -sticky => 'nw'); - $sw->Label(-text => __("Long description:"))->grid( - $sw->Label(-wraplength => '500', -justify => 'left', - -text => $Packages{$p}{'tlp'}->longdesc), - -sticky => "nw"); - $sw->Label(-text => __("Installed:"))->grid( - $sw->Label(-text => ($Packages{$p}{'installed'} ? __("Yes") : __("No"))), + $tf->Label(-text => __("Long description:"))->grid( + $tf->Label(-wraplength => '500', -justify => 'left', + -text => $tlp->longdesc), -sticky => "nw"); + $tf->Label(-text => __("Installed:"))->grid( + $tf->Label(-text => ($Packages{$p}{'installed'} ? __("Yes") : __("No"))), -sticky => "nw"); - $sw->Label(-text => __("Local Revision:"))->grid( - $sw->Label(-text => $Packages{$p}{'localrevision'}), + $tf->Label(-text => __("Local Revision:"))->grid( + $tf->Label(-text => $Packages{$p}{'localrevision'}), -sticky => "nw"); if (defined($Packages{$p}{'localcatalogueversion'})) { - $sw->Label(-text => __("Local Catalogue Version:"))->grid( - $sw->Label(-text => $Packages{$p}{'localcatalogueversion'}), + $tf->Label(-text => __("Local Catalogue Version:"))->grid( + $tf->Label(-text => $Packages{$p}{'localcatalogueversion'}), -sticky => "nw"); } - $sw->Label(-text => __("Remote Revision:"))->grid( - $sw->Label(-text => $Packages{$p}{'remoterevision'}), + $tf->Label(-text => __("Remote Revision:"))->grid( + $tf->Label(-text => $Packages{$p}{'remoterevision'}), -sticky => "nw"); if (defined($Packages{$p}{'remotecatalogueversion'})) { - $sw->Label(-text => __("Remote Catalogue Version:"))->grid( - $sw->Label(-text => $Packages{$p}{'remotecatalogueversion'}), + $tf->Label(-text => __("Remote Catalogue Version:"))->grid( + $tf->Label(-text => $Packages{$p}{'remotecatalogueversion'}), -sticky => "nw"); } + if ($tlmediatlpdb) { + my @colls; + if ($tlp->category ne "Collection" && $tlp->category ne "Scheme") { + @colls = $tlmediatlpdb->needed_by($tlp->name); + } + @colls = grep {m;^collection-;} @colls; + if (@colls) { + $tf->Label(-text => __("Collection:"))->grid( + $tf->Label(-text => "@colls"), -sticky => "nw"); + } + } + $tf->Label(-text => __("Warning: Catalogue versions might be lagging behind or be simply wrong."))->grid(-stick => "nw", -columnspan => 2); + + our @further_a = (); + our @further_b = (); + + sub add_filelist_text { + my $text = shift; + my @files = @_; + if (@files) { + my $t = ""; + for my $f (@files) { $t .= "$f\n"; } + $t =~ s/\n$//; + push @further_a, $tf->Label(-text => $text); + if ($#files >= 4) { + my $foo = $tf->Scrolled('ROText', -scrollbars => "oe", -height => 5, + -width => 50, -wrap => 'word', -relief => 'flat'); + $foo->insert("1.0", $t); + push @further_b, $foo; + } else { + push @further_b, + $tf->Label(-wraplength => '500', -justify => 'left', -text => $t); + } + } + } + my @deps; + my $do_arch; + my @arch_deps; + for my $d ($tlp->depends) { + if ($d eq "$p.ARCH") { + $do_arch = 1; + } else { + push @deps, $d; + } + } + add_filelist_text(__("Depends:"), @deps); + if ($do_arch) { + my @archs = $localtlpdb->available_architectures; + @arch_deps = map { "$p.$_"; } @archs; + push @further_a, $tf->Label(-text => __("Binaries' dependencies:")); + push @further_b, $tf->Label(-text => join('\n',@arch_deps)); + } + add_filelist_text(__("Runfiles:"), $tlp->runfiles); + add_filelist_text(__("Docfiles:"), $tlp->docfiles); + add_filelist_text(__("Srcfiles:"), $tlp->srcfiles); + my @binf = $tlp->allbinfiles; + if ($do_arch) { + for my $bp (@arch_deps) { + my $tlpb = $localtlpdb->get_package($bp); + if (!$tlpb) { + tlwarn("Cannot find $bp.\n"); + } else { + push @binf, $tlpb->allbinfiles; + } + } + } + add_filelist_text(__("Binfiles:"), @binf); + + my $f = $tf->Frame; + my $fb = $f->Button(-padx => 0, -pady => 0, + -text => "+", -borderwidth => 1, -relief => "ridge"); + my $ff = $f->Label(-text => "------ " . __("Further information") . " ------"); + $fb->grid($ff, -sticky => "nw"); + + $f->grid(-sticky => "nw", -columnspan => 2); + my $showdetails = 0; + $fb->configure(-command => + sub { + $showdetails = not($showdetails); + if ($showdetails) { + for my $i (0..$#further_a) { + $further_a[$i]->grid($further_b[$i], -sticky => "nw"); + } + } else { + for my $i (0..$#further_a) { + $further_a[$i]->gridForget($further_b[$i]); + } + } + }); + - $sw->Button(-text => __("Ok"), -width => 10, - -command => sub { $sw->destroy; })->grid(-columnspan => 2); + $bf->Button(-text => __("Ok"), -width => 10, + -command => sub { for (@further_a) { $_->destroy; }; + for (@further_b) { $_->destroy; }; + $sw->destroy; })->pack; } sub update_grid { @@ -720,7 +814,7 @@ sub do_arch_settings { $sw->grab(); my $subframe = $sw->Labelframe(-text => __("Select architectures to support")); $subframe->pack(-fill => "both", -padx => "2m", -pady => "2m"); - foreach my $a (@archsavail) { + foreach my $a (sort @archsavail) { $archsbuttons{$a} = $subframe->Checkbutton(-command => sub { check_on_removal($sw, $a); }, -variable => \$archs{$a}, @@ -793,7 +887,7 @@ sub init_defaults_setting { } sub do_general_settings { - my $sw = $mw->Toplevel(-title => __("Default options")); + my $sw = $mw->Toplevel(-title => __("General options")); $sw->transient($mw); $sw->grab(); init_defaults_setting(); @@ -815,7 +909,7 @@ sub do_general_settings { my @config_set_m; my @config_set_r; - my $back_config_set = $sw->Labelframe(-text => __("Default options")); + my $back_config_set = $sw->Labelframe(-text => __("General options")); my $back_config_buttons = $sw->Frame(); $back_config_set->pack(-fill => "both", -padx => "2m", -pady => "2m"); @@ -1045,7 +1139,7 @@ sub do_paper_settings { my $back_config_pap_l1 = $back_config_pap->Label(-text => __("Default paper for all"), -anchor => "w"); - my $back_config_pap_m1 = $back_config_pap->Button(-text => "A4", + my $back_config_pap_m1 = $back_config_pap->Button(-text => "a4", -command => sub { change_paper("all", "a4"); }); my $back_config_pap_r1 = $back_config_pap->Button(-text => "letter", -command => sub { change_paper("all", "letter"); }); @@ -1101,7 +1195,7 @@ sub menu_default_location { $entry->insert(0,$var); } })->pack(-side => "left",-padx => "2m", -pady => "2m"); - $f2->Button(-text => __("Default net package repository"), + $f2->Button(-text => __("Default remote repository"), -command => sub { $entry->delete(0,"end"); $entry->insert(0,$TeXLiveURL); @@ -1273,7 +1367,7 @@ sub init_install_media { $mw->Busy(-recurse => 1); info(__("Loading remote TeX Live Database\nThis may take some time, please wait!") . "\n"); $tlmediasrc = TeXLive::TLMedia->new($newroot); - info(__("Completed") . "\n"); + info(__("Completed") . ".\n"); $mw->Unbusy; if (!defined($tlmediasrc)) { # something went badly wrong, maybe the newroot is wrong? @@ -1496,9 +1590,11 @@ sub update_list_remote { my $tlp = $tlmediatlpdb->get_package($p); $Packages{$p}{'displayname'} = $p; $Packages{$p}{'remoterevision'} = $tlp->revision; - # overwrite, we assume that the remove version is better ;-) - delete($Packages{$p}{'tlp'}) if defined($Packages{$p}{'tlp'}); - $Packages{$p}{'tlp'} = $tlp; + if (!defined($Packages{$p}{'tlp'})) { + $Packages{$p}{'tlp'} = $tlp; + } + ## delete($Packages{$p}{'tlp'}) if defined($Packages{$p}{'tlp'}); + ## $Packages{$p}{'tlp'} = $tlp; $Packages{$p}{'selected'} = 0 unless defined $Packages{$p}{'selected'}; $Packages{$p}{'cb'} = $g->Checkbutton(-variable => \$Packages{$p}{'selected'}) @@ -1522,7 +1618,11 @@ sub update_list_remote { # collect information about that package we will show $Packages{$p}{'displayname'} = $p; $Packages{$p}{'remoterevision'} = $tlp->revision; - $Packages{$p}{'tlp'} = $tlp; + if (!defined($Packages{$p}{'tlp'})) { + $Packages{$p}{'tlp'} = $tlp; + } + ## disabled, the file lists in remote tlpd contain RELOC + ## $Packages{$p}{'tlp'} = $tlp; $Packages{$p}{'selected'} = 0 unless defined $Packages{$p}{'selected'}; $Packages{$p}{'cb'} = $g->Checkbutton(-variable => \$Packages{$p}{'selected'}) |