Handle unnamed printers
This commit is contained in:
parent
ba37531a84
commit
51ff40b691
6 changed files with 40 additions and 23 deletions
|
@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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'imprimante</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unknown</source>
|
||||
<translation>Inconnu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Removing printer</source>
|
||||
<translation>Suppression de l'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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue