summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps_gtk.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-04-19 18:56:18 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-04-19 18:56:18 +0000
commit59e7ea4bfc0abe3f1da710369ef377a08c9626d2 (patch)
tree10334274ece5f5773208dd27e0ef32d6a5b7eeee /perl-install/install_steps_gtk.pm
parentd88e554c03238937161200a1e940cf05114cae20 (diff)
downloaddrakx-backup-do-not-use-59e7ea4bfc0abe3f1da710369ef377a08c9626d2.tar
drakx-backup-do-not-use-59e7ea4bfc0abe3f1da710369ef377a08c9626d2.tar.gz
drakx-backup-do-not-use-59e7ea4bfc0abe3f1da710369ef377a08c9626d2.tar.bz2
drakx-backup-do-not-use-59e7ea4bfc0abe3f1da710369ef377a08c9626d2.tar.xz
drakx-backup-do-not-use-59e7ea4bfc0abe3f1da710369ef377a08c9626d2.zip
no_comment
Diffstat (limited to 'perl-install/install_steps_gtk.pm')
-rw-r--r--perl-install/install_steps_gtk.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index 1660d85ad..7cf56d3bc 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -296,8 +296,8 @@ _("Choose the sizes"),
#------------------------------------------------------------------------------
sub chooseSizeToInstall {
my ($o, $packages, $min_size, $max_size_, $available, $individual) = @_;
- my $enough = $available > $max_size_;
my $max_size = min($max_size_, $available * 0.9);
+ my $enough = $max_size == $max_size_;
my $percentage = int 100 * $max_size / $max_size_;
#- don't ask anything if the difference between min and max is too small
@@ -306,7 +306,7 @@ sub chooseSizeToInstall {
log::l("choosing size to install between $min_size and $max_size");
my $w = my_gtk->new('');
my $adj = create_adjustment($percentage, $min_size * 100 / $max_size_, $percentage);
- my $spin = gtkset_usize(new Gtk::SpinButton($adj, 0, 0), 100, 0);
+ my $spin = gtkset_usize(new Gtk::SpinButton($adj, 0, 0), 20, 0);
my $val;
gtkadd($w->{window},
@@ -326,15 +326,19 @@ A low percentage will install only the most important packages;
a percentage of %d%% will install as many packages as possible.", $percentage, $percentage))
. ($individual ? "\n\n" . _("You will be able to choose them more specifically in the next step.") : ''),
create_packtable({},
- [ _("Percentage of packages to install") . ' ', $spin, "%", ],
+ [ _("Percentage of packages to install") . ' ', $spin, "%", my $mb = new Gtk::Label('xxxx MB') ],
[ undef, new Gtk::HScrollbar($adj) ],
),
create_okcancel($w)
)
);
+ $spin->signal_connect(changed => my $changed = sub {
+ my $val = $spin->get_value_as_int / 100 * $max_size;
+ $mb->set(sprintf("(%dMB)", pkgs::correctSize($val / sqr(1024))));
+ }); &$changed();
$spin->signal_connect(activate => sub { $w->{retval} = 1; Gtk->main_quit });
$spin->grab_focus();
- $w->main and $spin->get_value_as_int / 100 * $max_size;
+ $w->main and $val;
}
sub choosePackagesTree {
my ($o, $packages, $compss) = @_;