aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2006-11-27 18:30:34 +0000
committerThierry Vignaud <tv@mandriva.org>2006-11-27 18:30:34 +0000
commit48ac7e11b34056878266d7aa3c20dbc02128eb96 (patch)
tree94303fb228bcf0238d093c3d5cb73006c3b0e267
parente013b9909fe58a342da786abb23f2a7d3b0fa9d5 (diff)
downloadrpmdrake-48ac7e11b34056878266d7aa3c20dbc02128eb96.tar
rpmdrake-48ac7e11b34056878266d7aa3c20dbc02128eb96.tar.gz
rpmdrake-48ac7e11b34056878266d7aa3c20dbc02128eb96.tar.bz2
rpmdrake-48ac7e11b34056878266d7aa3c20dbc02128eb96.tar.xz
rpmdrake-48ac7e11b34056878266d7aa3c20dbc02128eb96.zip
set the initial selection for updates (#25271)
-rwxr-xr-xrpmdrake9
1 files changed, 7 insertions, 2 deletions
diff --git a/rpmdrake b/rpmdrake
index 18fa9754..77890284 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -756,7 +756,7 @@ sub format_pkg_info {
sub run_treeview_dialog {
my ($callback_action) = @_;
my ($urpm, $pkgs, $descriptions);
- my (%filter_methods, $force_displaying_group);
+ my (%filter_methods, $force_displaying_group, @initial_selection, $initial_selection_done);
my $switch_pkg_list_mode = sub {
my ($mode) = @_;
return if !$mode;
@@ -783,6 +783,11 @@ sub run_treeview_dialog {
#security => sub { $pkgs = },
#normal => sub { $pkgs = }
);
+ if (!$initial_selection_done) {
+ $filter_methods{all}->();
+ @initial_selection = grep { $pkgs->{$_}{selected} } keys %$pkgs;
+ $initial_selection_done = 1;
+ }
foreach my $importance (qw(bugfix security normal)) {
$filter_methods{$importance} = sub {
$pkgs = $h->{updates};
@@ -1118,7 +1123,7 @@ or you already installed all of them."));
rebuild_tree => sub {},
};
- if (my @initial_selection = grep { $pkgs->{$_}{selected} } keys %$pkgs) {
+ if (@initial_selection) {
$options->{initial_selection} = \@initial_selection;
$pkgs->{$_}{selected} = 0 foreach keys %$pkgs;
}