summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-09-01 03:52:20 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-09-01 03:52:20 +0000
commitda7b7117f82f6b2f6d8ef5e349270ce5d98e3c64 (patch)
treedf2cf5ffde12cf8053ded9a56cf9f9dbd65b719a
parent500a37f6c9bceb221356b5d1c4daa600722290d3 (diff)
downloadcontrol-center-da7b7117f82f6b2f6d8ef5e349270ce5d98e3c64.tar
control-center-da7b7117f82f6b2f6d8ef5e349270ce5d98e3c64.tar.gz
control-center-da7b7117f82f6b2f6d8ef5e349270ce5d98e3c64.tar.bz2
control-center-da7b7117f82f6b2f6d8ef5e349270ce5d98e3c64.tar.xz
control-center-da7b7117f82f6b2f6d8ef5e349270ce5d98e3c64.zip
new look
-rwxr-xr-xcontrol-center67
1 files changed, 23 insertions, 44 deletions
diff --git a/control-center b/control-center
index 8dcf37d8..2f8e0847 100755
--- a/control-center
+++ b/control-center
@@ -541,16 +541,16 @@ update_profiles();
gtkadd($window_global,
gtkpack_(Gtk2::VBox->new(0, 0),
0, $menu,
+ 0, my $banner_notebook = Gtk2::Notebook->new,
+ 0, Gtk2::HSeparator->new,
# 0, gtkset_size_request(Gtk2::VBox->new(10, 10), -1, 2),
- 1, gtkpack_(Gtk2::VBox->new(0, 0),
- 0, my $banner_notebook = Gtk2::Notebook->new,
- 0, Gtk2::HSeparator->new,
+ 1, gtkpack_(Gtk2::HBox->new(0, 0),
1, my $notebook_global = gtkset_name(Gtk2::Notebook->new, 'mcc'),
1, gtkpack(my $emb_box = Gtk2::VBox->new(0, 0),
my $wait_darea = gtkset_size_request(Gtk2::DrawingArea->new, -1, -1),
),
- 0, Gtk2::HSeparator->new,
),
+ 0, Gtk2::HSeparator->new,
0, my $buttons = gtkadd(gtkset_layout(Gtk2::HButtonBox->new, 'start'),
map { gtkset_border_width($_, 3) }
gtksignal_connect(my $cancel = Gtk2::Button->new(N("Cancel")),
@@ -559,12 +559,6 @@ gtkadd($window_global,
kill_children();
child_just_exited();
}),
- gtksignal_connect(my $previous = Gtk2::Button->new(N("Previous")),
- clicked => sub {
- $page_id = 0;
- warn_on_startup();
- },
- ),
gtkset_sensitive(gtkset_relief(Gtk2::Button->new(""), 'none'), 0),
),
)
@@ -596,10 +590,11 @@ my (undef, $nodename) = POSIX::uname();
$window_global->set_title(N("Mandrakelinux Control Center %s [on %s]", $version, $nodename));
$window_global->set_position('center');
-foreach my $notebook ($notebook_global, $banner_notebook) {
+foreach my $notebook ($banner_notebook) {
$notebook->set_property('show-border', 0);
$notebook->set_property('show-tabs', 0);
}
+$notebook_global->set_property('tab-pos', 'left');
# banner :
@@ -608,23 +603,13 @@ add2notebook($banner_notebook, "", Gtk2::Banner->new("/usr/share/icons/large/dra
N("Welcome to the Mandrakelinux Control Center")));
-# main page (summary) :
-
-add2notebook($notebook_global, "", create_scrolled_window(gtkset_size_request(my $main_page = Gtk2::HBox->new,
- 50, 50),
- [ 'never', 'automatic' ], 'none',
- ),
- );
-
-
-
my ($hand_cursor, $normal_cursor, $wait_cursor) = map { Gtk2::Gdk::Cursor->new($_) } qw(hand2 left-ptr watch);
my ($index, $left_locked) = (0, 0);
my $spacing = 25;
-my (@main_icons, %tool_callbacks);
+my %tool_callbacks;
foreach (@tree) {
my ($text, $icon, $subtree) = @$_;
@@ -681,25 +666,22 @@ foreach (@tree) {
$event_box;
} @subtree));
- add2notebook($notebook_global, "",
+ # b/c we use Pango text markup language, we've to protect '&' caracter:
+ $text =~ s/&/&amp;/g;
+ gtkappend_page($notebook_global,
my $_w_ret = create_scrolled_window(gtkset_border_width($tbl, 5),
[ 'never', 'automatic' ], 'none',
),
+ gtkpack__(Gtk2::HBox->new,
+ Gtk2::Image->new_from_pixbuf(::scale(gtkcreate_pixbuf($icon), -16)),
+ gtkset_markup(Gtk2::Label->new, '<span weight="bold">' . $text . '</span>'),
+ ),
);
# $w_ret->vscrollbar->set_size_request(19, undef);
- push @main_icons, $box;
add2notebook($banner_notebook, "", Gtk2::Banner->new($icon, $text));
}
-gtkadd($main_page,
- create_scrolled_window(create_packtable({ col_spacings => $spacing, row_spacings => $spacing, homogeneous => 1, mcc => 1 },
- group_by3(@main_icons)),
- [ 'never', 'automatic' ],
- 'none',
- )
- );
-
foreach (keys %check_boxes) {
my $widget = $check_boxes{$_};
@@ -754,7 +736,7 @@ $notebook_global->signal_connect(switch_page => sub {
});
$window_global->show_all;
-show_hide_previous(0);
+hide_buttons();
$emb_box->hide;
$wait_darea->realize;
@@ -811,10 +793,10 @@ sub child_just_exited() {
undef $emb_socket;
}
$emb_box->hide;
- show_hide_previous(1);
+ hide_buttons();
$cancel->hide;
gtkset_mousecursor_normal();
- foreach my $notebook ($previous, $notebook_global, $banner_notebook) {
+ foreach my $notebook ($notebook_global, $banner_notebook) {
$notebook->show;
}
@@ -844,7 +826,7 @@ sub create_hidden_socket {
$banner->show;
stop_wait_area();
$left_locked = 0;
- show_hide_previous(0);
+ hide_buttons();
$buttons->hide;
return if !$emb_socket;
$emb_socket->show;
@@ -899,10 +881,10 @@ sub compute_exec_string {
$emb_socket->realize;
$pending_app = 1;
if ($gtkplug > 0) {
+ $buttons->show;
$exec .= " --embedded " . $emb_socket->get_id;
$wait_darea->show;
$cancel->show;
- $previous->hide;
$run_pixbuf = gtkcreate_pixbuf($icon . "_128");
$run_counter = 255;
$run_counter_add = -5;
@@ -937,6 +919,7 @@ sub compute_exec_string {
1;
});
$left_locked = 1;
+ $buttons->show;
$tool_pids{$label} = fork_($exec);
} else { # gtkplug == 0
$emb_box->grab_focus;
@@ -1160,15 +1143,11 @@ sub set_page {
start_logdrake();
set_page_raw($index);
$help_on_context = $ctx[$index];
- show_hide_previous($index);
+ hide_buttons();
}
-sub show_hide_previous {
- my ($bool) = @_;
- if ($bool) {
- $previous->show;
- $buttons->show;
- } else { $previous->hide }
+sub hide_buttons {
+ $buttons->hide;
$cancel->hide;
}