Actually consider PDF support in printer-info

This commit is contained in:
Anton Thomasson 2020-02-16 14:15:48 +01:00
parent 86bfedf01a
commit 3a5b5cdf59
9 changed files with 32 additions and 30 deletions

View file

@ -210,6 +210,13 @@ Page {
Row {
spacing: Theme.paddingMedium
Label {
id: format_unsupported_label
visible: format_label.text == "" && maybe_format_label.text == ""
color: "red"
font.pixelSize: Theme.fontSizeExtraSmall
text: qsTr("No compatible formats supported")
}
Label {
id: format_label
color: canPrint ? Theme.primaryColor : "red"

View file

@ -14,20 +14,15 @@ function supported_formats(printer)
supported.push("JPEG");
}
if(supported.length == 0)
{
supported.push(qsTr("No compatible formats supported"))
}
//var info = "MFG:Hewlett-Packard;CMD:PJL,BIDI-ECP,PJL,POSTSCRIPT,PDF,PCLXL,PCL;MDL:HP LaserJet P3010 Series;CLS:PRINTER;DES:Hewlett-Packard ".split(";");
var maybe = []
var info = printer.attrs["printer-info"].value.split(";");
var info = printer.attrs["printer-info"] ? printer.attrs["printer-info"].value.split(";") : [];
for(var i in info)
{
if(info[i].split(":")[0] == "CMD")
{
if(has(info[i].split(":")[1].split(","), "PDF"))
if(!has(supported, "PDF") && has(info[i].split(":")[1].split(","), "PDF"))
{
mimetypes.push("application/pdf");
maybe.push("PDF");

View file

@ -9,7 +9,7 @@ Name: harbour-seaprint
# << macros
Summary: SeaPrint
Version: 0.4.1
Version: 0.4.2
Release: 1
Group: Qt/Qt
License: LICENSE

View file

@ -1,6 +1,6 @@
Name: harbour-seaprint
Summary: SeaPrint
Version: 0.4.1
Version: 0.4.2
Release: 1
# The contents of the Group field should be one of the groups listed here:
# https://github.com/mer-tools/spectacle/blob/master/data/GROUPS

View file

@ -140,6 +140,10 @@
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No compatible formats supported</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>JobsPage</name>
@ -281,9 +285,5 @@
<source>dots/cm</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No compatible formats supported</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View file

@ -140,6 +140,10 @@
<source>Unknown</source>
<translation>Desconocido</translation>
</message>
<message>
<source>No compatible formats supported</source>
<translation type="unfinished">No hay formatos compatibles</translation>
</message>
</context>
<context>
<name>JobsPage</name>
@ -281,9 +285,5 @@
<source>dots/cm</source>
<translation>ppp</translation>
</message>
<message>
<source>No compatible formats supported</source>
<translation>No hay formatos compatibles</translation>
</message>
</context>
</TS>

View file

@ -140,6 +140,10 @@
<source>Unknown</source>
<translation>Inconnu</translation>
</message>
<message>
<source>No compatible formats supported</source>
<translation type="unfinished">Aucun format compatible supporté</translation>
</message>
</context>
<context>
<name>JobsPage</name>
@ -281,9 +285,5 @@
<source>dots/cm</source>
<translation>pts/cm</translation>
</message>
<message>
<source>No compatible formats supported</source>
<translation>Aucun format compatible supporté</translation>
</message>
</context>
</TS>

View file

@ -140,6 +140,10 @@
<source>Unknown</source>
<translation></translation>
</message>
<message>
<source>No compatible formats supported</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>JobsPage</name>
@ -281,9 +285,5 @@
<source>dots/cm</source>
<translation>/</translation>
</message>
<message>
<source>No compatible formats supported</source>
<translation></translation>
</message>
</context>
</TS>

View file

@ -140,6 +140,10 @@
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No compatible formats supported</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>JobsPage</name>
@ -281,9 +285,5 @@
<source>dots/cm</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No compatible formats supported</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>