From 50903881fa52d8d8f03e6ef8b622937617281787 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 19 Jul 2004 12:03:23 +0000 Subject: unsensitive buttons immediatly once ifup/isdown has completed --- perl-install/standalone/net_monitor | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'perl-install/standalone') diff --git a/perl-install/standalone/net_monitor b/perl-install/standalone/net_monitor index b001235d2..1f59d0024 100755 --- a/perl-install/standalone/net_monitor +++ b/perl-install/standalone/net_monitor @@ -32,6 +32,7 @@ use common; use network::netconnect; use network::tools; use MDK::Common::Globals "network", qw($in); +use POSIX; if ("@ARGV" =~ /--status/) { print connected(); exit(0) } my $force = "@ARGV" =~ /--force/; @@ -142,6 +143,22 @@ Glib::Source->remove($time_tag2); $time_tag2 = Glib::Timeout->add(20000, \&update); connection() if $connect && !$isconnected || $disconnect && $isconnected; + +my $tool_pid; + +$SIG{CHLD} = sub { + my $child_pid; + do { + $child_pid = waitpid(-1, POSIX::WNOHANG); + if ($tool_pid eq $child_pid) { + undef $tool_pid; + $button_connect->set_sensitive(1); + $button_close->set_sensitive(1); + } + } while $child_pid > 0; +}; + + $window1->main; ugtk2->exit(0); @@ -236,9 +253,9 @@ sub connection() { gtkflush(); if ($wasconnected == 1) { - stop_connection(); + $tool_pid = stop_connection(); } else { - start_connection(); + $tool_pid = start_connection(); } } -- cgit v1.2.1