summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/network/connection/cellular_card.pm5
-rw-r--r--lib/network/connection_manager.pm7
-rw-r--r--lib/network/netconnect.pm5
3 files changed, 12 insertions, 5 deletions
diff --git a/lib/network/connection/cellular_card.pm b/lib/network/connection/cellular_card.pm
index 3d90771..b6a889c 100644
--- a/lib/network/connection/cellular_card.pm
+++ b/lib/network/connection/cellular_card.pm
@@ -173,6 +173,11 @@ sub check_device {
sub check_hardware {
my ($self) = @_;
+ 0;
+}
+
+sub configure_hardware {
+ my ($self) = @_;
my $device_ready = 0;
diff --git a/lib/network/connection_manager.pm b/lib/network/connection_manager.pm
index 09949d9..d6c93d9 100644
--- a/lib/network/connection_manager.pm
+++ b/lib/network/connection_manager.pm
@@ -66,7 +66,8 @@ sub setup_connection {
$cmanager->{in}->ask_warn(N("Error"), $cmanager->{connection}{device}{error});
return;
}
- if ($cmanager->{connection}->can('get_hardware_settings')) {
+ my $device_ready = !$cmanager->{connection}->can('check_hardware') || $cmanager->{connection}->check_hardware;
+ if ($cmanager->{connection}->can('get_hardware_settings') && !$device_ready) {
$cmanager->{connection}->guess_hardware_settings if $cmanager->{connection}->can('guess_hardware_settings');
$cmanager->{in}->ask_from_({
title => N("Network settings"),
@@ -77,9 +78,9 @@ sub setup_connection {
return;
}
}
- if ($cmanager->{connection}->can('check_hardware')) {
+ if ($cmanager->{connection}->can('configure_hardware') && !$device_ready) {
my $wait = $cmanager->{in}->wait_message(N("Please wait"), N("Configuring device..."));
- if (!$cmanager->{connection}->check_hardware) {
+ if (!$cmanager->{connection}->configure_hardware) {
undef $wait;
$cmanager->{in}->ask_warn(N("Error"), $cmanager->{connection}{hardware}{error}) if $cmanager->{connection}{hardware}{error};
return;
diff --git a/lib/network/netconnect.pm b/lib/network/netconnect.pm
index 36ab362..f35abd0 100644
--- a/lib/network/netconnect.pm
+++ b/lib/network/netconnect.pm
@@ -180,9 +180,10 @@ sub real_main {
$in->ask_warn('', $connection->{hardware}{error});
return 1;
}
- if ($connection->can('check_hardware')) {
+ return 0 if !$connection->can('check_hardware') || $connection->check_hardware;
+ if ($connection->can('configure_hardware')) {
my $_w = $in->wait_message(N("Please wait"), N("Configuring device..."));
- if (!$connection->check_hardware) {
+ if (!$connection->configure_hardware) {
$in->ask_warn(N("Error"), $connection->{hardware}{error}) if $connection->{hardware}{error};
return 1;
}