summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-08-10 09:00:49 +0000
committerOlivier Blin <oblin@mandriva.org>2005-08-10 09:00:49 +0000
commit16d600d0009a680ee936c749cbbe155bb1c17dc8 (patch)
treed7fe7d4de98f9339bd70353017cfde362096a5c1
parent6245035b3104b41bb57a1326006cc3eb71b741a7 (diff)
downloaddrakx-backup-do-not-use-16d600d0009a680ee936c749cbbe155bb1c17dc8.tar
drakx-backup-do-not-use-16d600d0009a680ee936c749cbbe155bb1c17dc8.tar.gz
drakx-backup-do-not-use-16d600d0009a680ee936c749cbbe155bb1c17dc8.tar.bz2
drakx-backup-do-not-use-16d600d0009a680ee936c749cbbe155bb1c17dc8.tar.xz
drakx-backup-do-not-use-16d600d0009a680ee936c749cbbe155bb1c17dc8.zip
compute approx_level in network::monitor::list_wireless
-rw-r--r--perl-install/network/monitor.pm1
-rw-r--r--perl-install/standalone/net_applet3
2 files changed, 2 insertions, 2 deletions
diff --git a/perl-install/network/monitor.pm b/perl-install/network/monitor.pm
index 08fc4c971..eea814bc8 100644
--- a/perl-install/network/monitor.pm
+++ b/perl-install/network/monitor.pm
@@ -22,6 +22,7 @@ sub list_wireless {
#- bssid / frequency / signal level / flags / ssid
while ($results =~ /^((?:[0-9a-f]{2}:){5}[0-9a-f]{2})\t(\d+)\t(\d+)\t(.*?)\t(.*)$/mg) {
$networks{$1} = { frequency => $2, signal_level => $3, flags => $4, ssid => $5 };
+ $networks{$1}{approx_level} = 20 + min(80, int($3/20)*20);
}
my $list;
eval { $list = $o->call_method('ListNetworks') };
diff --git a/perl-install/standalone/net_applet b/perl-install/standalone/net_applet
index 39c7bd80e..087a121c5 100644
--- a/perl-install/standalone/net_applet
+++ b/perl-install/standalone/net_applet
@@ -171,8 +171,7 @@ sub update_wireless_item {
my ($net, $ap_address) = @_;
$net->{ssid_label}->set_text($net->{ssid} || "[$ap_address]");
$net->{keyring_image}->visible(defined $net->{flags});
- my $approx_level = 20 + int(min($net->{signal_level}, 80)/20)*20;
- $net->{level_image}->set_from_pixbuf($pixbufs{link_level}{$approx_level});
+ $net->{level_image}->set_from_pixbuf($pixbufs{link_level}{$net->{approx_level}});
$net->{menuitem}->signal_handler_block($net->{activate});
$net->{menuitem}->set_active($net->{current});