diff options
author | Norbert Preining <preining@logic.at> | 2009-07-09 11:39:06 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2009-07-09 11:39:06 +0000 |
commit | ab471595e495323c12b4fcf31856f62269405a83 (patch) | |
tree | 4cba4dccc48f4535201066bf18c6458726d92ec7 /Master/tlpkg/installer/install-menu-perltk.pl | |
parent | 58b5e933d6749fd1a1c9bd27d8855a786a44b20e (diff) |
allow option -all-options to show all options in text and
perltk mode, even those that are not really applicable
use that option to actually show stuff in menu-text and menu-perltk
show explanation strings for file assoc settings instead of number
git-svn-id: svn://tug.org/texlive/trunk@14198 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/installer/install-menu-perltk.pl')
-rw-r--r-- | Master/tlpkg/installer/install-menu-perltk.pl | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl index da4daf3aaf2..6edd17362d2 100644 --- a/Master/tlpkg/installer/install-menu-perltk.pl +++ b/Master/tlpkg/installer/install-menu-perltk.pl @@ -51,6 +51,9 @@ our %text; our %labels; require("installer/install-translations.pl"); +$::fileassocdesc[0] = $text{fa_dontchange}; +$::fileassocdesc[1] = $text{fa_onlynew}; +$::fileassocdesc[2] = $text{fa_all}; my $mw; my $subframe; @@ -73,7 +76,7 @@ my $fmtyesno = ( $vars{'option_fmt'} ? $text{'yes'} : $text{'no'} ); my $srcyesno = ( $vars{'option_src'} ? $text{'yes'} : $text{'no'} ); my $deskintyesno = ( $vars{'option_desktop_integration'} ? $text{'yes'} : $text{'no'} ); my $pathadjyesno = ( $vars{'option_path'} ? $text{'yes'} : $text{'no'} ); -my $fileassocsyesno = $vars{'option_file_assocs'}; +my $fileassocyesno = $::fileassocdesc[$vars{'option_file_assocs'}]; my $editoryesno = ( $vars{'addon_editor'} ? $text{'yes'} : $text{'no'} ); my $adminallyesno = ( $vars{'option_w32_multi_user'} ? $text{'yes'} : $text{'no'} ); my $docyesno = ( $vars{'option_doc'} ? $text{'yes'} : $text{'no'} ); @@ -274,7 +277,7 @@ sub run_menu_perltk { $fr->Button(-text => $text{'toggle'}, -command => sub { toggle_and_set_opt_variable(\$vars{'option_path'}, \$pathadjyesno); })->grid(-row => $row, -column => 3, -sticky => "ew", -padx => "2m"); } - if (win32()) { + if ($::opt_all_options || win32()) { $row++; $fr->Label(-text => $labels{'desktop_integration'}, -anchor => 'w')->grid(-row => $row, -column => 1, -sticky => 'w'); $fr->Label(-anchor => 'w', -textvariable => \$deskintyesno)->grid(-row => $row, -column => 2, -padx => "2m"); @@ -282,10 +285,10 @@ sub run_menu_perltk { $row++; $fr->Label(-text => $labels{'fileassocs'}, -anchor => 'w')->grid(-row => $row, -column => 1, -sticky => 'w'); - $fr->Label(-anchor => 'w', -textvariable => \$vars{'option_file_assocs'})->grid(-row => $row, -column => 2, -padx => "2m"); + $fr->Label(-anchor => 'w', -textvariable => \$fileassocyesno)->grid(-row => $row, -column => 2, -padx => "2m"); $fr->Button(-text => $text{'change'}, -command => sub { menu_edit_file_assocs(); })->grid(-row => $row, -column => 3, -sticky => "ew", -padx => "2m"); - if (admin()) { + if ($::opt_all_options || admin()) { $row++; $fr->Label(-text => $labels{'w32admallusers'}, -anchor => 'w')->grid(-row => $row, -column => 1, -sticky => 'w'); $fr->Label(-anchor => 'w', -textvariable => \$adminallyesno)->grid(-row => $row, -column => 2, -padx => "2m"); @@ -481,18 +484,31 @@ sub menu_edit_file_assocs { $sw->transient($mainwindow); $sw->grab(); my $key = 'option_file_assocs'; - my $var = $vars{$key}; + my $var = $::fileassocdesc[$vars{$key}]; $sw->Label(-text => $labels{"fileassocs"})->pack(-padx => "2m", -pady => "2m"); my $opt = $sw->BrowseEntry(-autolistwidth => 1, -variable => \$var); - $opt->insert("end", "0 -- $text{fa_dontchange}"); - $opt->insert("end", "1 -- $text{fa_onlynew}"); - $opt->insert("end", "2 -- $text{fa_all}"); + for my $i (0..2) { + $opt->insert("end", $::fileassocdesc[$i]); + } $opt->pack(-padx => "2m", -pady => "2m"); my $f = $sw->Frame; my $okbutton = $f->Button(-text => $text{"ok"}, - -command => sub { $vars{$key} = substr($var,0,1); $sw->destroy; })->pack(-side => "left", -padx => "2m", -pady => "2m"); + -command => sub { + my $idx; + if ($var eq $::fileassocdesc[0]) { + $idx = 0; + } elsif ($var eq $::fileassocdesc[1]) { + $idx = 1; + } elsif ($var eq $::fileassocdesc[2]) { + $idx = 2; + } else { + die "How that could happen!\n"; + } + $vars{$key} = $idx; + $fileassocyesno = $::fileassocdesc[$idx]; + $sw->destroy; })->pack(-side => "left", -padx => "2m", -pady => "2m"); my $cancelbutton = $f->Button(-text => $text{"cancel"}, -command => sub { $sw->destroy; })->pack(-side => "left", -padx => "2m", -pady => "2m"); $f->pack; $sw->bind('<Return>', [ $okbutton, 'Invoke' ]); |