From 48ac7e11b34056878266d7aa3c20dbc02128eb96 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 27 Nov 2006 18:30:34 +0000 Subject: set the initial selection for updates (#25271) --- rpmdrake | 9 +++++++-- 1 file 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; } -- cgit v1.2.1