Pop PrinterPage if wifi is lost
This commit is contained in:
parent
276b9d2759
commit
c745d6121b
3 changed files with 19 additions and 10 deletions
|
@ -4,6 +4,7 @@ import QtQuick.LocalStorage 2.0
|
|||
import Nemo.Notifications 1.0
|
||||
import Nemo.Configuration 1.0
|
||||
import "pages"
|
||||
import "components"
|
||||
|
||||
ApplicationWindow
|
||||
{
|
||||
|
@ -16,6 +17,10 @@ ApplicationWindow
|
|||
property string busyMessage: ""
|
||||
property string progress: ""
|
||||
|
||||
WifiChecker {
|
||||
id: wifi
|
||||
}
|
||||
|
||||
Item {
|
||||
id: db
|
||||
property var db_conn
|
||||
|
|
|
@ -6,8 +6,6 @@ import seaprint.convertchecker 1.0
|
|||
import seaprint.ippprinter 1.0
|
||||
import seaprint.mimer 1.0
|
||||
import "utils.js" as Utils
|
||||
import "../components"
|
||||
import Nemo.DBus 2.0
|
||||
|
||||
Page {
|
||||
id: page
|
||||
|
@ -16,12 +14,12 @@ Page {
|
|||
property string selectedFile: ""
|
||||
property string selectedFileType
|
||||
|
||||
WifiChecker {
|
||||
id: wifi
|
||||
Connections {
|
||||
target: wifi
|
||||
onConnectedChanged: {
|
||||
console.log("conn", connected, ssid)
|
||||
if(connected) {
|
||||
var favourites = db.getFavourites(ssid);
|
||||
console.log("conn", wifi.connected, wifi.ssid)
|
||||
if(wifi.connected) {
|
||||
var favourites = db.getFavourites(wifi.ssid);
|
||||
console.log(favourites);
|
||||
IppDiscovery.favourites = favourites;
|
||||
}
|
||||
|
@ -34,7 +32,7 @@ Page {
|
|||
property bool initialSSIDchange: true
|
||||
|
||||
onSsidChanged: {
|
||||
console.log("ssid changed", ssid);
|
||||
console.log("ssid changed", wifi.ssid);
|
||||
if(!initialSSIDchange)
|
||||
{
|
||||
IppDiscovery.reset();
|
||||
|
|
|
@ -14,8 +14,14 @@ Page {
|
|||
property var jobParams: new Object();
|
||||
property string selectedFile
|
||||
|
||||
Component.onCompleted: {
|
||||
console.log(JSON.stringify(printer.attrs))
|
||||
|
||||
Connections {
|
||||
target: wifi
|
||||
onConnectedChanged: {
|
||||
if(!wifi.connected) {
|
||||
pageStack.pop()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function choiceMade(name, tag, choice)
|
||||
|
|
Loading…
Reference in a new issue