summaryrefslogtreecommitdiffstats
path: root/lib/network/netcenter.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-09-19 22:33:30 +0000
committerOlivier Blin <oblin@mandriva.com>2007-09-19 22:33:30 +0000
commita4dccd8bed1783e7bf2f09bb382f26bb756fd931 (patch)
tree30d9430667ade98679808bf89b11137c5872fbd3 /lib/network/netcenter.pm
parentcac63e3f3c271eb24d31d0c943378899f275733f (diff)
downloaddrakx-net-a4dccd8bed1783e7bf2f09bb382f26bb756fd931.tar
drakx-net-a4dccd8bed1783e7bf2f09bb382f26bb756fd931.tar.gz
drakx-net-a4dccd8bed1783e7bf2f09bb382f26bb756fd931.tar.bz2
drakx-net-a4dccd8bed1783e7bf2f09bb382f26bb756fd931.tar.xz
drakx-net-a4dccd8bed1783e7bf2f09bb382f26bb756fd931.zip
update connection status on dbus event
Diffstat (limited to 'lib/network/netcenter.pm')
-rwxr-xr-xlib/network/netcenter.pm18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/network/netcenter.pm b/lib/network/netcenter.pm
index 9b0f884..880822c 100755
--- a/lib/network/netcenter.pm
+++ b/lib/network/netcenter.pm
@@ -35,7 +35,7 @@ sub build_cmanager {
}
sub main {
- my ($in, $net) = @_;
+ my ($in, $net, $dbus) = @_;
my $title = N("Network Center");
my $icon = '/usr/share/mcc/themes/default/drakroam-mdk.png';
@@ -126,6 +126,22 @@ sub main {
]),
);
+ if ($dbus) {
+ my $monitor;
+ eval { $monitor = network::monitor->new($dbus) };
+ $dbus->{connection}->add_filter(sub {
+ my ($_con, $msg) = @_;
+ if ($msg->get_member eq 'status') {
+ my ($status, $interface) = $msg->get_args_list;
+ my $cmanager = find { $_->{connection}->get_interface eq $interface } @cmanagers
+ or return;
+ network::connection_manager::update_on_status_change($cmanager);
+ }
+ });
+ $dbus->{connection}->add_match("type='signal',interface='com.mandriva.network'");
+ dbus_object::set_gtk2_watch_helper($dbus);
+ }
+
my $base_color = $w->{window}->get_style->base('normal')->to_string;
Gtk2::Rc->parse_string(<<END);
style "netcenter_bg" {