Actually consider PDF support in printer-info
This commit is contained in:
parent
86bfedf01a
commit
3a5b5cdf59
9 changed files with 32 additions and 30 deletions
|
@ -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"
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue