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 { Label {
text: printer.attrs["printer-make-and-model"].value text: Utils.unknownForEmptyString(printer.attrs["printer-make-and-model"].value)
} }
SectionHeader { SectionHeader {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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