summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-07-05 09:03:00 +0000
committerNorbert Preining <preining@logic.at>2009-07-05 09:03:00 +0000
commit407ed8d770a8c8af3483d26fa23359d331390307 (patch)
treecad58bd82a36cf82d3a18638dabc2aa4d3fe9eb3 /Master
parentb7f193e607685d596b8b6cd03140ba326cf7b662 (diff)
make tlmgrgui aware of the new values for file_assocs
git-svn-id: svn://tug.org/texlive/trunk@14114 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl55
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl6
2 files changed, 49 insertions, 12 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl b/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl
index c5746ac7954..f2166aca24f 100644
--- a/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl
+++ b/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl
@@ -92,23 +92,24 @@ if (!win32()) {
}
if (win32()) {
- for my $key (qw/desktop_integration file_assocs w32_multi_user/) {
+ for my $key (qw/desktop_integration w32_multi_user/) {
push @config_set_l,
$back_config_set->Label(-text => ___($key), -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;
- }
- });
+ $back_config_set->Button(-text => ___"toggle",
+ -command => sub { toggle_setting($key); });
}
+
+ push @config_set_l,
+ $back_config_set->Label(-text => ___"file_assocs", -anchor => "w");
+ push @config_set_m,
+ $back_config_set->Label(-textvariable => \$defaults{'file_assocs'});
+ push @config_set_r,
+ $back_config_set->Button(-text => ___"change",
+ -command => sub { select_file_assocs($p); }, -anchor => "w");
+
}
for my $i (0..$#config_set_l) {
@@ -363,6 +364,38 @@ sub select_autobackup {
}
+sub select_file_assocs {
+ my $foo = $back_config->Toplevel(-title => ___"fileassocs");
+ $foo->transient($mw);
+ $foo->grab();
+ my $var = $defaults{"file_assocs"};
+ my $opt = $foo->BrowseEntry(-label => ___"fileassocs",
+ -variable => \$var);
+ my @al;
+ push @al, "0 " . ___"fa_dontchange";
+ push @al, "1 " . ___"fa_onlynew";
+ push @al, "2 " . ___"fa_all";
+ foreach my $p (@al) {
+ $opt->insert("end",$p);
+ }
+ $opt->pack(-padx => "2m", -pady => "2m");
+ my $f = $foo->Frame;
+ my $okbutton = $f->Button(-text => ___"ok",
+ -command => sub {
+ $var = substr($var,0,1);
+ $localtlpdb->option("file_assocs", $var);
+ $defaults{"file_assocs"} = $var;
+ $localtlpdb->save;
+ $foo->destroy;
+ }
+ )->pack(-side => "left", -padx => "2m", -pady => "2m");
+ my $cancelbutton = $f->Button(-text => ___"cancel", -command => sub { $foo->destroy; })->pack(-side => "left", -padx => "2m", -pady => "2m");
+ $f->pack;
+ $foo->bind('<Return>', [ $okbutton, 'Invoke' ]);
+ $foo->bind('<Escape>', [ $cancelbutton, 'Invoke' ]);
+}
+
+
1;
### Local Variables:
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl
index dae5c3f3460..7cd95bf99c6 100755
--- a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl
+++ b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl
@@ -116,7 +116,11 @@ $TRANS{'en'} = {
backupdir => "Default backup directory",
autobackup => "Auto backup setting",
critupdates => "Updates for the tlmgr are present.\nInstallation and upgrades won't work without being forced.\nPlease go to the update screen and press the \"update all\" button.\nThe program will terminate after the update.\nThen you can restart the program for further updates.",
- critupdw32 => "Please wait a bit after the program has terminated so that the update can be completed."
+ critupdw32 => "Please wait a bit after the program has terminated so that the update can be completed.",
+ fileassocs => 'Change file associations',
+ fa_dontchange => "Don't change any file association",
+ fa_onlynew => "Create only new file associations",
+ fa_all => 'Create all file associatons',
};