From 7e07e65aedba8f96e6d25b6e95370199f90fa4c2 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 10 Sep 2007 11:54:14 +0000 Subject: add get_status_icon() --- lib/network/connection.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/network') diff --git a/lib/network/connection.pm b/lib/network/connection.pm index fbe29dc..75564e0 100644 --- a/lib/network/connection.pm +++ b/lib/network/connection.pm @@ -90,6 +90,19 @@ sub get_status { $self->{status} = to_bool($gw_address); } +=item get_status_icon() + +Get status icon path (connected/disconnected/unconfigured) + +=cut + +sub get_status_icon { + my ($self) = @_; + my $icon = $self->get_type_icon; + my $status = $self->get_interface ? $self->get_status ? "on" : "off" : "w"; + $icon . "-" . $status; +} + sub get_ifcfg_bool { my ($self, $field) = @_; defined $self->{ifcfg}{$field} ? text2bool($self->{ifcfg}{$field}) : undef; -- cgit v1.2.1