| \n",
$drv->{'mode'} == 1 ? "checked" : "";
print "$text{'suse_driver'} | ";
print " | $text{'suse_printer'} | \n";
print " | \n";
print " | $text{'suse_res'} | \n";
print " | \n";
print "$text{'suse_colour'} | \n";
printf " %s\n",
$drv->{'colour'} eq 'mono' ? '' : 'checked', $text{'yes'};
printf " %s | \n",
$drv->{'colour'} eq 'mono' ? 'checked' : '', $text{'no'};
print " | $text{'suse_paper'} | \n";
print " | \n";
print "$text{'suse_method'} | \n";
printf " %s\n",
$drv->{'method'} eq 'ascii' ? '' : 'checked',
$text{'suse_auto'};
printf " %s | \n",
$drv->{'method'} eq 'ascii' ? 'checked' : '',
$text{'suse_ascii'};
print " |
\n";
}
else {
# Show input for new-style suse printer (NOT DONE YET!)
printf " | \n",
$drv->{'mode'} == 3 ? "checked" : "";
print "$text{'suse_yast2'} | ";
print " | $text{'suse_printer'} | \n";
print " | \n";
print " | $text{'suse_colour'} | \n";
printf " %s\n",
$drv->{'colour'} eq 'mono' ? '' : 'checked', $text{'yes'};
printf " %s | \n",
$drv->{'colour'} eq 'mono' ? 'checked' : '', $text{'no'};
print "$text{'suse_paper'} | \n";
print " | \n";
print " | $text{'suse_res'} | \n";
printf " %s\n",
$drv->{'res'} ? '' : 'checked', $text{'suse_auto'};
printf "\n",
$drv->{'res'} ? 'checked' : '';
print " | \n";
print "$text{'suse_method'} | \n";
print " | \n";
print " | $text{'suse_extra'} | \n";
print " | \n";
print " |
\n";
}
}
# parse_driver()
# Parse driver selection from %in and return a driver structure
sub parse_driver
{
if ($in{'mode'} == 0) {
return { 'mode' => 0 };
}
elsif ($in{'mode'} == 2) {
(-x $in{'iface'}) || &error(&text('suse_eprog', $in{'iface'}));
return { 'mode' => 2,
'file' => $in{'iface'} };
}
elsif ($in{'mode'} == 3) {
# New suse printer (NOT DONE YET!)
# All the other odd files created by yast2 need to be supported
$in{'device'} || &error($text{'suse_edriver'});
$in{'res_def'} || $in{'res'} =~ /^\d+$/ ||
$in{'res'} =~ /^\d+x\d+$/ || &error($text{'suse_eres'});
}
elsif ($in{'mode'} == 1) {
# Old-style suse printer
$in{'device'} || &error($text{'suse_edriver'});
$in{'res'} =~ /^\d+$/ || &error(&text('suse_eres', $in{'res'}));
return { 'mode' => 1,
'device' => $in{'device'},
'paper' => $in{'paper'},
'method' => $in{'method'},
'colour' => $in{'colour'},
'res' => $in{'res'} };
}
}
1;