Index: sources/gui/qml/pages/SettingsWifi.qml =================================================================== diff -u -rd71990c79c75c613d781890c6f77505d409d6c64 -r091bc0425b84f094cbd863865a5edac2477208eb --- sources/gui/qml/pages/SettingsWifi.qml (.../SettingsWifi.qml) (revision d71990c79c75c613d781890c6f77505d409d6c64) +++ sources/gui/qml/pages/SettingsWifi.qml (.../SettingsWifi.qml) (revision 091bc0425b84f094cbd863865a5edac2477208eb) @@ -49,7 +49,6 @@ left: parent.left topMargin: Variables.settingsWIFIMargin } - text: qsTr("Wifi Settings") } @@ -79,6 +78,7 @@ onEnterPressed: { console.log("IP Address: Enter pressed") _keyboard.setVisible(false) + vNetworkModel.doSetIPAddress(textInput.text) } } @@ -96,6 +96,7 @@ textInput.text: vNetworkModel.gateway onEnterPressed: { _keyboard.setVisible(false) + vNetworkModel.doSetGateway(textInput.text) } } @@ -113,6 +114,7 @@ textInput.text: vNetworkModel.subnetMask onEnterPressed: { _keyboard.setVisible(false) + vNetworkModel.doSetSubnetMask(textInput.text) } } @@ -130,6 +132,7 @@ textInput.text: vNetworkModel.dns onEnterPressed: { _keyboard.setVisible(false) + vNetworkModel.doSetDNS(textInput.text) } } @@ -146,9 +149,6 @@ } labelText: qsTr("SSID: ") textInput.text: vNetworkModel.ssid - onEnterPressed: { - _keyboard.setVisible(false) - } } TouchRect { id: _scan @@ -223,8 +223,12 @@ anchors { centerIn: parent } + width: parent.width + horizontalAlignment: Text.AlignHCenter font.pixelSize: Fonts.fontPixelTextRectExtra text: ssid + clip: true + elide: Text.ElideRight color: Colors.textMain } @@ -240,15 +244,29 @@ color: Colors.textMain } + Text { + id: _isConnected + anchors { + right: parent.right + rightMargin: 10 + bottom: parent.bottom + } + font.pixelSize: Fonts.fontPixelDialogText + text: vNetworkModel.macAddress === macAddress ? qsTr("Connected") : qsTr("") + color: Colors.textMain + } + onClicked: { - console.debug("Clicked " + ssid + " with macAddress: " + macAddress); - if (vNetworkModel.doCheckIfConnected(macAddress)) { - // TODO: show alert to confirm disconnect + if (vNetworkModel.macAddress === macAddress) { + _wifiJoinDisconnect.isJoin = false + _wifiJoinDisconnect.macAddress = macAddress + _wifiJoinDisconnect.visible = true } else { // initiate connection to this network, as for password - _joinNetwork.ssid = ssid - _joinNetwork.macAddress = macAddress - _joinNetwork.visible = true + _wifiJoinDisconnect.isJoin = true + _wifiJoinDisconnect.ssid = ssid + _wifiJoinDisconnect.macAddress = macAddress + _wifiJoinDisconnect.visible = true } } }