diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-09-08 11:14:58 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-09-08 11:14:58 +0000 |
commit | c7ce6282bc6360e3106818c301c550523f7a1f7a (patch) | |
tree | 0c122786d23df1141f4f048a8052d32f3010915d /perl-install/interactive.pm | |
parent | fdc0e52cf8c9cfae833f45ec59d35d640a7ce6cc (diff) | |
download | drakx-backup-do-not-use-c7ce6282bc6360e3106818c301c550523f7a1f7a.tar drakx-backup-do-not-use-c7ce6282bc6360e3106818c301c550523f7a1f7a.tar.gz drakx-backup-do-not-use-c7ce6282bc6360e3106818c301c550523f7a1f7a.tar.bz2 drakx-backup-do-not-use-c7ce6282bc6360e3106818c301c550523f7a1f7a.tar.xz drakx-backup-do-not-use-c7ce6282bc6360e3106818c301c550523f7a1f7a.zip |
no_comment
Diffstat (limited to 'perl-install/interactive.pm')
-rw-r--r-- | perl-install/interactive.pm | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm index cf22eae85..4cf9ef95b 100644 --- a/perl-install/interactive.pm +++ b/perl-install/interactive.pm @@ -44,27 +44,41 @@ sub new($) { #-###################################################################################### sub ask_warn($$$) { my ($o, $title, $message) = @_; - ask_from_list($o, $title, $message, [ _("Ok") ]); + ask_from_list2($o, $title, $message, [ _("Ok") ]); } sub ask_yesorno($$$;$) { my ($o, $title, $message, $def) = @_; - ask_from_list_($o, $title, $message, [ __("Yes"), __("No") ], $def ? "No" : "Yes") eq "Yes"; + ask_from_list2_($o, $title, $message, [ __("Yes"), __("No") ], $def ? "No" : "Yes") eq "Yes"; } sub ask_okcancel($$$;$) { my ($o, $title, $message, $def) = @_; - ask_from_list_($o, $title, $message, [ __("Ok"), __("Cancel") ], $def ? "Cancel" : "Ok") eq "Ok"; + ask_from_list2_($o, $title, $message, [ __("Ok"), __("Cancel") ], $def ? "Cancel" : "Ok") eq "Ok"; } -sub ask_from_list_($$$$;$) { +sub ask_from_list_ { + my ($o, $title, $message, $l, $def) = @_; + @$l == 0 and die; + @$l == 1 and return $l->[0]; + goto &ask_from_list2_; +} + +sub ask_from_list { + my ($o, $title, $message, $l, $def) = @_; + @$l == 0 and die; + @$l == 1 and return $l->[0]; + goto &ask_from_list2; +} + +sub ask_from_list2_($$$$;$) { my ($o, $title, $message, $l, $def) = @_; untranslate( ask_from_list($o, $title, $message, [ map { translate($_) } @$l ], translate($def)), @$l); } -sub ask_from_list($$$$;$) { +sub ask_from_list2($$$$;$) { my ($o, $title, $message, $l, $def) = @_; $message = ref $message ? $message : [ $message ]; |