summaryrefslogtreecommitdiff
path: root/Master/tlpkg
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2011-01-29 06:18:25 +0000
committerNorbert Preining <preining@logic.at>2011-01-29 06:18:25 +0000
commit7d7ca96b28d4e8cdcda09c5ee2e74ac30a79d03a (patch)
tree19e33086a2f755ac4f4b5afdba227abbc0a6d947 /Master/tlpkg
parentfd1458caec4330ceb5531fb493ec8e10f12e4253 (diff)
fixes in various places for GUI language support, including support for
deleting keys in TLConfFile git-svn-id: svn://tug.org/texlive/trunk@21221 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rw-r--r--Master/tlpkg/TeXLive/TLConfFile.pm15
1 files changed, 14 insertions, 1 deletions
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");