diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2003-03-06 14:25:27 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2003-03-06 14:25:27 +0000 |
commit | cdd491ef4af8baf94cb85b6906f6ba7c7da8d4f5 (patch) | |
tree | 9ed884ee979a248b8bcde3ec97dbdf97a5c3ff2d /perl-install | |
parent | a91668aae284633b47fd49d70dcd9df2e2d2b648 (diff) | |
download | drakx-cdd491ef4af8baf94cb85b6906f6ba7c7da8d4f5.tar drakx-cdd491ef4af8baf94cb85b6906f6ba7c7da8d4f5.tar.gz drakx-cdd491ef4af8baf94cb85b6906f6ba7c7da8d4f5.tar.bz2 drakx-cdd491ef4af8baf94cb85b6906f6ba7c7da8d4f5.tar.xz drakx-cdd491ef4af8baf94cb85b6906f6ba7c7da8d4f5.zip |
let fix #2244, #2245, #2730
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/harddrake/sound.pm | 25 | ||||
-rw-r--r-- | perl-install/install_steps_interactive.pm | 5 | ||||
-rwxr-xr-x | perl-install/standalone/draksound | 2 |
3 files changed, 17 insertions, 15 deletions
diff --git a/perl-install/harddrake/sound.pm b/perl-install/harddrake/sound.pm index 6e3904a9c..edbed5e01 100644 --- a/perl-install/harddrake/sound.pm +++ b/perl-install/harddrake/sound.pm @@ -141,13 +141,13 @@ sub get_alternative { } sub do_switch { - my ($old_driver, $new_driver) = @_; + my ($old_driver, $new_driver, $index) = @_; log::explanations("removing old $old_driver\n"); rooted("service sound stop") unless $blacklisted; rooted("service alsa stop") if $old_driver =~ /^snd-/ && !$blacklisted; unload($old_driver); # run_program("/sbin/modprobe -r $driver"); # just in case ... modules::remove_module($old_driver); # completed by the next add_alias() - modules::add_alias("sound-slot-$::i", $new_driver); + modules::add_alias("sound-slot-$index", $new_driver); modules::write_conf(); if ($new_driver =~ /^snd-/) { rooted("service alsa start") unless $blacklisted; @@ -160,7 +160,7 @@ sub do_switch { } sub switch { - my ($in, $device) = @_; + my ($in, $device, $index) = @_; my $driver = $device->{current_driver}; $driver ||= $device->{driver}; @@ -173,7 +173,7 @@ sub switch { N("There's no known OSS/ALSA alternative driver for your sound card (%s) which currently uses \"%s\"", $device->{description}, $driver), [ - &get_any_driver_entry($in, $driver, $device), + &get_any_driver_entry($in, $driver, $device, $index), ] ); } elsif ($in->ask_from_({ title => N("Sound configuration"), @@ -207,7 +207,7 @@ To use alsa, one can either use: val => N("Trouble shooting"), disabled => sub {}, clicked => sub { &trouble($in) } }, - &get_any_driver_entry($in, $driver, $device), + &get_any_driver_entry($in, $driver, $device, $index), ])) { return if $new_driver eq $driver; @@ -216,7 +216,7 @@ To use alsa, one can either use: It has been reported to oops the kernel on unloading.\n The new \"%s\" driver'll only be used on next bootstrap.", $driver, $new_driver)) if $blacklisted; my $wait = $in->wait_message(N("Please wait"), N("Please Wait... Applying the configuration")); - do_switch($driver, $new_driver); + do_switch($driver, $new_driver, $index); undef $wait; } } elsif ($driver =~ /^Bad:/) { @@ -228,7 +228,7 @@ The new \"%s\" driver'll only be used on next bootstrap.", $driver, $new_driver) $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, $driver, $device) ]); + [ &get_any_driver_entry($in, $driver, $device, $index) ]); } else { $in->ask_warn(N("Unkown driver"), N("Error: The \"%s\" driver for your sound card is unlisted"), @@ -238,8 +238,7 @@ The new \"%s\" driver'll only be used on next bootstrap.", $driver, $new_driver) } sub config { - my ($in, $device) = @_; - switch($in, $device); + switch(@_); } @@ -269,7 +268,7 @@ initlevel 3 } sub choose_any_driver { - my ($in, $driver, $card) = @_; + my ($in, $driver, $card, $index) = @_; my $old_driver = $driver; if ($in->ask_from(N("Choosing an arbitratry driver"), formatAlaTeX(N("If you really think that you know which driver is the right one for your card @@ -281,15 +280,15 @@ The current driver for your \"%s\" sound card is \"%s\" ", $card, $driver)), ] )) { - do_switch($old_driver, $driver); + do_switch($old_driver, $driver, $index); } } sub get_any_driver_entry { - my ($in, $driver, $device) = @_; + my ($in, $driver, $device, $index) = @_; { val => N("Let me pick any driver"), disabled => sub {}, - clicked => sub { &choose_any_driver($in, $driver, $device->{description}); goto end } + clicked => sub { &choose_any_driver($in, $driver, $device->{description}, $index); goto end } } } diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index af387c92d..10e340b0b 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -935,7 +935,9 @@ sub summary { my @sound_cards = detect_devices::getSoundDevices(); + my $sound_index = 0; foreach my $device (@sound_cards) { + my $own_sound_index = $sound_index; push @l, { group => N("Hardware"), label => N("Sound card"), @@ -944,9 +946,10 @@ sub summary { }, clicked => sub { require harddrake::sound; - harddrake::sound::config($o, $device) + harddrake::sound::config($o, $device, $own_sound_index) }, }; + $sound_index++; } if (!@sound_cards && ($o->{compssUsersChoice}{GAMES} || $o->{compssUsersChoice}{AUDIO})) { diff --git a/perl-install/standalone/draksound b/perl-install/standalone/draksound index 5f27779fb..7e71af88d 100755 --- a/perl-install/standalone/draksound +++ b/perl-install/standalone/draksound @@ -40,7 +40,7 @@ if (@devices) { my $driver = modules::get_alias("sound-slot-$::i"); $driver = modules::get_alias($driver) if $driver =~ /sound-card/; # alsaconf ... $_->{current_driver} = $driver if $driver; - harddrake::sound::config($in, $_); + harddrake::sound::config($in, $_, $::i); } modules::probe_category('multimedia/sound'); } else { $in->ask_warn(N("No Sound Card detected!"), |