summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2012-04-08 13:44:23 +0000
committerPascal Terjan <pterjan@mageia.org>2012-04-08 13:44:23 +0000
commit021a0c24180014a75759fd01951d34330e41a58f (patch)
tree5bba87f00bf6adc08c58be06ebccc1b88750f3e9 /perl-install/interactive
parentd66d1a7945c35ab08dd4779ce43987def152a246 (diff)
downloaddrakx-backup-do-not-use-021a0c24180014a75759fd01951d34330e41a58f.tar
drakx-backup-do-not-use-021a0c24180014a75759fd01951d34330e41a58f.tar.gz
drakx-backup-do-not-use-021a0c24180014a75759fd01951d34330e41a58f.tar.bz2
drakx-backup-do-not-use-021a0c24180014a75759fd01951d34330e41a58f.tar.xz
drakx-backup-do-not-use-021a0c24180014a75759fd01951d34330e41a58f.zip
make sure ranges are always within limits in text mode (mga#646)
Diffstat (limited to 'perl-install/interactive')
-rw-r--r--perl-install/interactive/curses.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/perl-install/interactive/curses.pm b/perl-install/interactive/curses.pm
index 81e0f0459..482f14e45 100644
--- a/perl-install/interactive/curses.pm
+++ b/perl-install/interactive/curses.pm
@@ -412,6 +412,21 @@ sub create_widget {
my $width = $w->{'-sw'} - ($w->{'-vscrollbar'} ? 1 : 0);
$w->text(join("\n", _messages($width, $text)));
};
+ } elsif ($e->{type} eq 'range') {
+ $w = $win->add(undef, 'TextEntry',
+ '-sbborder' => 1,
+ '-text' => '',
+ '-regexp' => '/^\d*$/',
+ '-onchange' => sub {
+ log::l("onchange: ".$w->text);
+ $w->text($e->{min}) if $w->text < $e->{min};
+ $w->text($e->{max}) if $w->text > $e->{max};
+ ${$e->{val}} = $w->text;
+ log::l("/onchange: ".$w->text);
+ $changed->() if $changed;
+ },
+ %options);
+ $set = sub { $w->text($_[0] || '') };
} else {
$w = $win->add(undef, $e->{hidden} ? 'PasswordEntry' : 'TextEntry',
'-sbborder' => 1,