summaryrefslogtreecommitdiffstats
path: root/perl-install/printer/main.pm
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2003-03-11 15:50:36 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2003-03-11 15:50:36 +0000
commit1f256dcf1775e1ee958a108b9f43e00251b3bbfd (patch)
tree9bfb504acc55a1ec628752edc949b4039df15cc0 /perl-install/printer/main.pm
parent40691a6bac8382e825fcb6549cae4d7704ca5c15 (diff)
downloaddrakx-1f256dcf1775e1ee958a108b9f43e00251b3bbfd.tar
drakx-1f256dcf1775e1ee958a108b9f43e00251b3bbfd.tar.gz
drakx-1f256dcf1775e1ee958a108b9f43e00251b3bbfd.tar.bz2
drakx-1f256dcf1775e1ee958a108b9f43e00251b3bbfd.tar.xz
drakx-1f256dcf1775e1ee958a108b9f43e00251b3bbfd.zip
Added button to switch to japanese text file printing.
Diffstat (limited to 'perl-install/printer/main.pm')
-rw-r--r--perl-install/printer/main.pm17
1 files changed, 17 insertions, 0 deletions
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