summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-12-07 08:13:01 +0000
committerNorbert Preining <preining@logic.at>2009-12-07 08:13:01 +0000
commit527ba05256a88ec3960d769889dbb67809dd8b48 (patch)
treef19df9d28f5774f27f2452578310d6b03abb20d9 /Master
parentda9bfb5113e8deb75e21172dc36438b897c0bfe8 (diff)
some fixes suggested by Tomek
git-svn-id: svn://tug.org/texlive/trunk@16320 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/tlpkg/dev/tlmgrgui2.pl57
1 files changed, 23 insertions, 34 deletions
diff --git a/Master/tlpkg/dev/tlmgrgui2.pl b/Master/tlpkg/dev/tlmgrgui2.pl
index 195fec26d5d..4e4eeac435d 100644
--- a/Master/tlpkg/dev/tlmgrgui2.pl
+++ b/Master/tlpkg/dev/tlmgrgui2.pl
@@ -316,6 +316,7 @@ my $list_frame = $back_f1->Labelframe(-text => "Packages");
my $g = $list_frame->Scrolled('HList', -scrollbars => "se", -bd => 0,
-command => \&show_extended_info, # does not work, double click!
-columns => 7, -header => 1,
+ -borderwidth => 0, -padx => 0, -pady => 0,
-separator => "/",
-selectmode => "none");
@@ -336,11 +337,11 @@ my $status_only_updated = 3;
my $status_value = 0;
$filter_status->Radiobutton(-text => "all", -command => \&update_grid,
-variable => \$status_value, -value => $status_all)->pack(@a_w);
-$filter_status->Radiobutton(-text => "only installed", -command => \&update_grid,
+$filter_status->Radiobutton(-text => "installed", -command => \&update_grid,
-variable => \$status_value, -value => $status_only_installed)->pack(@a_w);
-$filter_status->Radiobutton(-text => "only uninstalled", -command => \&update_grid,
+$filter_status->Radiobutton(-text => "not installed", -command => \&update_grid,
-variable => \$status_value, -value => $status_only_not_installed)->pack(@a_w);
-$filter_status->Radiobutton(-text => "only updated", -command => \&update_grid,
+$filter_status->Radiobutton(-text => "with updates", -command => \&update_grid,
-variable => \$status_value, -value => $status_only_updated)->pack(@a_w);
my $filter_category = $filter_frame->Labelframe(-text => "Category");
@@ -357,27 +358,25 @@ $filter_category->Checkbutton(-text => "schemes", -command => \&update_grid,
my $filter_match = $filter_frame->Labelframe(-text => "Match");
$filter_match->pack(@left, @x_y, @p_ii);
-my $match_all = 1;
-$filter_match->Radiobutton(-text => "all", -command => \&update_grid,
- -variable => \$match_all, -value => 1)->pack(@a_w);
-$filter_match->Radiobutton(-text => "matching:",
- -variable => \$match_all, -value => 0)->pack(@a_w);
+my $match_string = 0;
+$filter_match->Checkbutton(-text => "matching:",
+ -variable => \$match_string)->pack(@a_w);
my $match_entry =
$filter_match->Entry(-width => 15, -validate => 'key',
)->pack(@a_w, -padx => '2m', @x_x);
$match_entry->configure(-validate => 'key',
- -validatecommand => sub { $match_all = 0; update_grid(); return 1; });
+ -validatecommand => sub { $match_string = 1; update_grid(); return 1; });
my $filter_selection = $filter_frame->Labelframe(-text => "Selection");
$filter_selection->pack(@left, @x_y, @p_ii);
my $selection_value = 0;
$filter_selection->Radiobutton(-text => "all", -command => \&update_grid,
-variable => \$selection_value, -value => 0)->pack(@a_w);
-$filter_selection->Radiobutton(-text => "only selected", -command => \&update_grid,
- -variable => \$selection_value, -value => 1)->pack(@a_w);
-$filter_selection->Radiobutton(-text => "only not selected", -command => \&update_grid,
- -variable => \$selection_value, -value => 2)->pack(@a_w);
+$filter_selection->Radiobutton(-text => "selected", -command => \&update_grid,
+ -variable => \$selection_value, -value => 1)->pack(@a_w);
+$filter_selection->Radiobutton(-text => "not selected", -command => \&update_grid,
+ -variable => \$selection_value, -value => 2)->pack(@a_w);
my $filter_button = $filter_frame->Labelframe(-text => "Action");
@@ -389,7 +388,7 @@ $filter_button->Button(-text => "Reset filters",
$show_packages = 1; $show_collections = 1;
$show_schemes = 1;
$selection_value = 0;
- $match_all = 1;
+ $match_string = 0;
update_grid();
})->pack(@left, @a_c, @p_ii);
@@ -409,14 +408,18 @@ my $lighttext = $g->ItemStyle('text', -background => 'gray90',
my $darktext = $g->ItemStyle('text', -background => 'gray70',
-selectbackground => 'gray70', -selectforeground => 'blue');
+my @htype = qw/-relief ridge/;
+
+#my $all_none;
+#$all_none = $g->Checkbutton(-command => [\&update_grid, $all_none->{'Value'} ]);
+#$g->headerCreate(0, @htype, -itemtype => 'window', -widget => $all_none);
my $f = $g->Frame();
my $bi = $f->Button(-padx => 1, -pady => 3,
- -text => 'all', -command => \&grid_select_all_shown);
+ -text => 'all', -command => [ \&update_grid, 1 ]);
my $bii= $f->Button(-padx => 1, -pady => 3,
- -text => 'none', -command => \&grid_deselect_all_shown);
+ -text => 'none', -command => [ \&update_grid, 0 ]);
$bi->pack(@left);
$bii->pack(@right);
-my @htype = qw/-relief ridge/;
$g->headerCreate(0, @htype, -itemtype => 'window', -widget => $f);
$g->headerCreate(1, @htype, -itemtype => 'text', -text => "Package");
$g->headerCreate(2, @htype, -itemtype => 'text', -text => "Local\nRevision");
@@ -470,19 +473,11 @@ sub show_extended_info {
-command => sub { $sw->destroy; })->grid(-columnspan => 2);
}
-sub grid_select_all_shown {
- update_grid(1);
-}
-
-sub grid_deselect_all_shown {
- update_grid(2);
-}
-
sub update_grid {
# select code
# if not given just do nothing
# if == 1 select all packages that will be shown
- # if == 2 deselect all packages that will be shown
+ # if == 0 deselect all packages that will be shown
my $selectcode = shift;
my @schemes;
@@ -512,13 +507,7 @@ sub update_grid {
for my $p (@displist) {
if ($crit_match || MatchesFilters($p)) {
if (defined($selectcode)) {
- if ($selectcode == 1) {
- $Packages{$p}{'selected'} = 1;
- } elsif ($selectcode == 2) {
- $Packages{$p}{'selected'} = 0;
- } else {
- tlwarn("selectcode $selectcode not known, strange.\n");
- }
+ $Packages{$p}{'selected'} = $selectcode;
}
$g->add($p);
my $st = ($i%2 ? $lighttext : $darktext);
@@ -569,7 +558,7 @@ sub MatchesFilters {
return 0;
}
# match
- if (!$match_all) {
+ if ($match_string) {
my $r = $match_entry->get;
# check for match on string
my $t = $Packages{$p}{'tlp'}->shortdesc;