diff options
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr.pl | 6 | ||||
-rw-r--r-- | Master/texmf/scripts/texlive/tlmgrgui.pl | 23 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLConfFile.pm | 15 |
3 files changed, 35 insertions, 9 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index f3852703e6b..783b7e970c6 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -4731,6 +4731,12 @@ sub write_config_file # if the value has actually changed $tlmgr_config_file->value($k, $config{$k}); } + # make sure that deleted config entries are carried over + for my $k ($tlmgr_config_file->keys) { + if (not(defined($config{$k}))) { + $tlmgr_config_file->delete_key($k); + } + } if ($tlmgr_config_file->is_changed) { $tlmgr_config_file->save; } diff --git a/Master/texmf/scripts/texlive/tlmgrgui.pl b/Master/texmf/scripts/texlive/tlmgrgui.pl index 653ce846bcb..29355a6119a 100644 --- a/Master/texmf/scripts/texlive/tlmgrgui.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui.pl @@ -1329,12 +1329,12 @@ sub do_gui_language_setting { $sw->transient($mw); $sw->grab(); - my $var = "System"; + my $var = __("System default"); $var = $config{"gui-lang"} if (defined($config{"gui-lang"})); $var = $opts{"gui-lang"} if (defined($opts{"gui-lang"})); $var = (defined($code_lang{$var}) ? $code_lang{$var} : $var); my $opt = $sw->BrowseEntry(-label => __("Default language for GUI:"), -variable => \$var); - $opt->insert(0,__("System default")); + $opt->insert(0, __("System default")); my @ll; foreach my $p (<$Master/tlpkg/translations/*.po>) { $p =~ s!^.*translations/!!; @@ -1350,13 +1350,20 @@ sub do_gui_language_setting { my $f = $sw->Frame; my $okbutton = $f->Button(-text => __("Ok"), -command => sub { - for my $l (keys %code_lang) { - if ($code_lang{$l} eq $var) { - if ($config{'gui-lang'} ne $l) { - $config{'gui-lang'} = $l; - write_config_file(); + if ($var eq __("System default")) { + # we have to remove the setting in the config file + delete($config{'gui-lang'}); + write_config_file(); + } else { + for my $l (keys %code_lang) { + if ($code_lang{$l} eq $var) { + if (!defined($config{'gui-lang'}) || + (defined($config{'gui-lang'}) && ($config{'gui-lang'} ne $l))) { + $config{'gui-lang'} = $l; + write_config_file(); + } + last; } - last; } } $sw->destroy; diff --git a/Master/tlpkg/TeXLive/TLConfFile.pm b/Master/tlpkg/TeXLive/TLConfFile.pm index 33ca89e55bf..74eceaf1dca 100644 --- a/Master/tlpkg/TeXLive/TLConfFile.pm +++ b/Master/tlpkg/TeXLive/TLConfFile.pm @@ -125,6 +125,16 @@ sub value return; } +sub delete_key +{ + my ($self, $key) = @_; + %config = %{$self{'confdata'}}; + if (defined($self{'keyvalue'}{$key})) { + $self{'keyvalue'}{$key}{'status'} = 'deleted'; + $self{'changed'} = 1; + } +} + sub rename_key { my ($self, $oldkey, $newkey) = @_; @@ -133,13 +143,14 @@ sub rename_key if (($config{$i}{'type'} eq 'data') && ($config{$i}{'key'} eq $oldkey)) { $config{$i}{'key'} = $newkey; + $self{'changed'} = 1; } } if (defined($self{'keyvalue'}{$oldkey})) { $self{'keyvalue'}{$newkey} = $self{'keyvalue'}{$oldkey}; delete $self{'keyvalue'}{$oldkey}; $self{'keyvalue'}{$newkey}{'status'} = 'changed'; - + $self{'changed'} = 1; } } @@ -212,6 +223,8 @@ sub save print $fhout $config{$i}{'postcomment'}; } print $fhout ($config{$i}{'multiline'} ? "\\\n" : "\n"); + } elsif ($self{'keyvalue'}{$config{$i}{'key'}}{'status'} eq 'deleted') { + $is_changed = 1; } else { print $fhout "$config{$i}{'original'}"; print $fhout ($config{$i}{'multiline'} ? "\\\n" : "\n"); |