Add printer location
This commit is contained in:
parent
d9c14241bf
commit
6ef84580f3
10 changed files with 53 additions and 0 deletions
|
@ -37,6 +37,17 @@ Page {
|
|||
text: Utils.unknownForEmptyString(printer.attrs["printer-make-and-model"].value)
|
||||
}
|
||||
|
||||
SectionHeader {
|
||||
text: qsTr("Location")
|
||||
visible: Utils.existsAndNotEmpty("printer-location", printer)
|
||||
}
|
||||
|
||||
Label {
|
||||
text: printer.attrs["printer-location"].value
|
||||
visible: Utils.existsAndNotEmpty("printer-location", printer)
|
||||
}
|
||||
|
||||
|
||||
SectionHeader {
|
||||
text: qsTr("Printer status")
|
||||
}
|
||||
|
|
|
@ -262,6 +262,7 @@ Page {
|
|||
color: canPrint || selectedFile == "" ? Theme.primaryColor : Theme.secondaryColor
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
text: Utils.unknownForEmptyString(printer.attrs["printer-make-and-model"].value)
|
||||
+ (Utils.existsAndNotEmpty("printer-location", printer) ? " • "+printer.attrs["printer-location"].value : "")
|
||||
}
|
||||
|
||||
Label {
|
||||
|
|
|
@ -403,6 +403,19 @@ function unknownForEmptyString(s)
|
|||
}
|
||||
}
|
||||
|
||||
function existsAndNotEmpty(attrName, printer)
|
||||
{
|
||||
if(printer.attrs.hasOwnProperty(attrName))
|
||||
{
|
||||
return printer.attrs[attrName].value != ""
|
||||
}
|
||||
else
|
||||
{
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function basename(filewithpath)
|
||||
{
|
||||
return filewithpath.substring(filewithpath.lastIndexOf("/")+1);
|
||||
|
|
|
@ -220,6 +220,10 @@
|
|||
<source>Supply status</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Location</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>FirstPage</name>
|
||||
|
|
|
@ -220,6 +220,10 @@
|
|||
<source>Supply status</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Location</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>FirstPage</name>
|
||||
|
|
|
@ -220,6 +220,10 @@
|
|||
<source>Supply status</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Location</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>FirstPage</name>
|
||||
|
|
|
@ -220,6 +220,10 @@
|
|||
<source>Supply status</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Location</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>FirstPage</name>
|
||||
|
|
|
@ -220,6 +220,10 @@
|
|||
<source>Supply status</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Location</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>FirstPage</name>
|
||||
|
|
|
@ -220,6 +220,10 @@
|
|||
<source>Supply status</source>
|
||||
<translation>支持状态</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Location</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>FirstPage</name>
|
||||
|
|
|
@ -220,6 +220,10 @@
|
|||
<source>Supply status</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Location</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>FirstPage</name>
|
||||
|
|
Loading…
Reference in a new issue