Index: sources/gui/qml/pages/settings/SettingsStack.qml =================================================================== diff -u -r6c5b5292ae3b3ebf979175dcb1256c88b1baf90c -r56ad953ae404fcf6956bd4f76b7a54b12d0285d3 --- sources/gui/qml/pages/settings/SettingsStack.qml (.../SettingsStack.qml) (revision 6c5b5292ae3b3ebf979175dcb1256c88b1baf90c) +++ sources/gui/qml/pages/settings/SettingsStack.qml (.../SettingsStack.qml) (revision 56ad953ae404fcf6956bd4f76b7a54b12d0285d3) @@ -17,6 +17,8 @@ import QtQuick 2.12 // Project +import Gui.Actions 0.1 + // Qml imports import "qrc:/globals" import "qrc:/components" @@ -33,13 +35,60 @@ stackView.initialItem : _settingsHome + property bool serviceMode : false + enum ItemsIndex { - SetDateTime , - WiFi , - Bluetooth , - DGSettings , - Services + Information , + VolumeBrightness, + WiFi , + Bluetooth , + DGSettings , + Services , + SetDateTime , + Language , + Calibration , + SWUpdate , + FactoryReset } + property var itemsText : [ + qsTr("Information" ), // Information + qsTr("Volume And Brightness" ), // VolumeBrightness + qsTr("Wi-Fi" ), // WiFi + qsTr("Bluetooth" ), // Bluetooth + qsTr("Dialysate Generator Settings" ), // DGSettings + qsTr("Services" ), // Services + qsTr("Set Date And Time" ), // SetDateTime + qsTr("Set Language" ), // Language + qsTr("Calibration " ), // Calibration + qsTr("Software Update" ), // SWUpdate + qsTr("Factory Reset" ), // FactoryReset + ] + property var itemsEnabled : [ + false , // Information + false , // VolumeBrightness + true , // WiFi + false , // Bluetooth + true , // DGSettings + true , // Services + true , // SetDateTime + false , // Language + false , // Calibration + false , // SWUpdate + false , // FactoryReset + ] + property var itemsVisible : [ + true , // Information + true , // VolumeBrightness + true , // WiFi + true , // Bluetooth + true , // DGSettings + ! serviceMode , // Services + serviceMode , // SetDateTime + serviceMode , // Language + serviceMode , // Calibration + serviceMode , // SWUpdate + serviceMode , // FactoryReset + ] SettingsDateTime { id: _settingsDateTime itemIndex : SettingsStack.SetDateTime @@ -61,21 +110,36 @@ itemIndex : SettingsStack.Services title : qsTr("Please Enter The Service Password") isPassword: true + onBackClicked : { + clearPassword() + _settingsHome.notificationText = "" + } + onConfirmClicked: { + if ( vSettings.settings["Service Password"] === undefined ) { + _settingsHome.notificationText = qsTr("No service password defined") + } + else { + if ( password === vSettings.settings["Service Password"].keys[0] ) { + _settingsHome.notificationText = "" + serviceMode = true + } + else { + _settingsHome.notificationText = qsTr("Incorrect service password") + } + } + clearPassword() + pop() + } } - property var itemsText : [ - qsTr("Set Date And Time" ), - qsTr("Wi-Fi" ), - qsTr("Bluetooth" ), - qsTr("Dialysate Generator Settings" ), - qsTr("Services" ), - ] - SettingsHome { id : _settingsHome backVisible : false - confirmVisible : false + confirmVisible : serviceMode + confirmText.text: qsTr("SHUTDOWN") + onConfirmClicked: _GuiView.doActionTransmit(GuiActions.ID_PowerOff, GuiActions.NoData) itemsText : _root.itemsText - itemsEnabled : [ 1,1,1,1,1,0,0,0,0,0 ] + itemsEnabled : _root.itemsEnabled + itemsVisible : _root.itemsVisible onItemClicked : { switch (vIndex) { case SettingsStack.SetDateTime: