diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-03-29 10:57:01 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-03-29 10:57:01 +0000 |
commit | 60d8db2608388abb2880b3ed5686451e02cb3f21 (patch) | |
tree | 596f43023fdd97328f4e60fe68dc925a9d55310b /perl-install/install_steps_interactive.pm | |
parent | a2b994954476b4f646eae203f0bf7e0a82cc8796 (diff) | |
download | drakx-60d8db2608388abb2880b3ed5686451e02cb3f21.tar drakx-60d8db2608388abb2880b3ed5686451e02cb3f21.tar.gz drakx-60d8db2608388abb2880b3ed5686451e02cb3f21.tar.bz2 drakx-60d8db2608388abb2880b3ed5686451e02cb3f21.tar.xz drakx-60d8db2608388abb2880b3ed5686451e02cb3f21.zip |
(reallyChooseGroups): created from chooseGroups so that it can be
overridden in install_steps_gtk
Diffstat (limited to 'perl-install/install_steps_interactive.pm')
-rw-r--r-- | perl-install/install_steps_interactive.pm | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index 6030f25a4..a71745704 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -556,20 +556,34 @@ sub chooseGroups { int $total_size; }; - my %val; - foreach (@groups) { - $val{$_} = ! grep { ! $o->{compssUsersChoice}{$_} } @{$compssUsers->{$_}{flags}}; - } + my %val = map { + $_ => ! grep { ! $o->{compssUsersChoice}{$_} } @{$compssUsers->{$_}{flags}} + } @groups; + # @groups = grep { $size{$_} = round_down($size{$_} / sqr(1024), 10) } @groups; #- don't display the empty or small one (eg: because all packages are below $min_level) - my ($all, $size_text, $old_size, $path); - my $update_size = sub { + my ($all, $old_size); + my $size_to_display = sub { my $size = $system_size + $compute_size->(map { @{$compssUsers->{$_}{flags}} } grep { $val{$_} } @groups); #- if a profile is deselected, deselect everything (easier than deselecting the profile packages) $old_size > $size and install_any::unselectMostPackages($o); $old_size = $size; - $size_text = _("Selected size %d%s", pkgs::correctSize($size / sqr(1024)), _("MB")); - }; &$update_size; + _("Selected size %d%s", pkgs::correctSize($size / sqr(1024)), _("MB")); + }; + + $o->reallyChooseGroups($size_to_display, $individual, \%val) or return; + + $o->{compssUsersChoice}{$_} = 0 foreach map { @{$compssUsers->{$_}{flags}} } grep { !$val{$_} } keys %val; + $o->{compssUsersChoice}{$_} = 1 foreach map { @{$compssUsers->{$_}{flags}} } grep { $val{$_} } keys %val; + 1; +} + +sub reallyChooseGroups { + my ($o, $size_to_display, $individual, $val) = @_; + + my $size_text = &$size_to_display; + + my ($path, $all); $o->ask_from_entries_refH('', _("Package Group Selection"), [ { val => \$size_text, type => 'label' }, {}, (map {; @@ -578,7 +592,7 @@ sub chooseGroups { if_($old ne $path, { val => $path }), { help => translate($o->{compssUsers}{$_}{descr}), - val => \$val{$_}, + val => \$val->{$_}, type => 'bool', icon => do { my $f = "/usr/share/icons/" . ($o->{compssUsers}{$_}{icons} || 'default'); @@ -588,17 +602,15 @@ sub chooseGroups { }, disabled => sub { $all }, text => translate($o->{compssUsers}{$_}{label}),# . sprintf(" (%d%s)", $compute_size->(@{$compssUsers->{$_}{flags}}) / sqr(1024), _("MB")), - } } @groups), + } } @{$o->{compssUsersSorted}}), if_($o->{meta_class} eq 'desktop', { text => _("All"), val => \$all, type => 'bool' }), if_($individual, { text => _("Individual package selection"), val => $individual, advanced => 1, type => 'bool' }), - ], changed => $update_size) or return; + ], changed => sub { $size_text = &$size_to_display }) or return; + if ($all) { - $o->{compssUsersChoice}{$_} = 1 foreach map { @{$compssUsers->{$_}{flags}} } @groups; - } else { - $o->{compssUsersChoice}{$_} = 0 foreach map { @{$compssUsers->{$_}{flags}} } grep { !$val{$_} } keys %val; - $o->{compssUsersChoice}{$_} = 1 foreach map { @{$compssUsers->{$_}{flags}} } grep { $val{$_} } keys %val; + $val->{$_} = 1 foreach keys %$val; } - 1; + 1; } sub chooseCD { |