diff options
author | Olivier Blin <oblin@mandriva.com> | 2007-09-10 11:54:14 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2007-09-10 11:54:14 +0000 |
commit | 7e07e65aedba8f96e6d25b6e95370199f90fa4c2 (patch) | |
tree | 37646cb371c88eb3efa2883dd99c0d274e83345b /lib/network/connection.pm | |
parent | 9fcc5e9b2a10a1c4d4f82a48359e5f6137948a72 (diff) | |
download | drakx-net-7e07e65aedba8f96e6d25b6e95370199f90fa4c2.tar drakx-net-7e07e65aedba8f96e6d25b6e95370199f90fa4c2.tar.gz drakx-net-7e07e65aedba8f96e6d25b6e95370199f90fa4c2.tar.bz2 drakx-net-7e07e65aedba8f96e6d25b6e95370199f90fa4c2.tar.xz drakx-net-7e07e65aedba8f96e6d25b6e95370199f90fa4c2.zip |
add get_status_icon()
Diffstat (limited to 'lib/network/connection.pm')
-rw-r--r-- | lib/network/connection.pm | 13 |
1 files changed, 13 insertions, 0 deletions
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; |