summaryrefslogtreecommitdiffstats
path: root/lib/network/connection.pm
diff options
context:
space:
mode:
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")) {