summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2002-01-22 16:55:58 +0000
committerdamien <damien@mandriva.com>2002-01-22 16:55:58 +0000
commitbbcb7bc2536de8ee7f7dd8bb685458506c444bf4 (patch)
tree3bd821e5024e1a1bb67d11be1dd3a42f37d301b0
parentcde7bad284615ee13ca9c01bb279b11ad3513e5c (diff)
downloadcontrol-center-bbcb7bc2536de8ee7f7dd8bb685458506c444bf4.tar
control-center-bbcb7bc2536de8ee7f7dd8bb685458506c444bf4.tar.gz
control-center-bbcb7bc2536de8ee7f7dd8bb685458506c444bf4.tar.bz2
control-center-bbcb7bc2536de8ee7f7dd8bb685458506c444bf4.tar.xz
control-center-bbcb7bc2536de8ee7f7dd8bb685458506c444bf4.zip
updated
-rwxr-xr-xcontrol-center124
1 files changed, 54 insertions, 70 deletions
diff --git a/control-center b/control-center
index 5b3bd402..6758bdb8 100755
--- a/control-center
+++ b/control-center
@@ -65,7 +65,8 @@ my $png_path="$_iconsdir";
# leaf: label, icon, parent, file_to_seek, exec, gtk/x, grep, num_xwininfo
# hum need to have a function to install a package when clicked. => rpmdrake
-$::isWiz = $in->do_pkgs->is_installed(q(wizard));
+
+$::isWiz = -e "/usr/sbin/wizdrake"; #- $in->do_pkgs->is_installed(q(wizard));
my @tree =
( [_("Boot"), 'boot-mdk',
@@ -83,18 +84,6 @@ my @tree =
[_("Printer"),'printer-mdk.png', "$_sbindir/print.pm"],
[_("Keyboard"), 'keyboard-mdk.png', "$_sbindir/keyboarddrake"],
[_("Mount Points"),'partition-mdk.png', "$_sbindir/diskdrake"],
- [_("Display"),'XFdrake-mdk.png', "$_sbindir/XFdrake"],
- [_("Hardware"),'harddrake-mdk.png', "$_sbindir/harddrake"],
- [_("Mouse"), 'mousedrake-mdk.png', "$_sbindir/mousedrake"],
- [_("Printer"),'printer-mdk.png', "$_sbindir/print.pm"],
- [_("Keyboard"), 'keyboard-mdk.png', "$_sbindir/keyboarddrake"],
- [_("Mount Points"),'partition-mdk.png', "$_sbindir/diskdrake"],
- [_("Display"),'XFdrake-mdk.png', "$_sbindir/XFdrake"],
- [_("Hardware"),'harddrake-mdk.png', "$_sbindir/harddrake"],
- [_("Mouse"), 'mousedrake-mdk.png', "$_sbindir/mousedrake"],
- [_("Printer"),'printer-mdk.png', "$_sbindir/print.pm"],
- [_("Keyboard"), 'keyboard-mdk.png', "$_sbindir/keyboarddrake"],
- [_("Mount Points"),'partition-mdk.png', "$_sbindir/diskdrake"],
]
],
[_("Network & Internet"),'net-mdk',
@@ -138,7 +127,7 @@ my $window_global = new Gtk::Window -toplevel;
$window_global->signal_connect ( delete_event => sub { quit_global(); });
$window_global->set_position(1);
$window_global->set_title( _("Mandrake Control Center %s", $_version));
-#$window_global->border_width(0);
+$window_global->set_policy(0, 1, 0);
my $notebook_global;
@@ -199,7 +188,7 @@ foreach (@tree) {
}
});
$darea_left->signal_connect( button_release_event => sub {
- $darea_left->{state} == 2 and $notebook_global->set_page($index), return;
+ $darea_left->{state} == 2 and $notebook_global->set_page($index-1), return;
foreach (@darea_left_list) {
$_->[1]->window->set_cursor($cursor_hand);
if($_->[1]->{state} != 0) {
@@ -209,20 +198,13 @@ foreach (@tree) {
}
$darea_left->window->set_cursor($cursor_normal);
$darea_left->{state} = 2, $darea_left->draw(undef);
- print "index : $index \n";
- $notebook_global->set_page($index);
+# print "index : $index \n";
+ $notebook_global->set_page($index - 1);
});
push @darea_left_list, [ ($index-1)*45, $darea_left ];
}
-#my $fix;
-#$window_global->add($fix = new Gtk::Fixed);
-#$fix->put(gtkpng("XFdrake-mdk.png"), 75, 65);
-#$window_global->show_all;
-#Gtk->main;
-
-
$window_global->add(
gtkpack_(new Gtk::VBox(0, 0),
0, my $title_w = get_main_menu($window_global),
@@ -244,7 +226,7 @@ $window_global->add(
foreach (@darea_left_list) {
$fixed_left->put($_->[1], 0, $_->[0]);
}
-$fixed_left->signal_connect(realize => sub { $fixed_left->window->set_back_pixmap($back[0], 0) });
+$fixed_left->signal_connect( realize => sub { $fixed_left->window->set_back_pixmap($back[0], 0) });
# my $dbl_arealast;
# $last_darea->signal_connect( size_allocate => sub { $dbl_arealast = undef });
@@ -290,51 +272,53 @@ $darea_title->signal_connect( expose_event => sub {
my ($pixmap_back_right, undef) = gtkcreate_png('mcc-core-back');
-my ($pix_splash_map, undef) = gtkcreate_png('mcc-splash');
-my $pix_dbl;
-$notebook_global->append_page(createScrolledWindow(my $fixed_about = new Gtk::Fixed, ['automatic', 'automatic']), undef);
-$fixed_about->put(gtkset_usize(my $darea1 = new Gtk::DrawingArea, 540, 460), 0, 0);
-$fixed_about->signal_connect(realize => sub { $fixed_about->window->set_back_pixmap($pix_splash_map, 0) });
-$darea1->signal_connect( size_allocate => sub { $pix_dbl = undef });
-$darea1->signal_connect( expose_event => sub {
- my ($dx, $dy) = ($darea1->allocation->[2], $darea1->allocation->[3]);
- if (!defined($pix_dbl)) {
- $pix_dbl = new Gtk::Gdk::Pixmap($darea1->window, $dx, $dy);
-
-# fill_tiled($darea1, $pix_dbl, $pixmap_back_right, 540, 460, $dx, $dy);
- $pix_dbl->draw_pixmap($darea1->style->white_gc, $pix_splash_map,
- 0, 0, ($dx-540)/2, ($dy-460)/2, 540, 460);
- my $style = new Gtk::Style;
- my $style_dflt = new Gtk::Style;
- $style->font(Gtk::Gdk::Font->fontset_load(_("-urw-helvetica-medium-r-normal-*-*-190-*-*-p-*-iso8859-1")));
- #_("-adobe-times-bold-r-normal--17-*-100-100-p-*-iso8859-*,*-r-*")));
- $pix_dbl->draw_string($style->font, $darea1->style->black_gc, 80, 165, _("Welcome to the Mandrake Control Center") );
- my @revtree;
- open VERS, "/etc/mandrake-release" or die _("cannot open this file for read: %s", $!);
- while (<VERS>) { push (@revtree,$_) }
- my @info_tree = split / /, $revtree[0];
- my ($sysname, $nodename, $release, $version, $machine) = POSIX::uname();
- my $style1 = new Gtk::Style;
- $style1->font(Gtk::Gdk::Font->fontset_load(_("-urw-helvetica-medium-r-normal-*-*-90-*-*-p-*-iso8859-1")));
- #_("-adobe-times-bold-r-normal--14-*-100-100-p-*-iso8859-*,*-r-*")));
- my $i=0;
- foreach(
- [_("System:"), "$info_tree[0] $info_tree[1] $info_tree[3] $info_tree[4]"],
- [_("Hostname:"), $nodename],
- [_("Kernel Version:"), "$release $version"],
- [_("Machine:"), $machine] ) {
- $pix_dbl->draw_string($style_dflt->font, $darea1->style->black_gc, 80, 200+$i, $_->[0]);
- $pix_dbl->draw_string($style_dflt->font, $darea1->style->black_gc, 81, 200+$i, $_->[0]);
- $pix_dbl->draw_string($style_dflt->font, $darea1->style->black_gc, 200, 200+$i, $_->[1]);
- $i+=20;
- }
- }
- $darea1->window->draw_pixmap ($darea1->style->white_gc,
- $pix_dbl, 0, 0,
- ($darea1->allocation->[2]-540)/2, ($darea1->allocation->[3]-460)/2,
- 540, 460);
- 0;
- });
+# my ($pix_splash_map, undef) = gtkcreate_png('mcc-splash');
+# my $pix_dbl;
+# $notebook_global->append_page(my $scrolled_about = createScrolledWindow(my $fixed_about = new Gtk::Fixed, ['automatic', 'automatic']), undef);
+# $scrolled_about->set_usize(544, 464);
+# $fixed_about->put(gtkset_usize(my $darea1 = new Gtk::DrawingArea, 540, 460), 0, 0);
+# $fixed_about->signal_connect( realize => sub { $fixed_about->window->set_back_pixmap($pix_splash_map, 0) });
+# $fixed_about->signal_connect( configure_event => sub { print "CONFIGURE\n"; });
+# $darea1->signal_connect( size_allocate => sub { $pix_dbl = undef });
+# $darea1->signal_connect( expose_event => sub {
+# my ($dx, $dy) = ($darea1->allocation->[2], $darea1->allocation->[3]);
+# if (!defined($pix_dbl)) {
+# $pix_dbl = new Gtk::Gdk::Pixmap($darea1->window, $dx, $dy);
+
+# # fill_tiled($darea1, $pix_dbl, $pixmap_back_right, 540, 460, $dx, $dy);
+# $pix_dbl->draw_pixmap($darea1->style->white_gc, $pix_splash_map,
+# 0, 0, ($dx-540)/2, ($dy-460)/2, 540, 460);
+# my $style = new Gtk::Style;
+# my $style_dflt = new Gtk::Style;
+# $style->font(Gtk::Gdk::Font->fontset_load(_("-urw-helvetica-medium-r-normal-*-*-190-*-*-p-*-iso8859-1")));
+# #_("-adobe-times-bold-r-normal--17-*-100-100-p-*-iso8859-*,*-r-*")));
+# $pix_dbl->draw_string($style->font, $darea1->style->black_gc, 80, 165, _("Welcome to the Mandrake Control Center") );
+# my @revtree;
+# open VERS, "/etc/mandrake-release" or die _("cannot open this file for read: %s", $!);
+# while (<VERS>) { push (@revtree,$_) }
+# my @info_tree = split / /, $revtree[0];
+# my ($sysname, $nodename, $release, $version, $machine) = POSIX::uname();
+# my $style1 = new Gtk::Style;
+# $style1->font(Gtk::Gdk::Font->fontset_load(_("-urw-helvetica-medium-r-normal-*-*-90-*-*-p-*-iso8859-1")));
+# #_("-adobe-times-bold-r-normal--14-*-100-100-p-*-iso8859-*,*-r-*")));
+# my $i=0;
+# foreach(
+# [_("System:"), "$info_tree[0] $info_tree[1] $info_tree[3] $info_tree[4]"],
+# [_("Hostname:"), $nodename],
+# [_("Kernel Version:"), "$release $version"],
+# [_("Machine:"), $machine] ) {
+# $pix_dbl->draw_string($style_dflt->font, $darea1->style->black_gc, 80, 200+$i, $_->[0]);
+# $pix_dbl->draw_string($style_dflt->font, $darea1->style->black_gc, 81, 200+$i, $_->[0]);
+# $pix_dbl->draw_string($style_dflt->font, $darea1->style->black_gc, 200, 200+$i, $_->[1]);
+# $i+=20;
+# }
+# }
+# $darea1->window->draw_pixmap ($darea1->style->white_gc,
+# $pix_dbl, 0, 0,
+# ($darea1->allocation->[2]-540)/2, ($darea1->allocation->[3]-460)/2,
+# 540, 460);
+# 0;
+# });
$window_global->realize;