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
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue