summaryrefslogtreecommitdiffstats
path: root/lib/network/connection.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-05-18 19:52:13 +0000
committerOlivier Blin <oblin@mandriva.com>2008-05-18 19:52:13 +0000
commit8e185cf17268b0b35f0345c18e98b7f2768cd7e3 (patch)
tree745eee691f5d0b27199cb1cce9ff967d6c810fe3 /lib/network/connection.pm
parent6fc6dba9b140c06cf66e94581fa9bec84c61b941 (diff)
downloaddrakx-net-8e185cf17268b0b35f0345c18e98b7f2768cd7e3.tar
drakx-net-8e185cf17268b0b35f0345c18e98b7f2768cd7e3.tar.gz
drakx-net-8e185cf17268b0b35f0345c18e98b7f2768cd7e3.tar.bz2
drakx-net-8e185cf17268b0b35f0345c18e98b7f2768cd7e3.tar.xz
drakx-net-8e185cf17268b0b35f0345c18e98b7f2768cd7e3.zip
move provider settings guess in connection object
Diffstat (limited to 'lib/network/connection.pm')
-rw-r--r--lib/network/connection.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/network/connection.pm b/lib/network/connection.pm
index 8851e92..6efbe1b 100644
--- a/lib/network/connection.pm
+++ b/lib/network/connection.pm
@@ -158,6 +158,15 @@ sub get_access_settings_label { N("Access settings") }
sub get_address_settings_label { N("Address settings") }
#- check that $self->can('get_providers') first
+sub guess_provider_settings {
+ my ($self) = @_;
+ require lang;
+ my @providers_data = $self->get_providers;
+ my $locale_country = lang::c2name(ref($::o) && $::o->{locale}{country} || lang::read()->{country});
+ my $separator = $providers_data[1];
+ $self->{provider_name} = find { /^\Q$locale_country$separator\E/ } sort(keys %{$providers_data[0]});
+}
+
sub set_provider {
my ($self) = @_;
if ($self->{provider_name} ne N("Unlisted - edit manually")) {