From 8b65fe2d1e3a0bdc4079be430634475586ce148c Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 10 Sep 2007 12:35:30 +0000 Subject: fallback on type icon if no status icon is available --- lib/network/connection.pm | 1 + lib/network/netcenter.pm | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/network/connection.pm b/lib/network/connection.pm index 75564e0..cf3d14c 100644 --- a/lib/network/connection.pm +++ b/lib/network/connection.pm @@ -93,6 +93,7 @@ sub get_status { =item get_status_icon() Get status icon path (connected/disconnected/unconfigured) +The file may not exist =cut diff --git a/lib/network/netcenter.pm b/lib/network/netcenter.pm index 80b5909..c779bf8 100755 --- a/lib/network/netcenter.pm +++ b/lib/network/netcenter.pm @@ -57,8 +57,10 @@ sub main { child => gtknew('VBox', spacing => 5, children_tight => [ map_index { my $cmanager = build_cmanager($in, $net, $w, $pixbufs, $_); + my $icon = $_->get_status_icon; + ugtk2::_find_imgfile($icon) or $icon = $_->get_type_icon; my $head = gtknew('HBox', children => [ - 0, gtknew('Image', file => $_->get_status_icon), + 0, gtknew('Image', file => $icon), 0, gtknew('Label', padding => [ 5, 0 ]), 1, gtknew('Label', ellipsize => 'end', alignment => [ 0, 0 ], text_markup => '' . $_->get_description . ''), 0, gtknew('Label', padding => [ 2, 0 ]), -- cgit v1.2.1