summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2002-01-29 11:51:48 +0000
committerdamien <damien@mandriva.com>2002-01-29 11:51:48 +0000
commit1efd7731d5c919739d17fe4a96fda0cf7ad53707 (patch)
tree4b8b991938b21058e036ab52c71a2e082ebd0b7c
parente8977aa8a26f784ac8c8e17fae431a79d97a3931 (diff)
downloadcontrol-center-1efd7731d5c919739d17fe4a96fda0cf7ad53707.tar
control-center-1efd7731d5c919739d17fe4a96fda0cf7ad53707.tar.gz
control-center-1efd7731d5c919739d17fe4a96fda0cf7ad53707.tar.bz2
control-center-1efd7731d5c919739d17fe4a96fda0cf7ad53707.tar.xz
control-center-1efd7731d5c919739d17fe4a96fda0cf7ad53707.zip
better icon placement
-rwxr-xr-xcontrol-center108
1 files changed, 65 insertions, 43 deletions
diff --git a/control-center b/control-center
index 8dd777a3..af53fd07 100755
--- a/control-center
+++ b/control-center
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
# $Id$
# Copyright (C) 1999-2001 MandrakeSoft
@@ -48,7 +48,7 @@ Gtk->set_locale;
use Config;
use POSIX;
-my $_version = "0.89";
+my $_version = "0.90";
my $in = 'interactive'->vnew('su', 'default');
@@ -135,7 +135,7 @@ my $nb_pages=0;
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->set_title( _("Mandrake Control Center %s", 'beta' )); #$_version));
$window_global->set_policy(0, 1, 0);
my $notebook_global;
@@ -144,6 +144,7 @@ my ($pixmap_back_left, undef) = gtkcreate_png('mcc-left-back');
my @darea_left_list;
my $cursor_hand = new Gtk::Gdk::Cursor 60;
my $cursor_normal = new Gtk::Gdk::Cursor 68;
+my $cursor_busy = new Gtk::Gdk::Cursor 150;
my @back;
($back[0], undef) = gtkcreate_png('mcc-left-back');
($back[2], undef) = gtkcreate_png('mcc-left-back2');
@@ -151,7 +152,7 @@ $back[1] = $back[0];
my $style_dflt = new Gtk::Style;
# fontsets *must* be used in order to allow proper font selection for non
# latin1 languages; never use a simple font, *always* load a fontset
-$style_dflt->font(Gtk::Gdk::Font->fontset_load(_("-*-times-bold-r-normal-*-14-*-*-*-p-*-iso8859-1,*-r-*")));
+# $style_dflt->font(Gtk::Gdk::Font->fontset_load(_("-*-times-bold-r-normal-*-14-*-*-*-p-*-iso8859-1,*-r-*")));
my $index = 0;
foreach (@tree) {
$index++;
@@ -210,7 +211,6 @@ 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 - 1);
});
@@ -235,22 +235,11 @@ $window_global->add(
)
)
);
+
foreach (@darea_left_list) {
$fixed_left->put($_->[1], 0, $_->[0]);
}
-my ($check1, $check2);
-$fixed_left->signal_connect( realize => sub {
- $fixed_left->window->set_back_pixmap($back[0], 0);
- $fixed_left->put(gtkshow(gtkset_usize(new Gtk::HSeparator, $fixed_left->allocation->[2], 0)), 0, $index * 45 + 5);
- $fixed_left->put(gtkpack__(gtkshow(new Gtk::VBox),
- (map { $_->[0] = gtkset_usize(new Gtk::CheckButton($_->[1]), $fixed_left->allocation->[2] - 30, 0) }
- ([$check1, _("display logs")], [$check2, _("launch embedded")])),
- gtkset_usize(new Gtk::HBox, 0, 5)
- ),
- 15, $index * 45 + 10);
- });
-
# my $dbl_arealast;
# $last_darea->signal_connect( size_allocate => sub { $dbl_arealast = undef });
# $last_darea->signal_connect( expose_event => sub {
@@ -271,6 +260,7 @@ my ($pixmap_icon, undef) = gtkcreate_png('mcc-title-icon');
$fixed_title->put(my $darea_title = gtkset_usize(new Gtk::DrawingArea, 450, 55), 0, 0);
#FIXME
+$fixed_left->signal_connect( realize => sub { $fixed_left->window->set_back_pixmap($pixmap_back_left, 0) });
$fixed_title->signal_connect( realize => sub { $fixed_title->window->set_back_pixmap($pixmap_back, 0) });
$darea_title->signal_connect( configure_event => sub { $dbl_area = undef });
@@ -280,13 +270,13 @@ $darea_title->signal_connect( expose_event => sub {
if (!defined($dbl_area)) {
# *always* uyse a fontset to write something on screen
my ($pix, $width, $height) = create_pix_text($darea_title, _("welcome"), "#255#255#255",
- Gtk::Gdk::Font->fontset_load( _("-*-helvetica-medium-r-normal-*-*-190-*-*-p-*-iso8859-1,*-r-*")),
+ undef, #Gtk::Gdk::Font->fontset_load( _("-*-helvetica-medium-r-normal-*-*-190-*-*-p-*-iso8859-1,*-r-*")),
max($dx-336, 0), $dy, 0, 1, $pixmap_back, 110, 55, 0, 0);
$dbl_area = new Gtk::Gdk::Pixmap($darea_title->window, $dx, $dy);
fill_tiled($darea_title, $dbl_area, $pixmap_back, 110, 55, $dx, $dy);
$dbl_area->draw_pixmap($darea_title->style->bg_gc('normal'),
$pixmap_icon, 0, 0, 0, 0, 336, 55);
- my $y_pos = int( (55-$height)/2/5 )*5 + 10;
+ my $y_pos = int( (55-$height)/2/5 )*5 + 15;
$dbl_area->draw_pixmap($darea_title->style->bg_gc('normal'),
$pix, 0, 0, 336, $y_pos, $width, $height);
}
@@ -344,14 +334,16 @@ my ($pixmap_back_right, undef) = gtkcreate_png('mcc-core-back');
# 0;
# });
-$window_global->realize;
my $cursor = new Gtk::Gdk::Cursor 15;
-$notebook_global->append_page(gtkicons_labels_widget($_->[2], $window_global, "#0#0#0", $style_dflt->font,
- #"-urw-times-bold-r-normal-*-*-100-*-*-p-*-iso8859-1"),
- $pixmap_back_right, 540, 460, 55, 50, 50, 50, 50, 50)
- ) foreach @tree;
+foreach (@tree) {
+ my $w = gtkicons_labels_widget($_->[2], $window_global, "#0#0#0", $style_dflt->font,
+ #"-urw-times-bold-r-normal-*-*-100-*-*-p-*-iso8859-1"),
+ $pixmap_back_right, 540, 460, 55, 50, 50, 50, 50, 50);
+ $notebook_global->append_page($w);
+}
$window_global->show_all;
+$window_global->realize;
my @pid_launched;
my %tree_launched;
@@ -387,7 +379,18 @@ my %tree_launched;
# )
# }
+$window_global->hide;
+Gtk->main_iteration while Gtk->events_pending;
+$notebook_global->signal_connect( switch_page => sub {
+ my (undef, $tab_widget, $tab_number) = @_;
+ $tab_widget->child->child->child->{redraw_function}->();
+ });
+foreach (0..$#tree) {
+ $notebook_global->set_page($_);
+ Gtk->main_iteration while Gtk->events_pending;
+}
$notebook_global->set_page(0);
+$window_global->show;
my @anim;
($anim[$_]->[0], $anim[$_]->[1]) = gtkcreate_png("$png_path/anim_" . ($_ + 1) . ".png") foreach (0..9);
@@ -742,23 +745,42 @@ sub about_mdk_cc {
}
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(
- (
- { path => _("/_File"), type => '<Branch>' },
- { path => _("/File")._("/_Quit"), accelerator => _("<control>Q"), callback => \&quit_global },
- { path => _("/_Help"),type => '<Branch>' },
-# { path => _("/Help")._("/_Help on line"), callback => sub { Gtk->exit(0) } },
- { path => _("/Help")._("/_Report Bug") , callback => sub {connect_to_site("https://qa.mandrakesoft.com/");}},
- { path => _("/Help/-"), type => '<Separator>' },
- { path => _("/Help")._("/Mandrake_Campus"), callback => sub {connect_to_site("http://www.mandrakecampus.com/");} },
- { path => _("/Help")._("/Mandrake_Expert"), callback => sub {connect_to_site("http://www.mandrakeexpert.com/");} },
- { path => _("/Help/-"), type => '<Separator>' },
- { path => _("/Help")._("/_About..."), callback => \&about_mdk_cc }
- )
- );
- $window->add_accel_group($accel_group);
- return ($item_factory->get_widget('<main>'));
+ my ($window) = @_;
+ my $accel_group = new Gtk::AccelGroup();
+ my $item_factory = new Gtk::ItemFactory('Gtk::MenuBar', '<main>', $accel_group);
+ $item_factory->create_items(
+ (
+ { path => _("/_File"),
+ type => '<Branch>' },
+ { path => _("/File")._("/_Quit"),
+ accelerator => _("<control>Q"),
+ callback => \&quit_global },
+ { path => _("/_Options"),
+ type => '<Branch>' },
+ { path => _("/Options")._("/Display _Logs"),
+ callback => \&display_logs,
+ type => '<CheckItem>'
+ },
+ { path => _("/Options")._("/_Embedded Mode"),
+ callback => \&embedded_mode,
+ type => '<ToggleItem>'},
+ { path => _("/_Help"),
+ type => '<Branch>' },
+# { path => _("/Help")._("/_Help on line"), callback => sub { Gtk->exit(0) } },
+# { path => _("/Help")._("/_Report Bug"),
+# callback => \&connect_to_site("https://qa.mandrakesoft.com/")},
+# { path => _("/Help/-"),
+# type => '<Separator>' },
+# { path => _("/Help")._("/Mandrake_Campus"),
+# callback => \&connect_to_site("http://www.mandrakecampus.com/") },
+# { path => _("/Help")._("/Mandrake_Expert"),
+# callback => \&connect_to_site("http://www.mandrakeexpert.com/") },
+# { path => _("/Help/-"),
+# type => '<Separator>' },
+ { path => _("/Help")._("/_About..."),
+ callback => \&about_mdk_cc }
+ )
+ );
+ $window->add_accel_group($accel_group);
+ return ($item_factory->get_widget('<main>'));
}