diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2003-02-11 09:24:57 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2003-02-11 09:24:57 +0000 |
commit | 8c59b5f3e0626f4c030d3b96ce728e4dc518218f (patch) | |
tree | bf9b019bcf0b08566baca8fde88f96077724f0dd | |
parent | 253174bff30dc4e55c57046db12e9f847c4184cc (diff) | |
download | control-center-8c59b5f3e0626f4c030d3b96ce728e4dc518218f.tar control-center-8c59b5f3e0626f4c030d3b96ce728e4dc518218f.tar.gz control-center-8c59b5f3e0626f4c030d3b96ce728e4dc518218f.tar.bz2 control-center-8c59b5f3e0626f4c030d3b96ce728e4dc518218f.tar.xz control-center-8c59b5f3e0626f4c030d3b96ce728e4dc518218f.zip |
- (connect_to_site) : kill unused function
- (kill_them_all) : consolidate code from kill_children() and kill_logdrake()
- (compute_exec_string) : remove unused code
- sig_child(), tree parsing : remove old commented out code
- (sig_usr1) : fix crash on embedded app exit
- explanation frame: make it inner
-rwxr-xr-x | control-center | 52 |
1 files changed, 16 insertions, 36 deletions
diff --git a/control-center b/control-center index b286b5ba..b35c26b1 100755 --- a/control-center +++ b/control-center @@ -290,9 +290,7 @@ my ($menu, $factory) = create_factory_menu($window_global, } }, { path => join('', @{$options{embedded_mode}}), type => '<ToggleItem>', - callback => sub { - $embedded = $embedded_check_box->active; - } + callback => sub { $embedded = $embedded_check_box->active } }, if_($::isWiz, { path => join('', @{$options{wiz_expert}}), type => '<ToggleItem>', @@ -362,7 +360,7 @@ gtkadd($window_global, ) ), 1, my $notebook_global = gtkset_name(Gtk2::Notebook->new, 'mcc'), - 0, gtkadd(gtkset_shadow_type(gtkset_size_request(gtkset_border_width($exp_frame = Gtk2::Frame->new(N("Logs")), 5), 0, 120), 'etched_out')), + 0, gtkadd(gtkset_shadow_type(gtkset_size_request(gtkset_border_width($exp_frame = Gtk2::Frame->new(N("Logs")), 5), 0, 120), 'etched_in')), 0, gtksignal_connect(gtkset_size_request(Gtk2::DrawingArea->new(), -1, 1), realize => sub { set_back_pixbuf($_[0], gtkcreate_pixbuf('mcc-right-bottom')) }), @@ -554,8 +552,6 @@ foreach (@tree) { # my $vscrollbar = new Gtk2::VScrollbar(Gtk2::Adjustment->new); $notebook_global->append_page(my $w_ret = create_scrolled_window($tbl, undef, 'none')); -# $notebook_global->append_page(create_scrolled_window($tbl)); -# $notebook_global->append_page($tbl); # $w_ret->vscrollbar->set_size_request(19, undef); } @@ -642,7 +638,9 @@ sub update_exp { return if $still_in_splash_screen || $pending_app; if ($show_logs) { $exp_frame->show_all; - } elsif ($exp_frame) { $exp_frame->hide } + } else { + $exp_frame->hide; + } } @@ -658,7 +656,6 @@ sub sig_child { return unless $left_locked; kill('USR1', $$); splash_warning(N("This program has exited abnormally")); -# Gtk2->main } # got when child properly exited @@ -675,7 +672,7 @@ sub sig_usr1 { sub sig_usr2 { $left_locked = 0; $emb_wait->hide; - $emb_socket->show; + $emb_socket->show if $emb_socket; } @@ -744,7 +741,7 @@ sub compute_exec_string { # (re)start logdrake if needed if ($show_logs && $freeze_log) { #FIXME && !$exp_socket my $exp_socket; - gtkadd($exp_frame, gtkset_name($exp_socket = Gtk2::Socket->new), 'mcc'); + gtkadd($exp_frame, $exp_socket = Gtk2::Socket->new); $exp_socket->realize; my $exec_log = "logdrake --explain=$log_exp --embedded " . $exp_socket->window->XWINDOW . " " . $$; $freeze_log = 0; @@ -765,23 +762,27 @@ sub launch_xapp { return $1; } +sub kill_them_all { + map { if__($_, kill 'TERM', $_) } @_; +} + sub kill_children { - map { if__($_, kill 'TERM', $_) } @pid_launched; + kill_them_all(@pid_launched); @pid_launched = (); } sub kill_logdrake { - map { if__($_, kill 'TERM', $_) } @pid_exp; + kill_them_all(@pid_exp); } sub quit_global { &kill_children(); &kill_logdrake(); setVarsInSh($conffile, { - EMBEDDED => bool2text($embedded), - LOGS => bool2text($show_logs), + EMBEDDED => bool2text($embedded), + LOGS => bool2text($show_logs), EXPERT_WIZARD => bool2text($expert_wizard), - THEME => $theme, + THEME => $theme, }); gtkset_mousecursor_normal(); Gtk2->exit(0); @@ -888,27 +889,6 @@ sub about_mdk_cc { $window_about->show_all; } -sub connect_to_site { - my ($link, $help)=@_; - my $browser = $ENV{BROWSER}; - my $initial_user = $ENV{INITIAL_USER}; - - unless ($browser) { - splash_warning(" " . N("Warning: No browser specified") . " "); - return; - } - - if ($help) { - fork_("$browser $link &"); - } else { - if ($initial_user && $initial_user ne "root") { - fork_("su -m -l $initial_user -c \"$browser $link &\""); - } else { - splash_warning(" ".N("Security Warning: I'm not allowed to connect to the internet as root user")." "); - } - } -} - #------------------------------------------------------------- # mcc specific graphic functions: |