diff options
author | pad <pad@mandriva.com> | 1999-09-06 20:33:18 +0000 |
---|---|---|
committer | pad <pad@mandriva.com> | 1999-09-06 20:33:18 +0000 |
commit | 115b4b1145f86d90f20c0404a54fa907f06c30b0 (patch) | |
tree | 046cd13affb85df1028bcc687e1c8853fc576cd7 /perl-install/interactive.pm | |
parent | a6096f902a2df839b7e89c084d629840bf52a3a1 (diff) | |
download | drakx-115b4b1145f86d90f20c0404a54fa907f06c30b0.tar drakx-115b4b1145f86d90f20c0404a54fa907f06c30b0.tar.gz drakx-115b4b1145f86d90f20c0404a54fa907f06c30b0.tar.bz2 drakx-115b4b1145f86d90f20c0404a54fa907f06c30b0.tar.xz drakx-115b4b1145f86d90f20c0404a54fa907f06c30b0.zip |
bugfix
Diffstat (limited to 'perl-install/interactive.pm')
-rw-r--r-- | perl-install/interactive.pm | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm index dc846f42b..2f3fb4c15 100644 --- a/perl-install/interactive.pm +++ b/perl-install/interactive.pm @@ -1,10 +1,11 @@ - - package interactive; use diagnostics; use strict; +#-###################################################################################### +#- misc imports +#-###################################################################################### use common qw(:common :functional); # heritate from this class and you'll get all made interactivity for same steps. @@ -27,9 +28,10 @@ use common qw(:common :functional); # ask_from_listW should handle differently small lists and big ones. -1; - +#-###################################################################################### +#- OO Stuff +#-###################################################################################### sub new($) { my ($type) = @_; @@ -37,6 +39,9 @@ sub new($) { } +#-###################################################################################### +#- Interactive functions +#-###################################################################################### sub ask_warn($$$) { my ($o, $title, $message) = @_; ask_from_list($o, $title, $message, [ _("Ok") ]); @@ -100,7 +105,9 @@ sub ask_from_entries($$$$;$%) { [ map { $$_ } @$val ] : undef; } - +# can get a hash of callback: focus_out changed and complete +# moreove if you pass a hash with a field list -> combo +# if you pass a hash with a field hidden -> emulate stty -echo sub ask_from_entries_ref($$$$;$%) { my ($o, $title, $message, $l, $val, %callback) = @_; @@ -109,8 +116,8 @@ sub ask_from_entries_ref($$$$;$%) { { if ((ref $_) eq "SCALAR") { { val => $_ } } else { - @{$_->{list}} ? - { (%{$_}, type => "list")} : {(%{$_})} + ($_->{list} && @{$_->{list}}) ? + { %{$_}, type => "list"} : $_ } } @{$val} ]; @@ -138,3 +145,8 @@ sub kill { } $o->{before_killing} = @interactive::objects; } + +#-###################################################################################### +#- Wonderful perl :( +#-###################################################################################### +1; # |