Index: resources/images/WifiLogoConnected.png =================================================================== diff -u Binary files differ Index: resources/images/WifiLogoNotConnected.png =================================================================== diff -u Binary files differ Index: sources/gui/qml/WifiStatusIndicator.qml =================================================================== diff -u --- sources/gui/qml/WifiStatusIndicator.qml (revision 0) +++ sources/gui/qml/WifiStatusIndicator.qml (revision 6f66ec07cf63341336ec82f0d26874087007e814) @@ -0,0 +1,100 @@ +/*! + * + * Copyright (c) 2022-2023 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file WifiStatusIndicator.qml + * \author (last) Vy Duong + * \date (last) 28-Aug-2023 + * \author (original) Vy Duong + * \date (original) 28-Aug-2023 + * + */ + +// Qt +import QtQuick 2.12 +import QtQuick.Controls 2.12 // Dialog + +// Project +// C++ imports +// Qml imports +import "qrc:/globals" +import "qrc:/components" +import "qrc:/dialogs" + +/*! + * \brief WifiStatusIndicator is the component to provide user information about the Wifi Connection + * \detials This item includes connection status of Wifi. + * The ProgressCircle turns green if the Wifi is connected and grey when not connected to a network + * The ProgressCircle will indicate the wifi strength of the network + * Single click will open a small dialog with additional info + */ +TouchRect { id: _wifiStatusRoot + readonly property bool isConnected : vNetwork.macAddress !== "" // The macAddress property is empty if there is no connection + + property alias thickness : _batteryLevelCircle.thickness + property bool displayInformation : true + + touchExpanding : 20 // since the object visual is so small make the mouseArea bigger for the human finger to easier touch. + enabled : _wifiStatusRoot.isConnected + color : Colors.transparent + + width : 30 + height: width + radius: width + + ProgressCircle { id: _batteryLevelCircle + anchors.fill: parent + diameter: _wifiStatusRoot.width + minimum : 0 + maximum : 100 + value : 100 // TODO need to see if we have signal strength + color : _wifiStatusRoot.isConnected ? Colors.progressCircleConnected : Colors.progressCircleNotReady + } + + Image { id: _btIcon + anchors.centerIn: parent + anchors.fill : parent + 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 + 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") + ] + statusInfo : [ + vNetwork.ssid , + vNetwork.ipAddress , + vNetwork.gateway , + vNetwork.subnetMask , + vNetwork.DNS + ] + } + } +} Index: sources/gui/qml/main.qml =================================================================== diff -u -rd1a4fe257de0cc4fe51f241075f429d22d83eebe -r6f66ec07cf63341336ec82f0d26874087007e814 --- sources/gui/qml/main.qml (.../main.qml) (revision d1a4fe257de0cc4fe51f241075f429d22d83eebe) +++ sources/gui/qml/main.qml (.../main.qml) (revision 6f66ec07cf63341336ec82f0d26874087007e814) @@ -297,21 +297,6 @@ font.pixelSize: 14 } - Text { // TEST : Wireless IP - color : Colors.textMain - anchors { - top : parent.top - left : parent.left - leftMargin : 325 - } - horizontalAlignment : Text.Alignleft - verticalAlignment : Text.AlignBottom - - height : 15 - text : "W:" + vNetwork.wirelessIP - font.pixelSize: 15 - } - Text { // TEST : Ethernet IP color : Colors.textMain anchors { @@ -372,17 +357,32 @@ font.pixelSize: 14 } + WifiStatusIndicator { id: _wifiStatusIndicator + anchors { + top : parent.top + topMargin : 5 + + right : _bluetoothStatusIndicator.right + rightMargin : 50 + } + } BluetoothStatusIndicator { id: _bluetoothStatusIndicator anchors { top : parent.top right : parent.right topMargin : 5 - rightMargin : 75 + rightMargin : 250 } } SDCProgressItem { id: _sdcProgressItem // TODO: disable this later. this is only for diagnostic purpose. + anchors { + top : parent.top + right : parent.right + topMargin : 5 + rightMargin : 200 + } onDoubleClicked : { if ( _GuiView.dryDemoMode ) { let dryDemoTempID = 99