diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-12-15 11:59:08 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-12-15 11:59:08 +0000 |
commit | 12903bc3c97a7e39a130ffc9b07631186fb7c9ba (patch) | |
tree | 79719b3ee69a72a9aa5dd6ec392a0771fba58f5a /lib | |
parent | 78b07f05660628e6d00efe69022c2c1248b79df4 (diff) | |
download | drakx-net-12903bc3c97a7e39a130ffc9b07631186fb7c9ba.tar drakx-net-12903bc3c97a7e39a130ffc9b07631186fb7c9ba.tar.gz drakx-net-12903bc3c97a7e39a130ffc9b07631186fb7c9ba.tar.bz2 drakx-net-12903bc3c97a7e39a130ffc9b07631186fb7c9ba.tar.xz drakx-net-12903bc3c97a7e39a130ffc9b07631186fb7c9ba.zip |
keep wireless wait messages while wpa_supplicant is associating
Diffstat (limited to 'lib')
-rw-r--r-- | lib/network/connection_manager.pm | 6 | ||||
-rwxr-xr-x | lib/network/netcenter.pm | 10 |
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/network/connection_manager.pm b/lib/network/connection_manager.pm index a3cfe41..05f345e 100644 --- a/lib/network/connection_manager.pm +++ b/lib/network/connection_manager.pm @@ -199,7 +199,7 @@ sub start_connection { } gtkset_mousecursor_wait($cmanager->{gui}{w}{window}->window); - my $_wait = $cmanager->{in}->wait_message(N("Please wait"), N("Connecting...")); + my $wait = $cmanager->{in}->wait_message(N("Please wait"), N("Connecting...")); if ($cmanager->{connection}->can('apply_network_selection')) { $cmanager->load_settings; $cmanager->{connection}->apply_network_selection($cmanager); @@ -210,6 +210,10 @@ sub start_connection { gtkset_mousecursor_normal($cmanager->{gui}{w}{window}->window); $cmanager->update_on_status_change; + if ($cmanager->{wait_message_timeout}) { + $cmanager->{wait_message} = $wait; + Glib::Timeout->add($cmanager->{wait_message_timeout}, sub { undef $cmanager->{wait_message} }); + }; } sub stop_connection { diff --git a/lib/network/netcenter.pm b/lib/network/netcenter.pm index 5e170d9..a43c52a 100755 --- a/lib/network/netcenter.pm +++ b/lib/network/netcenter.pm @@ -18,6 +18,7 @@ sub build_cmanager { my $cmanager = network::connection_manager->new($in, $net, $w, $pixbufs); $cmanager->set_connection($connection); $cmanager->{gui}{show_unique_network} = $cmanager->{connection}->has_unique_network; + $cmanager->{wait_message_timeout} = 20*1000 if ref($connection) eq 'network::connection::wireless' && $net->{monitor}; if ($connection->can('get_networks')) { $cmanager->create_networks_list; @@ -198,6 +199,15 @@ sub main { 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'"); |