From ce9bee0f8dd03a89d4a4a1cdc9baffdbd480245d Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 30 Aug 2005 11:31:37 +0000 Subject: cleanup (translate late, and move methods to upper class) --- perl-install/interactive.pm | 12 ++++++++---- perl-install/interactive/gtk.pm | 8 -------- perl-install/interactive/newt.pm | 8 -------- perl-install/interactive/stdio.pm | 8 -------- 4 files changed, 8 insertions(+), 28 deletions(-) diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm index 6356d14d3..b93df4bdb 100644 --- a/perl-install/interactive.pm +++ b/perl-install/interactive.pm @@ -116,6 +116,9 @@ sub vnew { interactive::newt->new; } +sub ok { N_("Ok") } +sub cancel { N_("Cancel") } + sub enter_console {} sub leave_console {} sub suspend {} @@ -130,6 +133,7 @@ sub exit { } } + #-###################################################################################### #- Interactive functions #-###################################################################################### @@ -148,13 +152,13 @@ sub ask_okcancel { sub ask_warn_ { my ($o, $common) = @_; - ask_from_listf_raw_no_check($o, $common, undef, [ $o->ok ]); + ask_from_listf_raw_no_check($o, $common, \&translate, [ $o->ok ]); } sub ask_yesorno_ { my ($o, $common, $b_def) = @_; $common->{cancel} = ''; - ask_from_listf_raw($o, $common, sub { translate($_[0]) }, [ N_("Yes"), N_("No") ], $b_def ? "Yes" : "No") eq "Yes"; + ask_from_listf_raw($o, $common, \&translate, [ N_("Yes"), N_("No") ], $b_def ? "Yes" : "No") eq "Yes"; } sub ask_okcancel_ { @@ -165,7 +169,7 @@ sub ask_okcancel_ { $common->{focus_cancel} = !$b_def; ask_from_no_check($o, $common, []); } else { - ask_from_listf_raw($o, $common, sub { translate($_[0]) }, [ $o->ok, $o->cancel ], $b_def ? $o->ok : $o->cancel) eq $o->ok; + ask_from_listf_raw($o, $common, \&translate, [ $o->ok, $o->cancel ], $b_def ? $o->ok : $o->cancel) eq $o->ok; } } @@ -199,7 +203,7 @@ sub ask_from_list { sub ask_from_list_ { my ($o, $title, $message, $l, $o_def) = @_; - ask_from_listf($o, $title, $message, sub { translate($_[0]) }, $l, $o_def); + ask_from_listf($o, $title, $message, \&translate, $l, $o_def); } sub ask_from_listf_ { diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index cf252c0bc..36007face 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -807,12 +807,4 @@ sub kill { @tempory::objects = (); } -sub ok { - N("Ok"); -} - -sub cancel { - N("Cancel"); -} - 1; diff --git a/perl-install/interactive/newt.pm b/perl-install/interactive/newt.pm index af829b42b..d42eb99d8 100644 --- a/perl-install/interactive/newt.pm +++ b/perl-install/interactive/newt.pm @@ -420,12 +420,4 @@ sub simplify_string { $s; } -sub ok { - N("Ok"); -} - -sub cancel { - N("Cancel"); -} - 1; diff --git a/perl-install/interactive/stdio.pm b/perl-install/interactive/stdio.pm index 553f3fec5..04b5abfcf 100644 --- a/perl-install/interactive/stdio.pm +++ b/perl-install/interactive/stdio.pm @@ -168,13 +168,5 @@ sub wait_message_nextW { } sub wait_message_endW { print "\nDone\n" } -sub ok { - N("Ok"); -} - -sub cancel { - N("Cancel"); -} - 1; -- cgit v1.2.1