Index: leahi.qrc =================================================================== diff -u -rea51c0546c7061d225e7b9d8b754554c65f0d1b1 -r3bee9f20350882eca47f3d18b0accf5bec3933d4 --- leahi.qrc (.../leahi.qrc) (revision ea51c0546c7061d225e7b9d8b754554c65f0d1b1) +++ leahi.qrc (.../leahi.qrc) (revision 3bee9f20350882eca47f3d18b0accf5bec3933d4) @@ -34,6 +34,7 @@ sources/gui/qml/dialogs/NotificationDialog.qml sources/gui/qml/dialogs/AlarmListDialog.qml sources/gui/qml/dialogs/LockDialog.qml + sources/gui/qml/dialogs/WiFiDialog.qml sources/gui/qml/dialogs/diagnostics/DiagnosticsDialog.qml @@ -157,6 +158,7 @@ sources/gui/qml/components/LabelValue.qml sources/gui/qml/components/ArrowButton.qml sources/gui/qml/components/HeaderBar.qml + sources/gui/qml/components/HeaderBarPopup.qml sources/gui/qml/compounds/PressureRangeSlider.qml Index: sources/device/DeviceController.cpp =================================================================== diff -u -rbabe585dd9603621275742b07135c0fd4181802f -r3bee9f20350882eca47f3d18b0accf5bec3933d4 --- sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision babe585dd9603621275742b07135c0fd4181802f) +++ sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision 3bee9f20350882eca47f3d18b0accf5bec3933d4) @@ -243,9 +243,53 @@ settingsPartitionSpaceCheck(); #endif findPendingLogs(); + checkWiFi(); } /*! + * \brief DeviceController::checkWiFi + * \details Periodically check for WiFi network + */ +void DeviceController::checkWiFi() +{ + struct WiFiData { + QString mSSID ; + QString mIP ; + QString mSTRENGTH ; + QString mSECURITY ; + + QString toString() { + QStringList fields = QStringList() + << mSSID + << mIP + << mSTRENGTH + << mSECURITY; + return fields.join(','); + } + } ; + + + WiFiData mWifiData; + mWifiData.mSSID = "TEST"; + mWifiData.mIP = "1925.3168.0.31"; + mWifiData.mSECURITY = "max"; + mWifiData.mSTRENGTH = "150"; + + emit didWiFiData(mWifiData.toString()); + +// struct WIFIDATA { +// QString mSSID ; +// QString mIP ; +// QString mSECURITY ; +// QString mSTRENGTH ; + + +// } ; + + +} + +/*! * \brief DeviceController::usbCheck * \details Runs usbSeek to mount or umount or remove it * regarding the state it's in. Index: sources/device/DeviceController.h =================================================================== diff -u -ra2a273600d25e863214833ead3324a63fb4759f1 -r3bee9f20350882eca47f3d18b0accf5bec3933d4 --- sources/device/DeviceController.h (.../DeviceController.h) (revision a2a273600d25e863214833ead3324a63fb4759f1) +++ sources/device/DeviceController.h (.../DeviceController.h) (revision 3bee9f20350882eca47f3d18b0accf5bec3933d4) @@ -283,6 +283,8 @@ void findPendingLogs(); + void checkWiFi(); + bool logBackup(const QString &vFileName); bool logUpload(const QString &vFileName); @@ -431,6 +433,14 @@ */ void didLogUpload ( bool vPass, const QString &vFileName ); + /*! + * \brief didWiFiData + * \details notifies UI when WiFi netowrk data has changed + * \param vData - WiFi data to displayh on UI + + */ + void didWiFiData ( const QString &vData ); + private: // ----- USB void usbCheck (); Index: sources/device/DeviceView.cpp =================================================================== diff -u -r71cd3700a59ff4b0e363aae8e3487c559c0a0eec -r3bee9f20350882eca47f3d18b0accf5bec3933d4 --- sources/device/DeviceView.cpp (.../DeviceView.cpp) (revision 71cd3700a59ff4b0e363aae8e3487c559c0a0eec) +++ sources/device/DeviceView.cpp (.../DeviceView.cpp) (revision 3bee9f20350882eca47f3d18b0accf5bec3933d4) @@ -31,6 +31,8 @@ DEVICE_VIEW_INIT_CONNECTIONS_LIST connect(&_DeviceController , SIGNAL(didPOSTOSVersionData(QString)), this , SLOT( onPOSTOSVersionData(QString))); + connect(&_DeviceController , SIGNAL(didWiFiData(QString)), + this , SLOT( onWiFiData(QString))); } // ================================================================================================== @@ -43,6 +45,20 @@ osVersion(vOSVersion); } +void VDevice::onWiFiData (const QString &vData) +{ + QStringList wifiData - vData.split[',']; + + if (wifiData.count() < 2) { + + } + else { + ssid(wifiData[0]); + ipAddress(wifiData[1]); + } + +} + // ================================================= Brightness void VDevice::doInitBrightness() { // DEBUG : qDebug() << "HERE Request" << vValue; Index: sources/device/DeviceView.h =================================================================== diff -u -rbabe585dd9603621275742b07135c0fd4181802f -r3bee9f20350882eca47f3d18b0accf5bec3933d4 --- sources/device/DeviceView.h (.../DeviceView.h) (revision babe585dd9603621275742b07135c0fd4181802f) +++ sources/device/DeviceView.h (.../DeviceView.h) (revision 3bee9f20350882eca47f3d18b0accf5bec3933d4) @@ -135,6 +135,7 @@ private slots: void onPOSTOSVersionData (const QString &vOSVersion); + void onWiFiData (const QString &vData); private: void parseWifiListResult(const QString &vResult); Index: sources/gui/qml/components/HeaderBar.qml =================================================================== diff -u -r31617ae652a85b46756ae4046d6df0c9570a84b0 -r3bee9f20350882eca47f3d18b0accf5bec3933d4 --- sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision 31617ae652a85b46756ae4046d6df0c9570a84b0) +++ sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision 3bee9f20350882eca47f3d18b0accf5bec3933d4) @@ -1,8 +1,8 @@ import QtQuick 2.12 -import QtQuick.Controls 2.12 // Dialog -import "qrc:/globals" import "qrc:/components" +import "qrc:/dialogs" +import "qrc:/globals" Rectangle { id: _root @@ -18,13 +18,13 @@ GradientStop { position: 0.8; color: Qt.darker (Colors.backgroundMain, 1.2) } } - function getPopupXCoord ( button, dialog) { + function getPopupXCoord ( button, dialog ) { var globalPoint = button.mapToGlobal(0, 0); - return globalPoint.x - dialog.width + button.width // to right align dialog with button right align + return globalPoint.x - dialog.width } Component.onCompleted: { - dialog.x = getPopupXCoord(_wifiButton, dialog) + _wifiDialog.x = getPopupXCoord(_wifiButton, _wifiDialog) } Item { id: _dateTimeItem @@ -35,8 +35,10 @@ bottom : parent.bottom margins : 10 } + Column { id: _dateTimeColumn anchors.fill: parent + Text { id: _timeText color : Colors.textMain width : parent.width @@ -46,6 +48,7 @@ text : vDateTime.time font.pixelSize: 40 } + Text { id: _dateText color : Colors.textMain width : parent.width @@ -109,35 +112,13 @@ } } - ModalDialog { id: dialog - width : 250 - height : 150 - lighterDimOVerlay : true - closePolicy: Dialog.CloseOnPressOutside - y : Variables.headerHeight + 5 - - Text { - text: "x: " + dialog.x + "\ny: " + dialog.y - color: "White" - font.pixelSize: 30 - anchors.bottom: parent.bottom - } - Text { id: _ipAddress - text : ("%1: %2").arg(qsTr("IP")).arg(vDevice.ipAddress) - color : Colors.white - font.pixelSize : 30 - } - - } - - Row { id: _headerButtonRow height : parent.height spacing : Variables.defaultMargin * 2 anchors { verticalCenter: parent.verticalCenter - right : parent.right - rightMargin : _headerButtonRow.spacing + right : parent.right + rightMargin : _headerButtonRow.spacing } IconButton { id : _prescriptionButton @@ -153,7 +134,7 @@ iconImageSource : "qrc:/images/iWifi" extraSpace : _headerButtonRow.spacing - onPressed : dialog.open() + onPressed : _wifiDialog.open() } IconButton { id : _bluetoothButton @@ -196,4 +177,6 @@ onPressed: print("Information button pressed!") } } + + WiFiDialog { id: _wifiDialog } } Index: sources/gui/qml/components/HeaderBarPopup.qml =================================================================== diff -u --- sources/gui/qml/components/HeaderBarPopup.qml (revision 0) +++ sources/gui/qml/components/HeaderBarPopup.qml (revision 3bee9f20350882eca47f3d18b0accf5bec3933d4) @@ -0,0 +1,14 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 // Dialog + +import "qrc:/globals" +import "qrc:/components" + +ModalDialog { id: dialog + width : 250 + height : 150 + modal : false + closePolicy : Dialog.CloseOnPressOutside + y : Variables.headerHeight + 5 + backgroundColor : "#F5F3F3" +} Index: sources/gui/qml/components/ModalDialog.qml =================================================================== diff -u -r31617ae652a85b46756ae4046d6df0c9570a84b0 -r3bee9f20350882eca47f3d18b0accf5bec3933d4 --- sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision 31617ae652a85b46756ae4046d6df0c9570a84b0) +++ sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision 3bee9f20350882eca47f3d18b0accf5bec3933d4) @@ -35,7 +35,6 @@ property alias radius : _backgroundRect.radius property alias notificationText : _notification.text property alias notification : _notification - property bool lighterDimOVerlay : false width : Variables.dialogWidth height : Variables.dialogHeight @@ -53,11 +52,8 @@ Overlay.modal : Rectangle { id : _borderRect anchors.fill : parent anchors.bottomMargin: _alarmBar.visible ? Variables.notificationHeight : 0 + color : "#99000000" - // darker (60%) for main bigger dialogs and lighter (20%) for smaller headerbar dialogs - color : lighterDimOVerlay ? "#33000000" : - "#99000000" - Behavior on opacity { NumberAnimation { duration: 300} } } Index: sources/gui/qml/dialogs/WiFiDialog.qml =================================================================== diff -u --- sources/gui/qml/dialogs/WiFiDialog.qml (revision 0) +++ sources/gui/qml/dialogs/WiFiDialog.qml (revision 3bee9f20350882eca47f3d18b0accf5bec3933d4) @@ -0,0 +1,61 @@ +import QtQuick 2.12 + +import "qrc:/components" +import "qrc:/globals" + +HeaderBarPopup { id: _root + readonly property int pixelSize : 24 + + +// width : Math.max( _wifiDataTable.contentWidth) + Variables.defaultMargin * 2 + + width : Math.max( test1.contentWidth, + _ssid.contentWidth, + _ipAddress.contentWidth) + Variables.defaultMargin * 2 + + height : 100 + +// ListModel { id: _wiFiData +//// ListElement { name: qsTr("x"); text: ("%1").arg(_root.x) } +// ListElement { name: qsTr("SSID"); text: vDevice.ssid } +// ListElement { name: qsTr("IP"); text: vDevice.ipAddress } +//// ListElement { name: qsTr("Security"); text: 2.45 } +//// ListElement { name: qsTr("Strength"); text: 2.45 } +// } + + Column { id : _dialogRow + anchors.fill : parent + anchors.leftMargin : Variables.defaultMargin + anchors.topMargin : 10 + + +// Repeater { id: _wifiDataTable +// model: _wiFiData +// Text { +// text: ("%1: %2").arg(model.name).arg(model.text) +// color: Colors.dialogText +// font.pixelSize: _root.pixelSize +// } +// } + + Text { id: test1 + text: "x: " + _root.x + color: Colors.dialogText + font.pixelSize: _root.pixelSize + } + + Text { id: _ssid + text: ("%1: %2").arg(qsTr("SSID")).arg(vDevice.ssid) + color: Colors.dialogText + font.pixelSize: _root.pixelSize + } + + Text { id: _ipAddress + text : ("%1: %2").arg(qsTr("IP")).arg(vDevice.ipAddress) + color : Colors.dialogText + font.pixelSize : _root.pixelSize + } + } + + +} Index: sources/gui/qml/globals/Colors.qml =================================================================== diff -u -r31ff96b799fff4ea66b9187416e9dd16e3dc10fe -r3bee9f20350882eca47f3d18b0accf5bec3933d4 --- sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 31ff96b799fff4ea66b9187416e9dd16e3dc10fe) +++ sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 3bee9f20350882eca47f3d18b0accf5bec3933d4) @@ -54,6 +54,7 @@ readonly property color backgroundUltrafiltrationButton : "#31568F" readonly property color textValueUltrafiltrationButtonFg: "#98aec2" + readonly property color dialogText : "#343434" readonly property color backgroundRangeRect : "#3e546e" readonly property color highlightProgressBar : "#3d8eef"