diff options
Diffstat (limited to 'control-center')
-rwxr-xr-x | control-center | 182 |
1 files changed, 117 insertions, 65 deletions
diff --git a/control-center b/control-center index 5fe9119a..03e5032b 100755 --- a/control-center +++ b/control-center @@ -32,6 +32,7 @@ use lang; # i18n: IMPORTANT: to get correct namespace (drakconf instead of libDrakX) BEGIN { unshift @::textdomains, 'drakconf' } +use mygtk2 qw(gtknew); use ugtk2 qw(:create :dialogs :helpers :wrappers); use Gtk2::Pango; use Gtk2::Html2; @@ -134,6 +135,16 @@ my $application_driven_menu; # embedded meaning: -1 => not embedded, 0 => external x11 app, 1 => proper embedding my %programs = ( + "3D" => + { + binary => "$sbindir/drak3d", + embedded => 1, + description => N("3D Desktop effects"), + long_description => N("Configure 3D Desktop effects"), + icon => 'drak3d', + }, + + "Authentication" => { binary => "$sbindir/drakauth", @@ -175,6 +186,7 @@ my %programs = description => N("Backups"), long_description => N("Configure backups of the system and of the users' data"), icon => 'backup-mdk', + application_driven_menu => 1, }, @@ -269,17 +281,6 @@ my %programs = }, - - "Roaming" => - { - binary => "$sbindir/drakroam", - embedded => 1, - description => translate("Wireless connection"), - long_description => translate("Wireless connection"), # translation came from DrakX - icon => 'drakroam-mdk', - }, - - "Fax" => { binary => "$sbindir/drakfax_server", @@ -373,6 +374,16 @@ my %programs = }, + "Invictus Firewall" => + { + binary => "$sbindir/drakinvictus", + embedded => 1, + description => N("Invictus Firewall"), + long_description => N("Set up network interfaces failover and firewall replication"), + icon => 'invictus', + }, + + "Keyboard" => { binary => "$sbindir/keyboarddrake", @@ -397,6 +408,7 @@ my %programs = { binary => "$bindir/localedrake", embedded => 1, + icon => 'localedrake', description => #-PO: this message is already translated in drakx domain from which MCC will searchs it: N("Language") . " - " . @@ -454,18 +466,18 @@ my %programs = embedded => 1, description => N("Updates"), long_description => N("Look at available updates and apply any fixes or upgrades to installed packages"), - icon => 'MandrakeUpdate', + icon => 'MandrivaUpdate', application_driven_menu => 1, }, "Menus" => { - binary => "$bindir/menudrake", - embedded => -1, - description => N("Menus"), - long_description => N("Select the application menu layout and change which programs are shown on the menu"), - icon => 'menudrake-mdk', + binary => "$bindir/drakmenustyle", + embedded => 1, + description => N("Menu Style"), + long_description => N("Menu Style Configuration"), + icon => 'drakmenustyle', }, @@ -498,13 +510,24 @@ my %programs = icon => 'mousedrake-mdk', }, + + "Network Center" => + { + binary => "$sbindir/draknetcenter", + embedded => 1, + description => N("Network Center"), + long_description => N("Control and configure network connections"), + icon => 'draknetcenter', + }, + + "Network Profiles" => { binary => "$sbindir/draknetprofile", embedded => 1, description => N("Network Profiles"), long_description => N("Activate and manage network profiles"), - icon => 'internet-access-mdk', #- FIXME: request a network profile icon + icon => 'draknetprofile', }, @@ -620,6 +643,16 @@ my %programs = }, + "Roaming" => + { + binary => "$sbindir/drakroam", + embedded => 1, + description => N("Wireless connection"), + long_description => N("Wireless connection"), + icon => 'drakroam-mdk', + }, + + "Samba mount points" => { binary => "$sbindir/diskdrake --smb", @@ -698,7 +731,7 @@ my %programs = embedded => 1, description => N("TV card"), long_description => N("Set up TV card"), - icon =>, 'tv-mdk', + icon => 'tv-mdk', }, @@ -726,6 +759,26 @@ my %programs = }, + "Virtualization" => + { + binary => "$sbindir/drakvirt", + embedded => 1, + description => N("Virtualization"), + long_description => N("Virtual machines management"), + icon => 'drakvirt', + }, + + + "VPN" => + { + binary => "$sbindir/drakvpn", + embedded => 1, + description => N("VPN configuration"), + long_description => N("Configure VPN connections"), + icon => 'drakvpn', + }, + + "WebDAV mount points" => { binary => "$sbindir/diskdrake --dav", @@ -755,7 +808,7 @@ sub wizard_format { icon => $icon, expert_mode => $expert_mode, }; - is_wizard_installed($file) ? $id : (); + if_(is_wizard_installed($file), $id); } @_; } @@ -790,9 +843,6 @@ my @tree = [ "Manage Samba share", "sambashare", 'wizard-mdk', N("Manage Samba share"), N("Manage, create special share, create public/user share"), 'Sambashare.pm', 1, ], - [ "Samba printing", "sambaprint", 'wizard-sambaprint', N("Samba printing configuration"), - N("Enable or disable printers in your Samba server configuration"), 'Sambaprint.pm', 1, - ], [ "Web wizard", "apache2", 'web_server-mdk', N("Configure web server"), N("Set up a web server"), 'Apache.pm', ], @@ -842,12 +892,12 @@ my @tree = [ N("Groupware"), 'groupware-mdk', [ (wizard_format(# [ id, wizard file name, icon, description ] - [ "News wizard", "inn", 'news-mdk', N("Configure news"), + if_(0, [ "News wizard", "inn", 'news-mdk', N("Configure news"), N("Configure a newsgroup server"), 'Inn.pm', ], [ "Kolab wizard", "kolab", "kolab-mdk", N("Configure groupware"), N("Configure a groupware server"), 'Kolab.pm', - ], + ]), [ "Postfix wizard", "postfix", 'postfix-mdk', N("Configure mail"), N("Configure the Internet Mail services"), 'Postfix.pm' ], @@ -892,7 +942,8 @@ my @tree = "Hardware List",, "Monitor", "Resolution", - if_(0, "Graphical server configuration"), + "3D", + "Graphical server configuration", if_(-x "$bindir/drakfax", "Fax"), "TV Cards", "Keyboard", @@ -905,6 +956,7 @@ my @tree = [ N("Network & Internet"), 'net-mdk', [ + "Network Center", "Add Connection", "Configure Internet", "Manage Connection", @@ -914,6 +966,7 @@ my @tree = "Connection Sharing", "Network Profiles", "Roaming", + "VPN", "Hosts", ], ], @@ -926,11 +979,13 @@ my @tree = "Services", "Fonts", "Date & Time", + "Localization", "Logs", if_($ENV{LANGUAGE} !~ /^zh/, "Console"), "Users", if_(-x "/usr/X11R6/bin/drakcronat", "Programs scheduling"), "Backups", + "Virtualization", ] ], @@ -987,6 +1042,7 @@ my @tree = "Security Level", "Security Permissions", "Firewall", + "Invictus Firewall", ] ], @@ -1033,7 +1089,10 @@ if (scalar glob_("$more_wizard_dir/*.conf")) { my ($timeout, %check_boxes, $emb_socket); # set default size: -my $window_global = gtkset_size_request(Gtk2::Window->new('toplevel'), 620, 460); + +my @min_size = join('x', gtkroot()->get_size()) eq '640x480' ? (620, 460) : (680, 500); + +my $window_global = gtkset_size_request(Gtk2::Window->new('toplevel'), @min_size); $::main_window = $window_global; if ($geometry) { @@ -1042,7 +1101,7 @@ if ($geometry) { $window_global->set_uposition($x, $y) if $x || $y; } else { } -$window_global->resize(max($default_width, $h{WIDTH}), max($h{HEIGTH}, $default_heigth)); +$window_global->resize(max($default_width, $h{WIDTH}, $min_size[0]), max($h{HEIGTH}, $default_heigth, $min_size[1])); $window_global->set_icon(gtkcreate_pixbuf("/usr/share/icons/drakconf.png")); @@ -1059,7 +1118,7 @@ my %options = ( 'show_log' => [ N("/_Options"), N("/Display _Logs") ], 'embedded_mode' => [ N("/_Options"), N("/_Embedded Mode") ], 'wiz_expert' => [ N("/_Options"), N("/Expert mode in _wizards") ], - 'expert_mode' => [ N("/_Options"), translate("/_Expert mode") ], + 'expert_mode' => [ N("/_Options"), N("/_Expert mode") ], ); my $mdk_rel = common::mandrake_release(); @@ -1124,7 +1183,7 @@ my @menu_items = ( [ N("/_Themes") . N("/_More themes"), undef, \&more_themes, undef, '<Item>' ] ), [ N("/_Help"), undef, undef, undef, '<Branch>' ], - [ N("/_Help") . N("/_Help"), undef, sub { fork_("drakhelp --id $help_on_context") }, undef, '<Item>', N("Help") ], + [ N("/_Help") . N("/_Help"), undef, sub { fork_("drakhelp --id $help_on_context", []) }, undef, '<Item>', N("Help") ], [ N("/_Help") . N("/_Report Bug"), undef, sub { fork_("drakbug --report drakconf &") }, undef, '<Item>' ], [ N("/_Help") . N("/_About..."), undef, \&about_mdk_cc, undef, '<Item>' ] ); @@ -1205,17 +1264,17 @@ add2notebook($banner_notebook, "", Gtk2::Banner->new("/usr/share/icons/large/dra N("Welcome to the Mandriva Linux Control Center"))); -my ($hand_cursor, $normal_cursor, $wait_cursor) = map { Gtk2::Gdk::Cursor->new($_) } qw(hand2 left-ptr watch); +my ($_hand_cursor, $wait_cursor) = map { Gtk2::Gdk::Cursor->new($_) } qw(hand2 watch); my ($index, $left_locked) = (0, 0); -my $spacing = 25; +#my $spacing = 25; my %tool_callbacks; my ($page_count, $need_to_refresh, $is_freezed); -sub really_refresh_tree { +sub really_refresh_tree() { my $pos = $notebook_global->get_current_page; $notebook_global->show_all; $notebook_global->queue_draw; @@ -1228,12 +1287,13 @@ sub really_refresh_tree { $notebook_global->set_current_page($saved_pos_while_in_menu); undef $saved_pos_while_in_menu; } - $notebook_global->window && $notebook_global->window->thaw_updates if $is_freezed; + $notebook_global->window and $notebook_global->window->thaw_updates if $is_freezed; $is_freezed = 0; } sub request_url { - my ($document, $url, $stream) = @_; + my ($_document, $url, $stream) = @_; + return if !$url; $stream->write(join('', cat_($url))); $stream->close; } @@ -1269,7 +1329,7 @@ foreach (@tree) { # Skip empty classes: next if !@subtree; - my $my_index = $index++; + my $_my_index = $index++; my $string = join("\n", qq(<HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> @@ -1290,20 +1350,17 @@ foreach (@tree) { my $view = Gtk2::Html2::View->new; my $document = Gtk2::Html2::Document->new; - $document->signal_connect (request_url => \&request_url); - $document->signal_connect ('link-clicked' => + $document->signal_connect(request_url => \&request_url); + $document->signal_connect('link-clicked' => sub { - my ($document, $url) = @_; + my ($_document, $url) = @_; $tool_callbacks{$url}->(); # FIXME: the following code is currently useless: # should we provide a way to kill buggy embedded programs ? return if $left_locked; warn_on_startup(); }); - $view->set_document ($document); - - - my $box; + $view->set_document($document); # Create right notebook pages : @@ -1322,7 +1379,7 @@ foreach (@tree) { $icon, $programs{$label}{description}, $programs{$label}); }; # FIX ME: DO THIS AGAIN: - $tool_feedback{$label} = sub { }; #sub { $event_box->window && $event_box->window->set_cursor($hand_cursor) }; + $tool_feedback{$label} = sub {}; #sub { $event_box->window && $event_box->window->set_cursor($hand_cursor) }; my $file = ugtk2::_find_imgfile($icon); my @widgets = ( qq(<TD><A HREF="$label"><IMG SRC="$file"></A></TD>), @@ -1364,10 +1421,9 @@ foreach (@tree) { really_refresh_tree() if $mode && !$need_to_refresh; } -refresh_tree(); +refresh_tree(0); my %icons = ( - "Localization" => 'localedrake' ); # manage tools not present in MCC (localedrake, drakauth, ...): @@ -1468,7 +1524,7 @@ sub group_by { @l; } -sub warn_on_startup { +sub warn_on_startup() { if ($pending_app) { return if !splash_warning(N("The modifications done in the current module won't be saved."), 1); kill_children(); @@ -1511,7 +1567,7 @@ $password_w->set_visibility(0); #set_invisible_char('*'); Gtk2->main; if ($account) { require interactive; - my $wait = 'interactive'->vnew->wait_message(N("Please wait"), N("Uploading in progress")); + my $_wait = 'interactive'->vnew->wait_message(N("Please wait"), N("Uploading in progress")); #info_dialog(N("Please wait"), N("Uploading in progress")); local $ENV{HWDB_PASSWD} = $password; @@ -1642,8 +1698,6 @@ sub run_tool { undef $wait_darea->{first_expose}; $wait_darea->{not_yet_complete} = 1; $timeout = Glib::Timeout->add(35, sub { - my $size = $wait_darea->{size} ||= $wait_darea->allocation; - my ($width, $height) = ($size->width, $size->height); my $style = $wait_darea->{style} ||= $wait_darea->get_style; my $bg = $wait_darea->{bg} ||= $style->bg('normal'); my $base = $wait_darea->{base} ||= $style->base('normal'); @@ -1682,7 +1736,7 @@ sub run_tool { $box->window->set_cursor($wait_cursor) if $box; } -sub start_logdrake { +sub start_logdrake() { # (re)start logdrake if needed if ($option_values{show_log} && !$pid_exp) { my $exec_log = "logdrake --explain=drakxtools"; @@ -1697,7 +1751,6 @@ sub kill_them_all { sub kill_children() { kill_them_all(@pid_launched); - @pid_launched = (); } sub kill_logdrake() { @@ -1730,8 +1783,8 @@ sub quit_global() { # signals managment # got when child died and gone in zombie state -sub sig_child() { - my ($sig, $o_is_cleaner) = @_; +sub sig_child { + my ($_sig, $o_is_cleaner) = @_; my $child_pid; do { $child_pid = waitpid(-1, POSIX::WNOHANG); @@ -1790,20 +1843,20 @@ sub about_mdk_cc() { my $credits = Gtk2::TextView->new; my $list = Gtk2::TreeView->new_with_model($tree_model); $list->can_focus(0); - each_index { $list->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererText->new, 'text' => $::i)) } 0..2; + each_index { $list->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererText->new, 'text' => $::i)) } 0..1; $list->set_headers_visible(0); - foreach my $row ([ N("Authors: "), '', '' ], - [ '', 'Chmouel Boudjnah', N("(original C version)") ], + foreach my $row ([ N("Authors: "), '' ], + [ '', 'Chmouel Boudjnah' ], [ '', 'Damien "dam\'s" Krotkine', #-PO "perl" here is the programming language N("(perl version)") ], - [ '', 'Daouda Lo', '<daouda@mandriva.com>' ], - [ '', 'Thierry Vignaud', '<tvignaud@mandriva.com>' ], - [ '', 'Yves Duret', N("(perl version)") ], + [ '', 'Daouda Lo' ], + [ '', 'Thierry Vignaud' ], + [ '', 'Yves Duret' ], [ '', '' ], [ N("Artwork: "), '', '' ], - [ '', 'Anh-Van Nguyen', N("(design)") ], + [ '', 'Anh-Van Nguyen' ], [ '', #-PO If your language allows it, use eacute for first "e" and egrave for 2nd one. @@ -1814,7 +1867,6 @@ sub about_mdk_cc() { my ($previous_type, $not_first_title, $not_first_block); my $locale = lang::read; - my @files = (glob("/usr/share/doc/mandriva-release-*/CREDITS"), glob("/usr/share/doc/mandriva-release-*/CREDITS.$locale->{lang}")); foreach my $line (grep { $_ ne "\n" && !/^#/ } cat_(top((glob("/usr/share/doc/mandriva-release-*/CREDITS"), glob("/usr/share/doc/mandriva-release-*/CREDITS.$locale->{lang}"))))) { $line =~ s/ Limited Edition 2005 \|//; if (my ($type, $comment, $contributor) = split(/\|/, $line, 3)) { @@ -1834,7 +1886,7 @@ sub about_mdk_cc() { ); } else { $comment = $comment . "\n" if !$not_first_block; # fix spacing before second title; - gtktext_append($credits, join('', if_($not_first_block, "- "), translate($comment)) ); + gtktext_append($credits, join('', if_($not_first_block, "- "), translate($comment))); $not_first_block = 1; } } @@ -1856,7 +1908,7 @@ sub about_mdk_cc() { gtkpack_($window_about->vbox, (0, gtkset_size_request(Gtk2::Banner->new('splash_screen_about', N("Mandriva Linux Control Center"), { txt_ypos => 50 }), -1, 120)), 0, Gtk2::Label->new(""), - 0, Gtk2::Label->new(N("Copyright (C) 1999-2005 Mandriva SA") . "\n"), + 0, Gtk2::Label->new(N("Copyright (C) 1999-2007 Mandriva SA") . "\n"), 0, Gtk2::HSeparator->new, 0, Gtk2::Label->new(""), 1, my $n = Gtk2::Notebook->new, @@ -1887,7 +1939,7 @@ sub set_page { hide_buttons(); } -sub hide_buttons { +sub hide_buttons() { $buttons->hide; $cancel->hide; } |