Pop AddPrinterDialog if wifi is lost
This commit is contained in:
parent
2d766345fe
commit
61eaad3fb3
9 changed files with 12 additions and 32 deletions
|
@ -11,6 +11,14 @@ Dialog {
|
||||||
property var printerName: false
|
property var printerName: false
|
||||||
canAccept: printerName != false
|
canAccept: printerName != false
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: wifi
|
||||||
|
onConnectedChanged: {
|
||||||
|
if(!wifi.connected) {
|
||||||
|
dialog.reject()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
valueField.forceActiveFocus()
|
valueField.forceActiveFocus()
|
||||||
|
@ -57,7 +65,7 @@ Dialog {
|
||||||
Label {
|
Label {
|
||||||
id: ssid_label
|
id: ssid_label
|
||||||
color: Theme.secondaryColor
|
color: Theme.secondaryColor
|
||||||
text: ssid
|
text: wifi.ssid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Row {
|
Row {
|
||||||
|
@ -102,6 +110,7 @@ Dialog {
|
||||||
onDone: {
|
onDone: {
|
||||||
if (result == DialogResult.Accepted) {
|
if (result == DialogResult.Accepted) {
|
||||||
value = valueField.text
|
value = valueField.text
|
||||||
|
ssid = wifi.ssid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,12 +102,11 @@ Page {
|
||||||
text: qsTr("Add by URL")
|
text: qsTr("Add by URL")
|
||||||
enabled: wifi.connected
|
enabled: wifi.connected
|
||||||
onClicked: {
|
onClicked: {
|
||||||
var dialog = pageStack.push(Qt.resolvedUrl("AddPrinterDialog.qml"),
|
var dialog = pageStack.push(Qt.resolvedUrl("AddPrinterDialog.qml"));
|
||||||
{ssid: wifi.ssid, title: qsTr("URL")});
|
|
||||||
dialog.accepted.connect(function() {
|
dialog.accepted.connect(function() {
|
||||||
console.log("add", wifi.ssid, dialog.value);
|
console.log("add", wifi.ssid, dialog.value);
|
||||||
db.addFavourite(wifi.ssid, dialog.value);
|
db.addFavourite(wifi.ssid, dialog.value);
|
||||||
IppDiscovery.favourites = db.getFavourites(wifi.ssid);
|
IppDiscovery.favourites = db.getFavourites(dialog.ssid);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -223,10 +223,6 @@
|
||||||
<source>Add by URL</source>
|
<source>Add by URL</source>
|
||||||
<translation>Mit URL hinzufügen</translation>
|
<translation>Mit URL hinzufügen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>URL</source>
|
|
||||||
<translation>URL</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Refresh</source>
|
<source>Refresh</source>
|
||||||
<translation>Aktualisieren</translation>
|
<translation>Aktualisieren</translation>
|
||||||
|
|
|
@ -223,10 +223,6 @@
|
||||||
<source>Add by URL</source>
|
<source>Add by URL</source>
|
||||||
<translation>Añadir por URL</translation>
|
<translation>Añadir por URL</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>URL</source>
|
|
||||||
<translation>URL</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Refresh</source>
|
<source>Refresh</source>
|
||||||
<translation>Actualizar</translation>
|
<translation>Actualizar</translation>
|
||||||
|
|
|
@ -223,10 +223,6 @@
|
||||||
<source>Add by URL</source>
|
<source>Add by URL</source>
|
||||||
<translation>Ajouter par URL</translation>
|
<translation>Ajouter par URL</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>URL</source>
|
|
||||||
<translation>URL</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Refresh</source>
|
<source>Refresh</source>
|
||||||
<translation>Actualiser</translation>
|
<translation>Actualiser</translation>
|
||||||
|
|
|
@ -223,10 +223,6 @@
|
||||||
<source>Add by URL</source>
|
<source>Add by URL</source>
|
||||||
<translation>Toevoegen via URL</translation>
|
<translation>Toevoegen via URL</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>URL</source>
|
|
||||||
<translation>URL</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Refresh</source>
|
<source>Refresh</source>
|
||||||
<translation>Ververs</translation>
|
<translation>Ververs</translation>
|
||||||
|
|
|
@ -223,10 +223,6 @@
|
||||||
<source>Add by URL</source>
|
<source>Add by URL</source>
|
||||||
<translation>Dodaj za pomocą URL</translation>
|
<translation>Dodaj za pomocą URL</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>URL</source>
|
|
||||||
<translation>URL</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Refresh</source>
|
<source>Refresh</source>
|
||||||
<translation>Odśwież</translation>
|
<translation>Odśwież</translation>
|
||||||
|
|
|
@ -223,10 +223,6 @@
|
||||||
<source>Add by URL</source>
|
<source>Add by URL</source>
|
||||||
<translation>通过URL添加</translation>
|
<translation>通过URL添加</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>URL</source>
|
|
||||||
<translation>URL</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Refresh</source>
|
<source>Refresh</source>
|
||||||
<translation>刷新</translation>
|
<translation>刷新</translation>
|
||||||
|
|
|
@ -223,10 +223,6 @@
|
||||||
<source>Add by URL</source>
|
<source>Add by URL</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>URL</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Refresh</source>
|
<source>Refresh</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
|
|
Loading…
Reference in a new issue