Index: sources/gui/qml/pages/settings/SettingsStack.qml =================================================================== diff -u -rf2e4eba6e85c5d36537be782926f23cc9dc01037 -r1bc34c23575fe101b85c851cff245436394d7123 --- sources/gui/qml/pages/settings/SettingsStack.qml (.../SettingsStack.qml) (revision f2e4eba6e85c5d36537be782926f23cc9dc01037) +++ sources/gui/qml/pages/settings/SettingsStack.qml (.../SettingsStack.qml) (revision 1bc34c23575fe101b85c851cff245436394d7123) @@ -38,6 +38,7 @@ stackView.initialItem : _settingsHome property bool serviceMode : false + property int currentItem : -1 readonly property bool normalMode : ! ( _GuiView.manufactSetup || _GuiView.updateSetup ) readonly property bool setupMode : _GuiView.manufactSetup || _GuiView.updateSetup @@ -53,7 +54,6 @@ readonly property bool visibleInformation : true readonly property bool visibleVolumeBrightness : ! onlyUpdating // same as service password, on application execution in updating, on mount files will be moved. readonly property bool visibleWiFi : true - readonly property bool visibleBluetooth : true readonly property bool visibleExportLogs : true // during the update we cannot enable the servce menu since the current set password is in ~denali folder @@ -63,21 +63,23 @@ readonly property bool visibleServicePassword : ( normalMode && ! loggedIn ) // || ( onlyUpdating && ! loggedIn ) readonly property bool visibleDGCleaning : normalMode readonly property bool visibleRoInput : normalMode - readonly property bool visibleRootSSHAccess : loggedIn - readonly property bool visibleFactoryReset : loggedIn - readonly property bool visibleDecommission : loggedIn - readonly property bool visibleSetDateTime : loggedIn || onlyUpdating - readonly property bool visibleDeviceConfiguration : onlyManufacturing && loggedIn - readonly property bool visibleDeviceRegistration : onlyManufacturing && loggedIn + readonly property bool visibleRootSSHAccess : loggedIn + readonly property bool visibleFactoryReset : loggedIn + readonly property bool visibleDecommission : false // TODO: Not Yet Defined + readonly property bool visibleSetDateTime : loggedIn || onlyUpdating + readonly property bool visibleDeviceConfiguration : onlyManufacturing && loggedIn + readonly property bool visibleDeviceRegistration : onlyManufacturing && loggedIn readonly property bool visibleInstitutionalRecord : true - readonly property bool visibleLocalization : true // loggedIn TODO: + 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") enum ItemsIndex { Information , VolumeBrightness , WiFi , - Bluetooth , DGCleaning , DGScheduling , ServicePassword , @@ -92,14 +94,14 @@ RootSSHAccess , FactoryReset , Decommission , - InstitutionalRecord + InstitutionalRecord , + UserMode } property var itemsText : [ - qsTr("Information" ), // Information + qsTr("Device Information" ), // Device Information qsTr("Volume And Brightness" ), // VolumeBrightness qsTr("Wi-Fi" ), // WiFi - qsTr("Bluetooth Cuff" ), // Bluetooth - qsTr("DG Cleaning" ), // DGCleaning + qsTr("Device Cleaning" ), // DGCleaning qsTr("DG Scheduling" ), // DGScheduling qsTr("Service" ), // servicePassword qsTr("Date and Time" ), // SetDateTime @@ -114,33 +116,13 @@ qsTr("Factory Reset" ), // FactoryReset qsTr("Decommissioning" ), // Decommission qsTr("Institutional Configurations" ), // Institutional Configurations + qsTr("User Modes" ), // User Modes ] - property var itemsEnabled : [ - true , // Information - true , // VolumeBrightness - true , // WiFi - true , // Bluetooth - true , // DGCleaning - true , // DGScheduling - true , // ServicePassword - true , // SetDateTime - true , // ExportLogs - true , // Localization - true , // RoInput - true , // Calibration - true , // Device Configuration - true , // DeviceRegistration - true , // SWUpdate - true , // RootSSHAccess - true , // FactoryReset - true , // Decommission - true , // Institutional Record - ] + property var itemsVisible : [ visibleInformation , // Information visibleVolumeBrightness , // VolumeBrightness visibleWiFi , // WiFi - visibleBluetooth , // Bluetooth visibleDGCleaning , // DGCleaning visibleDGScheduling , // DGScheduling visibleServicePassword , // ServicePassword @@ -156,10 +138,13 @@ visibleFactoryReset , // FactoryReset visibleDecommission , // Decommission visibleInstitutionalRecord , // Institutional Record + visibleUserModes , // User Modes ] + // TODO: SRS 405/406 Test Mode instead add Q_PROPERTY to monitor state??? + onServiceModeChanged: _headerBar.loggedUser = serviceMode ? "[Service]" : "" + SettingsHome { id : _settingsHome - title : _GuiView.manufactSetup ? qsTr("Manufacturing Setup") : serviceMode ? qsTr("Service") : _GuiView.updateSetup ? qsTr("Software Update") : qsTr("Device Settings") backVisible : false //TODO on graceful shutdown, the applicaiton quit shall be used for any applicaiton termination // and needs to be distinguished between the QUIT or SHUTDOWN touch, @@ -175,10 +160,11 @@ } } itemsText : _root.itemsText - itemsEnabled : _root.itemsEnabled itemsVisible : _root.itemsVisible onItemClicked : { + _root.currentItem = vIndex vDevice.status = "" + _headerBar.titleText = itemsText[vIndex] switch (vIndex) { case SettingsStack.Information: vAdjustmentVersions .doAdjustment() @@ -197,10 +183,6 @@ push( _settingsWiFi ) break - case SettingsStack.Bluetooth: - push( _settingsBluetooth ) - break - case SettingsStack.DGCleaning: push( _settingsDGCleaning ) break @@ -258,6 +240,10 @@ push( _settingLocalization ) break + case SettingsStack.UserMode: + push( _settingUserMode ) + break + default: console.debug("Unknown Index", vIndex) break @@ -268,7 +254,6 @@ SettingsInformation { id: _settingsInformation } SettingsVolumeBrightness { id: _settingsVolumeBrightness } SettingsWiFi { id: _settingsWiFi } - SettingsBluetoothCuff { id: _settingsBluetooth } SettingsDGCleaning { id: _settingsDGCleaning } SettingsDGScheduling { id: _settingsDGScheduling } SettingsServicePassword { id: _servicePassword } @@ -282,16 +267,14 @@ 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) if ( ! _servicePassword.isPassword_Accepted ) return serviceMode = vservice - if ( vservice ) - _mainMenu.hidden = true - else - if ( _settingsHome.visible ) - _mainMenu.hidden = false + if ( _settingsHome.visible ) + _mainMenu.hidden = false } Connections { target: vAdjustmentServiceMode @@ -325,12 +308,8 @@ function onManufactModeChanged( vPass ) { if ( _GuiView.manufactMode ) { vSettings.checkServicePasswordSet() - stackView.initialItem = _servicePassword + push(_servicePassword) } - else { - stackView.initialItem = _settingsHome - } - push(stackView.initialItem) //DEBUG console.log (" 1 ---------- ", _GuiView.manufactMode, _GuiView.manufactSetup, vPass, stackView.initialItem, stackView.currentItem, stackView.depth) if ( _GuiView.manufactSetup ) { @@ -341,7 +320,6 @@ if ( _GuiView.UpdateMode ) { stackView.initialItem = _settingsHome } - push(stackView.initialItem) //DEBUG console.log (" 1 ---------- ", _GuiView.manufactMode, _GuiView.manufactSetup, vPass, stackView.initialItem, stackView.currentItem, stackView.depth) if ( _GuiView.updateSetup ) { @@ -352,10 +330,12 @@ onVisibleChanged: { if (visible) { - _mainMenu.hidden = serviceMode || _GuiView.manufactSetup + _mainMenu.hidden = _GuiView.manufactSetup + _headerBar.titleText = _root.settingsTitle } else { stackView.initialItem = null + _headerBar.titleText = "" } } }