summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-03-14 17:47:04 +0000
committerOlivier Blin <oblin@mandriva.com>2008-03-14 17:47:04 +0000
commit16d29a97063bbd928874697180ecbc27e2525199 (patch)
tree00ad93991a07763dda226cfb04ac37dbb5424f01 /lib
parent5fa9d6db48beec58c1e0ae296ddb0e4918d69fd7 (diff)
downloaddrakx-net-16d29a97063bbd928874697180ecbc27e2525199.tar
drakx-net-16d29a97063bbd928874697180ecbc27e2525199.tar.gz
drakx-net-16d29a97063bbd928874697180ecbc27e2525199.tar.bz2
drakx-net-16d29a97063bbd928874697180ecbc27e2525199.tar.xz
drakx-net-16d29a97063bbd928874697180ecbc27e2525199.zip
add set_connection wrapper
Diffstat (limited to 'lib')
-rw-r--r--lib/network/connection_manager.pm5
-rwxr-xr-xlib/network/drakroam.pm7
-rwxr-xr-xlib/network/netcenter.pm2
3 files changed, 10 insertions, 4 deletions
diff --git a/lib/network/connection_manager.pm b/lib/network/connection_manager.pm
index cb3f066..9d6145f 100644
--- a/lib/network/connection_manager.pm
+++ b/lib/network/connection_manager.pm
@@ -33,6 +33,11 @@ sub create {
{ in => $in, net => $net, gui => { w => $w, pixbufs => $pixbufs } };
}
+sub set_connection {
+ my ($cmanager, $connection) = @_;
+ $cmanager->{connection} = $connection;
+}
+
sub check_setup {
my ($cmanager) = @_;
$cmanager->{connection}{passed_setup} =
diff --git a/lib/network/drakroam.pm b/lib/network/drakroam.pm
index e308cf3..7d499c5 100755
--- a/lib/network/drakroam.pm
+++ b/lib/network/drakroam.pm
@@ -40,7 +40,7 @@ sub get_connection {
sub select_connection {
my ($droam) = @_;
- $droam->{connection} = get_connection($droam);
+ network::connection_manager::set_connection($droam, get_connection($droam));
network::connection_manager::check_setup($droam) || network::connection_manager::setup_connection($droam)
if $droam->{connection};
update_on_connection_change($droam);
@@ -142,8 +142,9 @@ sub main {
my @connection_types = qw(network::connection::wireless network::connection::cellular_card);
@{$droam->{all_connections}} = map { $_->get_connections(automatic_only => 1) } @connection_types;
- $droam->{connection} = $o_interface && find { $_->get_interface eq $o_interface } @{$droam->{all_connections}};
- $droam->{connection} ||= find { !$_->network_scan_is_slow } @{$droam->{all_connections}};
+ my $connection = $o_interface && find { $_->get_interface eq $o_interface } @{$droam->{all_connections}};
+ $connection ||= find { !$_->network_scan_is_slow } @{$droam->{all_connections}};
+ network::connection_manager::set_connection($droam, $connection) if $connection;
update_connections_list($droam);
update_on_connection_change($droam);
diff --git a/lib/network/netcenter.pm b/lib/network/netcenter.pm
index 6c53114..3c3f2b5 100755
--- a/lib/network/netcenter.pm
+++ b/lib/network/netcenter.pm
@@ -16,7 +16,7 @@ sub build_cmanager {
my ($in, $net, $w, $pixbufs, $connection) = @_;
my $cmanager = network::connection_manager::create($in, $net, $w, $pixbufs);
- $cmanager->{connection} = $connection;
+ $cmanager->set_connection($connection);
if ($connection->can('get_networks')) {
network::connection_manager::create_networks_list($cmanager);