summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorDamien Chaumette <dchaumette@mandriva.com>2002-10-10 15:23:07 +0000
committerDamien Chaumette <dchaumette@mandriva.com>2002-10-10 15:23:07 +0000
commit9572c2b7be11fd83d7981c2c369f271c961254fb (patch)
tree9c71b69fc814f5789eb643c6de34dfa71c653748 /perl-install
parent8346dedbb1791281f72c83331cb09802904ef634 (diff)
downloaddrakx-9572c2b7be11fd83d7981c2c369f271c961254fb.tar
drakx-9572c2b7be11fd83d7981c2c369f271c961254fb.tar.gz
drakx-9572c2b7be11fd83d7981c2c369f271c961254fb.tar.bz2
drakx-9572c2b7be11fd83d7981c2c369f271c961254fb.tar.xz
drakx-9572c2b7be11fd83d7981c2c369f271c961254fb.zip
add a warning window for winmodems
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/network/netconnect.pm20
1 files changed, 15 insertions, 5 deletions
diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm
index 75f64bbac..70116cf5d 100644
--- a/perl-install/network/netconnect.pm
+++ b/perl-install/network/netconnect.pm
@@ -68,15 +68,25 @@ sub detect {
require network::ethernet;
network::ethernet->import;
my @all_cards = conf_network_card_backend (undef, undef, undef, undef, undef, undef);
+ map { $auto_detect->{lan}{$_->[0]} = $_->[1] } @all_cards if !$net_install;
+
+ my $adsl = {};
require network::adsl;
network::adsl->import;
- map {
- (!$net_install and adsl_detect($_->[0])) ? $auto_detect->{adsl} = $_->[0] : $auto_detect->{lan}{$_->[0]} = $_->[1] } @all_cards;
+ $auto_detect->{adsl} = adsl_detect($adsl);
+
my $modem = {};
require network::modem;
network::modem->import;
- modem_detect_backend($modem);
+ my (@pci_modems, $modem) = detect_devices::getModem;
$modem->{device} and $auto_detect->{modem} = $modem->{device};
+ show_pci_modems(@pci_modems) if @pci_modems;
+}
+
+sub show_pci_modems {
+ my @l = map { ' - ' . $_->{description} } @_;
+ pop @l;
+ $in->ask_warn(_("Warning"), _("You have internal winmodem(s) :\n\n%s\n\n Go to http://www.linmodem.org for further information", join ("\n", @l)));
}
sub pre_func {
@@ -184,7 +194,7 @@ If you don't want to use the auto detection, deselect the checkbox.
my @l = (
[_("Normal modem connection"), $netc->{autodetect}{modem}, __("detected on port %s"), \$conf{modem}],
[_("ISDN connection"), $netc->{autodetect}{isdn}{description}, __("detected %s"), \$conf{isdn}],
- [_("ADSL connection"), $netc->{autodetect}{adsl}, __("detected on interface %s"), \$conf{adsl}],
+ [_("ADSL connection"), $netc->{autodetect}{adsl}, __("detected"), \$conf{adsl}],
[_("Cable connection"), $netc->{autodetect}{cable}, __("cable connection detected"), \$conf{cable}],
[_("LAN connection"), $netc->{autodetect}{lan}, __("ethernet card(s) detected"), \$conf{lan}]
);
@@ -193,7 +203,7 @@ If you don't want to use the auto detection, deselect the checkbox.
@l = (
[_("Normal modem connection") . if_($netc->{autodetect}{modem}, " - " . _("detected on port %s", $netc->{autodetect}{modem})), \$conf{modem}],
[_("ISDN connection") . if_($netc->{autodetect}{isdn}{description}, " - " . _("detected %s", $netc->{autodetect}{isdn}{description})), \$conf{isdn}],
-[_("ADSL connection") . if_($netc->{autodetect}{adsl}, " - " . _("detected on interface %s", $netc->{autodetect}{adsl})), \$conf{adsl}],
+[_("ADSL connection") . if_($netc->{autodetect}{adsl}, " - " . _("detected", $netc->{autodetect}{adsl})), \$conf{adsl}],
[_("Cable connection") . if_($netc->{autodetect}{cable}, " - " . _("cable connection detected")), \$conf{cable}],
[_("LAN connection") . if_($netc->{autodetect}{lan}, " - " . _("ethernet card(s) detected")), \$conf{lan}]
);
class='lines'>
package interactive;

use diagnostics;
use strict;

#-######################################################################################
#- misc imports
#-######################################################################################
use common qw(:common :functional);

#- heritate from this class and you'll get all made interactivity for same steps.
#- for this you need to provide
#- - ask_from_listW(o, title, messages, arrayref, default) returns one string of arrayref
#- - ask_many_from_listW(o, title, messages, arrayref, arrayref2) returns many strings of arrayref
#-
#- where
#- - o is the object
#- - title is a string
#- - messages is an refarray of strings
#- - default is an optional string (default is in arrayref)
#- - arrayref is an arrayref of strings
#- - arrayref2 contains booleans telling the default state,
#-
#- ask_from_list and ask_from_list_ are wrappers around ask_from_biglist and ask_from_smalllist
#-
#- ask_from_list_ just translate arrayref before calling ask_from_list and untranslate the result
#-
#- ask_from_listW should handle differently small lists and big ones.



#-######################################################################################
#- OO Stuff
#-######################################################################################
sub new($) {
    my ($type) = @_;

    bless {}, ref $type || $type;
}

sub vnew {
    my ($type, $su) = @_;
    $su = $su eq "su";
    require c;
    if ($ENV{DISPLAY} && c::Xtest($ENV{DISPLAY})) {
	if ($su) {
	    $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}";
	    $> and exec "kdesu", "-c", "$0 @ARGV";	    
	}
	require interactive_gtk;
	interactive_gtk->new;
    } else {
	if ($su && $>) {
	    die "you must be root to run this program";
	}
	require 'log.pm';
	undef *log::l;
	*log::l = sub {}; # otherwise, it will bother us :(
	require interactive_newt;
	interactive_newt->new;
    }
}

sub suspend {}
sub resume {}
sub end {}
sub exit { exit($_[0]) }

#-######################################################################################
#- Interactive functions
#-######################################################################################
sub ask_warn($$$) {
    my ($o, $title, $message) = @_;
    ask_from_list2($o, $title, $message, [ _("Ok") ]);
}

sub ask_yesorno($$$;$) {
    my ($o, $title, $message, $def) = @_;
    ask_from_list2_($o, $title, $message, [ __("Yes"), __("No") ], $def ? "Yes" : "No") eq "Yes";
}

sub ask_okcancel($$$;$) {
    my ($o, $title, $message, $def) = @_;
    ask_from_list2_($o, $title, $message, [ __("Ok"), __("Cancel") ], $def ? "Ok" : "Cancel") eq "Ok";
}

sub ask_from_list_ {
    my ($o, $title, $message, $l, $def) = @_;
    @$l == 0 and die '';
    @$l == 1 and return $l->[0];
    goto &ask_from_list2_;
}

sub ask_from_list {
    my ($o, $title, $message, $l, $def) = @_;
    @$l == 0 and die 'ask_from_list: empty list';
    @$l == 1 and return $l->[0];
    goto &ask_from_list2;
}

sub ask_from_list2_($$$$;$) {
    my ($o, $title, $message, $l, $def) = @_;
    untranslate(
       ask_from_list($o, $title, $message, [ map { translate($_) } @$l ], translate($def)),
       @$l);
}

sub ask_from_list2($$$$;$) {
    my ($o, $title, $message, $l, $def) = @_;

    @$l > 10 and $l = [ sort @$l ];

    $o->ask_from_listW($title, [ deref($message) ], $l, $def || $l->[0]);
}

sub ask_from_list_with_help_ {
    my ($o, $title, $message, $l, $help, $def) = @_;
    @$l == 0 and die '';
    @$l == 1 and return $l->[0];
    goto &ask_from_list2_with_help_;
}

sub ask_from_list_with_help {
    my ($o, $title, $message, $l, $help, $def) = @_;
    @$l == 0 and die '';
    @$l == 1 and return $l->[0];
    goto &ask_from_list2_with_help;
}