diff options
author | Olivier Blin <oblin@mandriva.com> | 2009-02-25 16:23:36 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2009-02-25 16:23:36 +0000 |
commit | 357a13c8cfcb793b57d732a4c3684c081c952df8 (patch) | |
tree | 16e6b343a1730b8859c5655178af4b4f776549ec | |
parent | fcb4e42f06430b87c5fc7fcf9ebc21ea001c782a (diff) | |
download | drakx-net-357a13c8cfcb793b57d732a4c3684c081c952df8.tar drakx-net-357a13c8cfcb793b57d732a4c3684c081c952df8.tar.gz drakx-net-357a13c8cfcb793b57d732a4c3684c081c952df8.tar.bz2 drakx-net-357a13c8cfcb793b57d732a4c3684c081c952df8.tar.xz drakx-net-357a13c8cfcb793b57d732a4c3684c081c952df8.zip |
move wireless status code in generic dbus handling (to support it in drakroam too)
-rw-r--r-- | lib/network/connection_manager.pm | 14 | ||||
-rwxr-xr-x | lib/network/netcenter.pm | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/lib/network/connection_manager.pm b/lib/network/connection_manager.pm index eb6614c..a038838 100644 --- a/lib/network/connection_manager.pm +++ b/lib/network/connection_manager.pm @@ -453,8 +453,22 @@ sub setup_dbus_handlers { or return; $cmanager->update_networks if $member eq 'status'; } + if ($msg->get_interface eq 'com.mandriva.monitoring.wireless' && $msg->get_member eq 'Event') { + my ($event, $interface) = $msg->get_args_list; + print "got wireless event: $event $interface\n"; + my $cmanager = find { $_->{connection}->get_interface eq $interface } @$cmanagers; + if ($cmanager && $cmanager->{wait_message}) { + if ($event =~ /CTRL-EVENT-CONNECTED/) { + undef $cmanager->{wait_message}; + } elsif ($event =~ /Authentication with (.+?) timed out/) { + undef $cmanager->{wait_message}; + $cmanager->{in}->ask_warn(N("Error"), N("Connection failed.")); + } + } + } }); $dbus->{connection}->add_match("type='signal',interface='com.mandriva.network'"); + $dbus->{connection}->add_match("type='signal',interface='com.mandriva.monitoring.wireless'"); dbus_object::set_gtk2_watch_helper($dbus); } diff --git a/lib/network/netcenter.pm b/lib/network/netcenter.pm index feaa69b..a68107c 100755 --- a/lib/network/netcenter.pm +++ b/lib/network/netcenter.pm @@ -205,21 +205,7 @@ sub main { $cmanager->network::connection_manager::update_on_status_change; } } - if ($msg->get_interface eq 'com.mandriva.monitoring.wireless' && $msg->get_member eq 'Event') { - my ($event, $interface) = $msg->get_args_list; - print "got wireless event: $event $interface\n"; - my $cmanager = find { $_->{connection}->get_interface eq $interface } @cmanagers; - if ($cmanager && $cmanager->{wait_message}) { - if ($event =~ /CTRL-EVENT-CONNECTED/) { - undef $cmanager->{wait_message}; - } elsif ($event =~ /Authentication with (.+?) timed out/) { - undef $cmanager->{wait_message}; - $cmanager->{in}->ask_warn(N("Error"), N("Connection failed.")); - } - } - } }); - $dbus->{connection}->add_match("type='signal',interface='com.mandriva.monitoring.wireless'"); } network::connection_manager::setup_dbus_handlers(\@cmanagers, \@connections, undef, $dbus) if $dbus; |