diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-02-16 20:22:24 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-02-16 20:22:24 +0000 |
commit | 8c847f02b2ff79db0f8ecc0a3041d964f0658c37 (patch) | |
tree | 49faccdef1a9d3b80b347f43f4f2154ba74dcf92 /perl-install/interactive.pm | |
parent | 65476d975761958788bef066c0640f56cc213b64 (diff) | |
download | drakx-8c847f02b2ff79db0f8ecc0a3041d964f0658c37.tar drakx-8c847f02b2ff79db0f8ecc0a3041d964f0658c37.tar.gz drakx-8c847f02b2ff79db0f8ecc0a3041d964f0658c37.tar.bz2 drakx-8c847f02b2ff79db0f8ecc0a3041d964f0658c37.tar.xz drakx-8c847f02b2ff79db0f8ecc0a3041d964f0658c37.zip |
- factorize "Help"-button handling
- fix interactive_help_get_id (happily, it was no pb :)
Diffstat (limited to 'perl-install/interactive.pm')
-rw-r--r-- | perl-install/interactive.pm | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm index 2af88092a..d9c4b2f3b 100644 --- a/perl-install/interactive.pm +++ b/perl-install/interactive.pm @@ -364,7 +364,7 @@ sub ask_from_normalize { ($common->{title} = $0) =~ s|.*/||; } $common->{interactive_help} ||= $o->{interactive_help}; - $common->{interactive_help} ||= $common->{interactive_help_id} && sub { $o->interactive_help_get_id($common->{interactive_help_id}) }; + $common->{interactive_help} ||= $common->{interactive_help_id} && $o->interactive_help_sub_get_id($common->{interactive_help_id}); $common->{advanced_label} ||= N("Advanced"); $common->{advanced_label_close} ||= N("Basic"); $common->{$_} = [ deref($common->{$_}) ] foreach qw(messages advanced_messages); @@ -394,7 +394,7 @@ sub ask_from_real { sub ask_browse_tree_info { my ($o, $title, $message, $common) = @_; - $common->{interactive_help} ||= $common->{interactive_help_id} && sub { $o->interactive_help_get_id($common->{interactive_help_id}) }; + $common->{interactive_help} ||= $common->{interactive_help_id} && $o->interactive_help_sub_get_id($common->{interactive_help_id}); add2hash_($common, { ok => $::isWizard ? ($::Wizard_finished ? N("Finish") : N("Next ->")) : N("Ok"), cancel => $::isWizard ? N("<- Previous") : N("Cancel") }); add2hash_($common, { title => $title, message => $message }); @@ -470,11 +470,27 @@ sub helper_separator_tree_to_tree { } +sub interactive_help_has_id { + my ($_o, $id) = @_; + exists $help::steps{$id}; +} + sub interactive_help_get_id { - my @l = map { + my ($_o, @l) = @_; + @l = map { join("\n\n", map { s/\n/ /mg; $_ } split("\n\n", translate($help::steps{$_}))) - } grep { exists $help::steps{$_} } @_; + } grep { exists $help::steps{$_} } @l; join("\n\n\n", @l); } +sub interactive_help_sub_get_id { + my ($o, $id) = @_; + $o->interactive_help_has_id($id) && sub { $o->interactive_help_get_id($id) }; +} + +sub interactive_help_sub_display_id { + my ($o, $id) = @_; + $o->interactive_help_has_id($id) && sub { $o->ask_warn(N("Help"), $o->interactive_help_get_id($id)) }; +} + 1; |