From 89850eb2cbdc105293b3661abad91910fff231ca Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 29 Nov 2013 09:42:50 +0100 Subject: reverse the if branches rationale: since we no more offer an OSS alternative, the list is empty and thus we were not offering the dialog anymore. However it does more than offering to switch between OSS & ALSA: we do want to offer to configure PA even if we cannot switch to another driver. Thus the GUI is now either show an error dialog if there's no supported sound card of showing PA options --- perl-install/harddrake/sound.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'perl-install/harddrake') diff --git a/perl-install/harddrake/sound.pm b/perl-install/harddrake/sound.pm index 7605012b8..ce565e03b 100644 --- a/perl-install/harddrake/sound.pm +++ b/perl-install/harddrake/sound.pm @@ -129,7 +129,12 @@ sub config { my $driver = $device->{current_driver} || $device->{driver}; my @alternative = $driver ne $device->{driver} ? $device->{driver} : (); - if (@alternative) { + if ($driver eq "unknown") { + $in->ask_from(N("No known driver"), + N("There's no known driver for your sound card (%s)", + $device->{description}), + [ get_any_driver_entry($in, $modules_conf, $driver, $device) ]); + } else { my $new_driver = $driver; push @alternative, $driver; my %des = modules::category2modules_and_description('multimedia/sound'); @@ -212,6 +217,7 @@ To use alsa, one can either use: }, }, [ + if_(@alternative, { label => N("Driver:"), val => \$new_driver, list => \@alternative, default => $new_driver, sort =>1, allow_empty_list => 1, @@ -220,7 +226,7 @@ To use alsa, one can either use: sprintf(($des{$drv} ? "$des{$drv} (%s [%s])" : "%s [%s]"), $drv, $drv =~ /^snd_/ ? 'ALSA' : 'OSS'); } - }, + }), @common, ])) { @@ -230,11 +236,6 @@ To use alsa, one can either use: do_switch($in, $modules_conf, $device->{current_driver}, $new_driver, $device->{sound_slot_index}); $device->{current_driver} = $new_driver; } - } elsif ($driver eq "unknown") { - $in->ask_from(N("No known driver"), - N("There's no known driver for your sound card (%s)", - $device->{description}), - [ get_any_driver_entry($in, $modules_conf, $driver, $device) ]); } end: } -- cgit v1.2.1