Index: sources/gui/qml/WifiStatusIndicator.qml =================================================================== diff -u -r6f66ec07cf63341336ec82f0d26874087007e814 -r06152733946baf8da998803721e9013f48078f48 --- sources/gui/qml/WifiStatusIndicator.qml (.../WifiStatusIndicator.qml) (revision 6f66ec07cf63341336ec82f0d26874087007e814) +++ sources/gui/qml/WifiStatusIndicator.qml (.../WifiStatusIndicator.qml) (revision 06152733946baf8da998803721e9013f48078f48) @@ -60,40 +60,33 @@ source : _wifiStatusRoot.isConnected ? "qrc:/images/WifiLogoConnected" : "qrc:/images/WifiLogoNotConnected" } - Text { id: _wifiIndicatorLabel - visible : true - anchors.top: parent.bottom - anchors.horizontalCenter: parent.horizontalCenter - color : Colors.white - text : qsTr("Wifi") - font.pixelSize: 12 - font.bold: true - } - onClicked: if(displayInformation) _wifiInfoDialog.open() Item { // To allow better positioning control, wrapping ModalDialog in Item - anchors.right : _wifiStatusRoot.right - anchors.top : _wifiStatusRoot.bottom + anchors { + top : _wifiStatusRoot.bottom + topMargin : Variables.dialogSpaceFromIcon + + right : _wifiStatusRoot.right + } + width : _wifiInfoDialog.width height: _wifiInfoDialog.height StatusDialog{ id: _wifiInfoDialog dialogTitleText : qsTr("Wifi Info") infoLabels : [ - qsTr("SSID" ), - qsTr("IP Address" ), - qsTr("Gateway" ), - qsTr("Subnet Mask" ), - qsTr("DNS") + qsTr("SSID" ), + qsTr("IP Address" ), + qsTr("Signal Strength Level"), + qsTr("Security Type" ) ] statusInfo : [ - vNetwork.ssid , - vNetwork.ipAddress , - vNetwork.gateway , - vNetwork.subnetMask , - vNetwork.DNS + vNetwork.ssid , + vNetwork.ipAddress , + vNetwork.wifiSignalStrength , + vNetwork.wifiSecurityType ] } } Index: sources/gui/qml/dialogs/StatusDialog.qml =================================================================== diff -u -r070977fbf934ea7ff458bdadc6c1e0b7e7efd3bf -r06152733946baf8da998803721e9013f48078f48 --- sources/gui/qml/dialogs/StatusDialog.qml (.../StatusDialog.qml) (revision 070977fbf934ea7ff458bdadc6c1e0b7e7efd3bf) +++ sources/gui/qml/dialogs/StatusDialog.qml (.../StatusDialog.qml) (revision 06152733946baf8da998803721e9013f48078f48) @@ -33,8 +33,17 @@ property var infoLabels : [] property int fontPixelSizeText : Fonts.fontPixelStatusDialogText - width : 300 + width : 350 height : 175 + radius: 5 + CloseButton { id : _closeButton + anchors.top : parent.top + anchors.left : undefined + anchors.right : parent.right + anchors.bottom : undefined + anchors.margins : 10 + onClicked : close() + } Column{ x: 0 @@ -53,37 +62,32 @@ Repeater { id: _infoRepeater // When the model changes, the dialog height is updated to accomodate rows of data - onModelChanged: _root.height = (statusInfo.length + infoLabels.length) * 30 + onModelChanged: _root.height = Math.max(_root.infoLabels.length, _root.statusInfo.length) * 30 + _dialogTitle.height model: [] - Column { + Row { width: _root.width - _closeButton.width - Text { id: _text objectName : _root.textObjectName + index + width : parent.width/2 text : (index < _root.infoLabels.length) ? _root.infoLabels[index] : "" color : Colors.textMain font.pixelSize : fontPixelSizeText font.family : Fonts.fontFamilyFixed + horizontalAlignment: Text.AlignLeft } Text { objectName : _root.textObjectName + "L" + index + width : parent.width/2 text : " " + modelData color : Colors.textMain font.pixelSize : fontPixelSizeText font.family: Fonts.fontFamilyFixed + horizontalAlignment: Text.AlignLeft } } } } - CloseButton { id : _closeButton - anchors.top : undefined - anchors.left : undefined - anchors.right : parent.right - anchors.bottom : parent.bottom - anchors.margins : 10 - onClicked : close() - } } Index: sources/gui/qml/globals/Variables.qml =================================================================== diff -u -r159f2bb0317c7c3c0336e4cb80c7fef3f87e329a -r06152733946baf8da998803721e9013f48078f48 --- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 159f2bb0317c7c3c0336e4cb80c7fef3f87e329a) +++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 06152733946baf8da998803721e9013f48078f48) @@ -67,6 +67,7 @@ readonly property int dialogWidth : applicationWidth - dialogMargin readonly property int dialogHeight : applicationHeight - dialogMargin readonly property int dialogRadius : 10 + readonly property int dialogSpaceFromIcon : 2 readonly property int rangeRectMargin : 1 readonly property int rangeRectRadius : 2 Index: sources/view/settings/VNetworkModel.cpp =================================================================== diff -u -rbff1a7d681ce1928f39c79428958a5eb1625080c -r06152733946baf8da998803721e9013f48078f48 --- sources/view/settings/VNetworkModel.cpp (.../VNetworkModel.cpp) (revision bff1a7d681ce1928f39c79428958a5eb1625080c) +++ sources/view/settings/VNetworkModel.cpp (.../VNetworkModel.cpp) (revision 06152733946baf8da998803721e9013f48078f48) @@ -299,7 +299,18 @@ dns(vNetwork.mIPSettings.mDNS.trimmed()); ssid(vNetwork.ssid().trimmed()); macAddress(vNetwork.macAddress().trimmed()); + wifiSignalStrength(vNetwork.signalLevel()); + + QString securityTypes = MWifiNetwork::securityTypesToStringList(vNetwork.securityTypes()).join("/"); + wifiSecurityType(securityTypes); + status(tr("Connected to %1.").arg(vNetwork.ssid()).trimmed()); + + // If the security type list is empty, this indicates that this is a reconnection + // upon start-up. Need to do a scan and get updated + if (securityTypes.isEmpty()){ + doScan(); + } } /*! Index: sources/view/settings/VNetworkModel.h =================================================================== diff -u -r081df84b4b81ab39296f42c3c7e91deb021b8979 -r06152733946baf8da998803721e9013f48078f48 --- sources/view/settings/VNetworkModel.h (.../VNetworkModel.h) (revision 081df84b4b81ab39296f42c3c7e91deb021b8979) +++ sources/view/settings/VNetworkModel.h (.../VNetworkModel.h) (revision 06152733946baf8da998803721e9013f48078f48) @@ -56,6 +56,8 @@ PROPERTY(QString , macAddress , "") PROPERTY(QString , ethernetIP , "") PROPERTY(QString , wirelessIP , "") + PROPERTY(QString , wifiSecurityType , "") + PROPERTY(int ,wifiSignalStrength, 0) public: // Note: VIEW_DEC_CLASS(VNetworkModel) requires QObject as the parent, so it's necessary to define it here Index: sources/wifi/WifiInterface.cpp =================================================================== diff -u -r80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803 -r06152733946baf8da998803721e9013f48078f48 --- sources/wifi/WifiInterface.cpp (.../WifiInterface.cpp) (revision 80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803) +++ sources/wifi/WifiInterface.cpp (.../WifiInterface.cpp) (revision 06152733946baf8da998803721e9013f48078f48) @@ -256,7 +256,23 @@ LOG_DEBUG(QString("stderr: %1").arg(err)); _scanRunning = false; emit didScanStatusChanged(_scanRunning); - parseWifiScan(out); + QList networks = parseWifiScan(out); + + // A non-empty macAddress indicates UI is connected to a network + // if the network security type list is empty, this indicates that the connection + // was a result of a start-up reconnection. Traverse through discovered networks + // and update the security type list and signal strength info + if(!_network.macAddress().isEmpty() && _network.securityTypes().isEmpty()) { + foreach(WifiNetworkData network, networks){ + if(network.macAddress() == _network.macAddress()){ + // update the security and signal info + _network.securityTypes(network.securityTypes()); + _network.signalLevel(network.signalLevel()); + emit didConnectToNetwork(_network); + } + } + } + LOG_DEBUG("WiFi Scan Finished"); }