diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2002-08-05 13:33:00 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2002-08-05 13:33:00 +0000 |
commit | 29ab976e4bb3cd403ecba37e31bcba5cf290266b (patch) | |
tree | 15a4278c23c49eb3e7a6fe3016806a5c7595f3b2 | |
parent | cca23a632484309ed0aa8ad275d72f43efdb9b49 (diff) | |
download | rpmdrake-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-x | rpmdrake | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 ]); } }; |