diff options
author | damien <damien@mandriva.com> | 2001-02-08 14:35:20 +0000 |
---|---|---|
committer | damien <damien@mandriva.com> | 2001-02-08 14:35:20 +0000 |
commit | 3046ac1206698d014a5dd2b1dbda7045acbb98c6 (patch) | |
tree | 5153928d2b2f36b7fb2cec13ca469e01b8c3ce56 /control-center3 | |
parent | c56fc59bba121fd2aa6e3227a16a8e2476e89176 (diff) | |
download | control-center-3046ac1206698d014a5dd2b1dbda7045acbb98c6.tar control-center-3046ac1206698d014a5dd2b1dbda7045acbb98c6.tar.gz control-center-3046ac1206698d014a5dd2b1dbda7045acbb98c6.tar.bz2 control-center-3046ac1206698d014a5dd2b1dbda7045acbb98c6.tar.xz control-center-3046ac1206698d014a5dd2b1dbda7045acbb98c6.zip |
built package, ...
Diffstat (limited to 'control-center3')
-rwxr-xr-x | control-center3 | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/control-center3 b/control-center3 index b477f8b3..f7484d68 100755 --- a/control-center3 +++ b/control-center3 @@ -29,10 +29,11 @@ init Gtk; use Data::Dumper; my %pixmaps_global; -my $xpm_path="pixmaps"; +my $xpm_path="/usr/share/icons/"; my $tree_depth_max = 1; my @treeitem_sub; +my $nb_pages=0; my $window_global = new Gtk::Window -toplevel; $window_global->set_usize(800, 600); $window_global->signal_connect ( delete_event => sub { Gtk->exit(0); }); @@ -192,6 +193,14 @@ map { "Drakgw" => "drakgw" , "Menudrake" => "menudrake" , "Drakfont" => "drakfont" ); +%tree_launched = ("Drakboot" => -1, "Drakfloppy" => -1, + "Drakelogo" => -1 , "xfdrake" => -1 , + "Hardrake" => -1 , "Mousedrake" => -1 , + "Printdrake" => -1 , "Kbddrake" => -1 , + "Userdrake" => -1 , "Draknet" => -1 , + "Drakgw" => -1 , "Menudrake" => -1 , "Drakfont" => -1 + ); + #exec_treeitem("harddrake-auth",4); my $rc = "control-center.rc"; Gtk::Rc->parse($rc); @@ -239,7 +248,7 @@ sub create_tree_item() $treeitem->add($treebox); $treebox->show(); if ($tree_depth_max == 0) { - $treeitem->signal_connect('select', sub { exec_treeitem($tree_exec{$label},1);}); + $treeitem->signal_connect('select', sub { exec_treeitem($label, $tree_exec{$label});}); } $parent_tree->append($treeitem); $treeitem->show(); @@ -288,20 +297,28 @@ sub xpm_label_box return ( $box ); } - sub exec_treeitem { - my ($exec_string,$num) = @_; - + my ($label, $exec_string) = @_; +#exec_treeitem($tree_exec{$label},1);}); if ($exec_string) { - my $socket = new Gtk::Socket; - $socket->show; - $notebook_global->append_page($socket, ""); - $socket->realize; - print ("The XID of the sockets window n° is [" . $socket->window->XWINDOW . "]\nMy PID is [" . $$ . "]\n"); - my $a = $exec_string . " --embedded " . $socket->window->XWINDOW . " " . $$ . "&"; - print "$a\n"; - system ($a); - $notebook_global->set_page($num); + print "SELECTED\n"; + if ($tree_launched{$label}==-1) { + print "yes\n"; + my $socket = new Gtk::Socket; + $socket->show; + $notebook_global->append_page($socket, ""); + $socket->realize; + print ("The XID of the sockets window n° is [" . $socket->window->XWINDOW . "]\nMy PID is [" . $$ . "]\n"); + my $a = $exec_string . " --embedded " . $socket->window->XWINDOW . " " . $$ . "&"; + print "$a\n"; + system ($a); + $nb_pages++; + $tree_launched{$label}=$nb_pages; + $notebook_global->set_page($nb_pages); + } else { + print "no\n"; + $notebook_global->set_page($tree_launched{$label}); + } } } |