From 4cfe1e6b123875f985f4f6a8ddb333aed5657d9e Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 13 Aug 2009 00:44:13 +0000 Subject: fix tlmgr gui configuration hickup, $key is not lexically scoped so only the last definition was the counting one. git-svn-id: svn://tug.org/texlive/trunk@14636 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf/scripts/texlive/tlmgrgui/gui-config.pl | 148 ++++++++++----------- 1 file changed, 67 insertions(+), 81 deletions(-) diff --git a/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl b/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl index 3481691ea0b..2fe9bacc729 100644 --- a/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl @@ -46,36 +46,29 @@ push @config_set_r, -command => sub { menu_default_location(); }); -{ - my $key; - - $key = "create_formats"; - push @config_set_l, - $back_config_set->Label(-text => __("Create formats on installation"), -anchor => "w"); - push @config_set_m, - $back_config_set->Label(-textvariable => \$defaults{$key}); - push @config_set_r, - $back_config_set->Button(-text => __("Toggle"), - -command => sub { toggle_setting($key); }); +push @config_set_l, + $back_config_set->Label(-text => __("Create formats on installation"), -anchor => "w"); +push @config_set_m, + $back_config_set->Label(-textvariable => \$defaults{"create_formats"}); +push @config_set_r, + $back_config_set->Button(-text => __("Toggle"), + -command => sub { toggle_setting("create_formats"); }); - $key = "install_docfiles"; - push @config_set_l, - $back_config_set->Label(-text => __("Install macro/font sources"), -anchor => "w"); - push @config_set_m, - $back_config_set->Label(-textvariable => \$defaults{$key}); - push @config_set_r, - $back_config_set->Button(-text => __("Toggle"), - -command => sub { toggle_setting($key); }); +push @config_set_l, + $back_config_set->Label(-text => __("Install macro/font sources"), -anchor => "w"); +push @config_set_m, + $back_config_set->Label(-textvariable => \$defaults{"install_srcfiles"}); +push @config_set_r, + $back_config_set->Button(-text => __("Toggle"), + -command => sub { toggle_setting("install_srcfiles"); }); - $key = "install_srcfiles"; - push @config_set_l, - $back_config_set->Label(-text => __("Install macro/font docs"), -anchor => "w"); - push @config_set_m, - $back_config_set->Label(-textvariable => \$defaults{$key}); - push @config_set_r, - $back_config_set->Button(-text => __("Toggle"), - -command => sub { toggle_setting($key); }); -} +push @config_set_l, + $back_config_set->Label(-text => __("Install macro/font docs"), -anchor => "w"); +push @config_set_m, + $back_config_set->Label(-textvariable => \$defaults{"install_docfiles"}); +push @config_set_r, + $back_config_set->Button(-text => __("Toggle"), + -command => sub { toggle_setting("install_docfiles"); }); push @config_set_l, $back_config_set->Label(-text => __("Default backup directory"), -anchor => "w"); @@ -102,60 +95,53 @@ push @config_set_r, -command => sub { select_autobackup($p); }, -anchor => "w"); if (!win32()) { - { - my $key; + push @config_set_l, + $back_config_set->Label(-text => __("Link destination for programs"), -anchor => "w"); + push @config_set_m, + $back_config_set->Label(-textvariable => \$defaults{"sys_bin"}); + push @config_set_r, + $back_config_set->Button(-text => __("Change"), + -command => sub { + my $dir = $back_config->chooseDirectory(); + if (defined($dir) && ($defaults{"sys_bin"} ne $dir)) { + # see warning concerning UTF8 or other encoded dir names!! + $localtlpdb->option("sys_bin", $dir); + $defaults{"sys_bin"} = $dir; + $localtlpdb->save; + } + }); - $key = "sys_bin"; - push @config_set_l, - $back_config_set->Label(-text => __("Link destination for programs"), -anchor => "w"); - push @config_set_m, - $back_config_set->Label(-textvariable => \$defaults{$key}); - push @config_set_r, - $back_config_set->Button(-text => __("Change"), - -command => sub { - my $dir = $back_config->chooseDirectory(); - if (defined($dir) && ($defaults{$key} ne $dir)) { - # see warning concerning UTF8 or other encoded dir names!! - $localtlpdb->option($key, $dir); - $defaults{$key} = $dir; - $localtlpdb->save; - } - }); - - $key = "sys_info"; - push @config_set_l, - $back_config_set->Label(-text => __("Link destination for info docs"), -anchor => "w"); - push @config_set_m, - $back_config_set->Label(-textvariable => \$defaults{$key}); - push @config_set_r, - $back_config_set->Button(-text => __("Change"), - -command => sub { - my $dir = $back_config->chooseDirectory(); - if (defined($dir) && ($defaults{$key} ne $dir)) { - # see warning concerning UTF8 or other encoded dir names!! - $localtlpdb->option($key, $dir); - $defaults{$key} = $dir; - $localtlpdb->save; - } - }); - - $key = "sys_man"; - push @config_set_l, - $back_config_set->Label(-text => __("Link destination for man pages"), -anchor => "w"); - push @config_set_m, - $back_config_set->Label(-textvariable => \$defaults{$key}); - push @config_set_r, - $back_config_set->Button(-text => __("Change"), - -command => sub { - my $dir = $back_config->chooseDirectory(); - if (defined($dir) && ($defaults{$key} ne $dir)) { - # see warning concerning UTF8 or other encoded dir names!! - $localtlpdb->option($key, $dir); - $defaults{$key} = $dir; - $localtlpdb->save; - } - }); - } + push @config_set_l, + $back_config_set->Label(-text => __("Link destination for info docs"), -anchor => "w"); + push @config_set_m, + $back_config_set->Label(-textvariable => \$defaults{"sys_info"}); + push @config_set_r, + $back_config_set->Button(-text => __("Change"), + -command => sub { + my $dir = $back_config->chooseDirectory(); + if (defined($dir) && ($defaults{"sys_info"} ne $dir)) { + # see warning concerning UTF8 or other encoded dir names!! + $localtlpdb->option("sys_info", $dir); + $defaults{"sys_info"} = $dir; + $localtlpdb->save; + } + }); + + push @config_set_l, + $back_config_set->Label(-text => __("Link destination for man pages"), -anchor => "w"); + push @config_set_m, + $back_config_set->Label(-textvariable => \$defaults{"sys_man"}); + push @config_set_r, + $back_config_set->Button(-text => __("Change"), + -command => sub { + my $dir = $back_config->chooseDirectory(); + if (defined($dir) && ($defaults{"sys_man"} ne $dir)) { + # see warning concerning UTF8 or other encoded dir names!! + $localtlpdb->option("sys_man", $dir); + $defaults{"sys_man"} = $dir; + $localtlpdb->save; + } + }); } if (win32()) { -- cgit v1.2.3