summaryrefslogtreecommitdiffstats
path: root/lib/network/signal_strength.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-05-25 15:39:46 +0000
committerOlivier Blin <oblin@mandriva.com>2007-05-25 15:39:46 +0000
commit1d37bfdbbe874abd6dcb5563eea19f531de09e1c (patch)
tree74845e43ed8fa59c7aaafd1a87efaa6b0c83c228 /lib/network/signal_strength.pm
parentc6ba983db7d5a82ee63599e775be0f8211447c72 (diff)
downloaddrakx-net-1d37bfdbbe874abd6dcb5563eea19f531de09e1c.tar
drakx-net-1d37bfdbbe874abd6dcb5563eea19f531de09e1c.tar.gz
drakx-net-1d37bfdbbe874abd6dcb5563eea19f531de09e1c.tar.bz2
drakx-net-1d37bfdbbe874abd6dcb5563eea19f531de09e1c.tar.xz
drakx-net-1d37bfdbbe874abd6dcb5563eea19f531de09e1c.zip
sync with 2007.1 (because of SVN loss)2007.1
Diffstat (limited to 'lib/network/signal_strength.pm')
-rw-r--r--lib/network/signal_strength.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/network/signal_strength.pm b/lib/network/signal_strength.pm
new file mode 100644
index 0000000..0fa891d
--- /dev/null
+++ b/lib/network/signal_strength.pm
@@ -0,0 +1,14 @@
+package network::signal_strength;
+
+use common;
+use ugtk2;
+
+my %pixbufs;
+
+sub get_strength_icon {
+ my ($network) = @_;
+ my $approx = 20 + min(80, int($network->{signal_strength}/20)*20);
+ return $pixbufs{$approx} ||= ugtk2::gtkcreate_pixbuf('wifi-' . sprintf('%03d', $approx) . '.png');
+}
+
+1;