From 1f256dcf1775e1ee958a108b9f43e00251b3bbfd Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Tue, 11 Mar 2003 15:50:36 +0000 Subject: Added button to switch to japanese text file printing. --- perl-install/printer/main.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'perl-install/printer/main.pm') diff --git a/perl-install/printer/main.pm b/perl-install/printer/main.pm index 76a0f74aa..5ca9fc5f8 100644 --- a/perl-install/printer/main.pm +++ b/perl-install/printer/main.pm @@ -674,6 +674,23 @@ sub get_usermode { return $::expert; } +sub set_jap_textmode { + my $textmode = ($_[0] ? 'cjk' : ''); + my $file = "$::prefix/etc/cups/mime.convs"; + my @mimeconvs = cat_($file) or die "Cannot open $file for reading!"; + (s!^(\s*text/plain\s+\S+\s+\d+\s+)\S+(\s*$)!$1${textmode}texttops$2!) + foreach @mimeconvs; + output($file, @mimeconvs) or die "Cannot open $file for writing!"; + return 1; +} + +sub get_jap_textmode { + my @mimeconvs = cat_("$::prefix/etc/cups/mime.convs"); + (m!^\s*text/plain\s+\S+\s+\d+\s+(\S+)\s*$!m and + ($1 eq 'cjktexttops') and return 1) foreach @mimeconvs; + return 0; +} + #---------------------------------------------------------------------- # Handling of /etc/cups/cupsd.conf -- cgit v1.2.1