summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-05-19 15:50:07 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-05-19 15:50:07 +0000
commit47ad8baa1452500d330c10f19e72e2c4be695a82 (patch)
tree2f03177074d74f76536b873cbd726cc1b669851d
parent6caa708d82dec98cbaf3240ff5db4c7dbb32d8b5 (diff)
downloadcontrol-center-47ad8baa1452500d330c10f19e72e2c4be695a82.tar
control-center-47ad8baa1452500d330c10f19e72e2c4be695a82.tar.gz
control-center-47ad8baa1452500d330c10f19e72e2c4be695a82.tar.bz2
control-center-47ad8baa1452500d330c10f19e72e2c4be695a82.tar.xz
control-center-47ad8baa1452500d330c10f19e72e2c4be695a82.zip
- perl_checker fixes
- (new_pixbuf): o height and width are never provided but always calculated o height and width were inverted
-rwxr-xr-xcontrol-center57
1 files changed, 28 insertions, 29 deletions
diff --git a/control-center b/control-center
index 807f06e8..40dc8969 100755
--- a/control-center
+++ b/control-center
@@ -421,7 +421,7 @@ evil command line.")) ]
-$notebook_global->append_page($summary);
+$notebook_global->append_page($summary, "");
use POSIX qw(:sys_utsname_h :math_h :sys_wait_h :unistd_h);
@@ -562,9 +562,10 @@ foreach (@tree) {
} @$subtree));
$notebook_global->append_page(
- my $w_ret = create_scrolled_window(gtkset_border_width($tbl, 5),
+ my $_w_ret = create_scrolled_window(gtkset_border_width($tbl, 5),
[ 'never', 'automatic' ], 'none'
- )
+ ),
+ ""
);
# $w_ret->vscrollbar->set_size_request(19, undef);
}
@@ -629,7 +630,7 @@ Gtk2->main;
# socket/plug managment
# when child properly exited
-sub child_just_exited {
+sub child_just_exited() {
$pending_app = 0;
$left_locked = 0;
clean_socket();
@@ -638,19 +639,19 @@ sub child_just_exited {
Gtk2->timeout_remove($timeout) if $timeout;
}
-sub hide_socket_and_clean {
+sub hide_socket_and_clean() {
$emb_frame->hide;
$pending_app = 0;
update_exp();
}
-sub clean_socket {
+sub clean_socket() {
hide_socket_and_clean();
&kill_children();
undef $emb_socket;
}
-sub create_hidden_socket_if_needed {
+sub create_hidden_socket_if_needed() {
hide_socket_and_clean(); # clean_socket();
unless ($emb_socket) {
gtkpack($emb_box, gtksignal_connect($emb_socket = Gtk2::Socket->new, 'plug-removed' => \&child_just_exited));
@@ -667,7 +668,7 @@ sub create_hidden_socket_if_needed {
$emb_wait->hide;
}
-sub update_exp {
+sub update_exp() {
return if $still_in_splash_screen || $pending_app;
if ($option_values{show_log}) {
$w_exp->show_all;
@@ -682,12 +683,12 @@ sub update_exp {
# signals managment
# got when child unexpectedly died and gone in zombie state
-sub sig_child {
+sub sig_child() {
# reap zombies
my $kid;
do { $kid = waitpid(-1, POSIX::WNOHANG) } until $kid > 0;
return unless $left_locked;
- child_just_exited
+ child_just_exited();
splash_warning(N("This program has exited abnormally"));
}
@@ -703,12 +704,12 @@ my @pid_exp;
sub fork_ {
- my ($prog, $pid_table) = @_;
- $pid_table ||= \@pid_launched;
+ my ($prog, $o_pid_table) = @_;
+ $o_pid_table ||= \@pid_launched;
my $pid = fork();
if (defined $pid) {
!$pid and do { exec($prog) or POSIX::_exit(1) }; # immediate exit, else forked gtk+ object destructors will badly catch up parent mcc
- push @$pid_table, $pid if $option_values{embedded};
+ push @$o_pid_table, $pid if $option_values{embedded};
} else {
splash_warning(N("cannot fork: %s", "$!"));
child_just_exited();
@@ -789,29 +790,28 @@ sub launch_xapp {
fork_($exec);
my @after = &$find_windows();
require Time::HiRes;
- while (@after ne $xx + @before) {
+ while (@after != $xx + @before) {
Time::HiRes::usleep(50);
@after = &$find_windows()
}
my $c = top(difference2(\@after, \@before));
- $c =~ /\s*([0-9]*)\s*/;
- return $1;
+ return $1 if $c =~ /\s*([0-9]*)\s*/;
}
sub kill_them_all {
map { if__($_, kill 'TERM', $_) } @_;
}
-sub kill_children {
+sub kill_children() {
kill_them_all(@pid_launched);
@pid_launched = ();
}
-sub kill_logdrake {
+sub kill_logdrake() {
kill_them_all(@pid_exp);
}
-sub quit_global {
+sub quit_global() {
&kill_children();
&kill_logdrake();
setVarsInSh($conffile, {
@@ -830,14 +830,14 @@ sub quit_global {
# mcc dialog specific functions
sub splash_warning {
- my ($label, $cancel_button) = @_;
+ my ($label, $o_cancel_button) = @_;
my $ret;
my $window = new_dialog(N("Warning"), 1);
gtkpack__($window->action_area,
gtkadd(Gtk2::HButtonBox->new,
- gtksignal_connect(Gtk2::Button->new($cancel_button ? N("OK") : N("Close")), clicked => sub { $ret = 1; Gtk2->main_quit }),
- if_($cancel_button, gtksignal_connect(Gtk2::Button->new(N("Cancel")), clicked => sub { Gtk2->main_quit })),
+ gtksignal_connect(Gtk2::Button->new($o_cancel_button ? N("OK") : N("Close")), clicked => sub { $ret = 1; Gtk2->main_quit }),
+ if_($o_cancel_button, gtksignal_connect(Gtk2::Button->new(N("Cancel")), clicked => sub { Gtk2->main_quit })),
)
);
gtkpack($window->vbox,
@@ -851,7 +851,7 @@ sub splash_warning {
}
sub new_dialog {
- my ($title, $no_button) = @_;
+ my ($title, $o_no_button) = @_;
my $dialog = gtkset_border_width(Gtk2::Dialog->new(), 10);
$dialog->set_transient_for($window_global);
$dialog->set_position('center-on-parent');
@@ -859,11 +859,11 @@ sub new_dialog {
$dialog->action_area->pack_start(gtkadd(Gtk2::HButtonBox->new,
gtksignal_connect(Gtk2::Button->new(N("Close")), clicked => sub { $dialog->destroy })
),
- 0,0,0) unless $no_button;
+ 0,0,0) unless $o_no_button;
gtkset_modal($dialog, 1);
}
-sub more_themes {
+sub more_themes() {
my $window_about = new_dialog(N("More themes"));
my $style1 = $window_about->style->copy;
# $style1->font(Gtk2::Gdk::Font->fontset_load(N("-*-helvetica-medium-r-normal-*-20-*-100-100-p-*-iso8859-1,*-r-*")));
@@ -878,7 +878,7 @@ sub more_themes {
$window_about->show_all;
}
-sub about_mdk_cc {
+sub about_mdk_cc() {
my $window_about = new_dialog(N("About - Mandrake Control Center"));
my $tree_model = Gtk2::TreeStore->new(Gtk2::GType->STRING, Gtk2::GType->STRING, Gtk2::GType->STRING);
@@ -940,9 +940,8 @@ sub set_page {
# mcc specific graphic functions:
sub new_pixbuf {
- my ($pixbuf, $width, $height) = @_;
- $width ||= $pixbuf->get_height;
- $height ||= $pixbuf->get_width;
+ my ($pixbuf) = @_;
+ my ($height, $width) = ($pixbuf->get_height, $pixbuf->get_width);
my $new_pixbuf = Gtk2::Gdk::Pixbuf->new('rgb', 1, 8, $height, $width);
$new_pixbuf->fill(0x00000000); # transparent white
$width, $height, $new_pixbuf;