diff options
-rwxr-xr-x | control-center | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/control-center b/control-center index 8d7b7443..20add436 100755 --- a/control-center +++ b/control-center @@ -60,8 +60,8 @@ if ("@ARGV" =~ /--theme (\w+)/) { $theme = $1 } "@ARGV" =~ /--safe/ and $theme = 'default'; my_gtk::add_icon_path("$mcc_dir/$theme"); my $window_splash = new Gtk::Window -popup; -$window_splash->signal_connect ( delete_event => \&quit_global ); -$window_splash->set_title( _("Mandrake Control Center")); #$_version)); +$window_splash->signal_connect (delete_event => \&quit_global); +$window_splash->set_title(_("Mandrake Control Center")); #$_version)); $window_splash->set_policy(0, 0, 1); $window_splash->set_position(1); $window_splash->add( @@ -125,7 +125,7 @@ my $exec_hash = _("Web") => ["Web wizard", "drakwizard $_wizdir/web_wizard/web.wiz", -1 ], }; -my %wizard = ( "client" => [ _("DNS Client"), 'server-mdk'], +my %wizard = ("client" => [ _("DNS Client"), 'server-mdk'], "dhcp" => [ _("DHCP"), 'server-mdk'], "dns" => [ _("DNS"), 'server-mdk'], "ftp" => [ _("FTP"), 'server-mdk'], @@ -139,7 +139,7 @@ my %wizard = ( "client" => [ _("DNS Client"), 'server-mdk'], ); my @tree = - ( [_("Boot"), 'boot-mdk', + ([_("Boot"), 'boot-mdk', [ [_("Boot Disk"), 'drakfloppy-mdk'], [_("Boot Config"),'drakboot-mdk'], @@ -218,19 +218,19 @@ my @tree = if_($::isWiz, [_("Server Configuration"), 'wizard-mdk', [ - ( map { + (map { if_(-e '/usr/share/wizards/'.$_.'_wizard/'.$_.'.wiz', $wizard{$_}) - } keys %wizard ) + } keys %wizard) ] ]), ); #------------------------------------------------------------- -my $nb_pages=0; +my $nb_pages = 0; my $window_global = new Gtk::Window -toplevel; -$window_global->signal_connect ( delete_event => \&quit_global ); -$window_global->set_title( _("Mandrake Control Center %s", $_version)); +$window_global->signal_connect (delete_event => \&quit_global); +$window_global->set_title(_("Mandrake Control Center %s", $_version)); $window_global->set_policy(0, 1, 1); my $notebook_global; @@ -259,10 +259,10 @@ foreach (@tree) { $darea_left->{state} = 0; my $dbl_area_left; $darea_left->set_events(['exposure_mask', 'enter_notify_mask', 'leave_notify_mask', 'button_press_mask', 'button_release_mask' ]); - $darea_left->signal_connect( size_allocate => sub { $dbl_area_left = undef }); - $darea_left->signal_connect( expose_event => sub { + $darea_left->signal_connect(size_allocate => sub { $dbl_area_left = undef }); + $darea_left->signal_connect(expose_event => sub { my ($dx, $dy) = ($darea_left->allocation->[2], $darea_left->allocation->[3]); - if (!defined($dbl_area_left) || $darea_left->{state} != $dbl_area_left->{state} ) { + if (!defined($dbl_area_left) || $darea_left->{state} != $dbl_area_left->{state}) { my $state = $darea_left->{state}; my ($pix, $width, $height) = create_pix_text($darea_left, $text, "#0#0#0", $darea_left->style->font, @@ -279,20 +279,20 @@ foreach (@tree) { $darea_left->window->draw_pixmap($darea_left->style->bg_gc('normal'), $dbl_area_left, 0, 0, 0, 0, ($dx, $dy)); }); - $darea_left->signal_connect( realize => sub { $darea_left->window->set_cursor($cursor_hand) }); - $darea_left->signal_connect( enter_notify_event => sub { + $darea_left->signal_connect(realize => sub { $darea_left->window->set_cursor($cursor_hand) }); + $darea_left->signal_connect(enter_notify_event => sub { if ($darea_left->{state} == 0) { $darea_left->{state} = 1; $darea_left->draw(undef); } }); - $darea_left->signal_connect( leave_notify_event => sub { + $darea_left->signal_connect(leave_notify_event => sub { if ($darea_left->{state} == 1) { $darea_left->{state} = 0; $darea_left->draw(undef); } }); - $darea_left->signal_connect( button_release_event => sub { + $darea_left->signal_connect(button_release_event => sub { $left_locked and return; $pending_app && !splash_warning(_("The modifications done in the current module won't be saved."), 1) and return; clean_socket(); @@ -346,7 +346,7 @@ $window_global->add( 0, new Gtk::Label(_("Please wait...")), 1, new Gtk::HBox(0, 0), 0, gtkadd(gtkset_layout(gtkset_border_width(new Gtk::HButtonBox, 10), 'end'), - gtksignal_connect(new Gtk::Button(_("Cancel")), clicked => sub {kill('USR1', $$)}), + gtksignal_connect(new Gtk::Button(_("Cancel")), clicked => sub { kill('USR1', $$) }), ) ) ), @@ -389,7 +389,7 @@ foreach (@darea_left_list) { $fixed_left->put($_->[1], 0, $_->[0]); } -$fixed_left->signal_connect( realize => sub { $fixed_left->window->set_back_pixmap($pixmap_back_left, 0) }); +$fixed_left->signal_connect(realize => sub { $fixed_left->window->set_back_pixmap($pixmap_back_left, 0) }); my $dbl_area; my ($pixmap_back, undef) = gtkcreate_png_('mcc-title-back'); @@ -397,10 +397,10 @@ my ($pixmap_icon, undef) = gtkcreate_png_('mcc-title-icon'); $fixed_title->put(my $darea_title = gtkset_usize(new Gtk::DrawingArea, 335, 55), 0, 0); # 335 -> 450 -$fixed_title->signal_connect( realize => sub { $fixed_title->window->set_back_pixmap($pixmap_back, 0) }); -$darea_title->signal_connect( realize => sub { $darea_title->window->set_cursor($cursor_hand) }); +$fixed_title->signal_connect(realize => sub { $fixed_title->window->set_back_pixmap($pixmap_back, 0) }); +$darea_title->signal_connect(realize => sub { $darea_title->window->set_cursor($cursor_hand) }); $darea_title->set_events([ 'button_release_mask' ]); -$darea_title->signal_connect( button_release_event => sub { +$darea_title->signal_connect(button_release_event => sub { clean_socket(); $notebook_global->show; $notebook_global->set_page(0); @@ -410,9 +410,9 @@ $darea_title->signal_connect( button_release_event => sub { $_->[1]->draw(undef); } }); -$darea_title->signal_connect( configure_event => sub { $dbl_area = undef }); +$darea_title->signal_connect(configure_event => sub { $dbl_area = undef }); -$darea_title->signal_connect( expose_event => sub { +$darea_title->signal_connect(expose_event => sub { my @dim = @{$_[1]->{area}}; my ($dx, $dy) = ($darea_title->allocation->[2], $darea_title->allocation->[3]); if (!defined($dbl_area)) { @@ -429,27 +429,27 @@ my ($pixmap_back_right, undef) = gtkcreate_png_('mcc-core-back'); my $pix_dbl; $notebook_global->append_page(my $darea1 = new Gtk::DrawingArea);#my $fixed_about = new Gtk::Fixed); -$darea1->signal_connect( size_allocate => sub { $pix_dbl = undef }); -$darea1->signal_connect( expose_event => sub { +$darea1->signal_connect(size_allocate => sub { $pix_dbl = undef }); +$darea1->signal_connect(expose_event => sub { my ($dx, $dy) = ($darea1->allocation->[2], $darea1->allocation->[3]); if (!defined($pix_dbl)) { $pix_dbl = new Gtk::Gdk::Pixmap($darea1->window, $dx, $dy); fill_tiled($darea1, $pix_dbl, $pixmap_back_right, 540, 460, $dx, $dy); - my $style = $darea1->style->copy();; + my $style = $darea1->style->copy(); $style->font(Gtk::Gdk::Font->fontset_load(_("-*-helvetica-medium-r-normal-*-20-*-100-100-p-*-iso8859-1,*-r-*"))); - $pix_dbl->draw_string($style->font, $darea1->style->black_gc, 80, 115, _("Welcome to the Mandrake Control Center") ); + $pix_dbl->draw_string($style->font, $darea1->style->black_gc, 80, 115, _("Welcome to the Mandrake Control Center")); my @revtree; open VERS, "/etc/mandrake-release" or die _("cannot open this file for read: %s", $!); while (<VERS>) { push (@revtree,$_) } my @info_tree = split / /, $revtree[0]; my ($sysname, $nodename, $release, $version, $machine) = POSIX::uname(); - my $i=0; + my $i = 0; foreach( [_("System:"), "$info_tree[0] $info_tree[1] $info_tree[3] $info_tree[4]"], [_("Hostname:"), $nodename], [_("Kernel Version:"), "$release"],# $version"], - [_("Machine:"), $machine] ) { + [_("Machine:"), $machine]) { $pix_dbl->draw_string($darea1->style->font, $darea1->style->black_gc, 80, 150+$i, $_->[0]); $pix_dbl->draw_string($darea1->style->font, $darea1->style->black_gc, 81, 150+$i, $_->[0]); $pix_dbl->draw_string($darea1->style->font, $darea1->style->black_gc, 200, 150+$i, $_->[1]); @@ -472,7 +472,7 @@ foreach (@tree) { } my %tree_launched; Gtk->main_iteration while Gtk->events_pending; -$notebook_global->signal_connect( switch_page => sub { +$notebook_global->signal_connect(switch_page => sub { my (undef, $tab_widget, $tab_number) = @_; $tab_number > 0 or return; $tab_widget->child->child->child->{redraw_function}->(); @@ -496,7 +496,7 @@ $window_global->set_position(1); $SIG{USR1} = \&sig_usr1; $SIG{USR2} = \&sig_usr2; $SIG{TERM} = \&quit_global; -$SIG{CHLD} = sub {wait() }; +$SIG{CHLD} = sub { wait() }; Gtk->main; sub gtkpng_ { @@ -578,7 +578,7 @@ sub compute_exec_string { } else { system(($gtkplug == 0 ? $alternate->[0] : $alternate || $exec) . " &"); } - if($logs) { + if ($logs) { $exp_socket->realize; my $pid; unless ($pid = fork) { @@ -590,7 +590,7 @@ sub compute_exec_string { if ($embedded && $gtkplug != -1) { foreach (@darea_left_list) { $_->[1]->window->set_cursor($cursor_hand); - if($_->[1]->{state} != 0) { + if ($_->[1]->{state} != 0) { $_->[1]->{state} = 0; $_->[1]->draw(undef); } @@ -621,7 +621,7 @@ sub launch_xapp { $i++; } $c =~ /\s*([0-9]*)\s*/; - $res=$1; + $res = $1; } $res; } @@ -668,8 +668,8 @@ sub splash_warning { gtkpack__($win_about->action_area, gtkadd(new Gtk::HButtonBox, - gtksignal_connect(new Gtk::Button($cancel_button ? _("OK") : _("Close")), "clicked" => sub { $ret = 1; Gtk->main_quit}), - if_($cancel_button, gtksignal_connect(new Gtk::Button(_("Cancel")), "clicked" => sub { Gtk->main_quit})), + gtksignal_connect(new Gtk::Button($cancel_button ? _("OK") : _("Close")), "clicked" => sub { $ret = 1; Gtk->main_quit }), + if_($cancel_button, gtksignal_connect(new Gtk::Button(_("Cancel")), "clicked" => sub { Gtk->main_quit })), ) ); gtkpack($win_about->vbox, @@ -687,9 +687,9 @@ sub more_themes { my $window_about = new Gtk::Dialog(); $window_about->set_position(1); $window_about->set_border_width(10); - $window_about->set_title( _("More themes")); + $window_about->set_title(_("More themes")); $window_about->action_area->pack_start(gtkadd(new Gtk::HButtonBox, - gtksignal_connect(new Gtk::Button(_("Close")), "clicked" => sub { $window_about->destroy()})),0,0,0); + gtksignal_connect(new Gtk::Button(_("Close")), "clicked" => sub { $window_about->destroy() })),0,0,0); my $style1 = $window_about->style->copy(); $style1->font(Gtk::Gdk::Font->fontset_load(_("-*-helvetica-medium-r-normal-*-20-*-100-100-p-*-iso8859-1,*-r-*"))); gtkpack_($window_about->vbox, @@ -709,9 +709,9 @@ sub about_mdk_cc { my $window_about = new Gtk::Dialog(); $window_about->set_position(1); $window_about->set_border_width(10); - $window_about->set_title( _("About - Mandrake Control Center")); + $window_about->set_title(_("About - Mandrake Control Center")); $window_about->action_area->pack_start(gtkadd(new Gtk::HButtonBox, - gtksignal_connect(new Gtk::Button(_("Close")), "clicked" => sub { $window_about->destroy()})),0,0,0); + gtksignal_connect(new Gtk::Button(_("Close")), "clicked" => sub { $window_about->destroy() })),0,0,0); my $label = new Gtk::Label(); my $style1 = $label->style->copy(); @@ -732,10 +732,10 @@ sub about_mdk_cc { gtkpack_($window_about->vbox, -r "$mcc_dir/$theme/splash_screen_about.png" ? - (0, gtkpng("splash_screen_about")) : (1, gtksetstyle(new Gtk::Label( _("Mandrake Control Center %s\n", $_version) ), $style1),), - 0, new Gtk::Label( ''), - 0, new Gtk::Label( _("Copyright (C) 2001 Mandrakesoft SA")), - 0, new Gtk::Label( ''), + (0, gtkpng("splash_screen_about")) : (1, gtksetstyle(new Gtk::Label(_("Mandrake Control Center %s\n", $_version)), $style1),), + 0, new Gtk::Label(''), + 0, new Gtk::Label(_("Copyright (C) 2001 Mandrakesoft SA")), + 0, new Gtk::Label(''), 1, $clist, ); $clist->columns_autosize(); @@ -746,11 +746,11 @@ sub about_mdk_cc { sub connect_to_site { my ($link,$help)=@_; - my $browser=$ENV{'BROWSER'}; - my $initial_user=$ENV{'INITIAL_USER'}; - my $user_current=$ENV{'USER'}; + my $browser = $ENV{BROWSER}; + my $initial_user = $ENV{INITIAL_USER}; + my $user_current = $ENV{USER}; - if (!$browser) {splash_warning( " ". _("Warning: No browser specified") ." "); return;} + if (!$browser) { splash_warning(" ". _("Warning: No browser specified") ." "); return } if ($help) { system("$browser $link &"); @@ -779,7 +779,7 @@ sub get_main_menu { my @theme_list = grep { -d "$mcc_dir/$_" } all($mcc_dir); my $ignore_active; $item_factory->create_items( - ( + ( { path => _("/_File"), type => '<Branch>' }, { path => _("/File")._("/_Quit"), @@ -806,7 +806,7 @@ sub get_main_menu { }, ); \%h; - } @theme_list ), + } @theme_list), { path => _("/_Themes")._("/_More themes"), callback => \&more_themes }, ), |