From 3dc4f28c116fb76dfa82b039fa684a96a6f37610 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 19 Sep 2007 22:38:37 +0000 Subject: update status icon on connection change --- lib/network/connection_manager.pm | 6 ++++++ lib/network/netcenter.pm | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/network') diff --git a/lib/network/connection_manager.pm b/lib/network/connection_manager.pm index 9f12b77..1e6e68c 100644 --- a/lib/network/connection_manager.pm +++ b/lib/network/connection_manager.pm @@ -277,6 +277,12 @@ sub update_on_status_change { (!$cmanager->{connection}->can('get_networks') || $cmanager->{connection}{network}); $cmanager->{gui}{buttons}{configure}->set_sensitive($may_have_network) if $cmanager->{gui}{buttons}{configure}; + + if ($cmanager->{gui}{status_image} && $cmanager->{connection}) { + my $icon = $cmanager->{connection}->get_status_icon; + ugtk2::_find_imgfile($icon) or $icon = $cmanager->{connection}->get_type_icon; + gtkset($cmanager->{gui}{status_image}, file => $icon); + } } 1; diff --git a/lib/network/netcenter.pm b/lib/network/netcenter.pm index 880822c..a4ac43a 100755 --- a/lib/network/netcenter.pm +++ b/lib/network/netcenter.pm @@ -58,10 +58,8 @@ sub main { child => gtknew('VBox', spacing => 5, children_tight => [ map_index { my $cmanager = $cmanagers[$::i]; - my $icon = $_->get_status_icon; - ugtk2::_find_imgfile($icon) or $icon = $_->get_type_icon; my $head = gtknew('HBox', children => [ - 0, gtknew('Image', file => $icon), + 0, $cmanager->{gui}{status_image} = gtknew('Image'), 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