Index: sources/gui/qml/pages/settings/SettingsStack.qml =================================================================== diff -u -r4012b0f98277c73f6afb4ee4ccf5e876f062b4ad -r559dc64d12cf7647ec8c29ccbf4ca90f90e5e3a2 --- sources/gui/qml/pages/settings/SettingsStack.qml (.../SettingsStack.qml) (revision 4012b0f98277c73f6afb4ee4ccf5e876f062b4ad) +++ sources/gui/qml/pages/settings/SettingsStack.qml (.../SettingsStack.qml) (revision 559dc64d12cf7647ec8c29ccbf4ca90f90e5e3a2) @@ -7,14 +7,15 @@ * * \file SettingsStack.qml * \author (last) Behrouz NematiPour - * \date (last) 23-Nov-2022 + * \date (last) 03-Apr-2023 * \author (original) Behrouz NematiPour * \date (original) 16-Apr-2021 * */ // Qt import QtQuick 2.12 +import QtQuick.Controls 2.12 // Switch // Project import Gui.Actions 0.1 @@ -40,17 +41,19 @@ property bool serviceMode : false enum ItemsIndex { - Information , - VolumeBrightness, - WiFi , - Bluetooth , - DGSettings , - Services , - SetDateTime , - ExportLogs , - Language , - Calibration , - SWUpdate , + Information , + VolumeBrightness , + WiFi , + Bluetooth , + DGSettings , + Services , + SetDateTime , + ExportLogs , + RoInput , + Language , + Calibration , + DeviceRegistration , + SWUpdate , FactoryReset } property var itemsText : [ @@ -62,8 +65,10 @@ qsTr("Service" ), // Service qsTr("Set Date And Time" ), // SetDateTime qsTr("Export Logs" ), // ExportLogs + qsTr("Water Input Mode" ), // RoInput qsTr("Set Language" ), // Language qsTr("Calibration " ), // Calibration + qsTr("Device Registeration" ), // DeviceRegistration qsTr("Software Update" ), // SWUpdate qsTr("Factory Reset" ), // FactoryReset ] @@ -76,8 +81,10 @@ true , // Services true , // SetDateTime true , // ExportLogs + true , // RoInput false , // Language false , // Calibration + true , // DeviceRegistration false , // SWUpdate false , // FactoryReset ] @@ -90,8 +97,10 @@ ! serviceMode , // Services serviceMode , // SetDateTime true , // ExportLogs + true , // RoInput false /* serviceMode phase 1 */ , // Language false /* serviceMode phase 1 */ , // Calibration + true /* serviceMode */ , // DeviceRegistration // FIXME: On the normal setting menu for now for development. false /* serviceMode phase 1 */ , // SWUpdate false /* serviceMode phase 1 */ , // FactoryReset ] @@ -145,6 +154,14 @@ push( _settingsExportLogs ) break + case SettingsStack.RoInput: + push( _settingsRoInput ) + break + + case SettingsStack.DeviceRegistration: + push( _settingsDeviceRegistration ) + break + default: console.debug("Unknown Index", vIndex) break @@ -236,6 +253,86 @@ itemIndex : SettingsStack.ExportLogs } + SettingsBase { id: _settingsRoInput + confirmVisible : false + itemIndex : SettingsStack.RoInput + + + Row { id: _settingsRoInputRow + anchors.centerIn: parent + + Text { id : _settingsRoInputLabel + text : qsTr("Pure Water Mode") + width : 300 + height : _settingsRoInputSwitch.height + color : Colors.white + font.pixelSize: Fonts.fontPixelButton + verticalAlignment : Text.AlignVCenter + horizontalAlignment : Text.AlignLeft + } + + Switch { id: _settingsRoInputSwitch + property bool active: true + + checked : vDuetRoWaterDG.status + + width : 85 + height : 85 + + indicator: Rectangle { + implicitWidth : Variables.sliderCircleDiameter * 1.7 + implicitHeight : Variables.sliderCircleDiameter - ( Variables.progressbarHandlerBorderWidth * 2 ) + radius : implicitHeight + anchors.centerIn: parent + color : _settingsRoInputSwitch.checked ? Colors.backgroundButtonSelect : Colors.createTreatmentInactive + border.color : _settingsRoInputSwitch.checked ? Colors.borderButton : Colors.createTreatmentInactive + Rectangle { + property real diameter : Variables.sliderCircleDiameter + x: _settingsRoInputSwitch.checked ? parent.width - width : 0 + anchors.verticalCenter: parent.verticalCenter + width : diameter + height : diameter + radius : diameter + color : _settingsRoInputSwitch.active ? Colors.highlightProgressBar : Colors.createTreatmentInactive + border { + width: Variables.progressbarHandlerBorderWidth + color: Colors.textMain + } + } + } + + contentItem: Text { + width : parent.width + height : parent.height + text : _settingsRoInputSwitch.checked ? qsTr("ON") : qsTr("OFF") + font.pixelSize: Fonts.fontPixelButton + color : _settingsRoInputSwitch.active ? Colors.textMain : Colors.textDisableButton + verticalAlignment : Text.AlignTop + horizontalAlignment : Text.AlignHCenter + } + } + } + + Connections { target: _settingsRoInputSwitch + function onCheckedChanged() { + vDuetRoWaterDG.doAdjustment ( _settingsRoInputSwitch.checked ) + } + } + Connections { target: vDuetRoWaterDG + function onAdjustmentTriggered(vValue) { + if ( vDuetRoWaterDG.adjustment_Accepted ) { + _settingsRoInput.notificationText = "" + } + else { + _settingsRoInput.notificationText = vDuetRoWaterDG.notification // adjustment_ReasonText + } + vSettings.roWaterMode = vDuetRoWaterDG.status + } + } + } + + SettingsDeviceRegistration { id: _settingsDeviceRegistration } + UserConfirmation { id: _servicePassword property bool isPassword_Accepted : false property bool isDefaultPasswordSet : (vSettings.servicePass != "")