diff options
-rwxr-xr-x | control-center | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/control-center b/control-center index b6986cae..d16ae6ff 100755 --- a/control-center +++ b/control-center @@ -272,24 +272,30 @@ my ($timeout, $show_log_check_box, $embedded_check_box, $expert_wizard_check_box my $window_global = gtkset_size_request(Gtk2::Window->new('toplevel'), $global_width, $global_height); my $pending_app = 0; +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") ], +); + my ($menu, $factory) = create_factory_menu($window_global, ({ path => N("/_File"), type => '<Branch>' }, { path => N("/_File") . N("/_Quit"), accelerator => N("<control>Q"), callback => \&quit_global }, #-PO Don't remember to translate "_Options" the same way "Options" is (but for the underscore of course) { path => N("/_Options"), type => '<Branch>' }, - { path => N("/_Options") . N("/Display _Logs"), type => '<CheckItem>', + { path => join('', @{$options{show_log}}), type => '<CheckItem>', callback => sub { $show_logs = $show_log_check_box->active; update_exp(); } }, - { path => N("/_Options") . N("/_Embedded Mode"), type => '<ToggleItem>', + { path => join('', @{$options{embedded_mode}}), type => '<ToggleItem>', callback => sub { $embedded = $embedded_check_box->active; } }, if_($::isWiz, - { path => N("/_Options") . N("/Expert mode in _wizards"), type => '<ToggleItem>', + { path => join('', @{$options{wiz_expert}}), type => '<ToggleItem>', callback => sub { $expert_wizard = $expert_wizard_check_box->active } }, ), @@ -319,9 +325,9 @@ my ($menu, $factory) = create_factory_menu($window_global, )); #-PO Don't remember to translate "Options" the same way "_Options" is (but without the underscore of course) -$show_log_check_box = $factory->get_widget("<main>" . N("/Options") . N("/Display Logs")); -$embedded_check_box = $factory->get_widget("<main>" . N("/Options") . N("/Embedded Mode")); -$expert_wizard_check_box = $factory->get_widget("<main>" . N("/Options") . N("/Expert mode in wizards")) if $::isWiz; +$show_log_check_box = $factory->get_widget("<main>" . strip_first_underscore(@{$options{show_log}})); +$embedded_check_box = $factory->get_widget("<main>" . strip_first_underscore(@{$options{embedded_mode}})); +$expert_wizard_check_box = $factory->get_widget("<main>" . strip_first_underscore(@{$options{wiz_expert}})) if $::isWiz; gtkadd($window_global, gtkpack_(Gtk2::VBox->new(0, 3), @@ -870,6 +876,10 @@ sub set_page { } +sub strip_first_underscore { + join '', map { s/([^_]*)_(.*)/$1$2/; $_ } @_; +} + #------------------------------------------------------------- # mcc specific graphic functions: |