Pop AddPrinterDialog if wifi is lost

This commit is contained in:
Anton Thomasson 2021-02-15 18:03:35 +01:00
parent 2d766345fe
commit 61eaad3fb3
9 changed files with 12 additions and 32 deletions

View file

@ -11,6 +11,14 @@ Dialog {
property var printerName: false
canAccept: printerName != false
Connections {
target: wifi
onConnectedChanged: {
if(!wifi.connected) {
dialog.reject()
}
}
}
Component.onCompleted: {
valueField.forceActiveFocus()
@ -57,7 +65,7 @@ Dialog {
Label {
id: ssid_label
color: Theme.secondaryColor
text: ssid
text: wifi.ssid
}
}
Row {
@ -102,6 +110,7 @@ Dialog {
onDone: {
if (result == DialogResult.Accepted) {
value = valueField.text
ssid = wifi.ssid
}
}

View file

@ -102,12 +102,11 @@ Page {
text: qsTr("Add by URL")
enabled: wifi.connected
onClicked: {
var dialog = pageStack.push(Qt.resolvedUrl("AddPrinterDialog.qml"),
{ssid: wifi.ssid, title: qsTr("URL")});
var dialog = pageStack.push(Qt.resolvedUrl("AddPrinterDialog.qml"));
dialog.accepted.connect(function() {
console.log("add", wifi.ssid, dialog.value);
db.addFavourite(wifi.ssid, dialog.value);
IppDiscovery.favourites = db.getFavourites(wifi.ssid);
IppDiscovery.favourites = db.getFavourites(dialog.ssid);
})
}
}

View file

@ -223,10 +223,6 @@
<source>Add by URL</source>
<translation>Mit URL hinzufügen</translation>
</message>
<message>
<source>URL</source>
<translation>URL</translation>
</message>
<message>
<source>Refresh</source>
<translation>Aktualisieren</translation>

View file

@ -223,10 +223,6 @@
<source>Add by URL</source>
<translation>Añadir por URL</translation>
</message>
<message>
<source>URL</source>
<translation>URL</translation>
</message>
<message>
<source>Refresh</source>
<translation>Actualizar</translation>

View file

@ -223,10 +223,6 @@
<source>Add by URL</source>
<translation>Ajouter par URL</translation>
</message>
<message>
<source>URL</source>
<translation>URL</translation>
</message>
<message>
<source>Refresh</source>
<translation>Actualiser</translation>

View file

@ -223,10 +223,6 @@
<source>Add by URL</source>
<translation>Toevoegen via URL</translation>
</message>
<message>
<source>URL</source>
<translation>URL</translation>
</message>
<message>
<source>Refresh</source>
<translation>Ververs</translation>

View file

@ -223,10 +223,6 @@
<source>Add by URL</source>
<translation>Dodaj za pomocą URL</translation>
</message>
<message>
<source>URL</source>
<translation>URL</translation>
</message>
<message>
<source>Refresh</source>
<translation>Odśwież</translation>

View file

@ -223,10 +223,6 @@
<source>Add by URL</source>
<translation>URL添加</translation>
</message>
<message>
<source>URL</source>
<translation>URL</translation>
</message>
<message>
<source>Refresh</source>
<translation></translation>

View file

@ -223,10 +223,6 @@
<source>Add by URL</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>URL</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Refresh</source>
<translation type="unfinished"></translation>