diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2002-11-27 09:38:28 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2002-11-27 09:38:28 +0000 |
commit | 57363b5e8992038bf7b89e522efc6cedaab338e0 (patch) | |
tree | c04e528c77497a2d352d0d186eeb9df2ee8d4755 | |
parent | db7ba978d386aec77f760e3a9e2838cf121c5475 (diff) | |
download | control-center-57363b5e8992038bf7b89e522efc6cedaab338e0.tar control-center-57363b5e8992038bf7b89e522efc6cedaab338e0.tar.gz control-center-57363b5e8992038bf7b89e522efc6cedaab338e0.tar.bz2 control-center-57363b5e8992038bf7b89e522efc6cedaab338e0.tar.xz control-center-57363b5e8992038bf7b89e522efc6cedaab338e0.zip |
*** empty log message ***
-rw-r--r-- | ChangeLog | 27 | ||||
-rwxr-xr-x | cest_ton_boot | 223 | ||||
-rwxr-xr-x | relcontrolcenter | 447 |
3 files changed, 27 insertions, 670 deletions
@@ -1,3 +1,30 @@ +2002-11-27 10:34 tvignaud + + * drakconf.spec: 9.1-0.3mdk + +2002-11-27 10:31 tvignaud + + * Makefile, control-center, wrapper: - add a wrapper to prevent bad + side effects of c-z (aka sigstop/sigcont) on embedded apps in mcc + - Gtk is already imported by my_gtk + - documente sig_child() + +2002-11-27 10:28 tvignaud + + * drakconf.spec: let be --short-circuit aware + +2002-11-25 13:13 tvignaud + + * control-center: clean code + +2002-11-25 13:12 tvignaud + + * control-center: use mandrake_release() + +2002-11-25 09:55 tvignaud + + * ChangeLog: [no log message] + 2002-11-25 09:28 tvignaud * control-center, print_launcher.pl: bug fixes and workarounds: diff --git a/cest_ton_boot b/cest_ton_boot deleted file mode 100755 index 8b4763a9..00000000 --- a/cest_ton_boot +++ /dev/null @@ -1,223 +0,0 @@ -#!/usr/bin/perl -w - -# Control-center - -# Copyright (C) 2001 MandrakeSoft -# Yves Duret <yduret at mandrakesoft.com> -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - -use Gtk; -use Config; -init Gtk; -use POSIX; -use Locale::GetText; - -setlocale (LC_ALL, ""); -Locale::GetText::textdomain ("c'est ton boot !"); -#Locale::GetText::bindtextdomain ("drakfloppy", "/usr/share/locale"); - -import Locale::GetText I_; - -$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\S*) (\S*)/; -if ($::isEmbedded) { - print "EMBED\n"; - print "XID : $::XID\n"; - print "CCPID : $::CCPID\n"; -} - -local $_ = join '', @ARGV; - -/-h/ and die I_("usage: drakfloppy\n"); - -$x_mode = 0; -$a_mode = (-e "/etc/aurora/Monitor"); - -my @xpm_data = ( "16 16 4 1", - " c None s None", - ". c black", - "X c #808080", - "o c white", - " ", - " .. ", - " .Xo. ... ", - " .Xoo. ..oo. ", - " .Xooo.Xooo... ", - " .Xooo.oooo.X. ", - " .Xooo.Xooo.X. ", - " .Xooo.oooo.X. ", - " .Xooo.Xooo.X. ", - " .Xooo.oooo.X. ", - " .Xoo.Xoo..X. ", - " .Xo.o..ooX. ", - " .X..XXXXX. ", - " ..X....... ", - " .. ", - " "); - -my $window = $::isEmbedded ? new Gtk::Plug ($::XID) : new Gtk::Window ("toplevel"); -$window->signal_connect( 'delete_event', sub { $::isEmbedded ? kill(USR1, $::CCPID) : Gtk->exit(0) }); -$window->set_title( I_("ce soir tu choisis ton boot") ); -#$window->set_policy('automatic', 'automatic'); -$window->set_policy(0, 0, 0); -$window->border_width (10); -$window->realize; - - -### menus definition -# the menus are not shown -# but they provides shiny shortcut like C-q -my @menu_items = ( { path => I_("/_File"), - type => '<Branch>' }, - { path => I_("/File/_New"), - accelerator => I_("<control>N"), - callback => \&print_hello }, - { path => I_("/File/_Open"), - accelerator => I_("<control>O"), - callback => \&print_hello }, - { path => I_("/File/_Save"), - accelerator => I_("<control>S"), - callback => \&print_hello }, - { path => I_("/File/Save _As") }, - { path => I_("/File/-"), - type => '<Separator>' }, - { path => I_("/File/_Quit"), - accelerator => I_("<control>Q"), - callback => sub { $::isEmbedded ? kill(USR1, $::CCPID) : Gtk->exit(0) } }, - - { path => I_("/_Options"), - type => '<Branch>' }, - { path => I_("/Options/Test") }, - - { path => I_("/_Help"), - type => '<LastBranch>' }, - { path => I_("/Help/_About...") } ); - -my $menubar = get_main_menu( $window ); - -######### menus end - -my $global_vbox = new Gtk::VBox(); - -$global_vbox->pack_start (new Gtk::Label(I_("special c'est ton choix")), 0, 0, 0); - -######## aurora part -my $aurora_frame = new Gtk::Frame( I_("Boot mode") ); -my $a_main_hbox = new Gtk::HBox; - -my $a_dedans = new Gtk::VBox( 0, 10 ); -$a_dedans->border_width (5); -my $a_box = new Gtk::VBox(0, 0 ); - -my $a_button = new Gtk::CheckButton( I_("Launch Aurora at boot time") ); -$a_button->signal_connect( "clicked", sub { - ($a_mode) ? $a_box->set_sensitive(0) : $a_box->set_sensitive(1); - $a_mode = !$a_mode; - }); -$a_dedans->pack_start ($a_button, 0, 0, 0); - -my $a_h_button = new Gtk::RadioButton I_("horizontal nice looking aurora"); -$a_h_button->set_active(1); -$a_box->pack_start($a_h_button, 1, 1, 0); - -my $a_v_button = new Gtk::RadioButton I_("vertical traditionnal aurora"), $a_h_button; -$a_box->pack_start($a_v_button, 1, 1, 0); - -my $a_g_button = new Gtk::RadioButton I_("gMonitor (choose this only if you have a non FrameBuffer kernel"), $a_h_button; -$a_box->pack_start($a_g_button, 1, 1, 0); - -$a_box->set_sensitive (0); -$a_dedans->pack_start ($a_box, 0, 0, 0); - -# now for the pixmap from gdk -my ( $pixmap, $mask ) = Gtk::Gdk::Pixmap->create_from_xpm( $window->window, $window->get_style()->bg( 'normal' ), "./c.xpm" ); - -# a pixmap widget to contain the pixmap -my $pixmapwid = new Gtk::Pixmap( $pixmap, $mask ); -$pixmapwid->show(); - -$a_main_hbox->pack_start ($a_dedans, 0, 0, 0); -$a_main_hbox->pack_start ($pixmapwid, 0, 0, 0); -$aurora_frame->add($a_main_hbox); -$global_vbox->pack_start ($aurora_frame, 1, 1, 0); - -### X mode -my $x_main_frame = new Gtk::Frame( I_("System mode") ); -my $x_dedans = new Gtk::VBox( 0, 10 ); -$x_dedans->border_width (5); -my $x_box = new Gtk::VBox(0, 0 ); - -my $x_button = new Gtk::CheckButton( I_("Launch the X-Window system at start") ); -$x_button->signal_connect( "clicked", sub { - ($x_mode) ? $x_box->set_sensitive(0) : $x_box->set_sensitive(1); - $x_mode = !$x_mode; - }); -$x_dedans->pack_start ($x_button, 0, 0, 0); - - -my $x_no_button = new Gtk::RadioButton I_("no, I do not want autologin"); -#$x_no_button->set_active(1); -$x_box->pack_start($x_no_button, 1, 1, 0); - -my $x_yes_button = new Gtk::RadioButton I_("yes, I want autologin with this user"), $x_no_button; -$x_box->pack_start($x_yes_button, 1, 1, 0); - -my $user_dedans = new Gtk::VBox( 0, 10 ); -$user_dedans->border_width (0); - -my $user_combo = new Gtk::Combo; -$user_combo->set_popdown_strings( "you", "me", "rms", "linus"); -$user_dedans->pack_start($user_combo, 0, 0, 0); -$x_box->pack_start ($user_dedans, 0, 0, 0); -$x_box->set_sensitive (0); -$x_dedans->pack_start ($x_box, 0, 0, 0); -$x_main_frame->add($x_dedans); -$global_vbox->pack_start ($x_main_frame, 1, 1, 0); - -### final buttons -my $build_button = new Gtk::Button( I_("OK") ); -my $cancel_button = new Gtk::Button( I_("Cancel") ); -xmy $fin_hbox = new Gtk::HBox( 0, 0 ); -$cancel_button->signal_connect( 'clicked', sub {$::isEmbedded ? kill(USR1, $::CCPID) : Gtk->exit(0)}); -$build_button->signal_connect('clicked', \&print_hello); -$fin_hbox->pack_end($cancel_button, 0, 0, 0); -$fin_hbox->pack_end($build_button, 0, 0, 10); -$global_vbox->pack_start ($fin_hbox, 0, 0, 0); - -### back to window -$window->add( $global_vbox ); - -$window->show_all(); - -main Gtk; - -#------------------------------------------------------------- -# menu callback functions -#------------------------------------------------------------- - -sub print_hello { - print( "mcdtg !\n" ); -} - -sub get_main_menu { - my ( $window ) = @_; - - my $accel_group = new Gtk::AccelGroup(); - my $item_factory = new Gtk::ItemFactory( 'Gtk::MenuBar', '<main>', $accel_group ); - $item_factory->create_items( @menu_items ); - $window->add_accel_group( $accel_group ); - return ( $item_factory->get_widget( '<main>' ) ); -} diff --git a/relcontrolcenter b/relcontrolcenter deleted file mode 100755 index 8fe12a3f..00000000 --- a/relcontrolcenter +++ /dev/null @@ -1,447 +0,0 @@ -#!/usr/bin/perl -w - -# Control-center - -# Copyright (C) 1999-2001 MandrakeSoft -# Damien Krotkine (damien@mandrakesoft.com) -# Daouda Lo (daouda@mandrakesoft.com) -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - -use Gtk; -use Config; -use POSIX; -# for i18n -use Locale::GetText; - -setlocale (LC_ALL, ""); -Locale::GetText::textdomain ("DrakConf"); - -import Locale::GetText I_; -*_ = *I_; - -init Gtk; -use Data::Dumper; - -my %pixmaps_global; -my $xpm_path="pixmaps"; -my $tree_depth_max = 1; -my @ctree_sib; - -my $window_global = new Gtk::Window -toplevel; -$window_global->set_usize(800, 600); -$window_global->signal_connect ( delete_event => sub { Gtk->exit(0); }); -$window_global->set_position(1); -$window_global->set_title(_("Mandrake Control Center")); -$window_global->border_width(0); - -$vbox_global = new Gtk::VBox(0, 0); -$window_global->add($vbox_global); - -######### menus -my @item_factory_entries = ( - [_("/_File"), undef, 0, "<Branch>"], - [_("/File/tearoff1"), undef, 0, "<Tearoff>"], - #[_("/File/_Quit"), "<control>Q", 5], - { - 'path' => _("/File/_Quit"), - 'accelerator' => _("<control>Q"), - 'action' => 1, - 'type' => '<Item>' - }, - [_("/_Help"), undef, 0, "<Branch>"], - [_("/Help/_Mandrake Control Center"), undef, 2], - [_("/Help/_Report Bug"), undef, 3 ], - [_("/Help/_About..."), undef, 4 ] - ); - -my ($accel_group, $item_factory, $box1, $label, $box2); -my ($separator, $button, $dummy); - -$accel_group = new Gtk::AccelGroup; -$item_factory = new Gtk::ItemFactory('Gtk::MenuBar', "<main>", $accel_group); - -$accel_group->attach($window_global); -foreach (@item_factory_entries) { - $item_factory->create_item($_, \&item_factory_cb); -} - -$vbox_global->pack_start($item_factory->get_widget('<main>'), 0, 0, 0); -$hseparator_global = new Gtk::HSeparator; -$vbox_global->pack_start($hseparator_global, 0, 1, 0); -######### menus end - - -my $hbox_global = new Gtk::HBox(0,0); -$vbox_global->pack_start($hbox_global, 1, 1, 0); -$hbox_global->border_width(5); -my $scrolled_global = new Gtk::ScrolledWindow; -$scrolled_global->set_policy('automatic','automatic'); -$scrolled_global->set_usize(180, 0); -$scrolled_global->set_name("icons_back"); -#$scrolled_global->window->draw_rectangle(nil,1, 0, 0, 70, 70); #$scrolled_global->window->style->bg_gc('normal') -$hbox_global->pack_start($scrolled_global,0,1,0); -my $vseparator_global = new Gtk::VSeparator; -$hbox_global->pack_start($vseparator_global,0,1,0); - -my $notebook_global = new Gtk::Notebook; -$notebook_global->set_show_border(0); -$notebook_global->set_show_tabs(0); -$hbox_global->pack_start($notebook_global,1,1,0); - -#-------------------------------- splash screeen -------------------------------------------------------- - -<<<<<<< relcontrolcenter -sub splash { -======= -my $hbox1= new Gtk::HBox(0,20); -my ($pix_about_map, $pix_about_mask) = Gtk::Gdk::Pixmap->create_from_xpm(NULL, Gtk::Widget->get_default_style->bg('normal'), "$xpm_path/logo.xpm"); -my $pix_about = new Gtk::Pixmap ($pix_about_map, $pix_about_mask); -$pix_about->set_alignment(10,0); -$hbox1->pack_start($pix_about, 0, 1, 0); -my $style = new Gtk::Style; -$style->font(Gtk::Gdk::Font->fontset_load(_("-adobe-times-bold-r-normal--*-180-100-100-p-*-iso8859-*,*-r-*"))); -my $label_about2 = new Gtk::Label (_("Mandrake Control Center")); -$label_about2->set_alignment(0,0); -$label_about2->set_style($style); -$hbox1->pack_start($label_about2, 0, 1, 0); -my $vbox_about = new Gtk::VBox(0,10); -$vbox_about->pack_start($hbox1, 0, 1, 0); -my $label_about3 = new Gtk::Label (_("The place where you can configure your Mandrake Box")); -$vbox_about->pack_start($label_about3, 0, 0, 0); - -$table_info1 = new Gtk::Table(6,2,1); -$table_info1->set_row_spacings(15); -$table_info1->set_col_spacings(10); - -my @revtree; -my @infotree; -open VERS, "/etc/redhat-release" or die "cannot open this file for read: $!"; -while (<VERS>) { - push (@revtree,$_); -} -@info_tree = split / /, $revtree[0]; ->>>>>>> 1.3 - - my $hbox1= new Gtk::HBox(0,20); - my ($pix_about_map, $pix_about_mask) = Gtk::Gdk::Pixmap->create_from_xpm(NULL, Gtk::Widget->get_default_style->bg('normal'), "$xpm_path/logo.xpm"); - my $pix_about = new Gtk::Pixmap ($pix_about_map, $pix_about_mask); - $pix_about->set_alignment(10,0); - $hbox1->pack_start($pix_about, 0, 1, 0); - my $style = new Gtk::Style; - $style->font(Gtk::Gdk::Font->load('-adobe-times-bold-r-normal--25-180-100-100-p-132-iso8859-1')); - my $label_about2 = new Gtk::Label ("Mandrake Control Center"); - $label_about2->set_alignment(0,0); - $label_about2->set_style($style); - $hbox1->pack_start($label_about2, 0, 1, 0); - my $vbox_about = new Gtk::VBox(0,10); - $vbox_about->pack_start($hbox1, 0, 1, 0); - my $label_about3 = new Gtk::Label ("The place where you can configure your Mandrake Box"); - $vbox_about->pack_start($label_about3, 0, 0, 0); - - $table_info1 = new Gtk::Table(6,2,1); - $table_info1->set_row_spacings(15); - $table_info1->set_col_spacings(10); - -<<<<<<< relcontrolcenter - - my @revtree; - my @infotree; - open VERS, "/etc/redhat-release" or die "cannot open this file for read :$!"; - while (<VERS>) { - push (@revtree,$_); - } - @info_tree = split / /, $revtree[0]; - - my ($sysname, $nodename, $release, $version, $machine ) = POSIX::uname(); - my $username= POSIX::cuserid(); - - my $style1 = new Gtk::Style; - $style1->font(Gtk::Gdk::Font->load('-adobe-times-bold-r-normal--14-100-100-100-p-76-iso8859-1')); - - my $ld = new Gtk::Label("$username"); - $table_info1->attach($ld, 1, 2, 0, 1, 0, 0, 0, 0); - my $label_user = new Gtk::Label("User: "); - $label_user->set_style($style1); - $label_user->set_justify('right'); - $table_info1->attach($label_user, 0, 1, 0, 1, 0, 0, 0, 0); - my $ld1 = new Gtk::Label("$info_tree[0] $info_tree[1] $info_tree[3] $info_tree[4] "); - $table_info1->attach($ld1, 1, 2, 1, 2, 0, 0, 0, 0); - my $ld2 = new Gtk::Label("$nodename"); - $table_info1->attach($ld2, 1, 2, 2, 3, 0, 0, 0, 0); - my $ld3 = new Gtk::Label("$release $version"); - $table_info1->attach($ld3, 1, 2, 3, 4, 0, 0, 0, 0); - my $ld4 = new Gtk::Label("$machine"); - $table_info1->attach($ld4, 1, 2, 4, 5, 0, 0, 0, 0); - my $label_os = new Gtk::Label("System: "); - $label_os->set_style($style1); - $label_os->set_justify('right'); - $table_info1->attach($label_os, 0, 1, 1, 2, 0, 0, 0, 0); - my $label_host = new Gtk::Label("Hostname: "); - $label_host->set_style($style1); - $table_info1->attach_defaults($label_host, 0, 1, 2, 3); - my $label_kernel = new Gtk::Label("Kernel Version : "); - $label_kernel->set_style($style1); - $table_info1->attach_defaults($label_kernel, 0, 1, 3, 4); - my $label_box = new Gtk::Label("Machine: "); - $label_box->set_style($style1); - $table_info1->attach_defaults($label_box, 0, 1, 4, 5); - - $vbox_about->set_spacing(30); - $vbox_about->pack_start($table_info1, 0, 0, 0); - $vbox_about->reorder_child($table_info1,150); - - $notebook_global->append_page($vbox_about, "$arg"); - my $vbox_global_left = new Gtk::VBox(0,0); - $scrolled_global->add_with_viewport($vbox_global_left); - - $window_global->realize; - - my $ctree_parent = new Gtk::CTree(0,1,0); - $vbox_global_left->pack_start($ctree_parent,1,1,0); -} -======= -my $style1 = new Gtk::Style; -$style1->font(Gtk::Gdk::Font->fontset_load(_("-adobe-times-bold-r-normal--14-*-100-100-p-*-iso8859-*,*-r-*"))); - -my $ld = new Gtk::Label("$username"); -$table_info1->attach($ld, 1, 2, 0, 1, 0, 0, 0, 0); -my $label_user = new Gtk::Label(_("User: ")); -$label_user->set_style($style1); -$label_user->set_justify('right'); -$table_info1->attach($label_user, 0, 1, 0, 1, 0, 0, 0, 0); -my $ld1 = new Gtk::Label("$info_tree[0] $info_tree[1] $info_tree[3] $info_tree[4] "); -$table_info1->attach($ld1, 1, 2, 1, 2, 0, 0, 0, 0); -my $ld2 = new Gtk::Label("$nodename"); -$table_info1->attach($ld2, 1, 2, 2, 3, 0, 0, 0, 0); -my $ld3 = new Gtk::Label("$release $version"); -$table_info1->attach($ld3, 1, 2, 3, 4, 0, 0, 0, 0); -my $ld4 = new Gtk::Label("$machine"); -$table_info1->attach($ld4, 1, 2, 4, 5, 0, 0, 0, 0); -my $label_os = new Gtk::Label(_("System: ")); -$label_os->set_style($style1); -$label_os->set_justify('right'); -$table_info1->attach($label_os, 0, 1, 1, 2, 0, 0, 0, 0); -my $label_host = new Gtk::Label(_("Hostname: ")); -$label_host->set_style($style1); -$table_info1->attach_defaults($label_host, 0, 1, 2, 3); -my $label_kernel = new Gtk::Label(_("Kernel Version: ")); -$label_kernel->set_style($style1); -$table_info1->attach_defaults($label_kernel, 0, 1, 3, 4); -my $label_box = new Gtk::Label(_("Machine: ")); -$label_box->set_style($style1); -$table_info1->attach_defaults($label_box, 0, 1, 4, 5); - -$vbox_about->set_spacing(30); -$vbox_about->pack_start($table_info1, 0, 0, 0); -$vbox_about->reorder_child($table_info1,150); - -$notebook_global->append_page($vbox_about, "$arg"); -my $vbox_global_left = new Gtk::VBox(0,0); -$scrolled_global->add_with_viewport($vbox_global_left); - -$window_global->realize; - -my $ctree_parent = new Gtk::CTree(0,1,0); -$vbox_global_left->pack_start($ctree_parent,1,1,0); ->>>>>>> 1.3 - -map { - create_ctree($ctree_parent ,$_->[0], "$xpm_path/$_->[1]",0 , 1 , undef , undef); -} ([_("Boot Configuration"), 'logo.xpm'] , [_("Hardware Configuration"), 'logo.xpm'] , [_("User and Groups Management"),'logo.xpm'], - [_("Network and Internet Connection"),'logo.xpm'] , [_("Menu Customization"),'logo.xpm'] , [_("Font Management"),'logo.xpm']); - -map { - create_ctree($ctree_parent ,$_->[0], "$xpm_path/$_->[1]", 1, 0, $_->[2],$_->[3] ); -} ([_("Drakboot"),'item.xpm',1,0] , [_("Drakfloppy"), 'item.xpm',2,0] , [_("Drakelogo"), 'item.xpm',3,0], - [_("XFDrake"),'item.xpm',4,1] , [_("HardDrake"),'item.xpm',5,1] , [_("Mousedrake"), 'item.xpm',6,1] , [_("Printerdrake"),'item.xpm',7,1] , [_("Keyboarddrake"), 'item.xpm',8,1], - [_("Userdrake"),'item.xpm',9,2] , - [_("Draknet") , 'item.xpm',10,3] , [_("Drakgw"),'item.xpm',10,3], - [_("Menudrake") , 'item.xpm',11,4] , - [_("Drakfont"), 'item.xpm', 12,5]); - -%tree_exec = ([_("Drakboot") => "drakeboot"], [_("Drakfloppy") => "drakfloppy"], - [_("Drakelogo") => "DrakeLogo"] , [_("XFDrake") => "XFDrake"] , - [_("HardDrake") => "harddrake-auth"] , [_("Mousedrake") => "mousedrake"] , - [_("Printerdrake") => "printerdrake"] , [_("Keyboarddrake") => "keyboarddrake"] , - [_("Userdrake") => "userdrake"] , [_("Draknet") => "draknet"] , - [_("Drakgw") => "drakgw"] , [_("Menudrake") => "menudrake"] , [_("Drakfont") => "drakfont"] - ); - -my $rc = "control-center.rc"; - Gtk::Rc->parse($rc); -$window_global->show_all; - - -print "num: " . $notebook_global->page_num($vbox_about) . "\n"; -#$notebook_global->set_page(0); -$SIG{USR1} = sub { $notebook_global->set_page(0); }; # embedded applications will send me that signal in order to "hide" them - -Gtk->main; - -sub about_mdk_cc() -{ - my $window_about = new Gtk::Dialog(); - $window_about->set_position(1); - my $button = new Gtk::Button(_("Close")); - $button->signal_connect_object("clicked",$window_about => destroy); - $window_about->action_area->pack_start($button,$true,$true,0); - $button->show(); - - my $label = new Gtk::Label( _("Mandrake Control Center 1.0 \n Copyright (C) 2001 MandrakeSoft SA\n") ); - my $style1 = new Gtk::Style; - $style1->font(Gtk::Gdk::Font->fontset_load(_("-adobe-times-bold-r-normal--14-*-100-100-p-*-iso8859-*,*-r-*"))); - $label->set_style($style1); - $window_about->vbox->pack_start( $label, $true, $true, 0 ); - $label->show(); - - my $label1 = new Gtk::Label( _("Authors: ") . "\n\n Daouda Lo <daouda\@mandrakesoft.com> \n \n Damien Krotkine <dams\@mandrakesoft.com>\n" ); - $window_about->vbox->pack_start( $label1, $true, $true, 0 ); - $label1->show(); - - $window_about->show(); - -} - -sub create_ctree { - my ($ctree, $label , $xpm_filename, $is_leaf , $is_expand, $num, $tree_pos)= @_; - - my ($pixmap, $mask ); - my $sibling = undef; - my $parent = undef; - - # Now on to the xpm stuff - ($pixmap, $mask) = Gtk::Gdk::Pixmap->create_from_xpm($parent->window, $style, $xpm_filename ); - my $pixmapwid = new Gtk::Pixmap( $pixmap, $mask ); - - if(!$is_leaf) { - $sibling=$ctree->insert_node ( - $parent, - $sibling, - $label, - 5, - $pixmap, - $mask, - $pixmap, - $mask, - $is_leaf, - $is_expand - ); - push(@ctree_sib,$sibling); - }; - if($is_leaf) { - $sibling=$ctree->insert_node ( - $ctree_sib[tree_pos], - $sibling, - $label, - 5, - $pixmap, - $mask, - $pixmap, - $mask, - $is_leaf, - $is_expand, - ); - $ctree->signal_connect( 'tree_select_row', sub { - my ($ct, $node) = @_; - my ($t); - ($t, undef, undef) = $ct->node_get_pixtext($node); - exec_treeitem($tree_exec[$ct],$num); - } ); - -} - -} - -sub exec_treeitem { - my ($exec_string,$num) = @_; - - if ($exec_string) { - my $socket = new Gtk::Socket; - $socket->show; - $notebook_global->append_page($socket, ""); - $socket->realize; - printf ("The XID of the sockets window nr. %s is [%s]\n", $arg, $socket->window->XWINDOW ); - printf ("My PID is [%s]\n", $$ ); - my $a = $exec_string . " --embedded " . $socket->window->XWINDOW . " " . $$ . "&"; - print "$a\n"; - system ($a); - $notebook_global->set_page($num); - } -} - -sub item_factory_cb { - my ($widget, $action, @data) = @_; - - print "ItemFactory: activated ", $widget->item_factory_path(), " -> ", $action, "\n"; - $action == 1 and Gtk->exit(0); - $action == 4 and about_mdk_cc(); -} - - -sub create_item_factory { - if (!defined $item_factory_window) { - my ($accel_group, $item_factory, $box1, $label, $box2); - my ($separator, $button, $dummy); - - - $item_factory_window = new Gtk::Window('toplevel'); - signal_connect $item_factory_window destroy => \&destroy_window, \$item_factory_window; - signal_connect $item_factory_window "delete-event" => \&destroy_window, \$item_factory_window; - - $accel_group = new Gtk::AccelGroup; - $item_factory = new Gtk::ItemFactory('Gtk::MenuBar', "<main>", $accel_group); - - #$item_factory_window->set_data('<main>', $item_factory); - $accel_group->attach($item_factory_window); - # $item_factory->create_items(); - foreach (@item_factory_entries) { - $item_factory->create_item($_, \&item_factory_cb); - } - - $item_factory_window->set_title(_("Item Factory")); - $item_factory_window->set_border_width(0); - - $box1 = new Gtk::VBox(0, 0); - $item_factory_window->add($box1); - $box1->pack_start($item_factory->get_widget('<main>'), 0, 0, 0); - - $label = new Gtk::Label( _("Type\n<alt>\nto start") ); - - $label->set_usize(200, 200); - $label->set_alignment(0.5, 0.5); - $box1->pack_start($label, 1, 1, 0); - - $separator = new Gtk::HSeparator; - $box1->pack_start($separator, 0, 1, 0); - - $box2 = new Gtk::VBox(0, 10); - $box2->set_border_width(10); - $box1->pack_start($box2, 0, 1, 0); - - $button = new Gtk::Button(_("Close")); - $button->signal_connect('clicked', sub {$item_factory_window->destroy;}); - $box2->pack_start($button, 1, 1, 0); - $button->can_default(1); - $button->grab_default; - - } - if (!visible $item_factory_window) { - show_all $item_factory_window; - } else { - destroy $item_factory_window; - } -} |