From 8a427e6a327c5accfb420a37ee3ec193970a3a08 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 19 Sep 2007 23:19:39 +0000 Subject: do not hardcode icon size in get_type_icon implementation, make it optional --- lib/network/connection.pm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'lib/network/connection.pm') diff --git a/lib/network/connection.pm b/lib/network/connection.pm index cf3d14c..570935b 100644 --- a/lib/network/connection.pm +++ b/lib/network/connection.pm @@ -25,7 +25,12 @@ Get the connection type icon path =cut -sub get_type_icon() { '/usr/share/mcc/themes/default/drakconnect-mdk' } +sub get_type_icon { + my ($self, $o_size) = @_; + my $size = $o_size || 24; + my $icon = eval { $self->_get_type_icon . '-' . $size }; + $icon || '/usr/share/mcc/themes/default/drakconnect-mdk'; +} =item get_devices() @@ -248,4 +253,16 @@ sub get_status_message { }->{$status}; } +=head2 Pure virtual private instance methods + +=over + +=item _get_type_icon + +Get the icon prefix for the connection type + +=back + +=cut + 1; -- cgit v1.2.1