diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-11-17 11:30:54 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-11-17 11:30:54 +0000 |
commit | 765bccebb7ac1efc08549b6a191f1ac66529cd18 (patch) | |
tree | 287e91c848125e7c837617a8d46add307955b1c6 /lib/network/netcenter.pm | |
parent | 14a85cbcffcc8835d5032167613ce2c87d71498a (diff) | |
download | drakx-net-765bccebb7ac1efc08549b6a191f1ac66529cd18.tar drakx-net-765bccebb7ac1efc08549b6a191f1ac66529cd18.tar.gz drakx-net-765bccebb7ac1efc08549b6a191f1ac66529cd18.tar.bz2 drakx-net-765bccebb7ac1efc08549b6a191f1ac66529cd18.tar.xz drakx-net-765bccebb7ac1efc08549b6a191f1ac66529cd18.zip |
extract get_connections
Diffstat (limited to 'lib/network/netcenter.pm')
-rwxr-xr-x | lib/network/netcenter.pm | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/network/netcenter.pm b/lib/network/netcenter.pm index 20c4a9f..285d3e0 100755 --- a/lib/network/netcenter.pm +++ b/lib/network/netcenter.pm @@ -115,6 +115,18 @@ sub build_cmanager_box { $box; } +sub get_connections() { + my @all_connections = map { $_->get_connections(automatic_only => 1, fast_only => 1) } network::connection::get_types; + @all_connections = grep { !network::tools::is_zeroconf_interface($_->get_interface) } @all_connections; + my ($sysfs, $no_sysfs) = partition { exists $_->{device}{sysfs_device} } @all_connections; + my ($real, $other) = partition { network::tools::is_real_interface($_->get_interface) } @$sysfs; + ( + (uniq_ { $_->{device}{sysfs_device} } @$real), + (uniq_ { $_->{device}{sysfs_device} } @$other), + (uniq_ { $_->{device}{interface} } @$no_sysfs), + ); +} + sub main { my ($in, $net, $dbus) = @_; @@ -128,15 +140,7 @@ sub main { #- so that transient_for is defined, for wait messages and popups to be centered $::main_window = $w->{real_window}; - my @all_connections = map { $_->get_connections(automatic_only => 1, fast_only => 1) } network::connection::get_types; - @all_connections = grep { !network::tools::is_zeroconf_interface($_->get_interface) } @all_connections; - my ($sysfs, $no_sysfs) = partition { exists $_->{device}{sysfs_device} } @all_connections; - my ($real, $other) = partition { network::tools::is_real_interface($_->get_interface) } @$sysfs; - my @connections = ( - (uniq_ { $_->{device}{sysfs_device} } @$real), - (uniq_ { $_->{device}{sysfs_device} } @$other), - (uniq_ { $_->{device}{interface} } @$no_sysfs), - ); + my @connections = get_connections(); my $pixbufs = network::connection_manager::create_pixbufs(); my @cmanagers = map { build_cmanager($in, $net, $w, $pixbufs, $_) } @connections; |