summaryrefslogtreecommitdiff
path: root/Master/tlpkg/installer/install-menu-perltk.pl
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/installer/install-menu-perltk.pl')
-rw-r--r--Master/tlpkg/installer/install-menu-perltk.pl30
1 files changed, 27 insertions, 3 deletions
diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl
index e2ab24f0083..da4daf3aaf2 100644
--- a/Master/tlpkg/installer/install-menu-perltk.pl
+++ b/Master/tlpkg/installer/install-menu-perltk.pl
@@ -24,6 +24,7 @@ require Tk::DialogBox;
require Tk::PNG;
require Tk::ROText;
require Tk::ProgressBar;
+require Tk::BrowseEntry;
if ($::alternative_selector) {
require Tk::DirTree;
@@ -72,7 +73,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'} ? $text{'yes'} : $text{'no'} );
+my $fileassocsyesno = $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'} );
@@ -281,8 +282,8 @@ sub run_menu_perltk {
$row++;
$fr->Label(-text => $labels{'fileassocs'}, -anchor => 'w')->grid(-row => $row, -column => 1, -sticky => 'w');
- $fr->Label(-anchor => 'w', -textvariable => \$fileassocsyesno)->grid(-row => $row, -column => 2, -padx => "2m");
- $fr->Button(-text => $text{'toggle'}, -command => sub { toggle_and_set_opt_variable(\$vars{'option_file_assocs'}, \$fileassocsyesno); })->grid(-row => $row, -column => 3, -sticky => "ew", -padx => "2m");
+ $fr->Label(-anchor => 'w', -textvariable => \$vars{'option_file_assocs'})->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()) {
$row++;
@@ -475,6 +476,29 @@ sub menu_edit_vars_value {
$sw->bind('<Escape>' => [ $cancelbutton, 'Invoke']);
}
+sub menu_edit_file_assocs {
+ my $sw = $mainwindow->Toplevel(-title => $labels{'fileassocs'});
+ $sw->transient($mainwindow);
+ $sw->grab();
+ my $key = 'option_file_assocs';
+ my $var = $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}");
+
+ $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");
+ 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' ]);
+ $sw->bind('<Escape>', [ $cancelbutton, 'Invoke' ]);
+}
+
sub menu_select_scheme {
my $sw = $mainwindow->Toplevel(-title => $labels{'scheme'});