From a64700bfdccb652e2a88fdbd94ecd7ce54d17e13 Mon Sep 17 00:00:00 2001 From: damien Date: Fri, 23 Mar 2001 17:48:42 +0000 Subject: removed bad things --- control-center | 299 ----------------------------------------- control-center2 | 399 ------------------------------------------------------- relcontrolcenter | 367 -------------------------------------------------- screenshot1.png | Bin 16120 -> 0 bytes screenshot2.png | Bin 18004 -> 0 bytes screenshot3.png | Bin 18414 -> 0 bytes services.png | Bin 26975 -> 0 bytes 7 files changed, 1065 deletions(-) delete mode 100755 control-center delete mode 100755 control-center2 delete mode 100755 relcontrolcenter delete mode 100644 screenshot1.png delete mode 100644 screenshot2.png delete mode 100644 screenshot3.png delete mode 100644 services.png diff --git a/control-center b/control-center deleted file mode 100755 index 3abdfdb0..00000000 --- a/control-center +++ /dev/null @@ -1,299 +0,0 @@ -#!/usr/bin/perl - -# Control-center - -# Copyright (C) 1999 MandrakeSoft (damien@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; -# for i18n -use POSIX; -use Locale::GetText; - -setlocale (LC_ALL, ""); -Locale::GetText::textdomain ("DrakConf"); - -import Locale::GetText I_; -*_ = *I_; - -init Gtk; -#use lib qw(/usr/lib/libDrakX); -#use netconnect; -#use c; -#use Data::Dumper; -#local $_ = join '', @ARGV; -#if ($ARGV[1]= ) -#/-h/ and die "usage: draknet[--xf3] [--beginner] [--expert] [--auto] [--noauto] [--skiptest] [--testing]\n"; - -my %pixmaps_global; -my $xpm_path="pixmaps"; -#my $label_splash = new Gtk::Label(); - -my $window_global = new Gtk::Window -toplevel; -$window_global->set_usize(640, 480); -$window_global->signal_connect ( delete_event => sub { Gtk->exit(0); }); -$window_global->set_position(1); -$window_global->set_title(_("Control Center")); -$window_global->border_width(0); - -$vbox_global = new Gtk::VBox(0, 0); -$window_global->add($vbox_global); - -######### tree - -my @tree = ( - group1 => ( appli1 => 'drakfont', - appli2 => 'drakfloppy'), - group2 => ( appli1 => 'drakxservices', - appli2 => 'drakboot'), - ); - -######### menus -my @item_factory_entries = ( - [_("/_File"), undef, 0, ""], - [_("/File/tearoff1"), undef, 0, ""], - [_("/File/_New"), _("N"), 1], - [_("/File/_Open"), _("O"), 2], - [_("/File/_Save"), _("S"), 3], - [_("/File/Save _As..."), undef, 4], - [_("/File/-"), undef, 0, ""], - #[_("/File/_Quit"), "Q", 5], - { - 'path' => _("/File/_Quit"), - 'accelerator' => _("Q"), - 'action' => 5, - 'type' => '' - }, - - [_("/_Preferences"), undef, 0, ""], - [_("/_Preferences/_Color"), undef, 0, ""], - [_("/_Preferences/Color/_Red"), undef, 10, ""], - [_("/_Preferences/Color/_Green"), undef, 11, ""], - [_("/_Preferences/Color/_Blue"), undef, 12, ""], - [_("/_Preferences/_Shape"), undef, 0, ""], - [_("/_Preferences/Shape/_Square"), undef, 20, ""], - [_("/_Preferences/Shape/_Rectangle"), undef, 21, ""], - [_("/_Preferences/Shape/_Oval"), undef, 22, ""], - - [_("/_Help"), undef, 0, ""], - [_("/Help/_About..."), undef, 30] - ); - -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', "
", $accel_group); - -#$window_global->set_data('
', $item_factory); -$accel_group->attach($window_global); -#$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); -$vbox_global->pack_start($item_factory->get_widget('
'), 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(52, 0); -$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); - -my ($pix_about_map, $pix_about_mask) = Gtk::Gdk::Pixmap->create_from_xpm(NULL, Gtk::Widget->get_default_style->bg('normal'), "$xpm_path/logo1.xpm"); -my $pix_about = new Gtk::Pixmap ($pix_about_map, $pix_about_mask); -my $vbox_about = new Gtk::VBox(1,0); -$vbox_about->pack_start($pix_about, 1, 1, 0); -my $text_about = new Gtk::Text (); -$text_about->set_editable(0); -$text_about->insert ( undef, undef, undef, _("About, help, click on that button...")); -$vbox_about->pack_start($text_about, 1, 1, 0); -my $label_about2 = new Gtk::Label (""); -$vbox_about->pack_start($label_about2, 1, 1, 0); -$notebook_global->append_page($vbox_about, "$arg"); - -my $vbox_global_left = new Gtk::VBox(0,0); -$scrolled_global->add_with_viewport($vbox_global_left); -my %tools; - -for ( my $arg=0; $arg<=$#ARGV; $arg++) { - $tools[$arg]{socket} = new Gtk::Socket; - $tools[$arg]{socket}->show; - $notebook_global->append_page($tools[$arg]{socket}, "$ARGV[$arg]"); - $tools[$arg]{socket}->realize; -# print ("The XID of the sockets window n°$arg is [" . $tools[$arg]{socket}->window->XWINDOW . "]\n"); - system ( $ARGV[$arg] . " --embedded " . $tools[$arg]{socket}->window->XWINDOW . "&"); - map { - $pixmaps_global{$_ . '_pixmap'} = - Gtk::Gdk::Pixmap->create_from_xpm($window_global->window, Gtk::Widget->get_default_style->bg('normal'), "$xpm_path/$_.xpm"); - } ('draknet1','draknet2','draknet3','draknet4', 'draknet5', 'drakgw'); - $tools[$arg]{PIX_W} = 48; - $tools[$arg]{PIX_H} = 48; - $tools[$arg]{actual_pixmap}=1; - $tools[$arg]{save_pixmap}=0; - $tools[$arg]{anim_idle}=undef; - $tools[$arg]{timeout}=undef; - $tools[$arg]{darea} = new Gtk::DrawingArea; - $tools[$arg]{darea}->set_usize($tools[$arg]{PIX_W},$tools[$arg]{PIX_H}); - $tools[$arg]{darea}->set_events(['exposure_mask', 'enter_notify_mask', 'leave_notify_mask', 'button_press_mask', 'button_release_mask' ]); - - - $tools[$arg]{darea}->signal_connect - (expose_event => sub { - my $arg=$_[1]; -# print Data::Dumper->Dump([%tools], ['$tools[$arg]']) . "\n"; -# print Data::Dumper->Dump([$tools[$arg]{darea}], ['area']) . "\n"; - $tools[$arg]{darea}->window->draw_pixmap - ($tools[$arg]{darea}->style->bg_gc('normal'), - $pixmaps_global{'draknet' . $tools[$arg]{actual_pixmap} . '_pixmap'}, 0, 0, - ($tools[$arg]{darea}->allocation->[2]-$tools[$arg]{PIX_W})/2, - ($tools[$arg]{darea}->allocation->[3]-$tools[$arg]{PIX_H})/2, - $tools[$arg]{PIX_W} , $tools[$arg]{PIX_H} ); - }, $arg ); - - - $tools[$arg]{darea}->signal_connect - (enter_notify_event => sub { - my $arg=$_[1]; - - $tools[$arg]{anim_idle} ||= Gtk->idle_add - ( sub { - $tools[$arg]{actual_pixmap}==$tools[$arg]{save_pixmap} and return 1; - $tools[$arg]{darea}->window->draw_pixmap - ($tools[$arg]{darea}->style->bg_gc('normal'), - $pixmaps_global{'draknet' . $tools[$arg]{actual_pixmap} . '_pixmap'}, - 0, 0, - ($tools[$arg]{darea}->allocation->[2]-$tools[$arg]{PIX_W})/2, - ($tools[$arg]{darea}->allocation->[3]-$tools[$arg]{PIX_H})/2, - $tools[$arg]{PIX_W} , $tools[$arg]{PIX_H} ); - $tools[$arg]{save_pixmap}=$tools[$arg]{actual_pixmap}; - return 1; - }); - - $tools[$arg]{timeout} ||= Gtk->timeout_add - ( 50, sub { - $tools[$arg]{actual_pixmap}++; - $tools[$arg]{actual_pixmap}>5 and $tools[$arg]{actual_pixmap}=1; - return 1; - }); - }, $arg); - - - $tools[$arg]{darea}->signal_connect - (leave_notify_event => sub { - my $arg=$_[1]; - Gtk->main_iteration() while ($tools[$arg]{save_pixmap}!=1); - Gtk->idle_remove($tools[$arg]{anim_idle}); - Gtk->timeout_remove($tools[$arg]{timeout}); - undef $tools[$arg]{anim_idle}; - undef $tools[$arg]{timeout}; - }, $arg); -# $tools[$arg]{darea}->signal_connect(button_press_event => sub { }); - $tools[$arg]{darea}->signal_connect(button_release_event => sub { $notebook_global->set_page($_[1]+1);}, $arg); - $vbox_global_left->pack_start($tools[$arg]{darea},0,1,5); - #$vbox_global_left->pack_start($pixmaps_global{'drakgw'},0,1,5); -} - -$window_global->show_all; -print _("num: ") . $notebook_global->page_num($vbox_about) . "\n"; -$notebook_global->set_page(0); -Gtk->main; - - -sub item_factory_cb { - my ($widget, $action, @data) = @_; - - print "ItemFactory: activated ", $widget->item_factory_path(), " -> ", $action, "\n"; - $action == 5 and Gtk->exit; -} - - -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', "
", $accel_group); - - #$item_factory_window->set_data('
', $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('
'), 0, 0, 0); - - $label = new Gtk::Label _("Type\n\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; - } -} diff --git a/control-center2 b/control-center2 deleted file mode 100755 index 47599211..00000000 --- a/control-center2 +++ /dev/null @@ -1,399 +0,0 @@ -#!/usr/bin/perl -w - -# Control-center - -# Copyright (C) 1999 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 $window_global = new Gtk::Window -toplevel; -$window_global->set_usize(640, 480); -$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, ""], - [_("/File/tearoff1"), undef, 0, ""], - #[_("/File/_Quit"), _("Q"), 5], - { - 'path' => _("/File/_Quit"), - 'accelerator' => _("Q"), - 'action' => 1, - 'type' => '' - }, - [_("/_Help"), undef, 0, ""], - [_("/Help/_Mandrake Control Center"), undef, 30], - [_("/Help/_Report Bug"), undef, 30], - [_("/Help/_About..."), undef, 30] - ); - -my ($accel_group, $item_factory, $box1, $label, $box2); -my ($separator, $button, $dummy); - -$accel_group = new Gtk::AccelGroup; -$item_factory = new Gtk::ItemFactory('Gtk::MenuBar', "
", $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('
'), 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(100, 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); - -#-------------------------------- bal ----------------------------------------------------------- - -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 (_("This is the Mandrake Control Center, The place where you can configure your Mandrake Box")); -$vbox_about->pack_start($label_about3, 0, 0, 0); - -my $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( sprintf _("cannot open this file for read:$!") ); -while () { - 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->fontset_load(_("-adobe-times-bold-r-normal--*-100-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 $ld3 = new Gtk::Label("$machine"); -$table_info1->attach($ld3, 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; -map { - $pixmaps_global{$_ . '_pixmap'} = - Gtk::Gdk::Pixmap->create_from_xpm($window_global->window, Gtk::Widget->get_default_style->bg('normal'), "$xpm_path/$_.xpm"); -} ('item1', 'item2', 'item3', 'item4', 'item5','draknet1','draknet2','draknet3','draknet4', 'draknet5', 'drakgw'); - -my %tree; -$tree{nb_groups}=2; -$tree[0]{name}=_("Boot Configuration"); -$tree[0]{nb_applis}=2; -$tree[0]{applis}[0]{name}=_("draknet"); -$tree[0]{applis}[0]{exec}='drakfont'; -$tree[0]{applis}[1]{name}=_("DrakeLogo"); -$tree[0]{applis}[1]{exec}='DrakeLogo'; -$tree[1]{name}="groupe2"; -$tree[1]{nb_applis}=1; -$tree[1]{applis}[0]{name}=_("DrakFont");#'drakxservices'; -$tree[1]{applis}[0]{exec}='drakfont';#'drakxservices'; -$tree[1]{applis}[1]{name}=_("DrakFloppy");#'drakboot'; -$tree[1]{applis}[1]{exec}='drakfloppy';#'drakboot'; -#print Data::Dumper->Dump([%tree], ['tree']) . "\n"; -print _("nb gr: ") . $tree{nb_groups} . "\n"; -my $num=0; -my $group; -for ( $group=0; $group<$tree{nb_groups}; $group++) { - print _("group: ") . "$group\n"; - draw_icon(56, 36, 'item', 0, "", $tree[$group]{name}, $group); - for ($item=0; $item<$tree[$group]{nb_applis}; $item++) { - print _("item: ") . "$item\n"; - draw_icon(56, 36, 'item', 1, $tree[$group]{applis}[$item]{exec}, $tree[$group]{applis}[$item]{name}, $num); - $num++; - } -} -print Data::Dumper->Dump([$tree[0]{applis}[0]], ['tree-applis->0-->']) . "\n"; - - ######### - - -my $area_global = new Gtk::DrawingArea; -$vbox_global_left->pack_start($area_global,1,1,0); -my $rc = "control-center.rc"; -Gtk::Rc->parse($rc); -$window_global->show_all; -for (my $i=0; $i<$tree{nb_groups}; $i++) { - for (my $j=0; $j<$tree[$i]{nb_applis}; $j++) { - $tree[$i]{applis}[$j]{darea}->hide; - $tree[$i]{applis}[$j]{label}->hide; - } -} -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 draw_icon { - my ($width, $height, $icon_name, $decalage, $exec_string, $name, $number ) = @_; - my %hash; - 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); - } - $hash{PIX_W} = $width; - $hash{PIX_H} = $height; - $hash{actual_pixmap}=1; - $hash{save_pixmap}=0; - $hash{anim_idle}=undef; - $hash{timeout}=undef; - $hash{darea} = new Gtk::DrawingArea; - $hash{label} = new Gtk::DrawingArea; - $hash{label}->set_usize(50, 12); - $hash{label}->signal_connect(expose_event => sub { - my $font = $hash{label}->style->font; - my $w = $font->string_width($name); - $hash{label}->window->draw_string($font, $hash{label}->style->fg_gc('normal'), ($hash{label}->allocation->[2] - $w) / 2 * 0 + $decalage*20, 9, $name ); #($hash{label}->allocation->[3]-40)/2 -# $hash{label}->window->draw_string($font, $hash{label}->style->bg_gc('normal'), 0, 10, "QQWWylt"); #($hash{label}->allocation->[3]-40)/2 -}); - - if ($exec_string) { - $tree[$group]{applis}[$item]{darea} = $hash{darea}; - $tree[$group]{applis}[$item]{label} = $hash{label}; - } - $hash{darea}->set_usize($width,$height); - $hash{darea}->set_events(['exposure_mask', 'enter_notify_mask', 'leave_notify_mask', 'button_press_mask', 'button_release_mask' ]); - $hash{darea}->signal_connect - (expose_event => sub { - $hash{darea}->window->draw_pixmap - ($hash{darea}->style->bg_gc('normal'), - $pixmaps_global{ $icon_name . $hash{actual_pixmap} . '_pixmap'}, 0, 0, - ($hash{darea}->allocation->[2]-$hash{PIX_W})/2*0+($decalage * 20), - ($hash{darea}->allocation->[3]-$hash{PIX_H})/2, - $hash{PIX_W} , $hash{PIX_H} ); - }); - - - $hash{darea}->signal_connect - (enter_notify_event => sub { - $hash{anim_idle} ||= Gtk->idle_add - ( sub { - $hash{actual_pixmap}==$hash{save_pixmap} and return 1; - $hash{darea}->window->draw_pixmap - ($hash{darea}->style->bg_gc('normal'), - $pixmaps_global{ $icon_name . 1 . '_pixmap'}, # $hash{actual_pixmap} . '_pixmap'}, - 0, 0, - ($hash{darea}->allocation->[2]-$hash{PIX_W})/2*0+($decalage * 20), - ($hash{darea}->allocation->[3]-$hash{PIX_H})/2, - $hash{PIX_W} , $hash{PIX_H} ); - $hash{save_pixmap}=$hash{actual_pixmap}; - return 1; - }); - - $hash{timeout} ||= Gtk->timeout_add - ( 50, sub { - $hash{actual_pixmap}++; - $hash{actual_pixmap}>5 and $hash{actual_pixmap}=1; - return 1; - }); - }); - - - $hash{darea}->signal_connect - (leave_notify_event => sub { - Gtk->main_iteration() while ($hash{save_pixmap}!=1); - Gtk->idle_remove($hash{anim_idle}); - Gtk->timeout_remove($hash{timeout}); - undef $hash{anim_idle}; - undef $hash{timeout}; - }); - # $hash{darea}->signal_connect(button_press_event => sub { }); - if ($exec_string) { - $hash{darea}->signal_connect(button_release_event => sub { $notebook_global->set_page($number+1); }); - } else { - $hash{darea}->signal_connect(button_release_event => sub { - print _("group: ") . "$number\n"; - for (my $i=0; $i<$tree{nb_groups}; $i++) { - for (my $j=0; $j<$tree[$i]{nb_applis}; $j++) { - if ($i==$number) { - #print "yep i: $i ; j: $j\n"; - #print Data::Dumper->Dump([$tree[$i]{applis}[$j]{darea}], ['darea-->']) . "\n"; - $tree[$i]{applis}[$j]{darea}->show; - $tree[$i]{applis}[$j]{label}->show; - } else { - #print "nope i: $i ; j: $j\n"; - $tree[$i]{applis}[$j]{darea}->hide; - $tree[$i]{applis}[$j]{label}->hide; - } - } - } - }); - } - $vbox_global_left->pack_start($hash{darea},0,1,0); - $vbox_global_left->pack_start($hash{label},0,1,0); -} - -sub item_factory_cb { - my ($widget, $action, @data) = @_; - - print "ItemFactory: activated ", $widget->item_factory_path(), " -> ", $action, "\n"; - $action == 1 and Gtk->exit(0); -} - - -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', "
", $accel_group); - - #$item_factory_window->set_data('
', $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('
'), 0, 0, 0); - - $label = new Gtk::Label _("Type\n\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; - } -} diff --git a/relcontrolcenter b/relcontrolcenter deleted file mode 100755 index 504e7508..00000000 --- a/relcontrolcenter +++ /dev/null @@ -1,367 +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, ""], - [_("/File/tearoff1"), undef, 0, ""], - #[_("/File/_Quit"), "Q", 5], - { - 'path' => _("/File/_Quit"), - 'accelerator' => _("Q"), - 'action' => 1, - 'type' => '' - }, - [_("/_Help"), undef, 0, ""], - [_("/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', "
", $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('
'), 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 -------------------------------------------------------- - -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 () { - 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->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); - -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 \n \n Damien Krotkine \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', "
", $accel_group); - - #$item_factory_window->set_data('
', $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('
'), 0, 0, 0); - - $label = new Gtk::Label( _("Type\n\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; - } -} diff --git a/screenshot1.png b/screenshot1.png deleted file mode 100644 index 613e1433..00000000 Binary files a/screenshot1.png and /dev/null differ diff --git a/screenshot2.png b/screenshot2.png deleted file mode 100644 index a2ceca35..00000000 Binary files a/screenshot2.png and /dev/null differ diff --git a/screenshot3.png b/screenshot3.png deleted file mode 100644 index 6dda8bf8..00000000 Binary files a/screenshot3.png and /dev/null differ diff --git a/services.png b/services.png deleted file mode 100644 index ce388c4e..00000000 Binary files a/services.png and /dev/null differ -- cgit v1.2.1