Index: leahi.qrc =================================================================== diff -u -r01a8c935f7d90ce3b168970765c0f20ea0c1a273 -redb8ee3edc41b1d324cd8a53e8e27a2a58289563 --- leahi.qrc (.../leahi.qrc) (revision 01a8c935f7d90ce3b168970765c0f20ea0c1a273) +++ leahi.qrc (.../leahi.qrc) (revision edb8ee3edc41b1d324cd8a53e8e27a2a58289563) @@ -26,6 +26,7 @@ sources/gui/qml/pages/settings/SettingsDecommission.qml sources/gui/qml/pages/settings/SettingsInstitutionalRecord.qml sources/gui/qml/pages/settings/SettingsLocalization.qml + sources/gui/qml/pages/settings/SettingsUserMode.qml sources/gui/qml/dialogs/ConfirmDialog.qml Index: sources/device/DeviceView.cpp =================================================================== diff -u -rdeaef8b5bdfe9be7293e63fb6ac256a9ce3cd3f4 -redb8ee3edc41b1d324cd8a53e8e27a2a58289563 --- sources/device/DeviceView.cpp (.../DeviceView.cpp) (revision deaef8b5bdfe9be7293e63fb6ac256a9ce3cd3f4) +++ sources/device/DeviceView.cpp (.../DeviceView.cpp) (revision edb8ee3edc41b1d324cd8a53e8e27a2a58289563) @@ -28,6 +28,7 @@ void VDevice::initConnections() { + ACTION_VIEW_CONNECTION(SettingsData) DEVICE_VIEW_INIT_CONNECTIONS_LIST connect(&_DeviceController , SIGNAL(didPOSTOSVersionData(QString)), this , SLOT( onPOSTOSVersionData(QString))); @@ -632,3 +633,15 @@ ipAddress(vData); } +// ================================================= User Mode +/*! + * \brief VDevice::onSettingsDone + * \details fills the items below, read from the settings file, when the reading is notified done by ApplicationController. + */ +void VDevice::onActionReceive(const SettingsData &) +{ + QString mCategory = Storage::Settings_Category_SettingsSystem; + FROMVARIANT( userMode, "UserMode", "UserMode", UInt ); +} + + Index: sources/device/DeviceView.h =================================================================== diff -u -r3ee91a030e9affe0a50acdee33520c985c05d779 -redb8ee3edc41b1d324cd8a53e8e27a2a58289563 --- sources/device/DeviceView.h (.../DeviceView.h) (revision 3ee91a030e9affe0a50acdee33520c985c05d779) +++ sources/device/DeviceView.h (.../DeviceView.h) (revision edb8ee3edc41b1d324cd8a53e8e27a2a58289563) @@ -23,6 +23,7 @@ #include "VView.h" #include "DeviceGlobals.h" #include "DeviceModels.h" +#include "MSettings.h" // define @@ -128,7 +129,11 @@ READONLY ( QString , subnetMask , "" ) READONLY ( QString , dns , "" ) + READONLY ( bool , userMode , 0 ) + + VIEW_DEC_CLASS_EX(VDevice, QAbstractListModel) + VIEW_DEC_SLOT(SettingsData) public slots: void doWifiConnect(bool vConnect, const QString &vSsid, const QString &vPassword); Index: sources/gui/qml/pages/settings/SettingsHome.qml =================================================================== diff -u -r01a8c935f7d90ce3b168970765c0f20ea0c1a273 -redb8ee3edc41b1d324cd8a53e8e27a2a58289563 --- sources/gui/qml/pages/settings/SettingsHome.qml (.../SettingsHome.qml) (revision 01a8c935f7d90ce3b168970765c0f20ea0c1a273) +++ sources/gui/qml/pages/settings/SettingsHome.qml (.../SettingsHome.qml) (revision edb8ee3edc41b1d324cd8a53e8e27a2a58289563) @@ -31,15 +31,15 @@ property alias itemsText : _settingItems.itemsText property alias itemsVisible : _settingItems.itemsVisible - readonly property int rowCount : _settingItems.itemsVisible.filter(value => value).length / 2 + readonly property real rowCount : Math.ceil(_settingItems.itemsVisible.filter(value => value).length / 2) readonly property int colCount : 2 readonly property int delegateWidth : parent.width / 2.5 readonly property int delegateHeight: 80 signal itemClicked(int vIndex) - contentArea.anchors.topMargin: Variables.defaultMargin * 4 + contentArea.anchors.topMargin: Variables.defaultMargin * 5 contentItem: TouchGrid { id: _settingItems onItemClicked : _root.itemClicked(vIndex) Index: sources/gui/qml/pages/settings/SettingsLocalization.qml =================================================================== diff -u -r01a8c935f7d90ce3b168970765c0f20ea0c1a273 -redb8ee3edc41b1d324cd8a53e8e27a2a58289563 --- sources/gui/qml/pages/settings/SettingsLocalization.qml (.../SettingsLocalization.qml) (revision 01a8c935f7d90ce3b168970765c0f20ea0c1a273) +++ sources/gui/qml/pages/settings/SettingsLocalization.qml (.../SettingsLocalization.qml) (revision edb8ee3edc41b1d324cd8a53e8e27a2a58289563) @@ -19,6 +19,7 @@ // Qml imports import "qrc:/globals" import "qrc:/components" +import "qrc:/compounds" /*! * \brief SettingsROInput is the screen @@ -31,13 +32,22 @@ contentArea.anchors.topMargin: Variables.defaultMargin * 10 - contentItem: Item { id: _settingsLanguageItem - BaseComboBox { id: _settingsLanguageCombo - anchors.horizontalCenter : parent.horizontalCenter - width : 300 - height : 55 - currentIndex : vLocalization.languageIndex - model : vLocalization.languageList + contentItem: Item { + LabelUnitContainer { id: _settingsLanguageItem + anchors.horizontalCenter : parent.horizontalCenter + width : Variables.adjustmentLabelUnitContainerWidth + height : Variables.adjustmentLabelUnitContainerHeight + showUnit : false + text : qsTr("Language") + + contentItem: BaseComboBox { id: _settingsLanguageCombo + anchors.rightMargin : Variables.defaultMargin * 2 + anchors.leftMargin : anchors.rightMargin + anchors.topMargin : Variables.defaultMargin / 2 + anchors.bottomMargin: anchors.topMargin + currentIndex : vLocalization.languageIndex + model : vLocalization.languageList + } } } Index: sources/gui/qml/pages/settings/SettingsROInput.qml =================================================================== diff -u -r33f808e5b8d9134231fc0d016bfb16605c2de812 -redb8ee3edc41b1d324cd8a53e8e27a2a58289563 --- sources/gui/qml/pages/settings/SettingsROInput.qml (.../SettingsROInput.qml) (revision 33f808e5b8d9134231fc0d016bfb16605c2de812) +++ sources/gui/qml/pages/settings/SettingsROInput.qml (.../SettingsROInput.qml) (revision edb8ee3edc41b1d324cd8a53e8e27a2a58289563) @@ -52,8 +52,6 @@ Connections { target: vDuetRoWaterDG function onAdjustmentTriggered(vValue) { - print("**** vDuetRoWaterDG " + vValue ) - if ( vDuetRoWaterDG.adjustment_Accepted ) { _settingsRoInput.notificationText = "" } Index: sources/gui/qml/pages/settings/SettingsStack.qml =================================================================== diff -u -r01a8c935f7d90ce3b168970765c0f20ea0c1a273 -redb8ee3edc41b1d324cd8a53e8e27a2a58289563 --- sources/gui/qml/pages/settings/SettingsStack.qml (.../SettingsStack.qml) (revision 01a8c935f7d90ce3b168970765c0f20ea0c1a273) +++ sources/gui/qml/pages/settings/SettingsStack.qml (.../SettingsStack.qml) (revision edb8ee3edc41b1d324cd8a53e8e27a2a58289563) @@ -70,6 +70,7 @@ readonly property bool visibleDeviceRegistration : onlyManufacturing && loggedIn readonly property bool visibleInstitutionalRecord : true readonly property bool visibleLocalization : loggedIn + readonly property bool visibleUserModes : loggedIn readonly property string settingsTitle : _GuiView.manufactSetup ? qsTr("Manufacturing Setup") : _GuiView.updateSetup ? qsTr("Software Update") : qsTr("Device Settings") @@ -92,7 +93,8 @@ RootSSHAccess , FactoryReset , Decommission , - InstitutionalRecord + InstitutionalRecord , + UserMode } property var itemsText : [ qsTr("Device Information" ), // Device Information @@ -113,6 +115,7 @@ qsTr("Factory Reset" ), // FactoryReset qsTr("Decommissioning" ), // Decommission qsTr("Institutional Configurations" ), // Institutional Configurations + qsTr("User Modes" ), // User Modes ] property var itemsVisible : [ @@ -134,6 +137,7 @@ visibleFactoryReset , // FactoryReset visibleDecommission , // Decommission visibleInstitutionalRecord , // Institutional Record + visibleUserModes , // User Modes ] // TODO: SRS 405/406 Test Mode instead add Q_PROPERTY to monitor state??? @@ -234,6 +238,10 @@ push( _settingLocalization ) break + case SettingsStack.UserMode: + push( _settingUserMode ) + break + default: console.debug("Unknown Index", vIndex) break @@ -257,6 +265,7 @@ SettingsDecommission { id: _serviceDecommission } SettingsInstitutionalRecord { id: _settingsInstitutionalRecord } SettingsLocalization { id: _settingLocalization } + SettingsUserMode { id: _settingUserMode } function gotoServiceMode( vservice ) { //DEBUG console.log (" 0 ---------- ", _GuiView.manufactMode, _GuiView.manufactSetup, vservice, stackView.initialItem, stackView.currentItem, stackView.depth) Index: sources/gui/qml/pages/settings/SettingsUserMode.qml =================================================================== diff -u --- sources/gui/qml/pages/settings/SettingsUserMode.qml (revision 0) +++ sources/gui/qml/pages/settings/SettingsUserMode.qml (revision edb8ee3edc41b1d324cd8a53e8e27a2a58289563) @@ -0,0 +1,53 @@ +/*! + * + * Copyright (c) 2023-2025 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 SettingsUserMode.qml + * \author (last) Nico Ramirez + * \date (last) 27-Oct-2025 + * \author (original) Nico Ramirez + * \date (original) 27-Oct-2025 + * + */ + +// Qt +import QtQuick 2.12 + +// Qml imports +import "qrc:/globals" +import "qrc:/components" +import "qrc:/compounds" + +/*! + * \brief SettingsUserMode is the screen + * which enables the Ro Water Input + */ +SettingsBase { id: _root + itemIndex : SettingsStack.UserMode + + confirmVisible : false + + contentItem: Item { + LabelUnitContainer { id: _settingsUserModeItem + anchors.horizontalCenter : parent.horizontalCenter + width : Variables.adjustmentLabelUnitContainerWidth + height : Variables.adjustmentLabelUnitContainerHeight + showUnit : false + text : qsTr("Professional Mode") + contentArea.anchors.leftMargin : width * 0.75 + + contentItem: BaseSwitch { id: _settingsUserMode + checked : vDevice.userMode + + onClicked: { + vSettings.userMode = _settingsUserMode.checked + } + } + } + } + +} + Index: sources/view/settings/VSettings.cpp =================================================================== diff -u -r88a09dc4b26cfdd5fd111d20adfb9cb60697186c -redb8ee3edc41b1d324cd8a53e8e27a2a58289563 --- sources/view/settings/VSettings.cpp (.../VSettings.cpp) (revision 88a09dc4b26cfdd5fd111d20adfb9cb60697186c) +++ sources/view/settings/VSettings.cpp (.../VSettings.cpp) (revision edb8ee3edc41b1d324cd8a53e8e27a2a58289563) @@ -40,6 +40,7 @@ PROPERTY_POST_CONNECTION(VSettings, servicePass ); PROPERTY_POST_CONNECTION(VSettings, alarmVolume ); PROPERTY_POST_CONNECTION(VSettings, roWaterMode ); + PROPERTY_POST_CONNECTION(VSettings, userMode ); init = true; } @@ -60,6 +61,14 @@ } } +void VSettings::userMode_post(const bool &vuserMode_post) { + //TODO The Settings shall be the Singleton SettingsController and modify the MSettings like the others. + if ( Storage::Settings::save(userModeGroup(), userModeKey(), QString::number(vuserMode_post)) != 0 ) { + userMode(false); + // FIXME: Notify UI with a message + } +} + void VSettings::alarmVolume_post(const quint8 &valarmVolume) { //TODO The Settings shall be the Singleton SettingsController and modify the MSettings like the others. Storage::Settings::save(alarmVolumeGroup(), alarmVolumeKey(), QString::number(valarmVolume)); @@ -96,6 +105,12 @@ keyValue[key] = mRoWaterMode ; roWaterMode ( mRoWaterMode); } + else if ( isuserMode (category, group, key) ) { + bool mUserMode; + mUserMode = _Settings.value(category, group, key).toBool (); + keyValue[key] = mUserMode ; + userMode ( mUserMode); + } else if ( isalarmVolume (category, group, key) ) { quint8 mAlarmVolume; mAlarmVolume = _Settings.value(category, group, key).toInt (); // returns 0 if fails, so no error checking needed. @@ -118,6 +133,7 @@ servicePass ( _servicePass ); alarmVolume ( _alarmVolume ); roWaterMode ( _roWaterMode ); + userMode ( _userMode ); //DEBUG qDebug() << servicePass() << roWaterMode() << alarmVolume(); adjustment(true); Index: sources/view/settings/VSettings.h =================================================================== diff -u -r88a09dc4b26cfdd5fd111d20adfb9cb60697186c -redb8ee3edc41b1d324cd8a53e8e27a2a58289563 --- sources/view/settings/VSettings.h (.../VSettings.h) (revision 88a09dc4b26cfdd5fd111d20adfb9cb60697186c) +++ sources/view/settings/VSettings.h (.../VSettings.h) (revision edb8ee3edc41b1d324cd8a53e8e27a2a58289563) @@ -68,6 +68,7 @@ SETTINGS(QString , servicePass , "" , Storage::Settings_Category_SettingsSystem , "Service" , "Password" ) SETTINGS(quint8 , alarmVolume , 5 , Storage::Settings_Category_SettingsSystem , "Alarm" , "Volume" ) SETTINGS(bool , roWaterMode , false , Storage::Settings_Category_SettingsSystem , "RoWaterMode" , "RoWaterMode" ) + SETTINGS(bool , userMode , false , Storage::Settings_Category_SettingsSystem , "UserMode" , "UserMode" ) TRIGGER (bool , encryptionPass, false )