diff options
-rwxr-xr-x | control-center | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/control-center b/control-center index 6d0f6b54..3e9d28e1 100755 --- a/control-center +++ b/control-center @@ -22,6 +22,7 @@ use Config; use POSIX; +use Data::Dumper; my $_xbindir = "/usr/X11R6/bin"; my $_bindir = "/usr/bin"; @@ -209,6 +210,7 @@ sub translate { sub exec_treeitem { my ($label, $exec_string, $available) = @_; $scrolled_global->set_usize($label eq _("Software Manager") ? 1 : 210, 0); + print "e exec_tree_item->[$nb_pages]\n" . (Data::Dumper->Dump([\@pid_launched], ['p'])); if (!$available) { my $vbox = new Gtk::VBox(0, 0); $vbox->pack_start( new Gtk::Label ( sprintf( _("The application cannot be loaded,\nthe file '%s' has not been found.\nTry to install it.", $exec_string))), 1, 0, 0); @@ -226,14 +228,15 @@ sub exec_treeitem { $notebook_global->append_page($socket, new Gtk::Label("")); $nb_pages++; $tree_launched{$label}->[0]=$nb_pages; +# print "hash label->[$nb_pages]\n" . (Data::Dumper->Dump([\@pid_launched], ['p'])); $notebook_global->set_page($nb_pages); $socket->realize; $socket->steal(launch_wait("rxvt", "rxvt",1)); $notebook_global->show_all(); - $notebook_global->set_page($nb_pages-1); + $notebook_global->set_page($nb_pages); +# print "l console exec_tree_item->[$nb_pages]\n" . (Data::Dumper->Dump([\@pid_launched], ['p'])); return; } - #$label eq _("Samba Conf") and system($exec_string . " & "), return; my $vbox = new Gtk::VBox(0, 0); $vbox->show; my $vbox2 = new Gtk::VBox(0, 0); @@ -297,32 +300,30 @@ sub exec_treeitem { sub launch_wait { my ($exec, $grep, $num, $zz) = @_; -# print "{{ $exec }}\n"; +# print "e launch_wait->[$nb_pages]\n" . (Data::Dumper->Dump([\@pid_launched], ['p'])); my $b = "xwininfo -root -tree -int | grep '" . $grep . "'"; my @before = split ('\n', `$b`); unless ($pid = fork) { - die(_("cannot fork: %s", $~)) unless defined $pid; + splash_warning(_("cannot fork: %s", $~)) unless defined $pid; exec($exec); } - $pid_launched[$nb_pages] = $pid; - $nb_pages++; + $pid_launched[$nb_pages-1] = $pid; +# print "e launch pid->[$nb_pages]\n" . (Data::Dumper->Dump([\@pid_launched], ['p'])); +# $nb_pages++; my $res = 0; while (!$res) { my @after = split ('\n', `$b`); while (@after ne ($num+@before)) { @after = split ('\n', `$b`); } - print "@after\n"; my $i = 0; my $c; foreach (@after) { -# print "[[" . $after[$i] . "]]\n" if !member($after[$i], @before); $c = $after[$i] if !member($after[$i], @before); $i++; } $c =~ /\s*([0-9]*)\s*/; $res=$1; -# print "[" . $res . "]\n"; } $res; } @@ -371,7 +372,7 @@ sub gtkcreate_png { sub quit_global { foreach(@pid_launched) { - kill TERM, $_; + kill TERM, $_ if (defined $_); } Gtk->exit(0); } |