summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/net_monitor
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-07-19 12:03:23 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-07-19 12:03:23 +0000
commit50903881fa52d8d8f03e6ef8b622937617281787 (patch)
tree741fc416dd31d96354fa2987673628cb66e8b4f9 /perl-install/standalone/net_monitor
parent8da1e377ab895bd8607f74a89c79d326b65aac6f (diff)
downloaddrakx-backup-do-not-use-50903881fa52d8d8f03e6ef8b622937617281787.tar
drakx-backup-do-not-use-50903881fa52d8d8f03e6ef8b622937617281787.tar.gz
drakx-backup-do-not-use-50903881fa52d8d8f03e6ef8b622937617281787.tar.bz2
drakx-backup-do-not-use-50903881fa52d8d8f03e6ef8b622937617281787.tar.xz
drakx-backup-do-not-use-50903881fa52d8d8f03e6ef8b622937617281787.zip
unsensitive buttons immediatly once ifup/isdown has completed
Diffstat (limited to 'perl-install/standalone/net_monitor')
-rwxr-xr-xperl-install/standalone/net_monitor21
1 files changed, 19 insertions, 2 deletions
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();
}
}