diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-08-23 13:01:55 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-08-23 13:01:55 +0000 |
commit | 673787cbdab4a47b0b3cb987866c57704d7bdee9 (patch) | |
tree | 32255ffefd59a78b5e798e18a4f790b032449c1b /perl-install/interactive.pm | |
parent | 57ea24fde5f61bb54bee187847f1119b5c79f9f3 (diff) | |
download | drakx-backup-do-not-use-673787cbdab4a47b0b3cb987866c57704d7bdee9.tar drakx-backup-do-not-use-673787cbdab4a47b0b3cb987866c57704d7bdee9.tar.gz drakx-backup-do-not-use-673787cbdab4a47b0b3cb987866c57704d7bdee9.tar.bz2 drakx-backup-do-not-use-673787cbdab4a47b0b3cb987866c57704d7bdee9.tar.xz drakx-backup-do-not-use-673787cbdab4a47b0b3cb987866c57704d7bdee9.zip |
no_comment
Diffstat (limited to 'perl-install/interactive.pm')
-rw-r--r-- | perl-install/interactive.pm | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm index 76ed30345..b0bd6bb7d 100644 --- a/perl-install/interactive.pm +++ b/perl-install/interactive.pm @@ -3,7 +3,7 @@ package interactive; use diagnostics; use strict; -use common qw(:common); +use common qw(:common :functional); 1; @@ -18,11 +18,11 @@ sub ask_warn($$$) { my ($o, $title, $message) = @_; ask_from_list($o, $title, $message, [ _("Ok") ]); } -sub ask_yesorno($$$) { +sub ask_yesorno($$$;$) { my ($o, $title, $message, $def) = @_; ask_from_list_($o, $title, $message, [ __("Yes"), __("No") ], $def ? "No" : "Yes") eq "Yes"; } -sub ask_okcancel($$$) { +sub ask_okcancel($$$;$) { my ($o, $title, $message, $def) = @_; ask_from_list_($o, $title, $message, [ __("Ok"), __("Cancel") ], $def ? "Cancel" : "Ok") eq "Ok"; } @@ -56,3 +56,25 @@ sub ask_from_entry($$$;$) { $o->ask_from_entryW($title, $message, $def); } + +sub wait_message($$$) { + my ($o, $title, $message) = @_; + + $message = ref $message ? $message : [ $message ]; + + my $w = $o->wait_messageW($title, [ _("Please wait"), @$message ]); + my $b = before_leaving { $o->wait_message_endW($w) }; + + # enable access through set + common::add_f4before_leaving(sub { $o->wait_message_nextW($_[1], $w) }, $b, 'set'); + $b; +} + +sub kill { + my ($o) = @_; + while ($o->{before_killing} && @interactive::objects > $o->{before_killing}) { + my $w = pop @interactive::objects; + $w->destroy; + } + $o->{before_killing} = @interactive::objects; +} |