summaryrefslogtreecommitdiffstats
path: root/control-center3
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2001-03-06 09:01:50 +0000
committerdamien <damien@mandriva.com>2001-03-06 09:01:50 +0000
commitada476f8242462a776d9ffb1abc9265992570632 (patch)
treebb2da0f6666578969e5ecf71efbca1a7805dcfde /control-center3
parent8245eaa1bc6a7efc233fc5f67aa22e2882024860 (diff)
downloadcontrol-center-ada476f8242462a776d9ffb1abc9265992570632.tar
control-center-ada476f8242462a776d9ffb1abc9265992570632.tar.gz
control-center-ada476f8242462a776d9ffb1abc9265992570632.tar.bz2
control-center-ada476f8242462a776d9ffb1abc9265992570632.tar.xz
control-center-ada476f8242462a776d9ffb1abc9265992570632.zip
updated
Diffstat (limited to 'control-center3')
-rwxr-xr-xcontrol-center343
1 files changed, 21 insertions, 22 deletions
diff --git a/control-center3 b/control-center3
index 2668f6b0..54ea8bcd 100755
--- a/control-center3
+++ b/control-center3
@@ -21,8 +21,6 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-use Gtk;
-use Gtk::Gdk::ImlibImage;
use Config;
use Env;
use POSIX;
@@ -35,6 +33,12 @@ Locale::GetText::textdomain ("DrakConf");
import Locale::GetText I_;
#*_ = *I_;
+my $_xbindir = "/usr/X11R6/bin";
+my $_bindir = "/usr/bin";
+my $_sbindir = "/usr/sbin";
+my $_iconsdir = "/usr/share/icons";
+my $_docdir = "/usr/share/doc";
+
sub _ {
my $s = shift @_; my $t = I_($s);
$t && ref $t or return sprintf $t, @_;
@@ -42,15 +46,14 @@ sub _ {
sprintf $T, @_[@p];
}
+!$ENV{DISPLAY} and exec ("$_sbindir/drakxconf; reset");
+
+require Gtk;
+require Gtk::Gdk::ImlibImage;
init Gtk;
Gtk::Gdk::ImlibImage->init;
use Data::Dumper;
-my $_xbindir = "/usr/X11R6/bin";
-my $_bindir = "/usr/bin";
-my $_sbindir = "/usr/sbin";
-my $_iconsdir = "/usr/share/icons";
-my $_docdir = "/usr/share/doc";
my %pixmaps_global;
my $xpm_path="$_iconsdir";
@@ -171,8 +174,10 @@ $SIG{USR1} = sub {
$SIG{TERM} = sub { quit_global(); }; # embedded applications will send me that signal in order to quit the cc.
my $global_vbox;
my $global_time_tag;
+my $lock_time_tag;
my $global_socket;
-$SIG{USR2} = sub { $$global_vbox->hide; Gtk->timeout_remove($global_time_tag); $$global_socket->show;
+$SIG{USR2} = sub { Gtk->timeout_remove($lock_time_tag);
+ $$global_vbox->hide; Gtk->timeout_remove($global_time_tag); $$global_socket->show;
${$tree_launched{$_}->[1]} and ${$tree_launched{$_}->[1]}->set_sensitive(1) foreach (keys %tree_launched);
};
@@ -225,12 +230,7 @@ sub gtkcreate_png {
($im->move_image(), $im->move_mask);
}
-sub quit_global
-{
- print _("Cleaning...\n");
- foreach (@pid_launched) {
- print "$_\n";
- }
+sub quit_global {
kill TERM, @pid_launched;
Gtk->exit(0);
}
@@ -440,14 +440,9 @@ Try to reinstall DrakConf.", $exec_string)), 1, 0, 0);
$global_socket = \$socket;
$vbox->pack_start($socket, 1, 1, 0);
$notebook_global->append_page($vbox, "");
- $pid_launched[$nb_pages] = undef;
$nb_pages++;
$tree_launched{$label}->[0]=$nb_pages;
$notebook_global->set_page($nb_pages);
- print "##[ $label ]#######" . Data::Dumper->Dump([ $tree_launched{$label} ], ['$t']) . "\n";
- print "##[ $label ]#######" . Data::Dumper->Dump([ ${$tree_launched{$label}->[1]} ], ['$t2']) . "\n";
- # ${$tree_launched{$label}->[1]}->set_sensitive(0);
- # print ("#########" . $tree_launched{$_}->[0] . "\n") foreach (keys %tree_launched);
$tree_launched{$_}->[0] or ${$tree_launched{$_}->[1]} and ${$tree_launched{$_}->[1]}->set_sensitive(0) foreach (keys %tree_launched);
my $anim_nb=0;
$global_time_tag = Gtk->timeout_add(120, sub {
@@ -460,18 +455,22 @@ Try to reinstall DrakConf.", $exec_string)), 1, 0, 0);
$anim_nb > 7 and $anim_nb=0;
1;
});
+ $lock_time_tag = Gtk->timeout_add(20000, sub {
+ Gtk->timeout_remove($global_time_tag);
+ ${$tree_launched{$_}->[1]} and ${$tree_launched{$_}->[1]}->set_sensitive(1) foreach (keys %tree_launched);
+ $vbox->pack_start(new Gtk::Label (_("After 20 sec., this application didn't appear.\nIt's probably buggy")), 1, 1, 0);
+ $label_->set(_("After 20 sec., this application didn't appear.\nIt's probably buggy")); $darea1->hide;
+ });
$socket->realize;
# $label->destroy;
- printf ("The XID of the sockets window nr. %s is [%s]\n", "", $socket->window->XWINDOW );
- printf ("My PID is [%s]\n", $$ );
my $a = $exec_string . " --embedded " . $socket->window->XWINDOW . " " . $$;
- print "$a\n";
my $pid;
#($pid = fork) ? $pid_launched[$nb_pages] = $pid : system($a) == 0 or splash_warning(_("couldn't exec $a: $!"));
unless ($pid = fork) {
splash_warning(_("cannot fork: $~")) unless defined $pid;
exec("$a");
}
+ $pid_launched[$nb_pages] = $pid;
} else {
$notebook_global->set_page($tree_launched{$label}->[0]);
}