Handle unnamed printers

This commit is contained in:
Anton Thomasson 2020-01-02 22:10:58 +01:00
parent ba37531a84
commit 51ff40b691
6 changed files with 40 additions and 23 deletions

View file

@ -7,7 +7,8 @@ Dialog {
property string value
property string ssid
canAccept: printer_label.text != ""
property var printerName: false
canAccept: printerName != false
Column {
width: parent.width
@ -43,12 +44,12 @@ Dialog {
Label {
id: found_label
text: printer_label.text != "" ? qsTr("Found:") : qsTr("No printer found")
text: printerName != false ? qsTr("Found:") : qsTr("No printer found")
}
Label {
id: printer_label
color: Theme.secondaryColor
text: ""
text: printerName ? printerName : ""
}
}
IppPrinter {
@ -56,11 +57,11 @@ Dialog {
url: valueField.text
onAttrsChanged: {
if(printer.attrs["printer-name"]) {
printer_label.text = printer.attrs["printer-name"].value
printerName = printer.attrs["printer-name"].value == "" ? qsTr("Unknown") : printer.attrs["printer-name"].value
}
else
{
printer_label.text = ""
printerName = false
}
}

View file

@ -32,7 +32,7 @@ Page {
}
onSsidChanged: {
discovery.reset()
discovery.reset();
}
}
@ -87,7 +87,7 @@ Page {
visible: false
property string name: printer.attrs["printer-name"] ? printer.attrs["printer-name"].value : qsTr("Unknown")
property string name: printer.attrs["printer-name"].value != "" ? printer.attrs["printer-name"].value : qsTr("Unknown")
property bool canPrint: Utils.can_print(printer, selectedFile)
Connections {

View file

@ -78,6 +78,10 @@
<source>No printer found</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChoiceSetting</name>
@ -167,10 +171,6 @@
<source>Remove printer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Removing printer</source>
<translation type="unfinished"></translation>
@ -179,6 +179,10 @@
<source>About SeaPrint</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>JobsPage</name>

View file

@ -78,6 +78,10 @@
<source>No printer found</source>
<translation>Aucune imprimante détectée</translation>
</message>
<message>
<source>Unknown</source>
<translation type="unfinished">Inconnu</translation>
</message>
</context>
<context>
<name>ChoiceSetting</name>
@ -167,10 +171,6 @@
<source>Remove printer</source>
<translation>Supprimer l&apos;imprimante</translation>
</message>
<message>
<source>Unknown</source>
<translation>Inconnu</translation>
</message>
<message>
<source>Removing printer</source>
<translation>Suppression de l&apos;imprimante</translation>
@ -179,6 +179,10 @@
<source>About SeaPrint</source>
<translation>À propos de SeaPrint</translation>
</message>
<message>
<source>Unknown</source>
<translation type="unfinished">Inconnu</translation>
</message>
</context>
<context>
<name>JobsPage</name>

View file

@ -78,6 +78,10 @@
<source>No printer found</source>
<translation></translation>
</message>
<message>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChoiceSetting</name>
@ -163,10 +167,6 @@
<source>About SeaPrint</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>View jobs</source>
<translation type="unfinished"></translation>
@ -179,6 +179,10 @@
<source>Removing printer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>JobsPage</name>

View file

@ -78,6 +78,10 @@
<source>No printer found</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChoiceSetting</name>
@ -167,10 +171,6 @@
<source>Remove printer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Removing printer</source>
<translation type="unfinished"></translation>
@ -179,6 +179,10 @@
<source>About SeaPrint</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>JobsPage</name>