diff options
author | Olivier Blin <oblin@mandriva.com> | 2007-08-20 20:20:25 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2007-08-20 20:20:25 +0000 |
commit | 1cea8488e9dafbf723dbc4873018945a4ceed44a (patch) | |
tree | 49164f09c8cc9ed7cb5f653e649b586ad019e44c /lib | |
parent | 7c28d27ee6c78e0b11c744fc80f11f1512d92725 (diff) | |
download | drakx-net-1cea8488e9dafbf723dbc4873018945a4ceed44a.tar drakx-net-1cea8488e9dafbf723dbc4873018945a4ceed44a.tar.gz drakx-net-1cea8488e9dafbf723dbc4873018945a4ceed44a.tar.bz2 drakx-net-1cea8488e9dafbf723dbc4873018945a4ceed44a.tar.xz drakx-net-1cea8488e9dafbf723dbc4873018945a4ceed44a.zip |
split status bar code from dbus code
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/network/drakroam.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/network/drakroam.pm b/lib/network/drakroam.pm index fabc850..d8e21e4 100755 --- a/lib/network/drakroam.pm +++ b/lib/network/drakroam.pm @@ -81,14 +81,18 @@ sub create_drakroam_gui { my $status_bar = Gtk2::Statusbar->new; my $status_bar_cid = $status_bar->get_context_id("Network event"); + $droam->{on_network_event} = sub { + my ($message) = @_; + my $m_id = $status_bar->push($status_bar_cid, $message); + Glib::Timeout->add(20000, sub { $status_bar->remove($status_bar_cid, $m_id); 0 }); + }; if ($dbus) { eval { $droam->{net}{monitor} = network::monitor->new($dbus) }; $dbus->{connection}->add_filter(sub { my ($_con, $msg) = @_; my $member = $msg->get_member; my $message = get_network_event_message($droam, $member, $msg->get_args_list) or return; - my $m_id = $status_bar->push($status_bar_cid, $message); - Glib::Timeout->add(20000, sub { $status_bar->remove($status_bar_cid, $m_id); 0 }); + $droam->{on_network_event}($message) if $droam->{on_network_event}; network::connection_manager::update_networks($droam) if $member eq 'status'; }); $dbus->{connection}->add_match("type='signal',interface='com.mandriva.network'"); |