diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-11-17 15:45:50 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-11-17 15:45:50 +0000 |
commit | 28f9049aa073ad391ae897e4c717157a776bfae4 (patch) | |
tree | 2f26651c16672dd7ce3f7685ad8e7cc5b4876829 /bin/net_applet | |
parent | 03aa639ead519a79036050f595ecee21c9b2cba4 (diff) | |
download | drakx-net-28f9049aa073ad391ae897e4c717157a776bfae4.tar drakx-net-28f9049aa073ad391ae897e4c717157a776bfae4.tar.gz drakx-net-28f9049aa073ad391ae897e4c717157a776bfae4.tar.bz2 drakx-net-28f9049aa073ad391ae897e4c717157a776bfae4.tar.xz drakx-net-28f9049aa073ad391ae897e4c717157a776bfae4.zip |
extract get_interface_icon
Diffstat (limited to 'bin/net_applet')
-rwxr-xr-x | bin/net_applet | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bin/net_applet b/bin/net_applet index 6cd4ef2..9b24aae 100755 --- a/bin/net_applet +++ b/bin/net_applet @@ -110,6 +110,12 @@ sub get_interface_type { $ifcfg && network::connection->find_ifcfg_type($ifcfg); } +sub get_interface_icon { + my ($interface) = @_; + my $type = get_interface_type($interface); + $type && $type->get_type_icon; +} + sub get_interface_name { my ($interface) = @_; my $type = get_interface_type($interface); @@ -147,12 +153,7 @@ my %actions = ( $is_up; }, format_choice => sub { get_interface_name($_[0]) }, - get_icon => sub { - my $ifcfg = $net->{ifcfg}{$_[0]}; - require network::connection; - my $type = $ifcfg && network::connection->find_ifcfg_type($ifcfg); - $type && $type->get_type_icon; - }, + get_icon => \&get_interface_icon, launch => sub { my ($is_up, $_gw) = network::tools::get_interface_status($_[0]); if ($is_up) { |