Add a default for make-and-model

This commit is contained in:
Anton Thomasson 2021-02-13 17:30:19 +01:00
parent 3564b083e8
commit 34e09abd50
10 changed files with 42 additions and 2 deletions

View file

@ -33,7 +33,7 @@ Page {
}
Label {
text: printer.attrs["printer-make-and-model"].value
text: Utils.unknownForEmptyString(printer.attrs["printer-make-and-model"].value)
}
SectionHeader {

View file

@ -242,7 +242,7 @@ Page {
id: mm_label
color: canPrint || selectedFile == "" ? Theme.primaryColor : Theme.secondaryColor
font.pixelSize: Theme.fontSizeExtraSmall
text: printer.attrs["printer-make-and-model"].value
text: Utils.unknownForEmptyString(printer.attrs["printer-make-and-model"].value)
}
Label {

View file

@ -336,6 +336,18 @@ function isWaringState(printer)
return false;
}
function unknownForEmptyString(s)
{
if(s === "")
{
return qsTr("Unknown");
}
else
{
return s;
}
}
var media =
{"asme_f_28x40in": "28 x 40″",
"choice_iso_a4_210x297mm_na_letter_8.5x11in": "A4 or US Letter",

View file

@ -710,5 +710,9 @@
<source>single document (new sheet)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown</source>
<translation type="unfinished">Unbekannt</translation>
</message>
</context>
</TS>

View file

@ -710,5 +710,9 @@
<source>single document (new sheet)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View file

@ -710,5 +710,9 @@
<source>single document (new sheet)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown</source>
<translation type="unfinished">Inconnu</translation>
</message>
</context>
</TS>

View file

@ -710,5 +710,9 @@
<source>single document (new sheet)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown</source>
<translation type="unfinished">Onbekend</translation>
</message>
</context>
</TS>

View file

@ -710,5 +710,9 @@
<source>single document (new sheet)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View file

@ -710,5 +710,9 @@
<source>single document (new sheet)</source>
<translation></translation>
</message>
<message>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View file

@ -710,5 +710,9 @@
<source>single document (new sheet)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>