aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2002-08-05 13:33:00 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2002-08-05 13:33:00 +0000
commit29ab976e4bb3cd403ecba37e31bcba5cf290266b (patch)
tree15a4278c23c49eb3e7a6fe3016806a5c7595f3b2
parentcca23a632484309ed0aa8ad275d72f43efdb9b49 (diff)
downloadrpmdrake-29ab976e4bb3cd403ecba37e31bcba5cf290266b.tar
rpmdrake-29ab976e4bb3cd403ecba37e31bcba5cf290266b.tar.gz
rpmdrake-29ab976e4bb3cd403ecba37e31bcba5cf290266b.tar.bz2
rpmdrake-29ab976e4bb3cd403ecba37e31bcba5cf290266b.tar.xz
rpmdrake-29ab976e4bb3cd403ecba37e31bcba5cf290266b.zip
when the search lead to no results, say it
-rwxr-xr-xrpmdrake8
1 files changed, 6 insertions, 2 deletions
diff --git a/rpmdrake b/rpmdrake
index f4979f0f..594ba023 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -402,11 +402,15 @@ sub run_treeview_dialog {
my $find_entry;
my $find_callback = sub {
my $entry = $find_entry->get_text or return;
- $options->{state}{flat} ? $options->{delete_all}->() : $options->{delete_category}->(_("Search results"));
+ my ($results_ok, $results_none) = (_("Search results"), _("Search results (none)"));
+ $options->{delete_category}->($_) foreach ($results_ok, $results_none);
+ $options->{state}{flat} and $options->{delete_all}->();
+ $tree->collapse_recursive(undef);
if (my @search_results = sort { uc($a) cmp uc($b) } grep { eval { $_ =~ /$entry/i } } keys %$pkgs) {
$options->{add_nodes}->(map { [ $_, _("Search results") ] } @search_results);
- $tree->collapse_recursive(undef);
$tree->expand($tree->node_nth($tree->rows-1));
+ } else {
+ $options->{add_nodes}->([ '', $results_none ]);
}
};