diff options
author | Gatis Paeglis <gatis.paeglis@theqtcompany.com> | 2016-01-19 14:49:19 +0100 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@theqtcompany.com> | 2016-01-20 12:45:23 +0000 |
commit | 980a17e8041433673f6663c64032491457457cd2 (patch) | |
tree | 108f031c5dfbd4bf3fcd7a4968250822a1884894 /basicsuite | |
parent | ac10cad97d049a71af15dcc6bcf1ac782a795737 (diff) |
Use WifiManager.lastError for error reporting
Change-Id: Ia5e267bd631ada61703c7be5e295665be48c1410
Reviewed-by: Kimmo Ollila <kimmo.ollila@theqtcompany.com>
Diffstat (limited to 'basicsuite')
-rw-r--r-- | basicsuite/launchersettings/WifiGroupBox.qml | 24 | ||||
-rw-r--r-- | basicsuite/launchersettings/WifiNetworkList.qml | 5 |
2 files changed, 25 insertions, 4 deletions
diff --git a/basicsuite/launchersettings/WifiGroupBox.qml b/basicsuite/launchersettings/WifiGroupBox.qml index 7f47e47..4980335 100644 --- a/basicsuite/launchersettings/WifiGroupBox.qml +++ b/basicsuite/launchersettings/WifiGroupBox.qml @@ -81,6 +81,28 @@ ColumnLayout { } } + Connections { + target: WifiManager + onLastErrorChanged: { + wifiErrorReporter.text = "error: " + WifiManager.lastError + clearErrorTimer.restart() + } + } + + Text { + id: wifiErrorReporter + wrapMode: Text.WordWrap + Layout.leftMargin: mainLayout.column1Width + Layout.topMargin: engine.mm(2) + Layout.preferredWidth: mainLayout.width * .4 + Timer { + id: clearErrorTimer + repeat: false + interval: 6000 + onTriggered: wifiErrorReporter.text = "" + } + } + Binding { target: WifiManager property: "scanning" @@ -90,7 +112,7 @@ ColumnLayout { Button { id: listNetworksButton Layout.leftMargin: mainLayout.column1Width - Layout.topMargin: engine.mm(6) + Layout.topMargin: engine.mm(1) Layout.preferredWidth: mainLayout.width * .4 visible: WifiManager.backendState === WifiManager.Running text: networkList.visible ? qsTr("Hide Wi-Fi networks") diff --git a/basicsuite/launchersettings/WifiNetworkList.qml b/basicsuite/launchersettings/WifiNetworkList.qml index 806b021..dd5dddf 100644 --- a/basicsuite/launchersettings/WifiNetworkList.qml +++ b/basicsuite/launchersettings/WifiNetworkList.qml @@ -146,14 +146,13 @@ Item { } else { config.ssid = ssid; config.passphrase = passwordInput.text - var supportedProtocols; + var supportedProtocols = ""; if (supportsWPA) supportedProtocols += "WPA " if (supportsWPA2) supportedProtocols += "WPA2 " if (supportsWEP) supportedProtocols += "WEP " if (supportsWPS) supportedProtocols += "WPS " config.protocol = supportedProtocols - if (!WifiManager.connect(config)) - print("failed to connect: " + WifiManager.lastError) + WifiManager.connect(config) } } } |