diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2002-11-06 16:43:06 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2002-11-06 16:43:06 +0000 |
commit | 67b11cc5a1f26e771bcc21f3b431bcb05fdda178 (patch) | |
tree | fa5172f48be562de6ee2d7851b1ac1b2a559d05d | |
parent | d0d8eb08207bc00bbf0f73c475a055717185b8bc (diff) | |
download | control-center-67b11cc5a1f26e771bcc21f3b431bcb05fdda178.tar control-center-67b11cc5a1f26e771bcc21f3b431bcb05fdda178.tar.gz control-center-67b11cc5a1f26e771bcc21f3b431bcb05fdda178.tar.bz2 control-center-67b11cc5a1f26e771bcc21f3b431bcb05fdda178.tar.xz control-center-67b11cc5a1f26e771bcc21f3b431bcb05fdda178.zip |
update due to libdrakx changes
-rwxr-xr-x | control-center | 353 |
1 files changed, 171 insertions, 182 deletions
diff --git a/control-center b/control-center index f097bed8..c52f475d 100755 --- a/control-center +++ b/control-center @@ -63,12 +63,12 @@ if ("@ARGV" =~ /--theme (\w+)/) { $theme = $1 } add_icon_path("$themes_dir/$theme"); my $window_splash = new Gtk::Window -popup; $window_splash->signal_connect (delete_event => \&quit_global); -$window_splash->set_title(_("Mandrake Control Center")); +$window_splash->set_title(N("Mandrake Control Center")); $window_splash->set_policy(0, 0, 1); $window_splash->set_position(1); $window_splash->add( gtkadd(gtkset_shadow_type(new Gtk::Frame(), 'etched_out'), - new Gtk::Label(_("Loading... Please wait"))) + new Gtk::Label(N("Loading... Please wait"))) ); $window_splash->show_all; Gtk->main_iteration while Gtk->events_pending; @@ -88,70 +88,70 @@ $::isRpmDrake = -e "/usr/sbin/rpmdrake"; # { key => [log_exp, binary, gtkplug?, alternate] } my $exec_hash = { - _("Boot Disk") => [ "drakfloppy", "$_sbindir/drakfloppy", 1], - _("Boot Config") => [ "drakboot", "$_sbindir/drakboot", 1 ], - _("Auto Install") => [ "drakautoinst", "$_sbindir/drakautoinst", 1 ], - _("Monitor") => [ "XFdrake", "$_sbindir/XFdrake monitor", 1 ], - _("Resolution") => [ "XFdrake", "$_sbindir/XFdrake resolution", 1 ], - _("Graphical server configuration") => [ "XFdrake", "$_sbindir/XFdrake", 1 ], - _("Hardware List") => [ "harddrake", "$_sbindir/harddrake2", 1 ], - _("Mouse") => [ "mousedrake", "$_sbindir/mousedrake", 1 ], - _("Printer") => [ "printerdrake", "$_sbindir/printerdrake", 1, "$_sbindir/printerdrake" ], - _("Scanner") => [ "scannerdrake", "$_sbindir/scannerdrake", 1 ], - _("Users") => [ "userdrake", "$_bindir/userdrake", 1 ], - _("Keyboard") => [ "keyboarddrake", "$_sbindir/keyboarddrake", 1 ], - _("Hard Drives") => [ "diskdrake", "$_sbindir/diskdrake --hd", 1 ], - _("NFS mount points") => [ "diskdrake", "$_sbindir/diskdrake --nfs", 1 ], - _("Samba mount points") => [ "diskdrake", "$_sbindir/diskdrake --smb", 1 ], - _("WebDAV mount points") => [ "diskdrake", "$_sbindir/diskdrake --dav", 1 ], - _("Partition Sharing") => [ "diskdrake", "$_sbindir/diskdrake --fileshare", 1 ], - _("Connection") => [ "drakconnect", "$_sbindir/drakconnect", 1 ], - _("Connection Sharing") => [ "drakgw", "$_sbindir/drakgw", 1 ], - _("Proxy Configuration") => [ "drakproxy", "$_sbindir/drakproxy", 1 ], - _("Security Level") => [ "draksec", "$_sbindir/draksec", 1 ], - _("Security Permissions") => [ "drakperm", "$_sbindir/drakperm", 1 ], - _("Programs scheduling") => [ "drakcronat", "/usr/X11R6/bin/drakcronat", 1 ], - _("Firewall") => [ "drakfirewall", "$_sbindir/drakfirewall", 1 ], - _("Backups") => [ "drakbackup", "$_sbindir/drakbackup", 1 ], - _("Menus") => [ "menudrake", "$_sbindir/menus_launcher.pl", 1, "$_bindir/menudrake" ], - _("Services") => [ "drakxservices", "$_sbindir/drakxservices", 1 ], - _("Fonts") => [ "drakfont", "$_sbindir/drakfont", 1 ], - _("Date & Time") => [ "clock", "$_sbindir/clock.pl", 1 ], - _("Logs") => [ "logdrake", "$_sbindir/logdrake", 1 ], + N("Boot Disk") => [ "drakfloppy", "$_sbindir/drakfloppy", 1], + N("Boot Config") => [ "drakboot", "$_sbindir/drakboot", 1 ], + N("Auto Install") => [ "drakautoinst", "$_sbindir/drakautoinst", 1 ], + N("Monitor") => [ "XFdrake", "$_sbindir/XFdrake monitor", 1 ], + N("Resolution") => [ "XFdrake", "$_sbindir/XFdrake resolution", 1 ], + N("Graphical server configuration") => [ "XFdrake", "$_sbindir/XFdrake", 1 ], + N("Hardware List") => [ "harddrake", "$_sbindir/harddrake2", 1 ], + N("Mouse") => [ "mousedrake", "$_sbindir/mousedrake", 1 ], + N("Printer") => [ "printerdrake", "$_sbindir/printerdrake", 1, "$_sbindir/printerdrake" ], + N("Scanner") => [ "scannerdrake", "$_sbindir/scannerdrake", 1 ], + N("Users") => [ "userdrake", "$_bindir/userdrake", 1 ], + N("Keyboard") => [ "keyboarddrake", "$_sbindir/keyboarddrake", 1 ], + N("Hard Drives") => [ "diskdrake", "$_sbindir/diskdrake --hd", 1 ], + N("NFS mount points") => [ "diskdrake", "$_sbindir/diskdrake --nfs", 1 ], + N("Samba mount points") => [ "diskdrake", "$_sbindir/diskdrake --smb", 1 ], + N("WebDAV mount points") => [ "diskdrake", "$_sbindir/diskdrake --dav", 1 ], + N("Partition Sharing") => [ "diskdrake", "$_sbindir/diskdrake --fileshare", 1 ], + N("Connection") => [ "drakconnect", "$_sbindir/drakconnect", 1 ], + N("Connection Sharing") => [ "drakgw", "$_sbindir/drakgw", 1 ], + N("Proxy Configuration") => [ "drakproxy", "$_sbindir/drakproxy", 1 ], + N("Security Level") => [ "draksec", "$_sbindir/draksec", 1 ], + N("Security Permissions") => [ "drakperm", "$_sbindir/drakperm", 1 ], + N("Programs scheduling") => [ "drakcronat", "/usr/X11R6/bin/drakcronat", 1 ], + N("Firewall") => [ "drakfirewall", "$_sbindir/drakfirewall", 1 ], + N("Backups") => [ "drakbackup", "$_sbindir/drakbackup", 1 ], + N("Menus") => [ "menudrake", "$_sbindir/menus_launcher.pl", 1, "$_bindir/menudrake" ], + N("Services") => [ "drakxservices", "$_sbindir/drakxservices", 1 ], + N("Fonts") => [ "drakfont", "$_sbindir/drakfont", 1 ], + N("Date & Time") => [ "clock", "$_sbindir/clock.pl", 1 ], + N("Logs") => [ "logdrake", "$_sbindir/logdrake", 1 ], # little workaround to avoid drakconf freeze - _("Console") => [ "rxvt", "", 0, ["$_xbindir/rxvt", "rxvt", 1] ], -# _("Console") => [ "rxvt", "$_xbindir/rxvt", -1 ], - _("Install Software") => [ "rpmdrake", "$_sbindir/rpmdrake", -1 ], - _("Remove Software") => [ "rpmdrake", "$_sbindir/rpmdrake-remove", -1 ], - _("Mandrake Update") => [ "rpmdrake", "$_sbindir/MandrakeUpdate", -1 ], - _("Software Sources Manager") => [ "rpmdrake", "$_sbindir/edit-urpm-sources.pl", -1 ], + N("Console") => [ "rxvt", "", 0, ["$_xbindir/rxvt", "rxvt", 1] ], +# N("Console") => [ "rxvt", "$_xbindir/rxvt", -1 ], + N("Install Software") => [ "rpmdrake", "$_sbindir/rpmdrake", -1 ], + N("Remove Software") => [ "rpmdrake", "$_sbindir/rpmdrake-remove", -1 ], + N("Mandrake Update") => [ "rpmdrake", "$_sbindir/MandrakeUpdate", -1 ], + N("Software Sources Manager") => [ "rpmdrake", "$_sbindir/edit-urpm-sources.pl", -1 ], - _("TV Cards") => [ "drakxtv", "$_sbindir/drakxtv", 1 ], - - _("DNS Client") => ["Client wizard", "drakwizard $_wizdir/client_wizard/client.wiz", -1 ], - _("DHCP") => ["DHCP wizard", "drakwizard $_wizdir/dhcp_wizard/dhcp.wiz", -1 ], - _("DNS") => ["DNS wizard", "drakwizard $_wizdir/dns_wizard/dns.wiz", -1 ], - _("FTP") => ["FTP wizard", "drakwizard $_wizdir/ftp_wizard/ftp.wiz", -1 ], - _("News") => ["News wizard", "drakwizard $_wizdir/news_wizard/news.wiz", -1 ], - _("Postfix") => ["Postfix wizard", "drakwizard $_wizdir/postfix_wizard/postfix.wiz", -1 ], - _("Proxy") => ["Squid wizard", "drakwizard $_wizdir/proxy_wizard/proxy.wiz", -1 ], - _("Samba") => ["Samba wizard", "drakwizard $_wizdir/samba_wizard/samba.wiz", -1 ], - _("Time") => ["Time wizard", "drakwizard $_wizdir/time_wizard/time.wiz", -1 ], - _("Web") => ["Web wizard", "drakwizard $_wizdir/web_wizard/web.wiz", -1 ], + N("TV Cards") => [ "drakxtv", "$_sbindir/drakxtv", 1 ], + + N("DNS Client") => ["Client wizard", "drakwizard $_wizdir/client_wizard/client.wiz", -1 ], + N("DHCP") => ["DHCP wizard", "drakwizard $_wizdir/dhcp_wizard/dhcp.wiz", -1 ], + N("DNS") => ["DNS wizard", "drakwizard $_wizdir/dns_wizard/dns.wiz", -1 ], + N("FTP") => ["FTP wizard", "drakwizard $_wizdir/ftp_wizard/ftp.wiz", -1 ], + N("News") => ["News wizard", "drakwizard $_wizdir/news_wizard/news.wiz", -1 ], + N("Postfix") => ["Postfix wizard", "drakwizard $_wizdir/postfix_wizard/postfix.wiz", -1 ], + N("Proxy") => ["Squid wizard", "drakwizard $_wizdir/proxy_wizard/proxy.wiz", -1 ], + N("Samba") => ["Samba wizard", "drakwizard $_wizdir/samba_wizard/samba.wiz", -1 ], + N("Time") => ["Time wizard", "drakwizard $_wizdir/time_wizard/time.wiz", -1 ], + N("Web") => ["Web wizard", "drakwizard $_wizdir/web_wizard/web.wiz", -1 ], }; # { name => [ label, icon core ] } -my %wizard = ("client" => [ _("DNS Client"), 'server-mdk'], - "dhcp" => [ _("DHCP"), 'server-mdk'], - "dns" => [ _("DNS"), 'server-mdk'], - "ftp" => [ _("FTP"), 'ftp-mdk'], - "news" => [ _("News"), 'news-mdk'], - "postfix" => [ _("Postfix"), 'postfix-mdk'], - "proxy" => [ _("Proxy"), 'web-mdk'], - "samba" => [ _("Samba"), 'diskdrake_samba'], - "time" => [ _("Time"), 'time-mdk'], - "web" => [ _("Web"), 'web-mdk'], +my %wizard = ("client" => [ N("DNS Client"), 'server-mdk'], + "dhcp" => [ N("DHCP"), 'server-mdk'], + "dns" => [ N("DNS"), 'server-mdk'], + "ftp" => [ N("FTP"), 'ftp-mdk'], + "news" => [ N("News"), 'news-mdk'], + "postfix" => [ N("Postfix"), 'postfix-mdk'], + "proxy" => [ N("Proxy"), 'web-mdk'], + "samba" => [ N("Samba"), 'diskdrake_samba'], + "time" => [ N("Time"), 'time-mdk'], + "web" => [ N("Web"), 'web-mdk'], ); # { class_name => [ @@ -159,29 +159,29 @@ my %wizard = ("client" => [ _("DNS Client"), 'server-mdk'], # ] # } my @tree = - ([_("Boot"), 'boot-mdk', + ([N("Boot"), 'boot-mdk', [ - [_("Boot Disk"), 'drakfloppy-mdk'], - [_("Boot Config"),'drakboot-mdk'], - [_("Auto Install"), 'drakfloppy-mdk'], + [N("Boot Disk"), 'drakfloppy-mdk'], + [N("Boot Config"),'drakboot-mdk'], + [N("Auto Install"), 'drakfloppy-mdk'], ] ], - [_("Hardware"), 'drakhard-mdk', + [N("Hardware"), 'drakhard-mdk', [ - [_("Hardware List"),'harddrake-mdk'], - [_("Monitor"),'XFdrake-mdk'], - [_("Resolution"),'resolution-mdk'], - [_("Graphical server configuration"),'XFdrake-mdk'], - [_("TV Cards"),'tv-mdk'], - [_("Keyboard"), 'keyboard-mdk'], - [_("Mouse"), 'mousedrake-mdk'], - [_("Printer"),'printer-mdk'], - [_("Scanner"),'scanner-mdk'], + [N("Hardware List"),'harddrake-mdk'], + [N("Monitor"),'XFdrake-mdk'], + [N("Resolution"),'resolution-mdk'], + [N("Graphical server configuration"),'XFdrake-mdk'], + [N("TV Cards"),'tv-mdk'], + [N("Keyboard"), 'keyboard-mdk'], + [N("Mouse"), 'mousedrake-mdk'], + [N("Printer"),'printer-mdk'], + [N("Scanner"),'scanner-mdk'], ] ], - [_("Mount Points"),'partition-mdk', + [N("Mount Points"),'partition-mdk', [ - [_("Hard Drives"), 'diskdrake_hd'], + [N("Hard Drives"), 'diskdrake_hd'], (map { my ($type, $name, $scan) = @$_; map_index { @@ -196,58 +196,58 @@ my @tree = push @{$cdroms_by_type{$type}}, $_; } ( - [ 'cdrom', _("CD-ROM"), sub { @{$cdroms_by_type{cdrom} || []} } ], - [ 'dvd', _("DVD"), sub { @{$cdroms_by_type{DVD} || []} } ], - [ 'cdwriter', _("CD Burner"), sub { @{$cdroms_by_type{burner} || []} } ], - [ 'floppy', _("Floppy"), \&detect_devices::floppies ], - [ 'zip', _("Zip"), \&detect_devices::zips ], + [ 'cdrom', N("CD-ROM"), sub { @{$cdroms_by_type{cdrom} || []} } ], + [ 'dvd', N("DVD"), sub { @{$cdroms_by_type{DVD} || []} } ], + [ 'cdwriter', N("CD Burner"), sub { @{$cdroms_by_type{burner} || []} } ], + [ 'floppy', N("Floppy"), \&detect_devices::floppies ], + [ 'zip', N("Zip"), \&detect_devices::zips ], ), }), - [_("NFS mount points"), 'diskdrake_nfs'], - [_("Samba mount points"), 'diskdrake_samba'], - [_("WebDAV mount points"), 'webdav-mdk'], - [_("Partition Sharing"), 'diskdrake_fileshare'], + [N("NFS mount points"), 'diskdrake_nfs'], + [N("Samba mount points"), 'diskdrake_samba'], + [N("WebDAV mount points"), 'webdav-mdk'], + [N("Partition Sharing"), 'diskdrake_fileshare'], ] ], - [_("Network & Internet"),'net-mdk', + [N("Network & Internet"),'net-mdk', [ - [_("Connection"), 'drakconnect-mdk'], - [_("Proxy Configuration"),'drakconnect-mdk'], - [_("Connection Sharing"),'drakgw-mdk'], + [N("Connection"), 'drakconnect-mdk'], + [N("Proxy Configuration"),'drakconnect-mdk'], + [N("Connection Sharing"),'drakgw-mdk'], ], ], - [_("Security"),'security-mdk', + [N("Security"),'security-mdk', [ - [_("Security Level"), 'draksec-mdk'], - [_("Security Permissions"), 'drakperm-mdk'], - [_("Firewall"), 'firewall-mdk'], + [N("Security Level"), 'draksec-mdk'], + [N("Security Permissions"), 'drakperm-mdk'], + [N("Firewall"), 'firewall-mdk'], ] ], - [_("System"),'system-mdk', + [N("System"),'system-mdk', [ - [_("Menus") , 'menudrake-mdk'], - [_("Services") , 'service-mdk'], - [_("Fonts"), 'drakfont-mdk'], - [_("Date & Time") , 'time-mdk'], - [_("Logs"), 'logdrake-mdk'], - [_("Console"), 'console-mdk'], - [_("Users"), 'user-mdk'], - [_("Programs scheduling"), 'time-mdk'], - [_("Backups"), 'backup-mdk'], -# [_("RFBDrake"), 'unknown-mdk'], + [N("Menus") , 'menudrake-mdk'], + [N("Services") , 'service-mdk'], + [N("Fonts"), 'drakfont-mdk'], + [N("Date & Time") , 'time-mdk'], + [N("Logs"), 'logdrake-mdk'], + [N("Console"), 'console-mdk'], + [N("Users"), 'user-mdk'], + [N("Programs scheduling"), 'time-mdk'], + [N("Backups"), 'backup-mdk'], +# [N("RFBDrake"), 'unknown-mdk'], ] ], if_($::isRpmDrake, - [_("Software Management"),'software', + [N("Software Management"),'software', [ - [_("Install Software"), 'rpmdrake'], - [_("Remove Software"), 'rpmdrake-remove'], - [_("Mandrake Update"), 'MandrakeUpdate'], - [_("Software Sources Manager"), 'source-manager'], + [N("Install Software"), 'rpmdrake'], + [N("Remove Software"), 'rpmdrake-remove'], + [N("Mandrake Update"), 'MandrakeUpdate'], + [N("Software Sources Manager"), 'source-manager'], ] ]), if_($::isWiz, - [_("Server Configuration"), 'wizard-mdk', + [N("Server Configuration"), 'wizard-mdk', [ (map { if_(-e '/usr/share/wizards/'.$_.'_wizard/'.$_.'.wiz', $wizard{$_}) @@ -261,7 +261,7 @@ my @tree = my $window_global = new Gtk::Window -toplevel; my ($pixmap_back_right, undef) = gtkcreate_png('mcc-core-back'); $window_global->signal_connect (delete_event => \&quit_global); -$window_global->set_title(_("Mandrake Control Center %s", $_version)); +$window_global->set_title(N("Mandrake Control Center %s", $_version)); $window_global->set_policy(0, 1, 1); my $notebook_global; @@ -329,14 +329,14 @@ foreach (@tree) { }); $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; + $pending_app && !splash_warning(N("The modifications done in the current module won't be saved."), 1) and return; clean_socket(); $notebook_global->show; $darea_left->{state} == 2 and set_page($index), return; foreach (@darea_left_list) { $_->[1]->window->set_cursor($cursor_hand); - if($_->[1]->{state} != 0) { - $_->[1]->{state} = 0; + if($_->[1]{state} != 0) { + $_->[1]{state} = 0; $_->[1]->draw(undef); } } @@ -382,10 +382,10 @@ $window_global->add( ), 1, new Gtk::VBox(0, 0), ), - 0, new Gtk::Label(_("Please wait...")), + 0, new Gtk::Label(N("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 { Gtk->timeout_remove($timeout) if $timeout; kill('USR1', $$) }), + gtksignal_connect(new Gtk::Button(N("Cancel")), clicked => sub { Gtk->timeout_remove($timeout) if $timeout; kill('USR1', $$) }), ) ) ), @@ -401,7 +401,7 @@ sub update_exp { return if $still_in_splash_screen || $pending_app; if($logs && !$exp_frame) { gtkpack__($right_box, - gtkadd($exp_frame = gtkset_shadow_type(gtkset_usize(gtkset_border_width(new Gtk::Frame(_("Logs")), 5), 0, 120), 'etched_out'), + gtkadd($exp_frame = gtkset_shadow_type(gtkset_usize(gtkset_border_width(new Gtk::Frame(N("Logs")), 5), 0, 120), 'etched_out'), ) ); } @@ -440,7 +440,7 @@ $fixed_title->put(my $darea_title = gtkset_usize(new Gtk::DrawingArea, 335, 55), $fixed_title->signal_connect(realize => sub { $fixed_title->window->set_back_pixmap($pixmap_back, 0) }); $darea_title->signal_connect(expose_event => sub { - my @dim = @{$_[1]->{area}}; + my @dim = @{$_[1]{area}}; my ($dx, $dy) = ($darea_title->allocation->[2], $darea_title->allocation->[3]); if (!defined($dbl_area)) { $dbl_area = new Gtk::Gdk::Pixmap($darea_title->window, $dx, $dy); @@ -463,16 +463,16 @@ $summary_darea->signal_connect(expose_event => sub { my ($splash_pix, undef) = gtkcreate_png("mcc-splash"); fill_tiled($summary_darea, $pix_dbl, $splash_pix, $notebook_width, $notebook_height, $dx, $dy); my $style = $summary_darea->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, $summary_darea->style->black_gc, 80, 115, _("Welcome to the Mandrake Control Center")); - open VERS, "/etc/mandrake-release" or die _("cannot open this file for read: %s", $!); + $style->font(Gtk::Gdk::Font->fontset_load(N("-*-helvetica-medium-r-normal-*-20-*-100-100-p-*-iso8859-1,*-r-*"))); + $pix_dbl->draw_string($style->font, $summary_darea->style->black_gc, 80, 115, N("Welcome to the Mandrake Control Center")); + open VERS, "/etc/mandrake-release" or die N("cannot open this file for read: %s", $!); my ($sysname, $nodename, $release, undef, $machine) = uname(); my $i = 0; foreach( - [_("System:"), substr(<VERS>, 0, -1)], - [_("Hostname:"), $nodename], - [_("Kernel Version:"), $release], - [_("Machine:"), $machine]) { + [N("System:"), substr(<VERS>, 0, -1)], + [N("Hostname:"), $nodename], + [N("Kernel Version:"), $release], + [N("Machine:"), $machine]) { $pix_dbl->draw_string($summary_darea->style->font, $summary_darea->style->black_gc, 80, 150+$i, $_->[0]); $pix_dbl->draw_string($summary_darea->style->font, $summary_darea->style->black_gc, 81, 150+$i, $_->[0]); $pix_dbl->draw_string($summary_darea->style->font, $summary_darea->style->black_gc, 200, 150+$i, $_->[1]); @@ -551,24 +551,13 @@ sub sig_usr2 { # (This version is now UTF8 compliant - Sg 2001-08-18) #--- -{ - no warnings; - sub _ { - my $s = shift @_; my $t = translate($s); - sprintf $t, @_; - } - - sub translate { - my ($s) = @_; - $s ? c::dgettext('drakconf', $s) : ''; - } -} +push @::textdomains, 'drakconf'; sub fork_ { my ($prog, $do_not_kill) = @_; my $pid; unless ($pid = fork) { - splash_warning(_("cannot fork: %s", $~)) unless defined $pid; + splash_warning(N("cannot fork: %s", $~)) unless defined $pid; exec($prog); } return if $do_not_kill; @@ -613,8 +602,8 @@ sub compute_exec_string { if ($embedded && $gtkplug != -1) { foreach (@darea_left_list) { $_->[1]->window->set_cursor($cursor_hand); - if ($_->[1]->{state} != 0) { - $_->[1]->{state} = 0; + if ($_->[1]{state} != 0) { + $_->[1]{state} = 0; $_->[1]->draw(undef); } } @@ -628,7 +617,7 @@ sub compute_exec_string { if ($exec =~ /(drakfont|drakconnect|drakboot)/) { $exp_frame->hide() } # $window_global->height < 600 # fork_($exec_log, 1); unless ($pid = fork) { - splash_warning(_("cannot fork: %s", $~)) unless defined $pid; + splash_warning(N("cannot fork: %s", $~)) unless defined $pid; exec($exec_log); } push @pid_exp, $pid; @@ -636,14 +625,14 @@ sub compute_exec_string { } sub launch_xapp { - my $b = "xwininfo -root -tree -int | grep '" . $_[0]->[1] . "'"; + my $b = "xwininfo -root -tree -int | grep '" . $_[0][1] . "'"; my @before = split ('\n', `$b`); my $mcc_pid = $$; - fork_($_[0]->[0] . "; kill -USR1 $mcc_pid"); + fork_($_[0][0] . "; kill -USR1 $mcc_pid"); my $res = 0; while (!$res) { my @after = split ('\n', `$b`); - while (@after ne ($_[0]->[2]+@before)) { + while (@after ne ($_[0][2]+@before)) { @after = split ('\n', `$b`); } my $i = 0; @@ -696,8 +685,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 ? N("OK") : N("Close")), "clicked" => sub { $ret = 1; Gtk->main_quit }), + if_($cancel_button, gtksignal_connect(new Gtk::Button(N("Cancel")), "clicked" => sub { Gtk->main_quit })), ) ); gtkpack($win_about->vbox, @@ -718,21 +707,21 @@ sub new_dialog { $window_about->set_border_width(10); $window_about->set_title($title); $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(N("Close")), "clicked" => sub { $window_about->destroy() })),0,0,0); $window_about->set_policy(0, 0, 1); $window_about->set_modal(1); $window_about; } sub more_themes { - my $window_about = new_dialog(_("More themes")); + my $window_about = new_dialog(N("More themes")); my $style1 = $window_about->style->copy(); - $style1->font(Gtk::Gdk::Font->fontset_load(_("-*-helvetica-medium-r-normal-*-20-*-100-100-p-*-iso8859-1,*-r-*"))); + $style1->font(Gtk::Gdk::Font->fontset_load(N("-*-helvetica-medium-r-normal-*-20-*-100-100-p-*-iso8859-1,*-r-*"))); gtkpack_($window_about->vbox, - 0, gtksetstyle(new Gtk::Label(_("Getting new themes")), $style1), - 0, gtkadd(gtkset_shadow_type(gtkset_border_width(new Gtk::Frame(_("Additional themes")), 10), 'etched_out'), + 0, gtksetstyle(new Gtk::Label(N("Getting new themes")), $style1), + 0, gtkadd(gtkset_shadow_type(gtkset_border_width(new Gtk::Frame(N("Additional themes")), 10), 'etched_out'), gtkpack(new Gtk::HBox(0, 5), - _("Get additional themes on www.damz.net"), + N("Get additional themes on www.damz.net"), ) ) ); @@ -740,25 +729,25 @@ sub more_themes { } sub about_mdk_cc { - my $window_about = new_dialog(_("About - Mandrake Control Center")); + my $window_about = new_dialog(N("About - Mandrake Control Center")); my $label = new Gtk::Label(); my $style1 = $label->style->copy(); - $style1->font(Gtk::Gdk::Font->fontset_load(_("-*-helvetica-medium-r-normal-*-20-*-100-100-p-*-iso8859-1,*-r-*"))); + $style1->font(Gtk::Gdk::Font->fontset_load(N("-*-helvetica-medium-r-normal-*-20-*-100-100-p-*-iso8859-1,*-r-*"))); my $clist = new Gtk::CList(3); my $i = -1; - $i++, $clist->append(@$_) foreach ([ _("Authors: "), '', ''], + $i++, $clist->append(@$_) foreach ([ N("Authors: "), '', ''], [ '', 'Thierry Vignaud', 'tvignaud@mandrakesoft.com'], [ '', 'Daouda Lo', 'daouda@mandrakesoft.com'], [ '', ''], - [ _("Old authors: "), '', ''], + [ N("Old authors: "), '', ''], [ '', 'Chmouel Boudjnah', 'original C version'], [ '', 'Damien "dams" Krotkine', 'perl version'], [ '', 'Yves Duret', 'logdrake integration'], [ '', ''], - [ _("Artwork: "), + [ N("Artwork: "), #-PO If your language allows it, use eacute for first "e" and egrave for 2nd. - _("Helene Durosini"), 'ln@mandrakesoft.com'], + N("Helene Durosini"), 'ln@mandrakesoft.com'], [ '', 'Anh-Van Nguyen' ,'avnguyen@mandrakesoft.com'], ); @@ -766,13 +755,13 @@ sub about_mdk_cc { # friends that thez participated ... #-PO Add your Name here to find it in the About section in your language. - my $translator_name = _("~ * ~"); + my $translator_name = N("~ * ~"); #-PO Add your E-Mail address here if you want to show it in the about doialog. - my $translator_email = _("~ @ ~"); - if ( $translator_name ne "~ * ~ " && 0){ + my $translator_email = N("~ @ ~"); + if ($translator_name ne "~ * ~ " && 0) { $i++, $clist->append(@$_) foreach ( [ '', ''], - [ _("Translator: "), + [ N("Translator: "), $translator_name, $translator_email], ); } @@ -782,9 +771,9 @@ sub about_mdk_cc { gtkpack_($window_about->vbox, -r "$themes_dir/$theme/splash_screen_about.png" ? - (0, gtkpng("splash_screen_about")) : (1, gtksetstyle(new Gtk::Label(_("Mandrake Control Center %s\n", $_version)), $style1),), + (0, gtkpng("splash_screen_about")) : (1, gtksetstyle(new Gtk::Label(N("Mandrake Control Center %s\n", $_version)), $style1),), 0, new Gtk::Label(''), - 0, new Gtk::Label(_("Copyright (C) 2001-2002 Mandrakesoft SA")), + 0, new Gtk::Label(N("Copyright (C) 2001-2002 Mandrakesoft SA")), 0, new Gtk::Label(''), 1, $clist, ); @@ -797,7 +786,7 @@ sub connect_to_site { my $browser = $ENV{BROWSER}; my $initial_user = $ENV{INITIAL_USER}; - if (!$browser) { splash_warning(" ". _("Warning: No browser specified") ." "); return } + if (!$browser) { splash_warning(" ". N("Warning: No browser specified") ." "); return } if ($help) { fork_("$browser $link &"); @@ -805,7 +794,7 @@ sub connect_to_site { if ($initial_user ne "root" && $initial_user ne undef) { fork_("su -m -l $initial_user -c \"$browser $link &\""); } else { - splash_warning(" "._("Security Warning: I'm not allowed to connect to the internet as root user")." "); + splash_warning(" ".N("Security Warning: I'm not allowed to connect to the internet as root user")." "); } } } @@ -817,49 +806,49 @@ sub get_main_menu { my @theme_list = grep { -d "$themes_dir/$_" } all($themes_dir); $item_factory->create_items( ( - { path => _("/_File"), + { path => N("/_File"), type => '<Branch>' }, - { path => _("/File")._("/_Quit"), - accelerator => _("<control>Q"), + { path => N("/_File").N("/_Quit"), + accelerator => N("<control>Q"), callback => \&quit_global }, - { path => _("/_Options"), + { path => N("/_Options"), type => '<Branch>' }, - { path => _("/Options")._("/Display _Logs"), + { path => N("/_Options").N("/Display _Logs"), callback => sub { $logs = $log_check_box->active; - update_exp() ; $show_log = 1 if ($logs); }, + update_exp() ; $show_log = 1 if $logs }, type => '<CheckItem>' }, - { path => _("/Options")._("/_Embedded Mode"), + { path => N("/_Options").N("/_Embedded Mode"), callback => sub { $embedded = $embedded_check_box->active }, type => '<ToggleItem>'}, if_(all($themes_dir) > 1, - { path => _("/_Themes"), + { path => N("/_Themes"), type => '<Branch>' }, (map { my $l = $_; my %h = ( - path => _("/Themes"). "/" . ($l eq $theme ? " O " : " ") . "_$l", + path => N("/_Themes"). "/" . ($l eq $theme ? " O " : " ") . "_$l", callback => sub { $theme eq $l and return; !$pending_app || splash_warning( - _("This action will restart the control center.\nAny change not applied will be lost."), 1) and sig_usr1(), exec "$0 --theme $l"; + N("This action will restart the control center.\nAny change not applied will be lost."), 1) and sig_usr1(), exec "$0 --theme $l"; }, ); \%h; } @theme_list), - { path => _("/_Themes")._("/_More themes"), + { path => N("/_Themes").N("/_More themes"), callback => \&more_themes }, ), - { path => _("/_Help"), + { path => N("/_Help"), type => '<Branch>' }, - { path => _("/Help")._("/_Report Bug"), + { path => N("/_Help").N("/_Report Bug"), callback => sub { fork_("drakbug --report drakconf &") } }, - { path => _("/Help")._("/_About..."), + { path => N("/_Help").N("/_About..."), callback => \&about_mdk_cc } ) ); $window->add_accel_group($accel_group); - $log_check_box = $item_factory->get_widget("<main>"._("/Options")._("/Display Logs")); - $embedded_check_box = $item_factory->get_widget("<main>"._("/Options")._("/Embedded Mode")); + $log_check_box = $item_factory->get_widget("<main>".N("/Options").N("/Display Logs")); + $embedded_check_box = $item_factory->get_widget("<main>".N("/Options").N("/Embedded Mode")); return ($item_factory->get_widget('<main>')); } |