summaryrefslogtreecommitdiffstats
path: root/perl-install/printerdrake.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-02-20 01:09:07 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-02-20 01:09:07 +0000
commit1d27dbf5e28c61be9eeb078c44f2481fb25e7195 (patch)
tree2ad14181e14cca6244b53fa2c6856e5d17fd8d8d /perl-install/printerdrake.pm
parenta7463f88ccd1e833fcecec5c76ac47c804e060c0 (diff)
downloaddrakx-1d27dbf5e28c61be9eeb078c44f2481fb25e7195.tar
drakx-1d27dbf5e28c61be9eeb078c44f2481fb25e7195.tar.gz
drakx-1d27dbf5e28c61be9eeb078c44f2481fb25e7195.tar.bz2
drakx-1d27dbf5e28c61be9eeb078c44f2481fb25e7195.tar.xz
drakx-1d27dbf5e28c61be9eeb078c44f2481fb25e7195.zip
major move. now ask_from_list returns false when canceled (it doesn't die 'ask_from_list canceled' anymore)
Diffstat (limited to 'perl-install/printerdrake.pm')
-rw-r--r--perl-install/printerdrake.pm24
1 files changed, 13 insertions, 11 deletions
diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm
index 37560ecde..f9f42127b 100644
--- a/perl-install/printerdrake.pm
+++ b/perl-install/printerdrake.pm
@@ -235,15 +235,13 @@ sub setup_gsdriver_lpr($$$;$) {
do {
$printer->{DBENTRY} ||= $printer::thedb_gsdriver{$printer->{GSDRIVER}}{ENTRY};
- eval { $printer->{DBENTRY} = $printer::descr_to_db{
+ $printer->{DBENTRY} = $printer::descr_to_db{
$in->ask_from_list_(_("Configure Printer"),
_("What type of printer do you have?"),
[ @printer::entry_db_description ],
$printer::db_to_descr{$printer->{DBENTRY}},
- { %printer::descr_to_help })
- };
- }; $@ =~ /^ask_from_list cancel/ and return;
-
+ { %printer::descr_to_help }) || return
+ };
my %db_entry = %{$printer::thedb{$printer->{DBENTRY}}};
#- specific printer drivers to install.
@@ -300,7 +298,7 @@ sub setup_gsdriver_lpr($$$;$) {
printer::configure_queue($printer);
$printer->{complete} = 0;
- $action = $in->ask_from_listf('', _("Do you want to test printing?"), sub { $action{$_[0]} }, \@action, 'done');
+ $action = $in->ask_from_listf('', _("Do you want to test printing?"), sub { $action{$_[0]} }, \@action, 'done') or return;
my @testpages;
push @testpages, "/usr/lib/rhs/rhs-printfilters/testpage.asc"
@@ -342,10 +340,14 @@ sub main($$$;$) {
$queue = $printer->{want} || $in->ask_yesorno(_("Printer"),
_("Would you like to configure a printer?"), 0) ? 'lp' : 'Done';
} else {
- $queue = $in->ask_from_list_([''],
+ $in->ask_from_entries_refH_powered(,
+ {
+ messages =>
_("Here are the following print queues.
You can add some more or change the existing ones."),
- [ (sort keys %{$printer->{configured} || {}}), __("Add"), __("Done") ],
+ ok => '',
+ }, [ { val => \$queue, format => \&translate, list => [ (sort keys %{$printer->{configured} || {}}), __("Add"), __("Done") ] } ]
+ );
);
if ($queue eq 'Add') {
my %queues; @queues{map { split '\|', $_ } keys %{$printer->{configured}}} = ();
@@ -376,7 +378,7 @@ You can add some more or change the existing ones."),
_("How is the printer connected?"),
[ printer::printer_type($printer) ],
$printer->{str_type},
- );
+ ) or return;
$printer->{TYPE} = $printer::printer_type{$printer->{str_type}};
if ($printer->{TYPE} eq 'REMOTE') {
$printer->{str_type} = $printer::printer_type_inv{CUPS};
@@ -386,7 +388,7 @@ any printer here; printers will be automatically detected.
In case of doubt, select \"Remote CUPS server\"."),
[ @printer::printer_type_inv{qw(CUPS LPD SOCKET)} ],
$printer->{str_type},
- );
+ ) or return;
$printer->{TYPE} = $printer::printer_type{$printer->{str_type}};
}
if ($printer->{TYPE} eq 'CUPS') {
@@ -455,7 +457,7 @@ how is the printer connected?") }, [
_("How is the printer connected?"),
[ printer::printer_type($printer) ],
$printer->{str_type},
- );
+ ) or return;
} else {
$in->set_help('configurePrinterLPR') if $::isInstall;
$in->ask_from_entries_refH_powered(