summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcontrol-center354
1 files changed, 31 insertions, 23 deletions
diff --git a/control-center3 b/control-center3
index 7bddbb88..982e6f53 100755
--- a/control-center3
+++ b/control-center3
@@ -159,14 +159,15 @@ my %tree_exec = (_("Boot Loader") => "$_sbindir/drakboot", _("Boot Disk") => "$_
);
my @pid_launched;
-my %tree_launched = (_("Boot Loader") => -1, _("Boot Disk") => -1,
- _("Boot Logo") => -1 , _("XFDrake") => -1 ,
- _("HardDrake") => -1 , _("Mousedrake") => -1 ,
- _("Printerdrake") => -1 , _("Keyboarddrake") => -1 ,
- _("Userdrake") => -1 , _("Draknet") => -1 ,
- _("Drakgw") => -1 , _("Menudrake") => -1 ,
- _("Drakfont") => -1
- );
+my %tree_launched;
+# = (_("Boot Loader") => [-1, 0], _("Boot Disk") => [-1, 0],
+# _("Boot Logo") => [-1, 0] , _("XFDrake") => [-1, 0] ,
+# _("HardDrake") => [-1, 0] , _("Mousedrake") => [-1, 0] ,
+# _("Printerdrake") => [-1, 0] , _("Keyboarddrake") => [-1, 0] ,
+# _("Userdrake") => [-1, 0] , _("Draknet") => [-1, 0] ,
+# _("Drakgw") => [-1, 0] , _("Menudrake") => [-1, 0] ,
+# _("Drakfont") => [-1, 0]
+# );
#exec_treeitem("harddrake-auth",4);
my $rc = "control-center.rc";
@@ -178,7 +179,9 @@ $SIG{TERM} = sub { quit_global(); }; # embedded applications will send me that s
my $global_vbox;
my $global_time_tag;
my $global_socket;
-$SIG{USR2} = sub { $$global_vbox->hide; Gtk->timeout_remove($global_time_tag); $$global_socket->show; };
+$SIG{USR2} = sub { $$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);
+ };
my $pix_dbl = new Gtk::Gdk::Pixmap($darea1->window, 540,460);
draw_exposed($pix_dbl);
@@ -344,11 +347,11 @@ sub create_tree_item
my ($treeitem, $treebox, $new_subtree);
$treeitem = new Gtk::TreeItem();
- $treeitem_selected=$treeitem;
$treebox = xpm_label_box($window_global,$pixmap,$label);
$treeitem->add($treebox);
$treebox->show();
if ($tree_depth_max == 0) {
+ $tree_launched{$label}->[1]=\$treeitem;
# $treeitem->signal_connect('clicked', sub { exec_treeitem($label, $tree_exec{$label});});
$treeitem->signal_connect('select', sub { exec_treeitem($label, $tree_exec{$label}); });
} else {
@@ -426,7 +429,7 @@ sub xpm_label_box
sub exec_treeitem {
my ($label, $exec_string) = @_;
if ($exec_string) {
- if ($tree_launched{$label}==-1) {
+ if (!$tree_launched{$label}->[0]) {
my $vbox = new Gtk::VBox(0, 0);
$vbox->show;
my $vbox2 = new Gtk::VBox(0, 0);
@@ -441,6 +444,22 @@ sub exec_treeitem {
$darea1->set_usize(70,70);
$hbox->pack_start($darea1,1,0,0);
$darea1->show;
+# my $label = new Gtk::Label "Please be patient";
+# $vbox->pack_start( $label, 0, 0, 0);
+# $label->show;
+ my $socket = new Gtk::Socket;
+ $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 {
$darea1->window->draw_pixmap
@@ -452,13 +471,6 @@ sub exec_treeitem {
$anim_nb > 7 and $anim_nb=0;
1;
});
-# my $label = new Gtk::Label "Please be patient";
-# $vbox->pack_start( $label, 0, 0, 0);
-# $label->show;
- my $socket = new Gtk::Socket;
- $global_socket = \$socket;
- $vbox->pack_start($socket, 1, 1, 0);
- $notebook_global->append_page($vbox, "");
$socket->realize;
# $label->destroy;
printf ("The XID of the sockets window nr. %s is [%s]\n", "", $socket->window->XWINDOW );
@@ -471,12 +483,8 @@ sub exec_treeitem {
splash_warning(_("cannot fork: $~")) unless defined $pid;
exec("$a");
}
- $pid_launched[$nb_pages] = undef;
- $nb_pages++;
- $tree_launched{$label}=$nb_pages;
- $notebook_global->set_page($nb_pages);
} else {
- $notebook_global->set_page($tree_launched{$label});
+ $notebook_global->set_page($tree_launched{$label}->[0]);
}
}
}