From 197d0726845097104132ed12576270fbb8f4c1d8 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 28 May 2008 12:57:20 +0000 Subject: extract some variables (for next commit) --- lib/network/connection_manager.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/network/connection_manager.pm b/lib/network/connection_manager.pm index 388589e..124a423 100644 --- a/lib/network/connection_manager.pm +++ b/lib/network/connection_manager.pm @@ -309,11 +309,14 @@ sub update_networks { my @networks = filter_networks($cmanager->{connection}); foreach my $network (@networks) { my $ap = $network->{ap}; + my $connected_pixbuf = $network->{current} ? $connected ? $cmanager->{gui}{pixbufs}{state}{connected} : $cmanager->{gui}{pixbufs}{state}{refresh} : undef; + my $network_name = !$network->{essid} && exists $cmanager->{net}{wireless}{$ap} && $cmanager->{net}{wireless}{$ap}{WIRELESS_ESSID} || $network->{name}; + my $strength_pixbuf = network::signal_strength::get_strength_icon($network); push @{$cmanager->{gui}{networks_list}{data}}, [ $ap || $network->{name}, - $network->{current} ? $connected ? $cmanager->{gui}{pixbufs}{state}{connected} : $cmanager->{gui}{pixbufs}{state}{refresh} : undef, - !$network->{essid} && exists $cmanager->{net}{wireless}{$ap} && $cmanager->{net}{wireless}{$ap}{WIRELESS_ESSID} || $network->{name}, - network::signal_strength::get_strength_icon($network), + $connected_pixbuf, + $network_name, + $strength_pixbuf, $cmanager->{gui}{pixbufs}{encryption}{$network->{flags} =~ /WPA/i ? 'strong' : $network->{flags} =~ /WEP/i ? 'weak' : 'open'}, $network->{mode}, ]; -- cgit v1.2.1