diff options
author | Daouda Lo <daouda@mandriva.com> | 2001-02-21 05:11:36 +0000 |
---|---|---|
committer | Daouda Lo <daouda@mandriva.com> | 2001-02-21 05:11:36 +0000 |
commit | c225e04b77e19b77f5ed9672030b3b35d0f062c8 (patch) | |
tree | 22a0b36149559406b73b8fd07a0f2d5b31454241 | |
parent | a7f2b0f93fde2c2080a18328ebdfcac4a2515b03 (diff) | |
download | control-center-c225e04b77e19b77f5ed9672030b3b35d0f062c8.tar control-center-c225e04b77e19b77f5ed9672030b3b35d0f062c8.tar.gz control-center-c225e04b77e19b77f5ed9672030b3b35d0f062c8.tar.bz2 control-center-c225e04b77e19b77f5ed9672030b3b35d0f062c8.tar.xz control-center-c225e04b77e19b77f5ed9672030b3b35d0f062c8.zip |
kill apps properly
-rwxr-xr-x | control-center3 | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/control-center3 b/control-center3 index e7558ca3..012428ae 100755 --- a/control-center3 +++ b/control-center3 @@ -258,40 +258,32 @@ sub about_mdk_cc sub splash_warning { my ($label) = @_; - my $window_about = new Gtk::Dialog(); - $window_about->set_position(1); + my $win_about = new Gtk::Dialog(); + $win_about->set_position(1); my $button = new Gtk::Button(_("Close")); $button->signal_connect_object("clicked",$window_about => 'destroy'); - $window_about->action_area->pack_start($button,$true,$true,0); + $win_about->action_area->pack_start($button,$true,$true,0); my $lab = new Gtk::Label($label); my $style1 = new Gtk::Style; $style1->font(Gtk::Gdk::Font->fontset_load(_("-adobe-times-bold-r-normal--14-*-100-100-p-*-iso8859-*,*-r-*"))); $lab->set_style($style1); - $window_about->vbox->pack_start( $lab, $true, $true, 0 ); + $win_about->vbox->pack_start( $lab, $true, $true, 0 ); - $window_about->show_all(); - $window_about->set_modal(1); + $win_about->show_all(); + $win_about->set_modal(1); } sub connect_to_site { my ($link)=@_; my $browser="netscape"; - if (system("$browser -geometry 600x800+10+10 -no-about-splash $link ") == 127) + if (system("$browser -geometry 600x800+10+10 -no-about-splash $link ")) { splash_warning(_("You seems to not have Netscape installed")); } } -sub connect_exp_site -{ - my $exp_site_url="http://www.mandrakeexpert.com/"; - my $browser="netscape"; - system("$browser -geometry 600x800+10+10 -no-about-splash $exp_site_url &") -} - - sub create_tree_item { my ($parent_tree, $label, $pixmap, $tree_depth_max) =@_; @@ -351,7 +343,6 @@ sub xpm_label_box sub exec_treeitem { my ($label, $exec_string) = @_; -#exec_treeitem($tree_exec{$label},1);}); if ($exec_string) { print _("SELECTED\n"); if ($tree_launched{$label}==-1) { @@ -365,7 +356,13 @@ sub exec_treeitem my $a = $exec_string . " --embedded " . $socket->window->XWINDOW . " " . $$; print "$a\n"; my $pid; - ($pid = fork()) ? $pid_launched[$nb_pages] = $pid : exec ($a) or print STDERR _("couldn't exec $a: $!"); + #($pid = fork) ? $pid_launched[$nb_pages] = $pid : system($a) == 0 or splash_warning(_("couldn't exec $a: $!")); + unless ($pid = fork) { + splash_warning("cannot fork: $~") unless defined $pid; + exec("$a"); + my $kid = waitpid(-1,&WNOHANG); + } + $pid_launched[$nb_pages] = $kid; $nb_pages++; $tree_launched{$label}=$nb_pages; $notebook_global->set_page($nb_pages); |