Index: sources/gui/qml/pages/settings/SettingsStack.qml =================================================================== diff -u -r80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803 -r8d5fe7d63e3d86e9d89d5f824347d34479e4e9ec --- sources/gui/qml/pages/settings/SettingsStack.qml (.../SettingsStack.qml) (revision 80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803) +++ sources/gui/qml/pages/settings/SettingsStack.qml (.../SettingsStack.qml) (revision 8d5fe7d63e3d86e9d89d5f824347d34479e4e9ec) @@ -39,6 +39,36 @@ property bool serviceMode : false + readonly property bool normalMode : ! ( _GuiView.manufactSetup || _GuiView.updateSetup ) + readonly property bool setupMode : _GuiView.manufactSetup || _GuiView.updateSetup + readonly property bool onlyManufacturing : _GuiView.manufactMode && ! _GuiView.updateMode // <...>Mode is true if the POST passes + readonly property bool onlyUpdating : ! _GuiView.manufactMode && _GuiView.updateMode // <...>Mode is true if the POST passes + readonly property bool loggedIn : serviceMode + + + readonly property bool visibleLanguage : false + readonly property bool visibleSWUpdate : false + readonly property bool visibleDGScheduling : false + readonly property bool visibleCalibration : false + + readonly property bool visibleInformation : true + readonly property bool visibleVolumeBrightness : true + readonly property bool visibleWiFi : true + readonly property bool visibleBluetooth : true + readonly property bool visibleExportLogs : true + + readonly property bool visibleServicePassword : normalMode && ! 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 + readonly property bool visibleDeviceConfiguration : onlyManufacturing && loggedIn + readonly property bool visibleDeviceRegistration : onlyManufacturing && loggedIn + + + enum ItemsIndex { Information , VolumeBrightness , @@ -79,54 +109,57 @@ qsTr("Factory Reset" ), // FactoryReset qsTr("Decommissioning" ), // Decommission ] - property var itemsEnabled : [ - true , // Information - true , // VolumeBrightness - true , // WiFi - true , // Bluetooth - true , // DGCleaning - true , // DGScheduling - true , // ServicePassword - true , // SetDateTime - true , // ExportLogs - false , // Language - true , // RoInput - false , // Calibration - _GuiView.manufactMode , // Device Configuration - true , // DeviceRegistration - false , // SWUpdate - serviceMode , // RootSSHAccess - serviceMode , // FactoryReset - serviceMode , // Decommission + property var itemsEnabled : [ + true , // Information + true , // VolumeBrightness + true , // WiFi + true , // Bluetooth + true , // DGCleaning + true , // DGScheduling + true , // ServicePassword + true , // SetDateTime + true , // ExportLogs + true , // Language + true , // RoInput + true , // Calibration + true , // Device Configuration + true , // DeviceRegistration + true , // SWUpdate + true , // RootSSHAccess + true , // FactoryReset + true , // Decommission ] property var itemsVisible : [ - true , // Information - true , // VolumeBrightness - true , // WiFi - true , // Bluetooth - ! _GuiView.manufactSetup , // DGCleaning - false /* serviceMode phase 1B */ , // DGScheduling - ! serviceMode && ! _GuiView.manufactSetup , // ServicePassword - serviceMode , // SetDateTime - true , // ExportLogs - false /* serviceMode phase 1 */ , // Language - ! _GuiView.manufactSetup , // RoInput - false /* serviceMode phase 1 */ , // Calibration - _GuiView.manufactMode && serviceMode , // Device Configuration // && serviceMode added to make sure the service mode is confirmed by HD - _GuiView.manufactMode && serviceMode , // DeviceRegistration // && serviceMode added to make sure the service mode is confirmed by HD - false /* serviceMode phase 1 */ , // SWUpdate - serviceMode , // RootSSHAccess - serviceMode , // FactoryReset - serviceMode , // Decommission + visibleInformation , // Information + visibleVolumeBrightness , // VolumeBrightness + visibleWiFi , // WiFi + visibleBluetooth , // Bluetooth + visibleDGCleaning , // DGCleaning + visibleDGScheduling , // DGScheduling + visibleServicePassword , // ServicePassword + visibleSetDateTime , // SetDateTime + visibleExportLogs , // ExportLogs + visibleLanguage , // Language + visibleRoInput , // RoInput + visibleCalibration , // Calibration + visibleDeviceConfiguration , // Device Configuration + visibleDeviceRegistration , // DeviceRegistration + visibleSWUpdate , // SWUpdate + visibleRootSSHAccess , // RootSSHAccess + visibleFactoryReset , // FactoryReset + visibleDecommission , // Decommission ] SettingsHome { id : _settingsHome - title : _GuiView.manufactSetup ? qsTr("Manufacturing Setup") : serviceMode ? qsTr("Service") : qsTr("Device Settings") + title : _GuiView.manufactSetup ? qsTr("Manufacturing Setup") : serviceMode ? qsTr("Service") : _GuiView.updateSetup ? qsTr("Software Update") : qsTr("Device Settings") backVisible : false - confirmVisible : serviceMode - confirmText.text: _GuiView.manufactSetup ? qsTr("QUIT") : qsTr("SHUTDOWN") + //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, + // to know whether to run the lockdown scropt or just quit the app. + confirmVisible : serviceMode || _GuiView.updateMode + confirmText.text: _GuiView.manufactMode || _GuiView.updateMode ? qsTr("COMPLETE") : qsTr("SHUTDOWN") onConfirmClicked: { - if ( _GuiView.manufactSetup ) { + if ( _GuiView.manufactSetup || _GuiView.updateSetup ) { _GuiView.doQuitApplication() } else { @@ -268,9 +301,20 @@ //DEBUG console.log (" 1 ---------- ", _GuiView.manufactMode, _GuiView.manufactSetup, vPass, stackView.initialItem, stackView.currentItem, stackView.depth) if ( _GuiView.manufactSetup ) { - _settingsHome.notificationText = vPass ? "" : qsTr("Application POST Failed") + _settingsHome.notificationText = vPass ? "" : qsTr("Application POST Failed, please shutdown and retry") } } + function onUpdateModeChanged( vPass ) { + 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 ) { + _settingsHome.notificationText = vPass ? "" : qsTr("Application POST Failed, please shutdown and retry") + } + } } onVisibleChanged: {