diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-08-24 19:02:16 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-08-24 19:02:16 +0000 |
commit | 10b649b6503f47388f1548c8ba9391dd6ce0284e (patch) | |
tree | 6bc1fe238a7a28721cfd15b52946e67d236c8277 /perl-install/interactive.pm | |
parent | ed18d4ad1743445dc1c49d65b5a64a0c73510edd (diff) | |
download | drakx-backup-do-not-use-10b649b6503f47388f1548c8ba9391dd6ce0284e.tar drakx-backup-do-not-use-10b649b6503f47388f1548c8ba9391dd6ce0284e.tar.gz drakx-backup-do-not-use-10b649b6503f47388f1548c8ba9391dd6ce0284e.tar.bz2 drakx-backup-do-not-use-10b649b6503f47388f1548c8ba9391dd6ce0284e.tar.xz drakx-backup-do-not-use-10b649b6503f47388f1548c8ba9391dd6ce0284e.zip |
no_comment
Diffstat (limited to 'perl-install/interactive.pm')
-rw-r--r-- | perl-install/interactive.pm | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm index b0bd6bb7d..70f54b57b 100644 --- a/perl-install/interactive.pm +++ b/perl-install/interactive.pm @@ -5,6 +5,26 @@ use strict; use common qw(:common :functional); +# heritate from this class and you'll get all made interactivity for same steps. +# for this you need to provide +# - ask_from_listW(o, title, messages, arrayref, default) returns one string of arrayref +# - ask_many_from_listW(o, title, messages, arrayref, arrayref2) returns one string of arrayref +# +# where +# - o is the object +# - title is a string +# - messages is an refarray of strings +# - default is an optional string (default is in arrayref) +# - arrayref is an arrayref of strings +# - arrayref2 contains booleans telling the default state, +# +# ask_from_list and ask_from_list_ are wrappers around ask_from_biglist and ask_from_smalllist +# +# ask_from_list_ just translate arrayref before calling ask_from_list and untranslate the result +# +# ask_from_listW should handle differently small lists and big ones. + + 1; sub new($$) { @@ -41,12 +61,20 @@ sub ask_from_list($$$$;$) { $o->ask_from_listW($title, $message, $l, $def || $l->[0]); } +sub ask_many_from_list_ref($$$$;$) { + my ($o, $title, $message, $l, $val) = @_; + + $message = ref $message ? $message : [ $message ]; + + $o->ask_many_from_list_refW($title, $message, $l, $val); +} sub ask_many_from_list($$$$;$) { my ($o, $title, $message, $l, $def) = @_; - $message = ref $message ? $message : [ $message ]; + my $val = [ map { my $i = $_; \$i } @$def ]; - $o->ask_many_from_listW($title, $message, $l, $def); + $o->ask_many_from_list_ref($title, $message, $l, $val) ? + [ map { $$_ } @$val ] : undef; } sub ask_from_entry($$$;$) { |