diff --git a/components/InverterAcOutSettings.qml b/components/InverterAcOutSettings.qml index dd4ebbb27..06abceb23 100644 --- a/components/InverterAcOutSettings.qml +++ b/components/InverterAcOutSettings.qml @@ -27,7 +27,7 @@ Column { ListQuantityGroup { text: CommonWords.ac_out - allowed: !root.isInverterCharger + preferredVisible: !root.isInverterCharger textModel: [ { value: inverterData.phase1.voltage, unit: VenusOS.Units_Volt_AC }, { value: inverterData.phase1.current, unit: VenusOS.Units_Amp }, @@ -43,7 +43,7 @@ Column { //: %1 = phase number (1-3) //% "AC Out L%1" text: qsTrId("inverter_ac-out_num").arg(acPhaseNumber.isValid ? acPhaseNumber.value + 1 : 1) - allowed: root.isInverterCharger + preferredVisible: root.isInverterCharger textModel: [ { value: acPhase.voltage, unit: VenusOS.Units_Volt_AC }, { value: acPhase.current, unit: VenusOS.Units_Amp }, diff --git a/components/PageGensetModel.qml b/components/PageGensetModel.qml index 501e4ac0e..5cfe56ed1 100644 --- a/components/PageGensetModel.qml +++ b/components/PageGensetModel.qml @@ -48,7 +48,7 @@ ObjectModel { } PrimaryListLabel { - allowed: root.gensetEnabled.value === 0 + preferredVisible: root.gensetEnabled.value === 0 //% "This genset controller requires a helper relay to be controlled but the helper relay is not configured. Please configure Relay 1 under Settings → Relay to \"Connected genset helper relay\"." text: qsTrId("genset_controller_requires_helper_relay") } @@ -57,7 +57,7 @@ ObjectModel { id: autostartSwitch //% "Auto start functionality" text: qsTrId("ac-in-genset_auto_start_functionality") - allowed: root.gensetEnabled.value === 1 + preferredVisible: root.gensetEnabled.value === 1 dataItem.uid: root.startStopBindPrefix ? root.startStopBindPrefix + "/AutoStartEnabled" : "" updateDataOnClick: false @@ -81,7 +81,7 @@ ObjectModel { ListItem { text: CommonWords.manual_control - allowed: root.gensetEnabled.value === 1 + preferredVisible: root.gensetEnabled.value === 1 content.children: [ GeneratorManualControlButton { generatorUid: root.startStopBindPrefix @@ -95,7 +95,7 @@ ObjectModel { text: qsTrId("settings_page_genset_generator_run_time") secondaryText: dataItem.isValid ? Utils.secondsToString(dataItem.value, false) : "0" dataItem.uid: root.startStopBindPrefix ? root.startStopBindPrefix + "/Runtime" : "" - allowed: generatorState.value >= 1 && generatorState.value <= 3 // Running, Warm-up, Cool-down + preferredVisible: generatorState.value >= 1 && generatorState.value <= 3 // Running, Warm-up, Cool-down } ListText { @@ -120,7 +120,7 @@ ObjectModel { ListGeneratorError { //% "Control error code" text: qsTrId("ac-in-genset_control_error_code") - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: root.startStopBindPrefix ? root.startStopBindPrefix + "/Error" : "" } @@ -149,7 +149,7 @@ ObjectModel { return errorCodes.length ? errorCodes : CommonWords.none_errors } - allowed: defaultAllowed && _dataItem.isValid + preferredVisible: _dataItem.isValid enabled: secondaryText !== CommonWords.none_errors onClicked: Global.notificationLayer.popAndGoToNotifications() @@ -211,7 +211,7 @@ ObjectModel { ListDcOutputQuantityGroup { bindPrefix: root.bindPrefix - allowed: defaultAllowed && root.dcGenset + preferredVisible: root.dcGenset } ListNavigation { @@ -238,7 +238,7 @@ ObjectModel { //% "Load" text: qsTrId("ac-in-genset_load") dataItem.uid: root.bindPrefix + "/Engine/Load" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid unit: VenusOS.Units_Percentage } @@ -246,14 +246,14 @@ ObjectModel { //% "Oil pressure" text: qsTrId("ac-in-genset_oil_pressure") dataItem.uid: root.bindPrefix + "/Engine/OilPressure" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid unit: VenusOS.Units_Kilopascal } ListTemperature { //% "Oil temperature" text: qsTrId("ac-in-genset_oil_temperature") - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: root.bindPrefix + "/Engine/OilTemperature" precision: 0 } @@ -261,7 +261,7 @@ ObjectModel { ListTemperature { //% "Coolant temperature" text: qsTrId("ac-in-genset_coolant_temperature") - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: root.bindPrefix + "/Engine/CoolantTemperature" precision: 0 } @@ -269,14 +269,14 @@ ObjectModel { ListTemperature { //% "Exhaust temperature" text: qsTrId("ac-in-genset_exhaust_temperature") - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: root.bindPrefix + "/Engine/ExaustTemperature" } ListTemperature { //% "Winding temperature" text: qsTrId("ac-in-genset_winding_temperature") - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: root.bindPrefix + "/Engine/WindingTemperature" } @@ -284,14 +284,14 @@ ObjectModel { //% "Heatsink temperature" text: qsTrId("genset_heatsink_temperature") dataItem.uid: root.bindPrefix + "/HeatsinkTemperature" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListQuantity { //% "Starter battery voltage" text: qsTrId("ac-in-genset_starter_battery_voltage") dataItem.uid: root.bindPrefix + "/StarterVoltage" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid unit: VenusOS.Units_Volt_DC } @@ -299,7 +299,7 @@ ObjectModel { //% "Number of starts" text: qsTrId("ac-in-genset_number_of_starts") dataItem.uid: root.bindPrefix + "/Engine/Starts" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } } } @@ -322,7 +322,7 @@ ObjectModel { ListNavigation { //% "DC genset settings" text: qsTrId("page_genset_model_dc_genset_settings") - allowed: defaultAllowed && (chargeVoltage.isValid || chargeCurrent.isValid || bmsControlled.isValid) + preferredVisible: chargeVoltage.isValid || chargeCurrent.isValid || bmsControlled.isValid onClicked: Global.pageManager.pushPage(settingsComponent, {"title": text}) VeQuickItem { @@ -353,14 +353,14 @@ ObjectModel { decimals: 1 stepSize: 0.1 suffix: Units.defaultUnitString(VenusOS.Units_Volt_DC) - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid enabled: bmsControlled.dataItem.value === 0 } ListText { //% "The charge voltage is currently controlled by the BMS." text: qsTrId("genset_charge_voltage_controlled_by_bms") - allowed: defaultAllowed && bmsControlled.dataItem.value === 1 + preferredVisible: bmsControlled.dataItem.value === 1 } ListSpinBox { @@ -368,7 +368,7 @@ ObjectModel { text: qsTrId("genset_charge_current_limit") dataItem.uid: root.bindPrefix + "/Settings/ChargeCurrentLimit" suffix: Units.defaultUnitString(VenusOS.Units_Amp) - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListText { @@ -378,11 +378,11 @@ ObjectModel { text: qsTrId("genset_bms_controlled") secondaryText: CommonWords.yesOrNo(dataItem.value) dataItem.uid: root.bindPrefix + "/Settings/BmsPresent" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid bottomContentChildren: PrimaryListLabel { //% "BMS control is enabled automatically when a BMS is present. Reset it if the system configuration changed or if there is no BMS present." text: qsTrId("genset_bms_control_enabled_automatically") - allowed: bmsControlled.dataItem.value === 1 + preferredVisible: bmsControlled.dataItem.value === 1 } } @@ -390,7 +390,7 @@ ObjectModel { //% "BMS control" text: qsTrId("genset_bms_control") secondaryText: CommonWords.press_to_reset - visible: defaultAllowed && bmsControlled.dataItem.value === 1 + preferredVisible: bmsControlled.dataItem.value === 1 onClicked: bmsControlled.dataItem.setValue(0) } } diff --git a/components/TemperatureRelaySettings.qml b/components/TemperatureRelaySettings.qml index 6f6b7c3e5..585d974b7 100644 --- a/components/TemperatureRelaySettings.qml +++ b/components/TemperatureRelaySettings.qml @@ -59,7 +59,7 @@ Column { PrimaryListLabel { //% "Warning: The above selected relay is not configured for temperature, this condition will be ignored." text: qsTrId("settings_relay_invalid_temp_config_warning") - allowed: root.hasInvalidRelayTempConfig + preferredVisible: root.hasInvalidRelayTempConfig } } diff --git a/components/listitems/ListAcInError.qml b/components/listitems/ListAcInError.qml index 117b5275b..db89ae149 100644 --- a/components/listitems/ListAcInError.qml +++ b/components/listitems/ListAcInError.qml @@ -29,7 +29,7 @@ ListText { } return "" } - allowed: productId.value === ProductInfo.ProductId_PvInverter_Fronius + preferredVisible: productId.value === ProductInfo.ProductId_PvInverter_Fronius || productId.value === ProductInfo.ProductId_EnergyMeter_CarloGavazzi diff --git a/components/listitems/ListAlarmState.qml b/components/listitems/ListAlarmState.qml index a37d2c4cc..4bf5b1e27 100644 --- a/components/listitems/ListAlarmState.qml +++ b/components/listitems/ListAlarmState.qml @@ -9,7 +9,7 @@ import Victron.VenusOS ListText { //% "Alarm state" text: qsTrId("list_alarm_state") - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid secondaryText: { if (dataItem.value === 0) { return CommonWords.ok diff --git a/components/listitems/ListChargeSchedule.qml b/components/listitems/ListChargeSchedule.qml index 21491efac..25f669da9 100644 --- a/components/listitems/ListChargeSchedule.qml +++ b/components/listitems/ListChargeSchedule.qml @@ -126,7 +126,7 @@ ListNavigation { //% "Day" text: qsTrId("cgwacs_battery_schedule_day") dataItem.uid: root._scheduleSource + "/Day" - allowed: defaultAllowed && itemEnabled.checked + preferredVisible: itemEnabled.checked //% "Not set" defaultSecondaryText: qsTrId("cgwacs_battery_schedule_day_not_set") optionModel: root._dayModel @@ -135,7 +135,7 @@ ListNavigation { ListTimeSelector { text: CommonWords.start_time dataItem.uid: root._scheduleSource + "/Start" - allowed: defaultAllowed && itemEnabled.checked + preferredVisible: itemEnabled.checked } ListTimeSelector { @@ -143,7 +143,7 @@ ListNavigation { text: qsTrId("cgwacs_battery_schedule_duration") button.text: dataItem.value > 0 ? Utils.secondsToString(dataItem.value) : "--" dataItem.uid: root._scheduleSource + "/Duration" - allowed: defaultAllowed && itemEnabled.checked + preferredVisible: itemEnabled.checked maximumHour: 9999 } @@ -152,7 +152,7 @@ ListNavigation { //% "SOC limit" text: qsTrId("cgwacs_battery_schedule_soc_limit") - allowed: defaultAllowed && itemEnabled.checked + preferredVisible: itemEnabled.checked dataItem.uid: root._scheduleSource + "/Soc" suffix: "%" from: 5 @@ -164,7 +164,7 @@ ListNavigation { //% "Self-consumption above limit" text: qsTrId("cgwacs_battery_schedule_self_consumption_above_limit") dataItem.uid: root._scheduleSource + "/AllowDischarge" - allowed: defaultAllowed && itemEnabled.checked && socLimit.value < 100 + preferredVisible: itemEnabled.checked && socLimit.value < 100 optionModel: [ //% "PV" { display: qsTrId("cgwacs_battery_schedule_pv"), value: 0 }, diff --git a/components/listitems/ListClearHistoryButton.qml b/components/listitems/ListClearHistoryButton.qml index 8bfc1b9e9..f6790d6f2 100644 --- a/components/listitems/ListClearHistoryButton.qml +++ b/components/listitems/ListClearHistoryButton.qml @@ -49,5 +49,5 @@ ListButton { timer.start() } - allowed: connected.value === 1 && canBeCleared.value === 1 + preferredVisible: connected.value === 1 && canBeCleared.value === 1 } diff --git a/components/listitems/ListDcInputQuantityGroup.qml b/components/listitems/ListDcInputQuantityGroup.qml index 78676609c..4477a49a8 100644 --- a/components/listitems/ListDcInputQuantityGroup.qml +++ b/components/listitems/ListDcInputQuantityGroup.qml @@ -14,7 +14,7 @@ ListQuantityGroup { //: DC input measurement values //% "Input" text: qsTrId("dc_input") - allowed: defaultAllowed && (inVoltage.isValid || inPower.isValid) + preferredVisible: inVoltage.isValid || inPower.isValid textModel: [ { value: inVoltage.value, unit: VenusOS.Units_Volt_DC, visible: inVoltage.isValid }, { value: inCurrent.value, unit: VenusOS.Units_Amp, visible: inCurrent.isValid }, diff --git a/components/listitems/ListRelayState.qml b/components/listitems/ListRelayState.qml index 07115240e..6ecf42fb8 100644 --- a/components/listitems/ListRelayState.qml +++ b/components/listitems/ListRelayState.qml @@ -9,6 +9,6 @@ import Victron.VenusOS ListText { //% "Relay state" text: qsTrId("list_relay_state") - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid secondaryText: CommonWords.onOrOff(dataItem.value) } diff --git a/components/listitems/core/ListItem.qml b/components/listitems/core/ListItem.qml index 92f961abd..4244ad878 100644 --- a/components/listitems/core/ListItem.qml +++ b/components/listitems/core/ListItem.qml @@ -25,20 +25,17 @@ Item { readonly property bool userHasWriteAccess: Global.systemSettings.canAccess(writeAccessLevel) readonly property bool userHasReadAccess: Global.systemSettings.canAccess(showAccessLevel) - readonly property bool defaultAllowed: userHasReadAccess readonly property alias primaryLabel: primaryLabel - - readonly property int defaultImplicitHeight: contentLayout.height + Theme.geometry_gradientList_spacing readonly property int availableWidth: width - leftPadding - rightPadding - content.spacing property int maximumContentWidth: availableWidth * 0.7 - property bool allowed: defaultAllowed + property bool preferredVisible: true property int bottomContentSizeMode: content.height > primaryLabel.height ? VenusOS.ListItem_BottomContentSizeMode_Compact : VenusOS.ListItem_BottomContentSizeMode_Stretch - visible: allowed - implicitHeight: allowed ? defaultImplicitHeight : 0 + visible: preferredVisible && userHasReadAccess + implicitHeight: preferredVisible && userHasReadAccess ? (contentLayout.height + Theme.geometry_gradientList_spacing) : 0 implicitWidth: parent ? parent.width : 0 ListItemBackground { diff --git a/components/listitems/core/ListRadioButtonGroup.qml b/components/listitems/core/ListRadioButtonGroup.qml index 81b9d66d4..c567498a7 100644 --- a/components/listitems/core/ListRadioButtonGroup.qml +++ b/components/listitems/core/ListRadioButtonGroup.qml @@ -109,7 +109,7 @@ ListNavigation { ? modelData.fontFamily || Global.fontFamily : model.fontFamily || Global.fontFamily - allowed: (userHasWriteAccess && enabled) || checked + preferredVisible: (userHasWriteAccess && enabled) || checked checked: optionsListView.currentIndex === model.index showAccessLevel: root.showAccessLevel writeAccessLevel: root.writeAccessLevel @@ -147,7 +147,7 @@ ListNavigation { color: Theme.color_font_secondary text: bottomContentLoader.caption font.pixelSize: Theme.font_size_caption - allowed: bottomContentLoader.caption.length > 0 + preferredVisible: bottomContentLoader.caption.length > 0 } ListTextField { @@ -178,7 +178,7 @@ ListNavigation { textField.echoMode: TextInput.Password enabled: radioButton.enabled backgroundRect.color: "transparent" - allowed: showField && model.index === optionsListView.currentIndex && !!root.validatePassword + preferredVisible: showField && model.index === optionsListView.currentIndex && !!root.validatePassword validateInput: function() { // Validate the password on Enter/Return, or when "Confirm" is // clicked. Ignore validation requests when the field does not @@ -193,7 +193,7 @@ ListNavigation { return root.validatePassword(model.index, textField.text) } saveInput: function() { - if (allowed) { + if (preferredVisible) { radioButton.select() } } diff --git a/components/listitems/core/PrimaryListLabel.qml b/components/listitems/core/PrimaryListLabel.qml index 6357c11b3..50ab7793f 100644 --- a/components/listitems/core/PrimaryListLabel.qml +++ b/components/listitems/core/PrimaryListLabel.qml @@ -7,13 +7,13 @@ import QtQuick import Victron.VenusOS Label { - property bool allowed: true + property bool preferredVisible: true width: parent ? parent.width : 0 - height: allowed ? implicitHeight : 0 - visible: allowed - topPadding: allowed ? Theme.geometry_listItem_content_verticalMargin : 0 - bottomPadding: allowed ? Theme.geometry_listItem_content_verticalMargin : 0 + height: preferredVisible ? implicitHeight : 0 + visible: preferredVisible + topPadding: preferredVisible ? Theme.geometry_listItem_content_verticalMargin : 0 + bottomPadding: preferredVisible ? Theme.geometry_listItem_content_verticalMargin : 0 leftPadding: Theme.geometry_listItem_content_horizontalMargin rightPadding: Theme.geometry_listItem_content_horizontalMargin font.pixelSize: Theme.font_size_body1 diff --git a/pages/NotificationsPage.qml b/pages/NotificationsPage.qml index 37b608a85..627fe703c 100644 --- a/pages/NotificationsPage.qml +++ b/pages/NotificationsPage.qml @@ -151,7 +151,7 @@ SwipeViewPage { text: CommonWords.history anchors.top: activeNotificationsView.count ? activeNotificationsView.bottom : noCurrentAlerts.bottom - allowed: notificationsView.count !== 0 + preferredVisible: notificationsView.count !== 0 } } diff --git a/pages/controlcards/EVCSCard.qml b/pages/controlcards/EVCSCard.qml index 42fa54000..489be482a 100644 --- a/pages/controlcards/EVCSCard.qml +++ b/pages/controlcards/EVCSCard.qml @@ -68,7 +68,7 @@ ControlCard { to: root.evCharger.maxCurrent stepSize: 1 dataItem.uid: root.evCharger.serviceUid + "/SetCurrent" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid enabled: modeItem.value === VenusOS.Evcs_Mode_Manual } @@ -80,7 +80,7 @@ ControlCard { text: CommonWords.charging flat: true dataItem.uid: root.evCharger.serviceUid + "/StartStop" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } } diff --git a/pages/controlcards/InverterChargerCard.qml b/pages/controlcards/InverterChargerCard.qml index 2c524d5c5..e8d4ef20c 100644 --- a/pages/controlcards/InverterChargerCard.qml +++ b/pages/controlcards/InverterChargerCard.qml @@ -86,7 +86,7 @@ ControlCard { ListItem { text: CommonWords.ess flat: true - allowed: essModeItem.isValid + preferredVisible: essModeItem.isValid content.children: [ ListItemButton { font.pixelSize: Theme.font_size_body1 @@ -103,7 +103,7 @@ ControlCard { //% "Minimum SOC" text: qsTrId("controlcard_inverter_charger_ess_minimum_soc") flat: true - allowed: essMinSocItem.isValid && [ + preferredVisible: essMinSocItem.isValid && [ VenusOS.Ess_State_OptimizedWithBatteryLife, VenusOS.Ess_State_OptimizedWithoutBatteryLife].includes(essModeItem.value) button.text: Units.getCombinedDisplayText(VenusOS.Units_Percentage, essMinSocItem.value) diff --git a/pages/evcs/EvChargerPage.qml b/pages/evcs/EvChargerPage.qml index 68b34921e..fbdaeafd8 100644 --- a/pages/evcs/EvChargerPage.qml +++ b/pages/evcs/EvChargerPage.qml @@ -108,7 +108,7 @@ Page { //% "Charge mode" text: qsTrId("evcs_charge_mode") dataItem.uid: root.evCharger.serviceUid + "/Mode" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid optionModel: Global.evChargers.modeOptionModel } @@ -118,7 +118,7 @@ Page { from: 0 to: root.evCharger.maxCurrent dataItem.uid: root.evCharger.serviceUid + "/SetCurrent" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid enabled: chargeMode.dataItem.value === VenusOS.Evcs_Mode_Manual } @@ -126,12 +126,12 @@ Page { //% "Enable charging" text: qsTrId("evcs_enable_charging") dataItem.uid: root.evCharger.serviceUid + "/StartStop" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListNavigation { text: CommonWords.setup - allowed: !root.energyMeterMode || allowedRoles.isValid + preferredVisible: !root.energyMeterMode || allowedRoles.isValid onClicked: { if (root.energyMeterMode) { Global.pageManager.pushPage("/pages/settings/devicelist/ac-in/PageAcInSetup.qml", diff --git a/pages/evcs/EvChargerSetupPage.qml b/pages/evcs/EvChargerSetupPage.qml index f74925fe4..0a5a4f777 100644 --- a/pages/evcs/EvChargerSetupPage.qml +++ b/pages/evcs/EvChargerSetupPage.qml @@ -29,7 +29,7 @@ Page { text: qsTrId("evcs_lock_charger_display") dataItem.uid: root.bindPrefix + "/EnableDisplay" invertSourceValue: true - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } } } diff --git a/pages/invertercharger/OverviewInverterChargerPage.qml b/pages/invertercharger/OverviewInverterChargerPage.qml index d5ed6731a..81b558053 100644 --- a/pages/invertercharger/OverviewInverterChargerPage.qml +++ b/pages/invertercharger/OverviewInverterChargerPage.qml @@ -124,7 +124,7 @@ Page { ListActiveAcInput { bindPrefix: root.serviceUid - allowed: root.serviceType !== "inverter" + preferredVisible: root.serviceType !== "inverter" } ListQuantityGroup { @@ -160,7 +160,7 @@ Page { ListNavigation { text: CommonWords.ess - allowed: root.serviceType === "acsystem" + preferredVisible: root.serviceType === "acsystem" onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/rs/PageRsSystemEss.qml", { "title": text, "bindPrefix": root.serviceUid }) diff --git a/pages/settings/DvccCommonSettings.qml b/pages/settings/DvccCommonSettings.qml index dc976e5b8..5c8ae0fcf 100644 --- a/pages/settings/DvccCommonSettings.qml +++ b/pages/settings/DvccCommonSettings.qml @@ -31,7 +31,7 @@ Column { //% "Limit charge current" text: qsTrId("settings_dvcc_limit_charge_current") checked: maxChargeCurrent.dataItem.isValid && maxChargeCurrent.dataItem.value >= 0 - allowed: defaultAllowed && dvccSwitch.checked + preferredVisible: dvccSwitch.checked onClicked: { maxChargeCurrent.dataItem.setValue(maxChargeCurrent.dataItem.value < 0 ? 50 : -1) } @@ -42,7 +42,7 @@ Column { //% "Maximum charge current" text: qsTrId("settings_dvcc_max_charge_current") - allowed: defaultAllowed && maxChargeCurrentSwitch.visible && maxChargeCurrentSwitch.checked + preferredVisible: maxChargeCurrentSwitch.visible && maxChargeCurrentSwitch.checked dataItem.uid: Global.systemSettings.serviceUid + "/Settings/SystemSetup/MaxChargeCurrent" suffix: Units.defaultUnitString(VenusOS.Units_Amp) } diff --git a/pages/settings/GeneratorCondition.qml b/pages/settings/GeneratorCondition.qml index 8803ba450..7f88cc731 100644 --- a/pages/settings/GeneratorCondition.qml +++ b/pages/settings/GeneratorCondition.qml @@ -67,7 +67,7 @@ ListNavigation { id: startValue text: startValueDescription - allowed: dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: bindPrefix + "/StartValue" suffix: root.unit decimals: root.decimals @@ -80,7 +80,7 @@ ListNavigation { id: quietHoursStartValue text: CommonWords.start_value_during_quiet_hours - allowed: dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: bindPrefix + "/QuietHoursStartValue" suffix: root.unit decimals: root.decimals @@ -93,7 +93,7 @@ ListNavigation { id: startTime text: startTimeDescription - allowed: dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: bindPrefix + "/StartTimer" suffix: root.timeUnit } @@ -102,7 +102,7 @@ ListNavigation { id: stopValue text: stopValueDescription - allowed: dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: bindPrefix + "/StopValue" suffix: root.unit decimals: root.decimals @@ -115,7 +115,7 @@ ListNavigation { id: quietHoursStopValue text: CommonWords.stop_value_during_quiet_hours - allowed: dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: bindPrefix + "/QuietHoursStopValue" suffix: root.unit decimals: root.decimals @@ -128,7 +128,7 @@ ListNavigation { id: stopTime text: stopTimeDescription - allowed: dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: bindPrefix + "/StopTimer" suffix: root.timeUnit } @@ -137,7 +137,7 @@ ListNavigation { //% "Skip generator warm-up" text: qsTrId("settings_generator_condition_skip_warmup") dataItem.uid: bindPrefix + "/SkipWarmup" - allowed: root.supportsWarmup + preferredVisible: root.supportsWarmup } } } diff --git a/pages/settings/PageDeviceInfo.qml b/pages/settings/PageDeviceInfo.qml index 2c2a0410b..98d4267f0 100644 --- a/pages/settings/PageDeviceInfo.qml +++ b/pages/settings/PageDeviceInfo.qml @@ -37,7 +37,7 @@ Page { dataItem.uid: root.bindPrefix + "/CustomName" dataItem.invalidate: false textField.maximumLength: 32 - allowed: dataItem.isValid + preferredVisible: dataItem.isValid placeholderText: CommonWords.custom_name } @@ -59,7 +59,7 @@ Page { text: qsTrId("settings_deviceinfo_hardware_version") dataItem.uid: root.bindPrefix + "/HardwareVersion" dataItem.invalidate: false - allowed: dataItem.isValid + preferredVisible: dataItem.isValid } ListText { @@ -72,7 +72,7 @@ Page { text: CommonWords.serial_number dataItem.uid: root.bindPrefix + "/Serial" dataItem.invalidate: false - allowed: dataItem.isValid + preferredVisible: dataItem.isValid } ListText { @@ -80,7 +80,7 @@ Page { text: qsTrId("settings_deviceinfo_device_name") dataItem.uid: root.bindPrefix + "/DeviceName" dataItem.invalidate: false - allowed: dataItem.isValid + preferredVisible: dataItem.isValid } } } diff --git a/pages/settings/PageGenerator.qml b/pages/settings/PageGenerator.qml index 5f7bdd63a..147c7070e 100644 --- a/pages/settings/PageGenerator.qml +++ b/pages/settings/PageGenerator.qml @@ -52,12 +52,12 @@ Page { //% "Autostart functionality" text: qsTrId("settings_page_relay_generator_auto_start_enabled") dataItem.uid: root.startStopBindPrefix + "/AutoStartEnabled" - allowed: root.startStopBindPrefix === root.generator0ServiceUid + preferredVisible: root.startStopBindPrefix === root.generator0ServiceUid } ListItem { text: CommonWords.manual_control - allowed: root.startStopBindPrefix === root.generator0ServiceUid + preferredVisible: root.startStopBindPrefix === root.generator0ServiceUid content.children: [ GeneratorManualControlButton { generatorUid: root.startStopBindPrefix @@ -71,14 +71,14 @@ Page { text: qsTrId("settings_page_relay_generator_run_time") secondaryText: dataItem.isValid ? Utils.secondsToString(dataItem.value, false) : "0" dataItem.uid: root.startStopBindPrefix + "/Runtime" - allowed: generatorState.value >= 1 && generatorState.value <= 3 // Running, Warm-up, Cool-down + preferredVisible: generatorState.value >= 1 && generatorState.value <= 3 // Running, Warm-up, Cool-down } ListText { id: state text: CommonWords.state - allowed: root.startStopBindPrefix === root.generator0ServiceUid + preferredVisible: root.startStopBindPrefix === root.generator0ServiceUid secondaryText: activeCondition.isAutoStarted && generatorState.value === VenusOS.Generators_State_Running ? CommonWords.autostarted_dot_running_by.arg(Global.generators.runningByText(activeCondition.value)) : Global.generators.stateAndCondition(generatorState.value, activeCondition.value) @@ -93,7 +93,7 @@ Page { } ListGeneratorError { - allowed: root.startStopBindPrefix === root.generator0ServiceUid + preferredVisible: root.startStopBindPrefix === root.generator0ServiceUid dataItem.uid: root.startStopBindPrefix + "/Error" } diff --git a/pages/settings/PageGeneratorAcLoad.qml b/pages/settings/PageGeneratorAcLoad.qml index 44d6ce9ab..b113e227e 100644 --- a/pages/settings/PageGeneratorAcLoad.qml +++ b/pages/settings/PageGeneratorAcLoad.qml @@ -59,7 +59,7 @@ Page { //% "Start when power is higher than" text: qsTrId("start_when_power_is_higher_than") onMinValueReached: minValueWarning() - allowed: dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: bindPrefix + "/StartValue" suffix: Units.defaultUnitString(VenusOS.Units_Watt) stepSize: 5 @@ -70,7 +70,7 @@ Page { id: quietHoursStartValue text: CommonWords.start_value_during_quiet_hours onMinValueReached: minValueWarning() - allowed: dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: bindPrefix + "/QuietHoursStartValue" suffix: Units.defaultUnitString(VenusOS.Units_Watt) stepSize: 5 @@ -80,7 +80,7 @@ Page { ListSpinBox { id: startTime text: CommonWords.start_after_the_condition_is_reached_for - allowed: dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: bindPrefix + "/StartTimer" suffix: "s" stepSize: 1 @@ -91,7 +91,7 @@ Page { //% "Stop when power is lower than" text: qsTrId("stop_when_power_is_lower_than") onMaxValueReached: maxValueWarning() - allowed: dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: bindPrefix + "/StopValue" suffix: Units.defaultUnitString(VenusOS.Units_Watt) stepSize: 5 @@ -103,7 +103,7 @@ Page { id: quietHoursStopValue text: CommonWords.stop_value_during_quiet_hours onMaxValueReached: maxValueWarning() - allowed: dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: bindPrefix + "/QuietHoursStopValue" suffix: Units.defaultUnitString(VenusOS.Units_Watt) stepSize: 5 @@ -114,7 +114,7 @@ Page { ListSpinBox { id: stopTime text: CommonWords.stop_after_the_condition_is_reached_for - allowed: dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: bindPrefix + "/StopTimer" suffix: "s" stepSize: 1 diff --git a/pages/settings/PageGeneratorConditions.qml b/pages/settings/PageGeneratorConditions.qml index e970faf2a..ad42f3069 100644 --- a/pages/settings/PageGeneratorConditions.qml +++ b/pages/settings/PageGeneratorConditions.qml @@ -43,7 +43,7 @@ Page { //% "Unavailable monitor, set another" defaultSecondaryText: qsTrId("page_generator_conditions_unavailable_monitor_set_another") dataItem.uid: bindPrefix + "/BatteryService" - allowed: dataItem.value !== "default" + preferredVisible: dataItem.value !== "default" VeQuickItem { id: availableBatteryServices diff --git a/pages/settings/PageGeneratorRuntimeService.qml b/pages/settings/PageGeneratorRuntimeService.qml index 07d6eb495..fe230f6a8 100644 --- a/pages/settings/PageGeneratorRuntimeService.qml +++ b/pages/settings/PageGeneratorRuntimeService.qml @@ -46,7 +46,7 @@ Page { ListText { //% "Total run time" text: qsTrId("page_settings_run_time_and_service_total_run_time") - allowed: gensetOperatingHours.isValid + preferredVisible: gensetOperatingHours.isValid secondaryText: Math.round(accumulatedTotalItem.value / 60 / 60) + "h" } @@ -58,7 +58,7 @@ Page { secondaryText: Math.round(accumulatedTotalItem.value / 60 / 60) - Math.round(dataItem.value / 60 / 60) + "h" dataItem.uid: settingsBindPrefix + "/AccumulatedTotalOffset" enabled: userHasWriteAccess && state.value === 0 - allowed: dataItem.isValid && gensetBindPrefix === "" + preferredVisible: dataItem.isValid && gensetBindPrefix === "" maximumLength: 6 saveInput: function() { dataItem.setValue(accumulatedTotalItem.value - parseInt(textField.text, 10) * 60 * 60) @@ -116,10 +116,10 @@ Page { text: qsTrId("settings_page_run_time_and_service_time_to_next_test_run") secondaryText: "" dataItem.uid: root.startStopBindPrefix ? root.startStopBindPrefix + "/NextTestRun" : "" - allowed: dataItem.isValid && dataItem.value > 0 + preferredVisible: dataItem.isValid && dataItem.value > 0 Timer { - running: parent.allowed && root.animationEnabled + running: parent.preferredVisible && root.animationEnabled repeat: true interval: 1000 onTriggered: { @@ -139,7 +139,7 @@ Page { //% "Accumulated running time since last test run" text: qsTrId("settings_page_run_time_and_service_accumulated_running_time") showAccessLevel: VenusOS.User_AccessType_Service - allowed: defaultAllowed && nextTestRun.allowed + preferredVisible: nextTestRun.preferredVisible secondaryText: Utils.secondsToString(dataItem.value, false) dataItem.uid: root.startStopBindPrefix ? root.startStopBindPrefix + "/TestRunIntervalRuntime" : "" } @@ -149,7 +149,7 @@ Page { text: qsTrId("settings_page_run_time_and_service_time_to_service") dataItem.uid: root.startStopBindPrefix ? root.startStopBindPrefix + "/ServiceCounter" : "" secondaryText: Math.round(dataItem.value / 60 / 60) + "h" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListIntField { @@ -177,7 +177,7 @@ Page { //% "Reset service timer" text: qsTrId("page_settings_run_time_and_service_reset_service_timer") button.text: CommonWords.press_to_reset - allowed: serviceReset.isValid + preferredVisible: serviceReset.isValid onClicked: { serviceReset.setValue(1) //% "The service timer has been reset" diff --git a/pages/settings/PageGeneratorTestRun.qml b/pages/settings/PageGeneratorTestRun.qml index aa88641b8..7ca1f4e94 100644 --- a/pages/settings/PageGeneratorTestRun.qml +++ b/pages/settings/PageGeneratorTestRun.qml @@ -62,7 +62,7 @@ Page { //% "Run duration (hh:mm)" text: qsTrId("page_generator_test_run_run_duration") dataItem.uid: bindPrefix + "/TestRun/Duration" - allowed: !runTillBatteryFull.checked + preferredVisible: !runTillBatteryFull.checked } ListSwitch { @@ -71,7 +71,7 @@ Page { //% "Run until battery is fully charged" text: qsTrId("page_generator_test_run_run_until_fully_charged") dataItem.uid: bindPrefix + "/TestRun/RunTillBatteryFull" - allowed: dataItem.isValid + preferredVisible: dataItem.isValid } } } diff --git a/pages/settings/PageSettingsAcSystem.qml b/pages/settings/PageSettingsAcSystem.qml index eb37742bf..cb2f87ce5 100644 --- a/pages/settings/PageSettingsAcSystem.qml +++ b/pages/settings/PageSettingsAcSystem.qml @@ -93,7 +93,7 @@ Page { ? qsTrId("settings_system_monitor_for_grid_failure") //% "Monitor for shore disconnect" : qsTrId("settings_system_monitor_for_shore_disconnect") - allowed: root._isGrid || root._isShore + preferredVisible: root._isGrid || root._isShore dataItem.uid: Global.systemSettings.serviceUid + "/Settings/Alarm/System/GridLost" optionModel: [ { display: CommonWords.disabled, value: 0 }, diff --git a/pages/settings/PageSettingsAccessAndSecurity.qml b/pages/settings/PageSettingsAccessAndSecurity.qml index 28b6aae47..3bb12a3d5 100644 --- a/pages/settings/PageSettingsAccessAndSecurity.qml +++ b/pages/settings/PageSettingsAccessAndSecurity.qml @@ -251,7 +251,7 @@ Page { //% "Remote support tunnel" text: qsTrId("settings_remote_support_tunnel") secondaryText: remotePort.secondaryText.length > 0 ? CommonWords.online : CommonWords.offline - allowed: defaultAllowed && remoteSupportOnOff.checked + preferredVisible: remoteSupportOnOff.checked } ListText { @@ -260,7 +260,7 @@ Page { //% "Remote support IP and port" text: qsTrId("settings_remote_ip_and_support") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/System/RemoteSupportIpAndPort" - allowed: defaultAllowed && remoteSupportOnOff.checked + preferredVisible: remoteSupportOnOff.checked } ListButton { @@ -270,7 +270,7 @@ Page { button.text: qsTrId("settings_logout_now") // Cannot log out from GX devices, VRM or Unsecured profile with no password - allowed: Qt.platform.os === "wasm" && !BackendConnection.vrm + preferredVisible: Qt.platform.os === "wasm" && !BackendConnection.vrm && securityProfile.dataItem.value !== VenusOS.Security_Profile_Unsecured writeAccessLevel: VenusOS.User_AccessType_User onClicked: Global.dialogLayer.open(logoutDialogComponent) diff --git a/pages/settings/PageSettingsAlarmsAndFeedback.qml b/pages/settings/PageSettingsAlarmsAndFeedback.qml index 4ec700fe7..5488d2107 100644 --- a/pages/settings/PageSettingsAlarmsAndFeedback.qml +++ b/pages/settings/PageSettingsAlarmsAndFeedback.qml @@ -17,7 +17,7 @@ Page { //% "Audible alarm" text: qsTrId("settings_audible_alarm") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/Alarm/Audible" - allowed: defaultAllowed && buzzerStateDataItem.isValid + preferredVisible: buzzerStateDataItem.isValid VeQuickItem { id: buzzerStateDataItem @@ -29,7 +29,7 @@ Page { //% "Enable status LEDs" text: qsTrId("settings_enable_status_leds") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/LEDs/Enable" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } } } diff --git a/pages/settings/PageSettingsBatteries.qml b/pages/settings/PageSettingsBatteries.qml index fad638b8e..d39ab4443 100644 --- a/pages/settings/PageSettingsBatteries.qml +++ b/pages/settings/PageSettingsBatteries.qml @@ -46,7 +46,7 @@ Page { //% "Auto-selected" text: qsTrId("settings_system_auto_selected") dataItem.uid: Global.system.serviceUid + "/AutoSelectedBatteryService" - allowed: batteryMonitorRadioButtons.optionModel !== undefined + preferredVisible: batteryMonitorRadioButtons.optionModel !== undefined && batteryMonitorRadioButtons.currentIndex >= 0 && batteryMonitorRadioButtons.optionModel[batteryMonitorRadioButtons.currentIndex].value === "default" } diff --git a/pages/settings/PageSettingsBatteryMeasurements.qml b/pages/settings/PageSettingsBatteryMeasurements.qml index 9ca86764c..481d8279f 100644 --- a/pages/settings/PageSettingsBatteryMeasurements.qml +++ b/pages/settings/PageSettingsBatteryMeasurements.qml @@ -86,12 +86,12 @@ Page { text: root._visibleText //% "Active battery monitor" secondaryText: qsTrId("settings_batteries_active_battery_monitor") - allowed: batteryMenuItem.activeBattery + preferredVisible: batteryMenuItem.activeBattery } ListSwitch { text: root._visibleText - allowed: !batteryMenuItem.activeBattery + preferredVisible: !batteryMenuItem.activeBattery dataItem.uid: batteryEnabled.uid } @@ -101,7 +101,7 @@ Page { //% "Enter name" placeholderText: qsTrId("settings_batteries_enter_name") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/SystemSetup/Batteries/Configuration/" + batteryMenuItem.configId + "/Name" - allowed: dataItem.isValid + preferredVisible: dataItem.isValid textField.maximumLength: 32 } } diff --git a/pages/settings/PageSettingsBleSensors.qml b/pages/settings/PageSettingsBleSensors.qml index dd86c0060..6d1df8282 100644 --- a/pages/settings/PageSettingsBleSensors.qml +++ b/pages/settings/PageSettingsBleSensors.qml @@ -45,19 +45,19 @@ Page { //% "Continuous scanning" text: qsTrId("settings_continuous_scan") dataItem.uid: root.bleServiceUid + "/ContinuousScan" - allowed: enable.checked + preferredVisible: enable.checked } PrimaryListLabel { //% "Continuous scanning may interfere with Wi-Fi operation." text: qsTrId("settings_continuous_scan_may_interfere") - allowed: contScan.checked + preferredVisible: contScan.checked } ListNavigation { //% "Bluetooth adapters" text: qsTrId("settings_io_bluetooth_adapters") - allowed: enable.checked + preferredVisible: enable.checked onClicked: Global.pageManager.pushPage(bluetoothAdaptersComponent, {"title": text}) Component { diff --git a/pages/settings/PageSettingsBluetooth.qml b/pages/settings/PageSettingsBluetooth.qml index 3cbc4f093..069f2fbac 100644 --- a/pages/settings/PageSettingsBluetooth.qml +++ b/pages/settings/PageSettingsBluetooth.qml @@ -23,7 +23,7 @@ Page { ListTextField { //% "Pincode" text: qsTrId("settings_pincode") - allowed: bluetoothEnabled.checked + preferredVisible: bluetoothEnabled.checked dataItem.uid: Global.systemSettings.serviceUid + "/Settings/Ble/Service/Pincode" writeAccessLevel: VenusOS.User_AccessType_User textField.maximumLength: 6 diff --git a/pages/settings/PageSettingsCGwacs.qml b/pages/settings/PageSettingsCGwacs.qml index f58ffaef9..25bf2521d 100644 --- a/pages/settings/PageSettingsCGwacs.qml +++ b/pages/settings/PageSettingsCGwacs.qml @@ -55,7 +55,7 @@ Page { ListPvInverterPositionRadioButtonGroup { id: positions dataItem.uid: root.devicePath + "/Position" - allowed: root.serviceType === "pvinverter" + preferredVisible: root.serviceType === "pvinverter" } ListRadioButtonGroup { @@ -76,7 +76,7 @@ Page { //% "PV inverter on phase 2" text: qsTrId("settings_pv_inverter_on_phase_2") dataItem.uid: root.devicePath + "_S/Enabled" - allowed: multiPhaseSupport.value + preferredVisible: multiPhaseSupport.value && isMultiPhaseItem.value !== undefined && !isMultiPhaseItem.value && root.serviceType === "grid" @@ -86,7 +86,7 @@ Page { //% "PV inverter on phase 2 Position" text: qsTrId("settings_cgwacs_pv_inverter_l2_position") dataItem.uid: root.devicePath + "_S/Position" - allowed: pvOnL2.checked + preferredVisible: pvOnL2.checked optionModel: positions.optionModel } } diff --git a/pages/settings/PageSettingsCGwacsOverview.qml b/pages/settings/PageSettingsCGwacsOverview.qml index 65e3aaf07..b727fa518 100644 --- a/pages/settings/PageSettingsCGwacsOverview.qml +++ b/pages/settings/PageSettingsCGwacsOverview.qml @@ -31,7 +31,7 @@ Page { model: deviceIds.value ? deviceIds.value.split(',') : [] header: PrimaryListLabel { - allowed: energyMeterList.count === 0 + preferredVisible: energyMeterList.count === 0 //% "No energy meters found\n\n" //% "Note that this menu only shows Carlo Gavazzi meters connected over RS485. " //% "For any other meter, including Carlo Gavazzi meters connected over ethernet, " diff --git a/pages/settings/PageSettingsCanbus.qml b/pages/settings/PageSettingsCanbus.qml index f3aed8869..d6353c6ee 100644 --- a/pages/settings/PageSettingsCanbus.qml +++ b/pages/settings/PageSettingsCanbus.qml @@ -45,7 +45,7 @@ Page { ListNavigation { text: CommonWords.devices - allowed: root._isVecan || root._isRvc + preferredVisible: root._isVecan || root._isRvc onClicked: { if (root._isVecan) { Global.pageManager.pushPage("/pages/settings/PageSettingsVecanDevices.qml", @@ -61,17 +61,17 @@ Page { //% "NMEA2000-out" text: qsTrId("settings_canbus_nmea2000out") dataItem.uid: root._vecanSettingsPrefix + "/N2kGatewayEnabled" - allowed: root._isVecan + preferredVisible: root._isVecan } ListSpinBox { //% "Unique identity number selector" text: qsTrId("settings_canbus_unique_id_select") - allowed: root._isVecan || root._isRvc + preferredVisible: root._isVecan || root._isRvc dataItem.uid: (root._isRvc ? root._rvcSettingsPrefix : root._vecanSettingsPrefix) + "/VenusUniqueId" bottomContentChildren: PrimaryListLabel { - allowed: text.length > 0 + preferredVisible: text.length > 0 color: Theme.color_font_secondary text: root._isVecan //% "Above selector sets which block of unique identity numbers to use for the NAME Unique Identity Numbers in the PGN 60928 NAME field. Change only when using multiple GX Devices in one VE.Can network." @@ -102,7 +102,7 @@ Page { //% "Check Unique id numbers" text: qsTrId("settings_canbus_unique_id_choose") - allowed: root._isVecan || root._isRvc + preferredVisible: root._isVecan || root._isRvc button.text: timer.running ? Utils.secondsToString(timer.remainingTime) //% "Press to check" @@ -120,7 +120,7 @@ Page { bottomPadding: 0 //% "There is another device connected with this unique number, please select a new number." text: qsTrId("settings_canbus_unique_id_conflict") - allowed: vecanSameUniqueNameUsed.value === 1 || rvcSameUniqueNameUsed.value === 1 + preferredVisible: vecanSameUniqueNameUsed.value === 1 || rvcSameUniqueNameUsed.value === 1 }, PrimaryListLabel { id: uniqueIdOkLabel @@ -128,7 +128,7 @@ Page { bottomPadding: 0 //% "OK: No other device is connected with this unique number." text: qsTrId("settings_canbus_unique_id_ok") - allowed: (vecanSameUniqueNameUsed.value === 0 || rvcSameUniqueNameUsed.value === 0) && uniqueCheck.testDone + preferredVisible: (vecanSameUniqueNameUsed.value === 0 || rvcSameUniqueNameUsed.value === 0) && uniqueCheck.testDone } ] diff --git a/pages/settings/PageSettingsConnectivity.qml b/pages/settings/PageSettingsConnectivity.qml index b4dd24277..bd1e062a3 100644 --- a/pages/settings/PageSettingsConnectivity.qml +++ b/pages/settings/PageSettingsConnectivity.qml @@ -33,7 +33,7 @@ Page { ListNavigation { //% "Bluetooth" text: qsTrId("pagesettingsconnectivity_bluetooth") - allowed: networkServices.hasBluetoothSupport + preferredVisible: networkServices.hasBluetoothSupport onClicked: Global.pageManager.pushPage("/pages/settings/PageSettingsBluetooth.qml", {"title": text}) } @@ -53,7 +53,7 @@ Page { onClicked: { Global.pageManager.pushPage("/pages/settings/PageSettingsTailscale.qml", { title: text }) } - allowed: tailscale.isValid + preferredVisible: tailscale.isValid VeQuickItem { id: tailscale diff --git a/pages/settings/PageSettingsDisplayAndAppearance.qml b/pages/settings/PageSettingsDisplayAndAppearance.qml index 53cf12948..e1f4b3591 100644 --- a/pages/settings/PageSettingsDisplayAndAppearance.qml +++ b/pages/settings/PageSettingsDisplayAndAppearance.qml @@ -19,7 +19,7 @@ Page { //% "Adaptive brightness" text: qsTrId("settings_adaptive_brightness") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/Gui/AutoBrightness" - allowed: Qt.platform.os != "wasm" && dataItem.isValid && dataItem.max === 1 + preferredVisible: Qt.platform.os != "wasm" && dataItem.isValid && dataItem.max === 1 } ListSlider { @@ -27,7 +27,7 @@ Page { text: qsTrId("settings_brightness") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/Gui/Brightness" writeAccessLevel: VenusOS.User_AccessType_User - allowed: defaultAllowed && !autoBrightness.checked && Qt.platform.os != "wasm" + preferredVisible: !autoBrightness.checked && Qt.platform.os != "wasm" } ListRadioButtonGroup { @@ -50,7 +50,7 @@ Page { //% "Never" { display: qsTrId("settings_displayoff_never"), value: 0 }, ] - allowed: defaultAllowed && Qt.platform.os != "wasm" + preferredVisible: Qt.platform.os != "wasm" } ListRadioButtonGroup { diff --git a/pages/settings/PageSettingsDvcc.qml b/pages/settings/PageSettingsDvcc.qml index ea76c5be8..f0e2dc64e 100644 --- a/pages/settings/PageSettingsDvcc.qml +++ b/pages/settings/PageSettingsDvcc.qml @@ -17,7 +17,7 @@ Page { PrimaryListLabel { //% "CAUTION: Read the manual before adjusting." text: qsTrId("settings_dvcc_instructions") - allowed: commonSettings.userHasWriteAccess + preferredVisible: commonSettings.userHasWriteAccess } DvccCommonSettings { @@ -39,7 +39,7 @@ Page { //% "Limit managed battery charge voltage" text: qsTrId("settings_dvcc_limit_managed_battery_charge_voltage") checked: maxChargeVoltage.dataItem.isValid && maxChargeVoltage.dataItem.value > 0 - allowed: defaultAllowed && commonSettings.dvccActive + preferredVisible: commonSettings.dvccActive onClicked: { maxChargeVoltage.dataItem.setValue(maxChargeVoltage.dataItem.value === 0.0 ? 55.0 : 0.0) } @@ -50,7 +50,7 @@ Page { //% "Maximum charge voltage" text: qsTrId("settings_dvcc_max_charge_voltage") - allowed: defaultAllowed && maxChargeVoltageSwitch.visible && maxChargeVoltageSwitch.checked + preferredVisible: maxChargeVoltageSwitch.visible && maxChargeVoltageSwitch.checked dataItem.uid: Global.systemSettings.serviceUid + "/Settings/SystemSetup/MaxChargeVoltage" suffix: "V" decimals: 1 @@ -61,7 +61,7 @@ Page { //% "SVS - Shared voltage sense" text: qsTrId("settings_dvcc_shared_voltage_sense") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/SystemSetup/SharedVoltageSense" - allowed: defaultAllowed && commonSettings.dvccActive + preferredVisible: commonSettings.dvccActive } ListSwitchForced { @@ -70,7 +70,7 @@ Page { //% "STS - Shared temperature sense" text: qsTrId("settings_dvcc_shared_temp_sense") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/SystemSetup/SharedTemperatureSense" - allowed: defaultAllowed && commonSettings.dvccActive + preferredVisible: commonSettings.dvccActive } ListRadioButtonGroup { @@ -80,7 +80,7 @@ Page { dataItem.uid: Global.systemSettings.serviceUid + "/Settings/SystemSetup/TemperatureService" //% "Unavailable sensor, set another" defaultSecondaryText: qsTrId("settings_system_unavailable_sensor") - allowed: defaultAllowed && commonSettings.dvccActive && sharedTempSense.checked + preferredVisible: commonSettings.dvccActive && sharedTempSense.checked VeQuickItem { uid: Global.system.serviceUid + "/AvailableTemperatureServices" @@ -102,8 +102,7 @@ Page { //% "Used sensor" text: qsTrId("settings_dvcc_used_sensor") dataItem.uid: Global.system.serviceUid + "/AutoSelectedTemperatureService" - allowed: defaultAllowed - && sharedTempSense.checked + preferredVisible: sharedTempSense.checked && commonSettings.dvccActive && temperatureServiceRadioButtons.secondaryText === "default" } @@ -114,14 +113,14 @@ Page { //% "SCS - Shared current sense" text: qsTrId("settings_dvcc_shared_current_sense") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/SystemSetup/BatteryCurrentSense" - allowed: defaultAllowed && commonSettings.dvccActive + preferredVisible: commonSettings.dvccActive } ListRadioButtonGroup { //% "SCS status" text: qsTrId("settings_dvcc_scs_status") dataItem.uid: Global.system.serviceUid + "/Control/BatteryCurrentSense" - allowed: defaultAllowed && commonSettings.dvccActive && sharedCurrentSense.checked + preferredVisible: commonSettings.dvccActive && sharedCurrentSense.checked enabled: false optionModel: [ @@ -154,7 +153,7 @@ Page { //: Shown when BMS instance is invalid //% "Unavailable, set another" defaultSecondaryText: qsTrId("settings_dvcc_unavailable_bms") - allowed: defaultAllowed && commonSettings.dvccActive + preferredVisible: commonSettings.dvccActive // Only show if there are valid services published on /AvailableBmsServices or a valid active BMS service selected && (bmsOptions.optionModel.length > 2 || bmsService.isValid) @@ -184,7 +183,7 @@ Page { //% "Auto selected" text: qsTrId("settings_dvcc_auto_selected") - allowed: defaultAllowed && bmsOptions.allowed && bmsOptions.currentValue === -1 + preferredVisible: bmsOptions.preferredVisible && bmsOptions.currentValue === -1 secondaryText: bmsService.isValid ? bmsProductName.value || bmsCustomName.value || "" //: Indicates no option is selected @@ -216,7 +215,7 @@ Page { //% "Managed battery controls all Multis and Quattros" text: qsTrId("settings_dvcc_control_all_vebus_devices") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/SystemSetup/DvccControlAllMultis" - allowed: defaultAllowed && commonSettings.dvccActive && + preferredVisible: commonSettings.dvccActive && nrVebusDevices.isValid && nrVebusDevices.value > 1 bottomContentChildren: [ diff --git a/pages/settings/PageSettingsDynamicEss.qml b/pages/settings/PageSettingsDynamicEss.qml index b0c86b9fc..49e58e0ee 100644 --- a/pages/settings/PageSettingsDynamicEss.qml +++ b/pages/settings/PageSettingsDynamicEss.qml @@ -40,7 +40,7 @@ Page { ListQuantity { //% "Target SOC" text: qsTrId("settings_ess_target_soc") - allowed: dEssMode.dataItem.value === 1 + preferredVisible: dEssMode.dataItem.value === 1 dataItem.uid: Global.system.serviceUid + "/DynamicEss/TargetSoc" unit: VenusOS.Units_Percentage } diff --git a/pages/settings/PageSettingsEthernet.qml b/pages/settings/PageSettingsEthernet.qml index da115bb94..97d31f100 100644 --- a/pages/settings/PageSettingsEthernet.qml +++ b/pages/settings/PageSettingsEthernet.qml @@ -40,7 +40,7 @@ Page { //% "MAC address" text: qsTrId("settings_tcpip_mac_address") secondaryText: networkServices.macAddress - allowed: !networkServices.wifi + preferredVisible: !networkServices.wifi } ListRadioButtonGroup { @@ -67,9 +67,7 @@ Page { } return -1 } - enabled: userHasReadAccess - allowed: defaultAllowed onOptionClicked: function(index) { networkServices.setServiceProperty("Method", optionModel[index].value) @@ -111,7 +109,7 @@ Page { //% "Link-local IP address" text: qsTrId("settings_tcpip_link_local") - allowed: !networkServices.wifi + preferredVisible: !networkServices.wifi dataItem.uid: Global.venusPlatform.serviceUid + "/Network/Ethernet/LinkLocalIpAddress" } } diff --git a/pages/settings/PageSettingsFirmwareOffline.qml b/pages/settings/PageSettingsFirmwareOffline.qml index cf5c17b6e..c45c61430 100644 --- a/pages/settings/PageSettingsFirmwareOffline.qml +++ b/pages/settings/PageSettingsFirmwareOffline.qml @@ -39,7 +39,7 @@ Page { enabled: !Global.firmwareUpdate.busy writeAccessLevel: VenusOS.User_AccessType_User - allowed: !!Global.firmwareUpdate.offlineAvailableVersion && !Global.firmwareUpdate.checkingForUpdate + preferredVisible: !!Global.firmwareUpdate.offlineAvailableVersion && !Global.firmwareUpdate.checkingForUpdate onClicked: { Global.firmwareUpdate.installUpdate(VenusOS.Firmware_UpdateType_Offline) } @@ -49,7 +49,7 @@ Page { //% "Firmware build date/time" text: qsTrId("settings_firmware_build_date_time") dataItem.uid: Global.venusPlatform.serviceUid + "/Firmware/Offline/AvailableBuild" - allowed: installUpdate.allowed + preferredVisible: installUpdate.preferredVisible && Global.systemSettings.canAccess(VenusOS.User_AccessType_SuperUser) } diff --git a/pages/settings/PageSettingsFirmwareOnline.qml b/pages/settings/PageSettingsFirmwareOnline.qml index c8e02a025..91585a64e 100644 --- a/pages/settings/PageSettingsFirmwareOnline.qml +++ b/pages/settings/PageSettingsFirmwareOnline.qml @@ -52,7 +52,7 @@ Page { //% "Image type" text: qsTrId("settings_firmware_image_type") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/System/ImageType" - allowed: largeImageSupport.value === 1 + preferredVisible: largeImageSupport.value === 1 optionModel: [ //% "Normal" { display: qsTrId("settings_firmware_normal"), value: FirmwareUpdater.ImageTypeNormal }, @@ -96,7 +96,7 @@ Page { enabled: !Global.firmwareUpdate.busy writeAccessLevel: VenusOS.User_AccessType_User - allowed: !!Global.firmwareUpdate.onlineAvailableVersion && !Global.firmwareUpdate.checkingForUpdate + preferredVisible: !!Global.firmwareUpdate.onlineAvailableVersion && !Global.firmwareUpdate.checkingForUpdate onClicked: { Global.firmwareUpdate.installUpdate(VenusOS.Firmware_UpdateType_Online) } @@ -111,7 +111,7 @@ Page { //% "Update build date/time" text: qsTrId("settings_firmware_update_build_date_time") dataItem.uid: Global.venusPlatform.serviceUid + "/Firmware/Online/AvailableBuild" - allowed: installUpdate.allowed + preferredVisible: installUpdate.preferredVisible && Global.systemSettings.canAccess(VenusOS.User_AccessType_SuperUser) } } diff --git a/pages/settings/PageSettingsFronius.qml b/pages/settings/PageSettingsFronius.qml index 3abeb0808..d5968e6fc 100644 --- a/pages/settings/PageSettingsFronius.qml +++ b/pages/settings/PageSettingsFronius.qml @@ -53,7 +53,7 @@ Page { ListPortField { //% "TCP port" text: qsTrId("page_settings_fronius_tcp_port") - allowed: dataItem.value !== 80 + preferredVisible: dataItem.value !== 80 dataItem.uid: Global.systemSettings.serviceUid + "/Settings/Fronius/PortNumber" } diff --git a/pages/settings/PageSettingsFroniusInverter.qml b/pages/settings/PageSettingsFroniusInverter.qml index cd379bd61..5d41ddd1d 100644 --- a/pages/settings/PageSettingsFroniusInverter.qml +++ b/pages/settings/PageSettingsFroniusInverter.qml @@ -34,13 +34,13 @@ Page { text: CommonWords.phase //% "Multiphase" secondaryText: qsTrId("page_settings_fronius_inverter_multiphase") - allowed: phaseCount > 1 + preferredVisible: phaseCount > 1 } ListRadioButtonGroup { text: CommonWords.phase dataItem.uid: bindPrefix + "/Phase" - allowed: phaseCount === 1 + preferredVisible: phaseCount === 1 optionModel: [ //% "L1" { display: qsTrId("page_settings_fronius_inverter_l1"), value: 1 }, @@ -64,7 +64,7 @@ Page { //% "Power limiting" text: qsTrId("page_settings_fronius_inverter_power_limiting") dataItem.uid: bindPrefix + "/EnableLimiter" - allowed: isActive.dataItem.value === 1 && limiterSupportedItem.value === 1 + preferredVisible: isActive.dataItem.value === 1 && limiterSupportedItem.value === 1 optionModel: [ { display: CommonWords.disabled, value: 0 }, { display: CommonWords.enabled, value: 1 } diff --git a/pages/settings/PageSettingsGenerator.qml b/pages/settings/PageSettingsGenerator.qml index 2a87cfd4d..4bcdc7119 100644 --- a/pages/settings/PageSettingsGenerator.qml +++ b/pages/settings/PageSettingsGenerator.qml @@ -41,7 +41,7 @@ Page { ListNavigation { //% "Warm-up & cool-down" text: qsTrId("settings_page_generator_warm_up_cool_down") - allowed: capabilities.value & warmupCapability + preferredVisible: capabilities.value & warmupCapability onClicked: Global.pageManager.pushPage(warmupPageComponent, { title: text }) Component { @@ -141,7 +141,7 @@ Page { //% "Quiet hours start time" text: qsTrId("page_settings_generator_quiet_hours_start_time") dataItem.uid: settingsBindPrefix + "/QuietHours/StartTime" - allowed: defaultAllowed && quietHours.checked + preferredVisible: quietHours.checked writeAccessLevel: VenusOS.User_AccessType_User } @@ -149,7 +149,7 @@ Page { //% "Quiet hours end time" text: qsTrId("page_settings_generator_quiet_hours_end_time") dataItem.uid: settingsBindPrefix + "/QuietHours/EndTime" - allowed: defaultAllowed && quietHours.checked + preferredVisible: quietHours.checked writeAccessLevel: VenusOS.User_AccessType_User } } diff --git a/pages/settings/PageSettingsGsm.qml b/pages/settings/PageSettingsGsm.qml index 87ab06d35..594f42dff 100644 --- a/pages/settings/PageSettingsGsm.qml +++ b/pages/settings/PageSettingsGsm.qml @@ -63,7 +63,7 @@ Page { } ListItem { - allowed: gsmStatusIcon.valid + preferredVisible: gsmStatusIcon.valid text: CommonWords.signal_strength content.children: [ @@ -84,7 +84,7 @@ Page { ListItem { //% "It may be necessary to configure the APN settings below in this page, contact your operator for details.\nIf that doesn't work, check sim-card in a phone to make sure that there is credit and/or it is registered to be used for data." text: qsTrId("page_settings_gsm_error_message") - allowed: status.dataItem.value === 0 && carrier.dataItem.isValid && simStatus.value === 1000 + preferredVisible: status.dataItem.value === 0 && carrier.dataItem.isValid && simStatus.value === 1000 } ListSwitch { @@ -138,13 +138,13 @@ Page { dataItem.uid: settingsBindPrefix + "/PIN" writeAccessLevel: VenusOS.User_AccessType_User // Show only when PIN required - allowed: dataItem.isValid && [11, 16].indexOf(simStatus.value) > -1 + preferredVisible: dataItem.isValid && [11, 16].indexOf(simStatus.value) > -1 } ListText { text: CommonWords.ip_address dataItem.uid: bindPrefix + "/IP" - allowed: status.dataItem.value === 1 + preferredVisible: status.dataItem.value === 1 } ListNavigation { @@ -179,7 +179,7 @@ Page { //% "APN name" text: qsTrId("page_settings_gsm_apn_name") dataItem.uid: root.settingsBindPrefix + "/APN" - allowed: !useDefaultApn.checked + preferredVisible: !useDefaultApn.checked textField.maximumLength: 50 } } @@ -208,7 +208,7 @@ Page { //% "User name" text: qsTrId("page_settings_gsm_user_name") dataItem.uid: settingsBindPrefix + "/User" - allowed: useAuth.checked + preferredVisible: useAuth.checked } ListTextField { @@ -216,14 +216,14 @@ Page { text: CommonWords.password dataItem.uid: settingsBindPrefix + "/Password" - allowed: useAuth.checked + preferredVisible: useAuth.checked } ListText { //% "IMEI" text: qsTrId("page_settings_gsm_imei") dataItem.uid: bindPrefix + "/IMEI" - allowed: dataItem.isValid + preferredVisible: dataItem.isValid } } } diff --git a/pages/settings/PageSettingsHub4.qml b/pages/settings/PageSettingsHub4.qml index 26e9c3eb4..da61be4a0 100644 --- a/pages/settings/PageSettingsHub4.qml +++ b/pages/settings/PageSettingsHub4.qml @@ -57,7 +57,7 @@ Page { //% "Grid metering" text: qsTrId("settings_ess_grid_metering") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/CGwacs/RunWithoutGridMeter" - allowed: defaultAllowed && essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled + preferredVisible: essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled optionModel: [ //% "External meter" { display: qsTrId("settings_ess_external_meter"), value: 0 }, @@ -70,7 +70,7 @@ Page { //% "Self-consumption from battery" text: qsTrId("settings_ess_self_consumption_battery") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/CGwacs/BatteryUse" - allowed: defaultAllowed && withoutGridMeter.currentIndex === 0 && hasAcOutSystemItem.value === 1 + preferredVisible: withoutGridMeter.currentIndex === 0 && hasAcOutSystemItem.value === 1 optionModel: [ //% "All system loads" { display: qsTrId("settings_ess_all_system_loads"), value: 0 }, @@ -83,8 +83,7 @@ Page { //% "Multiphase regulation" text: qsTrId("settings_ess_multiphase_regulation") dataItem.uid: essMode.uid - allowed: defaultAllowed - && essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled + preferredVisible: essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled && batteryLifeState.dataItem.value !== VenusOS.Ess_BatteryLifeState_KeepCharged defaultSecondaryText: "" optionModel: [ @@ -111,8 +110,7 @@ Page { //% "Minimum SOC (unless grid fails)" text: qsTrId("settings_ess_min_soc") button.text: Global.ess.minimumStateOfCharge + "%" - allowed: defaultAllowed - && essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled + preferredVisible: essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled && batteryLifeState.dataItem.value !== VenusOS.Ess_BatteryLifeState_KeepCharged onClicked: Global.dialogLayer.open(minSocDialogComponent) @@ -129,8 +127,7 @@ Page { ListQuantity { //% "Active SOC limit" text: qsTrId("settings_ess_active_soc_limit") - allowed: defaultAllowed - && essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled + preferredVisible: essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled && Global.ess.isBatteryLifeActive(batteryLifeState.dataItem.value) value: Math.max(Global.ess.minimumStateOfCharge || 0, socLimit.value || 0) unit: VenusOS.Units_Percentage @@ -142,8 +139,7 @@ Page { //% "Battery life state" text: qsTrId("settings_ess_batteryLife_state") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/CGwacs/BatteryLife/State" - allowed: defaultAllowed - && essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled + preferredVisible: essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled && Global.ess.isBatteryLifeActive(batteryLifeState.dataItem.value) enabled: false optionModel: [ @@ -168,8 +164,7 @@ Page { //% "Limit charge power" text: qsTrId("settings_ess_limit_charge_power") checked: maxChargePower.dataItem.value >= 0 - allowed: defaultAllowed - && essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled + preferredVisible: essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled && !(maxChargeCurrentControl.isValid && maxChargeCurrentControl.value) onClicked: { @@ -186,7 +181,7 @@ Page { //% "Maximum charge power" text: qsTrId("settings_ess_max_charge_power") - allowed: defaultAllowed && maxChargePowerSwitch.visible && maxChargePowerSwitch.checked + preferredVisible: maxChargePowerSwitch.visible && maxChargePowerSwitch.checked dataItem.uid: Global.systemSettings.serviceUid + "/Settings/CGwacs/MaxChargePower" suffix: Units.defaultUnitString(VenusOS.Units_Watt) from: 0 @@ -200,8 +195,7 @@ Page { //% "Limit inverter power" text: qsTrId("settings_ess_limit_inverter_power") checked: maxDischargePower.dataItem.value >= 0 - allowed: defaultAllowed - && essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled + preferredVisible: essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled && batteryLifeState.dataItem.value !== VenusOS.Ess_BatteryLifeState_KeepCharged onClicked: { @@ -218,7 +212,7 @@ Page { //% "Maximum inverter power" text: qsTrId("settings_ess_max_inverter_power") - allowed: defaultAllowed && maxInverterPowerSwitch.visible && maxInverterPowerSwitch.checked + preferredVisible: maxInverterPowerSwitch.visible && maxInverterPowerSwitch.checked dataItem.uid: Global.systemSettings.serviceUid + "/Settings/CGwacs/MaxDischargePower" suffix: Units.defaultUnitString(VenusOS.Units_Watt) from: 0 @@ -229,7 +223,7 @@ Page { ListSpinBox { //% "Grid setpoint" text: qsTrId("settings_ess_grid_setpoint") - allowed: defaultAllowed && essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled + preferredVisible: essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled dataItem.uid: Global.systemSettings.serviceUid + "/Settings/CGwacs/AcPowerSetPoint" suffix: Units.defaultUnitString(VenusOS.Units_Watt) stepSize: 10 @@ -238,7 +232,7 @@ Page { ListNavigation { //% "Grid feed-in" text: qsTrId("settings_ess_grid_feed_in") - allowed: defaultAllowed && essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled + preferredVisible: essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled onClicked: { Global.pageManager.pushPage("/pages/settings/PageSettingsHub4Feedin.qml", @@ -249,7 +243,7 @@ Page { ListNavigation { //% "Peak shaving" text: qsTrId("settings_ess_peak_shaving") - allowed: defaultAllowed && essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled + preferredVisible: essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled onClicked: { Global.pageManager.pushPage("/pages/settings/PageSettingsHub4Peakshaving.qml", { title: text }) } @@ -263,8 +257,7 @@ Page { ? qsTrId("settings_ess_active").arg(scheduleSoc.text) //% "Inactive" : qsTrId("settings_ess_inactive") - allowed: defaultAllowed - && essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled + preferredVisible: essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled && batteryLifeState.dataItem.value !== VenusOS.Ess_BatteryLifeState_KeepCharged onClicked: { @@ -298,7 +291,7 @@ Page { ListNavigation { //% "Dynamic ESS" text: qsTrId("settings_ess_dynamic") - allowed: (dEssModeItem.value > 0 || Global.systemSettings.canAccess(VenusOS.User_AccessType_Service)) + preferredVisible: (dEssModeItem.value > 0 || Global.systemSettings.canAccess(VenusOS.User_AccessType_Service)) && essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled && batteryLifeState.dataItem.value !== VenusOS.Ess_BatteryLifeState_KeepCharged onClicked: { @@ -313,8 +306,7 @@ Page { ListNavigation { text: CommonWords.debug - allowed: defaultAllowed - && essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled + preferredVisible: essMode.value !== VenusOS.Ess_Hub4ModeState_Disabled && Global.systemSettings.canAccess(VenusOS.User_AccessType_Service) onClicked: { diff --git a/pages/settings/PageSettingsHub4Feedin.qml b/pages/settings/PageSettingsHub4Feedin.qml index c539b3987..1a3696006 100644 --- a/pages/settings/PageSettingsHub4Feedin.qml +++ b/pages/settings/PageSettingsHub4Feedin.qml @@ -19,7 +19,7 @@ Page { //% "AC-coupled PV - feed in excess" text: qsTrId("settings_ess_ac_coupled_pv") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/CGwacs/PreventFeedback" - allowed: defaultAllowed && hub4Mode !== VenusOS.Ess_Hub4ModeState_Disabled + preferredVisible: hub4Mode !== VenusOS.Ess_Hub4ModeState_Disabled invertSourceValue: true } @@ -29,8 +29,7 @@ Page { //% "DC-coupled PV - feed in excess" text: qsTrId("settings_ess_dc_coupled_pv") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/CGwacs/OvervoltageFeedIn" - allowed: defaultAllowed - && hub4Mode !== VenusOS.Ess_Hub4ModeState_Disabled + preferredVisible: hub4Mode !== VenusOS.Ess_Hub4ModeState_Disabled && doNotFeedInvOvervoltage.isValid VeQuickItem { @@ -44,7 +43,7 @@ Page { //% "Limit system feed-in" text: qsTrId("settings_ess_limit_system_feed_in") - allowed: defaultAllowed && (acFeedin.checked || feedInDc.checked) + preferredVisible: acFeedin.checked || feedInDc.checked checked: maxFeedInPower.value >= 0 onClicked: { if (maxFeedInPower.value < 0) { @@ -60,7 +59,7 @@ Page { //% "Maximum feed-in" text: qsTrId("settings_ess_max_feed_in") - allowed: defaultAllowed && restrictFeedIn.visible && restrictFeedIn.checked + preferredVisible: restrictFeedIn.visible && restrictFeedIn.checked dataItem.uid: Global.systemSettings.serviceUid + "/Settings/CGwacs/MaxFeedInPower" suffix: Units.defaultUnitString(VenusOS.Units_Watt) to: 300000 @@ -71,8 +70,7 @@ Page { id: feedInLimitingActive //% "Feed-in limiting active" text: qsTrId("settings_ess_feed_in_limiting_active") - allowed: defaultAllowed - && hub4Mode !== VenusOS.Ess_Hub4ModeState_Disabled + preferredVisible: hub4Mode !== VenusOS.Ess_Hub4ModeState_Disabled && dataItem.isValid dataItem.uid: BackendConnection.serviceUidForType("hub4") +"/PvPowerLimiterActive" secondaryText: CommonWords.yesOrNo(feedInLimitingActive.dataItem.value) diff --git a/pages/settings/PageSettingsHub4Peakshaving.qml b/pages/settings/PageSettingsHub4Peakshaving.qml index 137a4022f..bd08b2844 100644 --- a/pages/settings/PageSettingsHub4Peakshaving.qml +++ b/pages/settings/PageSettingsHub4Peakshaving.qml @@ -97,7 +97,7 @@ Page { bottomContentChildren: [ PrimaryListLabel { - allowed: !maxSystemAcInputCurrentSwitch.enabled + preferredVisible: !maxSystemAcInputCurrentSwitch.enabled topPadding: 0 bottomPadding: 0 color: Theme.color_font_secondary @@ -111,7 +111,7 @@ Page { //% "Maximum system import current (per phase)" text: qsTrId("settings_ess_max_system_import_current") enabled: userHasWriteAccess - allowed: maxSystemAcInputCurrentSwitch.enabled && maxSystemAcInputCurrentSwitch.checked + preferredVisible: maxSystemAcInputCurrentSwitch.enabled && maxSystemAcInputCurrentSwitch.checked dataItem.uid: systemAcInputLimit.uid suffix: Units.defaultUnitString(VenusOS.Units_Amp) decimals: 0 @@ -138,7 +138,7 @@ Page { bottomContentChildren: [ PrimaryListLabel { - allowed: !maxSystemAcExportCurrentSwitch.enabled + preferredVisible: !maxSystemAcExportCurrentSwitch.enabled topPadding: 0 bottomPadding: 0 color: Theme.color_font_secondary @@ -152,7 +152,7 @@ Page { //% "Maximum system export current (per phase)" text: qsTrId("settings_ess_max_system_export_current") enabled: userHasWriteAccess - allowed: maxSystemAcExportCurrentSwitch.enabled && maxSystemAcExportCurrentSwitch.checked + preferredVisible: maxSystemAcExportCurrentSwitch.enabled && maxSystemAcExportCurrentSwitch.checked dataItem.uid: systemAcExportLimit.uid suffix: Units.defaultUnitString(VenusOS.Units_Amp) decimals: 0 diff --git a/pages/settings/PageSettingsIntegrations.qml b/pages/settings/PageSettingsIntegrations.qml index 2f6311d69..cf057c9e2 100644 --- a/pages/settings/PageSettingsIntegrations.qml +++ b/pages/settings/PageSettingsIntegrations.qml @@ -39,7 +39,7 @@ Page { ListNavigation { //% "Bluetooth Sensors" text: qsTrId("pagesettingsintegrations_bluetooth_sensors") - allowed: hasBluetoothSupport.value + preferredVisible: hasBluetoothSupport.value onClicked: Global.pageManager.pushPage("/pages/settings/PageSettingsBleSensors.qml", {"title": text}) VeQuickItem { @@ -56,7 +56,7 @@ Page { ListNavigation { //% "Tank and Temperature Sensors" text: qsTrId("pagesettingsintegrations_tank_and_temperature_sensors") - allowed: defaultAllowed && analogModel.rowCount > 0 + preferredVisible: analogModel.rowCount > 0 onClicked: Global.pageManager.pushPage(analogInputsComponent, {"title": text}) VeQItemTableModel { @@ -89,7 +89,7 @@ Page { //% "Relays" text: qsTrId("pagesettingsintegrations_relays") onClicked: Global.pageManager.pushPage("/pages/settings/PageSettingsRelay.qml", {"title": text}) - allowed: relay0.isValid + preferredVisible: relay0.isValid VeQuickItem { id: relay0 @@ -100,7 +100,7 @@ Page { ListNavigation { //% "Digital I/O" text: qsTrId("pagesettingsintegrations_digital_io") - allowed: defaultAllowed && digitalModel.rowCount > 0 + preferredVisible: digitalModel.rowCount > 0 onClicked: Global.pageManager.pushPage(digitalInputsComponent, {"title": text}) VeQItemSortTableModel { @@ -174,19 +174,19 @@ Page { //% "Signal K" text: qsTrId("settings_large_signal_k") dataItem.uid: Global.venusPlatform.serviceUid + "/Services/SignalK/Enabled" - allowed: dataItem.isValid + preferredVisible: dataItem.isValid } PrimaryListLabel { //% "Access Signal K at http://venus.local:3000 and via VRM." text: qsTrId("settings_large_access_signal_k") - allowed: signalk.checked + preferredVisible: signalk.checked } ListNavigation { //% "Node-RED" text: qsTrId("settings_large_node_red") - allowed: nodeRedModeItem.isValid + preferredVisible: nodeRedModeItem.isValid onClicked: Global.pageManager.pushPage("/pages/settings/PageSettingsNodeRed.qml", {"title": text }) VeQuickItem { diff --git a/pages/settings/PageSettingsIo.qml b/pages/settings/PageSettingsIo.qml index c0e52ad7b..9f1d7b666 100644 --- a/pages/settings/PageSettingsIo.qml +++ b/pages/settings/PageSettingsIo.qml @@ -30,7 +30,7 @@ Page { ListNavigation { //% "Analog inputs" text: qsTrId("settings_io_analog_inputs") - allowed: defaultAllowed && analogModel.rowCount > 0 + preferredVisible: analogModel.rowCount > 0 onClicked: { Global.pageManager.pushPage(analogInputsComponent, {"title": text}) } @@ -58,7 +58,7 @@ Page { ListNavigation { //% "Digital inputs" text: qsTrId("settings_io_digital_inputs") - allowed: defaultAllowed && digitalModel.rowCount > 0 + preferredVisible: digitalModel.rowCount > 0 onClicked: { Global.pageManager.pushPage(digitalInputsComponent, {"title": text}) } diff --git a/pages/settings/PageSettingsLogger.qml b/pages/settings/PageSettingsLogger.qml index 7d0724cb3..853372365 100644 --- a/pages/settings/PageSettingsLogger.qml +++ b/pages/settings/PageSettingsLogger.qml @@ -113,7 +113,7 @@ Page { { display: qsTrId("settings_1_day"), value: 86400 }, ] dataItem.uid: Global.systemSettings.serviceUid + "/Settings/Vrmlogger/LogInterval" - allowed: vrmPortalMode.dataItem.isValid && vrmPortalMode.dataItem.value > 0 + preferredVisible: vrmPortalMode.dataItem.isValid && vrmPortalMode.dataItem.value > 0 } ListSwitch { @@ -122,7 +122,7 @@ Page { //% "Use secure connection (HTTPS)" text: qsTrId("settings_https_enabled") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/Vrmlogger/HttpsEnabled" - allowed: defaultAllowed && securityProfile.value !== VenusOS.Security_Profile_Secured + preferredVisible: securityProfile.value !== VenusOS.Security_Profile_Secured VeQuickItem { id: securityProfile @@ -134,7 +134,7 @@ Page { //% "Last contact" text: qsTrId("settings_last_contact") dataItem.uid: root.loggerServiceUid + "/Vrm/TimeLastContact" - allowed: vrmPortalMode.dataItem.isValid && vrmPortalMode.dataItem.value !== VenusOS.Vrm_PortalMode_Off + preferredVisible: vrmPortalMode.dataItem.isValid && vrmPortalMode.dataItem.value !== VenusOS.Vrm_PortalMode_Off Timer { interval: 1000 @@ -178,7 +178,7 @@ Page { //% "Connection status" text: qsTrId("settings_connection_status") secondaryText: CommonWords.no_error - allowed: !anyError + preferredVisible: !anyError } ListText { @@ -221,13 +221,13 @@ Page { //% "Connection status (HTTP channel)" qsTrId("settings_connection_error_http_channel") secondaryText: stringForErrorCode(connectionStatus.httpsConnectionError.value) - allowed: !connectionStatus.allowed + preferredVisible: !connectionStatus.preferredVisible } ListItem { //% "Error message: \n%1" text: qsTrId("settings_vrm_error_message").arg(errorMessage.value) - allowed: !!errorMessage.value + preferredVisible: !!errorMessage.value VeQuickItem { id: errorMessage @@ -239,14 +239,14 @@ Page { //% "Connection status (MQTT Real-time channel)" text: qsTrId("settings_connection_error_realtime_channel") secondaryText: connectionStatus.mqttRealtimeStatus.value || '' - allowed: !connectionStatus.allowed && connectionStatus.mqttRealtimeConnected.isValid + preferredVisible: !connectionStatus.preferredVisible && connectionStatus.mqttRealtimeConnected.isValid } ListText { //% "Connection status (MQTT RPC channel)" text: qsTrId("settings_connection_error_rpc_channel") secondaryText: connectionStatus.mqttRpcStatus.value || '' - allowed: !connectionStatus.allowed && connectionStatus.mqttRpcConnected.isValid + preferredVisible: !connectionStatus.preferredVisible && connectionStatus.mqttRpcConnected.isValid } ListSwitch { @@ -262,7 +262,7 @@ Page { dataItem.uid: Global.systemSettings.serviceUid + "/Settings/Watchdog/VrmTimeout" //% "No contact reset delay (hh:mm)" text: qsTrId("settings_vrm_no_contact_reset_delay") - allowed: !!dataItem.value && dataItem.value > 0 + preferredVisible: !!dataItem.value && dataItem.value > 0 } ListRadioButtonGroup { @@ -302,7 +302,7 @@ Page { ] enabled: false dataItem.uid: root.loggerServiceUid + "/Buffer/ErrorState" - allowed: !!dataItem.value + preferredVisible: !!dataItem.value } ListText { // This 'flickers' between values for ~30s after inserting a usb stick. Dbus-spy shows that the underlying data point flickers also. Old gui also flickers. diff --git a/pages/settings/PageSettingsModbus.qml b/pages/settings/PageSettingsModbus.qml index 65caca06a..975608aaa 100644 --- a/pages/settings/PageSettingsModbus.qml +++ b/pages/settings/PageSettingsModbus.qml @@ -37,7 +37,7 @@ Page { text: qsTrId("page_settings_modbus_scan_for_devices") secondaryText: scanItem.value ? CommonWords.scanning.arg(Math.round(scanProgressItem.value)) : CommonWords.press_to_scan onClicked: scanItem.setValue(!scanItem.value) - allowed: userHasWriteAccess + preferredVisible: userHasWriteAccess } ListNavigation { diff --git a/pages/settings/PageSettingsModbusDevices.qml b/pages/settings/PageSettingsModbusDevices.qml index 0e53f8040..c4080d93e 100644 --- a/pages/settings/PageSettingsModbusDevices.qml +++ b/pages/settings/PageSettingsModbusDevices.qml @@ -35,7 +35,7 @@ Page { GradientListView { header: PrimaryListLabel { horizontalAlignment: Text.AlignHCenter - allowed: !_devices.value + preferredVisible: !_devices.value //% "No Modbus devices saved" text: qsTrId("settings_modbus_no_devices_saved") } diff --git a/pages/settings/PageSettingsModbusDiscovered.qml b/pages/settings/PageSettingsModbusDiscovered.qml index 92edf9add..57fdbee9b 100644 --- a/pages/settings/PageSettingsModbusDiscovered.qml +++ b/pages/settings/PageSettingsModbusDiscovered.qml @@ -27,7 +27,7 @@ Page { id: listView header: PrimaryListLabel { horizontalAlignment: Text.AlignHCenter - allowed: listView.count === 0 + preferredVisible: listView.count === 0 //% "No Modbus devices discovered" text: qsTrId("settings_modbus_no_devices_discovered") } diff --git a/pages/settings/PageSettingsModbusTcp.qml b/pages/settings/PageSettingsModbusTcp.qml index 2c37f8097..7ff5dc913 100644 --- a/pages/settings/PageSettingsModbusTcp.qml +++ b/pages/settings/PageSettingsModbusTcp.qml @@ -34,7 +34,7 @@ Page { PrimaryListLabel { //% "No errors reported" text: lastError.isValid ? lastError.value : qsTrId("settings_modbus_no_errors") - allowed: enableModbusTcp.checked + preferredVisible: enableModbusTcp.checked horizontalAlignment: Text.AlignHCenter } @@ -42,13 +42,13 @@ Page { //% "Time of last error" text: qsTrId("settings_modbus_time_of_last_error") secondaryText: timestamp.isValid ? Qt.formatDateTime(new Date(timestamp.value * 1000), "yyyy-MM-dd hh:mm:ss") : "" - allowed: enableModbusTcp.checked && lastError.isValid + preferredVisible: enableModbusTcp.checked && lastError.isValid } ListButton { text: CommonWords.clear_error_action secondaryText: CommonWords.press_to_clear - allowed: enableModbusTcp.checked && lastError.isValid + preferredVisible: enableModbusTcp.checked && lastError.isValid onClicked: { lastError.setValue(undefined) timestamp.setValue(undefined) @@ -58,7 +58,7 @@ Page { ListNavigation { //% "Available services" text: qsTrId("settings_modbus_available_services") - allowed: enableModbusTcp.checked + preferredVisible: enableModbusTcp.checked onClicked: Global.pageManager.pushPage("/pages/settings/PageSettingsModbusTcpServices.qml", { title: text }) } } diff --git a/pages/settings/PageSettingsNodeRed.qml b/pages/settings/PageSettingsNodeRed.qml index 4a4e98b41..804668342 100644 --- a/pages/settings/PageSettingsNodeRed.qml +++ b/pages/settings/PageSettingsNodeRed.qml @@ -16,7 +16,7 @@ Page { text: qsTrId("settings_large_node_red") dataItem.uid: Global.venusPlatform.serviceUid + "/Services/NodeRed/Mode" - allowed: dataItem.isValid + preferredVisible: dataItem.isValid optionModel: [ { display: CommonWords.disabled, value: VenusOS.NodeRed_Mode_Disabled }, { display: CommonWords.enabled, value: VenusOS.NodeRed_Mode_Enabled }, @@ -30,7 +30,7 @@ Page { //% "Node-RED factory reset" text: qsTrId("page_settings_nodered_factory_reset") secondaryText: CommonWords.press_to_reset - allowed: true + preferredVisible: true onClicked: Global.dialogLayer.open(factoryResetConfirmationDialogComponent) VeQuickItem { @@ -54,7 +54,7 @@ Page { PrimaryListLabel { //% "Access Node-RED at https://venus.local:1881 and via VRM." text: qsTrId("settings_large_access_node_red") - allowed: nodered.currentValue > 0 + preferredVisible: nodered.currentValue > 0 } } } diff --git a/pages/settings/PageSettingsRelay.qml b/pages/settings/PageSettingsRelay.qml index a6c03c7a1..d0d463d85 100644 --- a/pages/settings/PageSettingsRelay.qml +++ b/pages/settings/PageSettingsRelay.qml @@ -42,7 +42,7 @@ Page { //% "Alarm relay polarity" text: qsTrId("settings_relay_alarm_polarity") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/Relay/Polarity" - allowed: relayFunction.currentValue === VenusOS.Relay_Function_Alarm + preferredVisible: relayFunction.currentValue === VenusOS.Relay_Function_Alarm optionModel: [ //% "Normally open" { display: qsTrId("settings_relay_normally_open"), value: 0 }, @@ -60,7 +60,7 @@ Page { //% "Relay on" : qsTrId("settings_relay_on") dataItem.uid: Global.system.serviceUid + "/Relay/0/State" - allowed: relayFunction.currentValue === VenusOS.Relay_Function_Manual + preferredVisible: relayFunction.currentValue === VenusOS.Relay_Function_Manual } ListRadioButtonGroup { @@ -69,7 +69,7 @@ Page { //% "Function (Relay 2)" text: qsTrId("settings_relay_function_relay2") dataItem.uid: Global.systemSettings.serviceUid + "/Settings/Relay/1/Function" - allowed: relay1State.isValid + preferredVisible: relay1State.isValid optionModel: [ //% "Manual" { display: qsTrId("settings_relay_manual"), value: VenusOS.Relay_Function_Manual }, @@ -83,14 +83,14 @@ Page { //% "Relay 2 on" text: qsTrId("settings_relay_relay2on") dataItem.uid: Global.system.serviceUid + "/Relay/1/State" - allowed: relay1State.isValid + preferredVisible: relay1State.isValid && relay1Function.currentValue === VenusOS.Relay_Function_Manual } ListNavigation { //% "Temperature control rules" text: qsTrId("settings_relay_temp_control_rules") - allowed: relayFunction.currentValue === VenusOS.Relay_Function_Temperature + preferredVisible: relayFunction.currentValue === VenusOS.Relay_Function_Temperature || relay1Function.currentValue === VenusOS.Relay_Function_Temperature onClicked: { Global.pageManager.pushPage("/pages/settings/PageSettingsRelayTempSensors.qml", { title: text }) diff --git a/pages/settings/PageSettingsRootfsSelect.qml b/pages/settings/PageSettingsRootfsSelect.qml index d6409e2e6..51d8fe8f3 100644 --- a/pages/settings/PageSettingsRootfsSelect.qml +++ b/pages/settings/PageSettingsRootfsSelect.qml @@ -61,7 +61,7 @@ Page { //% "Press to boot" ? qsTrId("settings_firmware_press_to_boot") : CommonWords.disabled - allowed: root._switchingEnabled + preferredVisible: root._switchingEnabled onClicked: { if (securityProfile.value === VenusOS.Security_Profile_Indeterminate) { @@ -93,13 +93,13 @@ Page { //% "Firmware %1 (%2)" text: qsTrId("settings_firmware_current_version").arg(currentVersionItem.value).arg(currentBuildItem.value) secondaryText: CommonWords.running_status - allowed: currentVersionItem.isValid && root._switchingEnabled + preferredVisible: currentVersionItem.isValid && root._switchingEnabled } ListText { //% "Backup firmware not available" text: qsTrId("settings_firmware_backup_not_available") - allowed: !currentVersion.visible && !backupVersion.visible && !root._rebooting + preferredVisible: !currentVersion.visible && !backupVersion.visible && !root._rebooting } } } diff --git a/pages/settings/PageSettingsRvcDevice.qml b/pages/settings/PageSettingsRvcDevice.qml index fd3619e72..26fa8fe39 100644 --- a/pages/settings/PageSettingsRvcDevice.qml +++ b/pages/settings/PageSettingsRvcDevice.qml @@ -57,13 +57,13 @@ Page { text: CommonWords.vrm_instance dataItem.uid: root.bindPrefix + "/VrmInstance" - allowed: root.isLocalSender + preferredVisible: root.isLocalSender } ListNavigation { //% "Configuration" text: qsTrId("settings_rvc_configuration") - allowed: root.isLocalSender && userHasWriteAccess + preferredVisible: root.isLocalSender && userHasWriteAccess onClicked: { Global.pageManager.pushPage("/pages/settings/PageSettingsRvcDeviceConfiguration.qml", diff --git a/pages/settings/PageSettingsRvcDeviceConfiguration.qml b/pages/settings/PageSettingsRvcDeviceConfiguration.qml index 92480f2af..c22ac670f 100644 --- a/pages/settings/PageSettingsRvcDeviceConfiguration.qml +++ b/pages/settings/PageSettingsRvcDeviceConfiguration.qml @@ -32,20 +32,20 @@ Page { //% "Charger instance" text: qsTrId("settings_rvc_charger_instance") dataItem.uid: root.bindPrefix + "/ChargerInstance" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListSpinBox { //% "Inverter instance" text: qsTrId("settings_rvc_inverter_instance") dataItem.uid: root.bindPrefix + "/InverterInstance" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListRadioButtonGroup { text: root._lineInstanceName(line2.dataItem.isValid ? "1" : "") dataItem.uid: root.bindPrefix + "/Line/0/Instance" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid optionModel: [ { display: "L1", value: 0 }, { display: "L2", value: 1 }, @@ -57,7 +57,7 @@ Page { text: root._lineInstanceName("2") dataItem.uid: root.bindPrefix + "/Line/1/Instance" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid optionModel: [ { display: "L1", value: 0 }, { display: "L2", value: 1 }, @@ -80,7 +80,7 @@ Page { //% "DC source instance" : qsTrId("settings_rvc_dc_source_instance") dataItem.uid: root.bindPrefix + "/DcSource/" + model.index + "/Instance" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListSpinBox { @@ -91,7 +91,7 @@ Page { //% "DC source priority" : qsTrId("settings_rvc_dc_source_priority") dataItem.uid: root.bindPrefix + "/DcSource/" + model.index + "/Priority" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } } } @@ -101,7 +101,7 @@ Page { //% "Tank instance" text: qsTrId("settings_rvc_tank_instance") dataItem.uid: root.bindPrefix + "/TankInstance" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } } } diff --git a/pages/settings/PageSettingsSystem.qml b/pages/settings/PageSettingsSystem.qml index 2c26ec933..cfe8e4b00 100644 --- a/pages/settings/PageSettingsSystem.qml +++ b/pages/settings/PageSettingsSystem.qml @@ -49,7 +49,7 @@ Page { //% "Enter name" placeholderText: qsTrId("settings_system_enter_user_defined_name") writeAccessLevel: VenusOS.User_AccessType_User - allowed: systemNameRadioButtons.currentIndex === systemNameRadioButtons.customValueIndex + preferredVisible: systemNameRadioButtons.currentIndex === systemNameRadioButtons.customValueIndex dataItem.uid: Global.systemSettings.serviceUid + "/Settings/SystemSetup/SystemName" } diff --git a/pages/settings/PageSettingsTailscale.qml b/pages/settings/PageSettingsTailscale.qml index f2932b952..2e69fc326 100644 --- a/pages/settings/PageSettingsTailscale.qml +++ b/pages/settings/PageSettingsTailscale.qml @@ -172,7 +172,7 @@ Page { PrimaryListLabel { text: root.serviceState - allowed: root.tailscaleEnabled && root.serviceState !== "" + preferredVisible: root.tailscaleEnabled && root.serviceState !== "" horizontalAlignment: Text.AlignHCenter onLinkActivated: (linkText) => { BackendConnection.openUrl(linkText) @@ -217,14 +217,14 @@ Page { //% "IPv4" text: qsTrId("settings_tailscale_ipv4") dataItem.uid: root.tailscaleServiceUid + "/IPv4" - allowed: dataItem.isValid && dataItem.value !== "" && root.tailscaleConnected + preferredVisible: dataItem.isValid && dataItem.value !== "" && root.tailscaleConnected } ListText { //% "IPv6" text: qsTrId("settings_tailscale_ipv6") dataItem.uid: root.tailscaleServiceUid + "/IPv6" - allowed: dataItem.isValid && dataItem.value !== "" && root.tailscaleConnected + preferredVisible: dataItem.isValid && dataItem.value !== "" && root.tailscaleConnected } ListButton { @@ -233,7 +233,7 @@ Page { //% "Log out now" button.text: qsTrId("settings_tailscale_logout_button") showAccessLevel: VenusOS.User_AccessType_Installer - allowed: defaultAllowed && root.tailscaleConnected + preferredVisible: root.tailscaleConnected onClicked: commandItem.setValue('logout') } diff --git a/pages/settings/PageSettingsTcpIp.qml b/pages/settings/PageSettingsTcpIp.qml index 687d0b7fe..2f6941b00 100644 --- a/pages/settings/PageSettingsTcpIp.qml +++ b/pages/settings/PageSettingsTcpIp.qml @@ -139,13 +139,13 @@ Page { ? qsTrId("settings_tcpip_wired") //% "[Hidden]" : root.network || qsTrId("settings_tcpip_hidden") - allowed: root._wifi + preferredVisible: root._wifi } ListTextField { text: CommonWords.password textField.maximumLength: 63 - allowed: root.ready && root._wifi && root._disconnected + preferredVisible: root.ready && root._wifi && root._disconnected && !service.favorite && service.secured writeAccessLevel: VenusOS.User_AccessType_User saveInput: function() { @@ -164,7 +164,7 @@ Page { text: qsTrId("settings_tcpip_connect_to_network") //% "Connect" button.text: qsTrId("settings_tcpip_connect") - allowed: root.ready && root._wifi && root._disconnected + preferredVisible: root.ready && root._wifi && root._disconnected && (service.favorite || !service.secured) writeAccessLevel: VenusOS.User_AccessType_User onClicked: performAction("connect") @@ -177,7 +177,7 @@ Page { text: qsTrId("settings_tcpip_forget_network") //% "Forget" button.text: qsTrId("settings_tcpip_forget") - allowed: root.ready && root._wifi && service.favorite + preferredVisible: root.ready && root._wifi && service.favorite writeAccessLevel: VenusOS.User_AccessType_User onClicked: Global.dialogLayer.open(forgetNetworkDialogComponent) @@ -198,7 +198,7 @@ Page { text: CommonWords.signal_strength value: service.strength unit: VenusOS.Units_Percentage - allowed: root._wifi + preferredVisible: root._wifi } } } diff --git a/pages/settings/PageSettingsWifi.qml b/pages/settings/PageSettingsWifi.qml index fa9b9dfe1..6bf73d8ca 100644 --- a/pages/settings/PageSettingsWifi.qml +++ b/pages/settings/PageSettingsWifi.qml @@ -28,7 +28,7 @@ Page { //% "Create access point" text: qsTrId("settings_wifi_create_ap") checked: accessPoint.value === 1 - allowed: defaultAllowed && accessPoint.isValid + preferredVisible: accessPoint.isValid onClicked: { if (checked) { Global.dialogLayer.open(confirmApDialogComponent) @@ -62,11 +62,11 @@ Page { SectionHeader { //% "Wi-Fi networks" text: qsTrId("settings_wifi_networks") - allowed: scanItem.isValid && accessPoint.isValid + preferredVisible: scanItem.isValid && accessPoint.isValid } PrimaryListLabel { - allowed: settingsListView.count === 0 + preferredVisible: settingsListView.count === 0 text: wifiModel.isValid //% "No access points" ? qsTrId("settings_wifi_no_access_points") diff --git a/pages/settings/PageTzInfo.qml b/pages/settings/PageTzInfo.qml index 9acd2e0b0..5d3e0ff8a 100644 --- a/pages/settings/PageTzInfo.qml +++ b/pages/settings/PageTzInfo.qml @@ -92,12 +92,12 @@ Page { // Qt for WebAssembly doesn't support timezones, // so we can't display the device-local date/time, // as we don't know what it is. Just hide the setting. - allowed: defaultAllowed && Qt.platform.os != "wasm" + preferredVisible: Qt.platform.os != "wasm" //% "Date/Time local" text: qsTrId("settings_tz_date_time_local") writeAccessLevel: VenusOS.User_AccessType_User - enabled: allowed && Global.systemSettings.time.isValid + enabled: preferredVisible && Global.systemSettings.time.isValid content.children: Row { spacing: Theme.geometry_listItem_content_spacing diff --git a/pages/settings/PageVrmDeviceInstances.qml b/pages/settings/PageVrmDeviceInstances.qml index fd13f58b6..3f8502828 100644 --- a/pages/settings/PageVrmDeviceInstances.qml +++ b/pages/settings/PageVrmDeviceInstances.qml @@ -302,7 +302,7 @@ Page { textField.inputMethodHints: Qt.ImhDigitsOnly textField.text: model.vrmInstance - allowed: model.deviceClass.length > 0 && model.vrmInstance >= 0 + preferredVisible: model.deviceClass.length > 0 && model.vrmInstance >= 0 validateInput: function() { const newVrmInstance = parseInt(textField.text) if (isNaN(newVrmInstance)) { diff --git a/pages/settings/debug/PageDebug.qml b/pages/settings/debug/PageDebug.qml index 1db821966..9a3497159 100644 --- a/pages/settings/debug/PageDebug.qml +++ b/pages/settings/debug/PageDebug.qml @@ -75,7 +75,7 @@ Page { text: qsTrId("settings_page_debug_display_cpu_usage") checked: Global.displayCpuUsage onClicked: Global.displayCpuUsage = !Global.displayCpuUsage - allowed: defaultAllowed && Qt.platform.os === "linux" + preferredVisible: Qt.platform.os === "linux" } SwitchItem { diff --git a/pages/settings/devicelist/DeviceListPage.qml b/pages/settings/devicelist/DeviceListPage.qml index 69412b961..b150e0d70 100644 --- a/pages/settings/devicelist/DeviceListPage.qml +++ b/pages/settings/devicelist/DeviceListPage.qml @@ -22,7 +22,7 @@ Page { readonly property bool _loadCustomDelegate: connected && !!device - // Only set width; height is sized to the loaded item, in case allowed=false and the + // Only set width; height is sized to the loaded item, in case preferredVisible=false and the // item should not be visible. width: parent ? parent.width : 0 @@ -60,7 +60,7 @@ Page { //% "Remove disconnected devices" text: qsTrId("devicelist_remove_disconnected_devices") secondaryText: CommonWords.remove - allowed: Global.allDevicesModel.disconnectedDeviceCount > 0 + preferredVisible: Global.allDevicesModel.disconnectedDeviceCount > 0 onClicked: { Global.allDevicesModel.removeDisconnectedDevices() } @@ -69,7 +69,7 @@ Page { ListNavigation { //% "Generator start/stop" text: qsTrId("settings_generator_start_stop") - allowed: defaultAllowed && relay0.isValid + preferredVisible: relay0.isValid onClicked: Global.pageManager.pushPage("/pages/settings/PageRelayGenerator.qml", {"title": text}) VeQuickItem { diff --git a/pages/settings/devicelist/PageAcCharger.qml b/pages/settings/devicelist/PageAcCharger.qml index 2f38c4d81..239d8839a 100644 --- a/pages/settings/devicelist/PageAcCharger.qml +++ b/pages/settings/devicelist/PageAcCharger.qml @@ -25,7 +25,7 @@ Page { dataItem.uid: root.bindPrefix + "/Mode" valueTrue: 1 valueFalse: 4 - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid writeAccessLevel: VenusOS.User_AccessType_User } @@ -38,7 +38,7 @@ Page { ListSpinBox { text: CommonWords.input_current_limit writeAccessLevel: VenusOS.User_AccessType_User - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: root.bindPrefix + "/Ac/In/CurrentLimit" suffix: Units.defaultUnitString(VenusOS.Units_Amp) stepSize: 0.1 @@ -80,7 +80,7 @@ Page { ListTemperature { text: CommonWords.battery_temperature dataItem.uid: root.bindPrefix + "/Dc/0/Temperature" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListQuantity { @@ -88,14 +88,14 @@ Page { text: qsTrId("settings_accharger_current") unit: VenusOS.Units_Amp dataItem.uid: root.bindPrefix + "/Ac/In/L1/I" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "Low battery voltage alarm" text: qsTrId("settings_accharger_low_battery_voltage_alarm") dataItem.uid: root.bindPrefix + "/Alarms/LowVoltage" - allowed: dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { @@ -104,7 +104,7 @@ Page { //% "High battery voltage alarm" text: qsTrId("settings_accharger_high_battery_voltage_alarm") dataItem.uid: root.bindPrefix + "/Alarms/HighVoltage" - allowed: dataItem.isValid + preferredVisible: dataItem.isValid } ListText { diff --git a/pages/settings/devicelist/PageDigitalInput.qml b/pages/settings/devicelist/PageDigitalInput.qml index 6ea2e7f5b..069f14804 100644 --- a/pages/settings/devicelist/PageDigitalInput.qml +++ b/pages/settings/devicelist/PageDigitalInput.qml @@ -58,7 +58,7 @@ Page { //% "Invert alarm logic" text: qsTrId("digitalinput_invert_alarm_logic") dataItem.uid: settingsBindPrefix + "/InvertAlarm" - allowed: alarmSwitch.checked + preferredVisible: alarmSwitch.checked } } } diff --git a/pages/settings/devicelist/PageMeteo.qml b/pages/settings/devicelist/PageMeteo.qml index d1e5f2fa4..8dd7a5c8b 100644 --- a/pages/settings/devicelist/PageMeteo.qml +++ b/pages/settings/devicelist/PageMeteo.qml @@ -45,7 +45,7 @@ Page { ListTemperature { //% "Cell temperature" text: qsTrId("page_meteo_cell_temperature") - allowed: dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: bindPrefix + "/CellTemperature" precision: 1 } @@ -56,7 +56,7 @@ Page { ? qsTrId("page_meteo_external_temperature_1") //% "External temperature" : qsTrId("page_meteo_external_temperature") - allowed: dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: bindPrefix + "/ExternalTemperature" precision: 1 } @@ -67,7 +67,7 @@ Page { dataItem.uid: bindPrefix + "/ExternalTemperature2" //% "External temperature (2)" text: qsTrId("page_meteo_external_temperature_2") - allowed: dataItem.isValid + preferredVisible: dataItem.isValid precision: 1 } @@ -75,7 +75,7 @@ Page { dataItem.uid: bindPrefix + "/WindSpeed" //% "Wind speed" text: qsTrId("page_meteo_wind_speed") - allowed: dataItem.isValid + preferredVisible: dataItem.isValid unit: VenusOS.Units_Speed_MetresPerSecond precision: 1 } @@ -84,7 +84,7 @@ Page { dataItem.uid: bindPrefix + "/WindDirection" //% "Wind direction" text: qsTrId("page_meteo_wind_direction") - allowed: dataItem.isValid + preferredVisible: dataItem.isValid unit: VenusOS.Units_CardinalDirection } @@ -92,7 +92,7 @@ Page { dataItem.uid: bindPrefix + "/InstallationPower" //% "Installation Power" text: qsTrId("page_meteo_installation_power") - allowed: dataItem.isValid + preferredVisible: dataItem.isValid unit: VenusOS.Units_Watt precision: 1 } @@ -101,7 +101,7 @@ Page { dataItem.uid: bindPrefix + "/TodaysYield" //% "Today's yield" text: qsTrId("page_meteo_daily_yield") - allowed: dataItem.isValid + preferredVisible: dataItem.isValid unit: VenusOS.Units_Energy_KiloWattHour precision: 1 } @@ -111,7 +111,7 @@ Page { //% "Sensor battery" text: qsTrId("page_meteo_battery_voltage") - allowed: defaultAllowed && batteryVoltage.isValid + preferredVisible: batteryVoltage.isValid content.children: [ QuantityLabel { @@ -157,7 +157,7 @@ Page { "title": CommonWords.settings, meteoSettingsPrefix: root.settingsPrefix }) - allowed: productId.value === ProductInfo.ProductId_MeteoSensor_Imt + preferredVisible: productId.value === ProductInfo.ProductId_MeteoSensor_Imt } ListNavigation { diff --git a/pages/settings/devicelist/PageMotorDrive.qml b/pages/settings/devicelist/PageMotorDrive.qml index 98473832c..d62a6e65c 100644 --- a/pages/settings/devicelist/PageMotorDrive.qml +++ b/pages/settings/devicelist/PageMotorDrive.qml @@ -25,28 +25,28 @@ Page { text: qsTrId("devicelist_motordrive_motorrpm") dataItem.uid: root.bindPrefix + "/Motor/RPM" unit: VenusOS.Units_RevolutionsPerMinute - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListTemperature { //% "Motor Temperature" text: qsTrId("devicelist_motordrive_motortemperature") dataItem.uid: root.bindPrefix + "/Motor/Temperature" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListQuantity { text: CommonWords.power_watts dataItem.uid: root.bindPrefix + "/Dc/0/Power" unit: VenusOS.Units_Watt - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListQuantity { text: CommonWords.voltage dataItem.uid: root.bindPrefix + "/Dc/0/Voltage" unit: VenusOS.Units_Volt_DC - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListQuantity { @@ -54,14 +54,14 @@ Page { dataItem.uid: root.bindPrefix + "/Dc/0/Current" unit: VenusOS.Units_Amp precision: 2 - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListTemperature { //% "Controller Temperature" text: qsTrId("devicelist_motordrive_controllertemperature") dataItem.uid: root.bindPrefix + "/Controller/Temperature" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListNavigation { diff --git a/pages/settings/devicelist/ac-in/PageAcInModel.qml b/pages/settings/devicelist/ac-in/PageAcInModel.qml index fc76cf5ce..04cb1be65 100644 --- a/pages/settings/devicelist/ac-in/PageAcInModel.qml +++ b/pages/settings/devicelist/ac-in/PageAcInModel.qml @@ -35,7 +35,7 @@ ObjectModel { ListText { text: CommonWords.status dataItem.uid: root.bindPrefix + "/StatusCode" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid secondaryText: VenusOS.pvInverter_statusCodeToText(dataItem.value) } @@ -49,7 +49,7 @@ ObjectModel { Repeater { model: root.phaseNumbers delegate: ListQuantityGroup { - allowed: root.phaseCountKnown || (phaseVoltage.isValid || phaseCurrent.isValid || + preferredVisible: root.phaseCountKnown || (phaseVoltage.isValid || phaseCurrent.isValid || phasePower.isValid || phasePowerFactor.isValid) text: CommonWords.ac_phase_x.arg(modelData) textModel: [ @@ -110,7 +110,7 @@ ObjectModel { text: qsTrId("ac-in-modeldefault_energy_x").arg(modelData) dataItem.uid: "%1/Ac/L%2/Energy/Forward".arg(root.bindPrefix).arg(modelData) unit: VenusOS.Units_Energy_KiloWattHour - allowed: root.phaseCountKnown || dataItem.isValid + preferredVisible: root.phaseCountKnown || dataItem.isValid } } } @@ -118,14 +118,14 @@ ObjectModel { ListText { text: CommonWords.zero_feed_in_power_limit dataItem.uid: root.bindPrefix + "/Ac/PowerLimit" - allowed: dataItem.isValid + preferredVisible: dataItem.isValid } ListText { //% "Phase Sequence" text: qsTrId("ac-in-modeldefault_phase_sequence") dataItem.uid: root.bindPrefix + "/PhaseSequence" - allowed: dataItem.isValid + preferredVisible: dataItem.isValid secondaryText: dataItem.value === 1 //: Phase sequence L1-L3-L2 //% "L1-L3-L2" @@ -137,7 +137,7 @@ ObjectModel { ListNavigation { text: CommonWords.setup - allowed: allowedRoles.isValid + preferredVisible: allowedRoles.isValid onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/ac-in/PageAcInSetup.qml", { "title": text, "bindPrefix": root.bindPrefix }) @@ -174,7 +174,7 @@ ObjectModel { //% "Data manager version" text: qsTrId("ac-in-modeldefault_data_manager_version") dataItem.uid: root.bindPrefix + "/DataManagerVersion" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } } } diff --git a/pages/settings/devicelist/ac-in/PageAcInSetup.qml b/pages/settings/devicelist/ac-in/PageAcInSetup.qml index c34216891..86f1d6bda 100644 --- a/pages/settings/devicelist/ac-in/PageAcInSetup.qml +++ b/pages/settings/devicelist/ac-in/PageAcInSetup.qml @@ -91,12 +91,12 @@ Page { ListPvInverterPositionRadioButtonGroup { dataItem.uid: root.bindPrefix + "/Position" - allowed: role.currentValue === "pvinverter" + preferredVisible: role.currentValue === "pvinverter" } ListEvChargerPositionRadioButtonGroup { dataItem.uid: root.bindPrefix + "/Position" - allowed: role.currentValue === "evcharger" + preferredVisible: role.currentValue === "evcharger" } /* EM24 settings */ @@ -104,7 +104,7 @@ Page { ListRadioButtonGroup { //% "Phase configuration" text: qsTrId("ac-in-setup_phase_configuration") - allowed: productId.value == ProductInfo.ProductId_EnergyMeter_Em24 + preferredVisible: productId.value == ProductInfo.ProductId_EnergyMeter_Em24 dataItem.uid: root.bindPrefix + "/PhaseConfig" enabled: !em24Locked() optionModel: [ @@ -120,14 +120,14 @@ Page { id: em24SwitchPos //% "Switch position" text: qsTrId("ac-in-setup_switch_position") - allowed: productId.value == ProductInfo.ProductId_EnergyMeter_Em24 + preferredVisible: productId.value == ProductInfo.ProductId_EnergyMeter_Em24 dataItem.uid: root.bindPrefix + "/SwitchPos" secondaryText: dataItem.isValid ? em24SwitchText(dataItem.value) : "--" } PrimaryListLabel { text: qsTr("Set the switch in an unlocked position to modify the settings.") - allowed: productId.value == ProductInfo.ProductId_EnergyMeter_Em24 && em24Locked() + preferredVisible: productId.value == ProductInfo.ProductId_EnergyMeter_Em24 && em24Locked() } /* Smappee settings */ @@ -135,7 +135,7 @@ Page { ListRadioButtonGroup { //% "Phase configuration" text: qsTrId("ac-in-setup_phase_configuration") - allowed: productId.value == ProductInfo.ProductId_PowerBox_Smappee + preferredVisible: productId.value == ProductInfo.ProductId_PowerBox_Smappee dataItem.uid: root.bindPrefix + "/PhaseConfig" optionModel: [ //% "Single phase" @@ -149,7 +149,7 @@ Page { ListNavigation { text: CommonWords.current_transformers - allowed: productId.value == ProductInfo.ProductId_PowerBox_Smappee + preferredVisible: productId.value == ProductInfo.ProductId_PowerBox_Smappee onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/ac-in/PageSmappeeCTList.qml", { "title": text, "bindPrefix": root.bindPrefix }) @@ -159,7 +159,7 @@ Page { ListNavigation { //% "Devices" text: qsTrId("ac-in-setup_devices") - allowed: productId.value == ProductInfo.ProductId_PowerBox_Smappee + preferredVisible: productId.value == ProductInfo.ProductId_PowerBox_Smappee onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/ac-in/PageSmappeeDeviceList.qml", { "bindPrefix": root.bindPrefix }) diff --git a/pages/settings/devicelist/ac-in/PageSmappeeCTList.qml b/pages/settings/devicelist/ac-in/PageSmappeeCTList.qml index 54ed67133..24dff5ea3 100644 --- a/pages/settings/devicelist/ac-in/PageSmappeeCTList.qml +++ b/pages/settings/devicelist/ac-in/PageSmappeeCTList.qml @@ -30,7 +30,7 @@ Page { //% "%1: %2" text: qsTrId("smappee_ct_list_type").arg(ctIndex + 1).arg(typeLookup.typeName) secondaryText: phase.value === undefined ? "" : "L%1".arg(phase.value + 1) - allowed: type.isValid + preferredVisible: type.isValid onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/ac-in/PageSmappeeCTSetup.qml", { "bindPrefix": root.bindPrefix, ctIndex: menu.ctIndex }) diff --git a/pages/settings/devicelist/battery/BatterySettingsAlarmModel.qml b/pages/settings/devicelist/battery/BatterySettingsAlarmModel.qml index 24999c9ce..feb56c49b 100644 --- a/pages/settings/devicelist/battery/BatterySettingsAlarmModel.qml +++ b/pages/settings/devicelist/battery/BatterySettingsAlarmModel.qml @@ -18,7 +18,7 @@ ObjectModel { slider.secondColor: Theme.color_green firstDataItem.uid: root.bindPrefix + "/Settings/Alarm/LowSoc" secondDataItem.uid: root.bindPrefix + "/Settings/Alarm/LowSocClear" - allowed: defaultAllowed && firstDataItem.isValid && secondDataItem.isValid + preferredVisible: firstDataItem.isValid && secondDataItem.isValid } ListRangeSlider { @@ -30,7 +30,7 @@ ObjectModel { slider.secondColor: Theme.color_green firstDataItem.uid: root.bindPrefix + "/Settings/Alarm/LowVoltage" secondDataItem.uid: root.bindPrefix + "/Settings/Alarm/LowVoltageClear" - allowed: defaultAllowed && firstDataItem.isValid && secondDataItem.isValid + preferredVisible: firstDataItem.isValid && secondDataItem.isValid } ListRangeSlider { @@ -42,7 +42,7 @@ ObjectModel { slider.secondColor: Theme.color_red firstDataItem.uid: root.bindPrefix + "/Settings/Alarm/HighVoltageClear" secondDataItem.uid: root.bindPrefix + "/Settings/Alarm/HighVoltage" - allowed: defaultAllowed && firstDataItem.isValid && secondDataItem.isValid + preferredVisible: firstDataItem.isValid && secondDataItem.isValid } ListRangeSlider { @@ -54,7 +54,7 @@ ObjectModel { slider.secondColor: Theme.color_green firstDataItem.uid: root.bindPrefix + "/Settings/Alarm/LowStarterVoltage" secondDataItem.uid: root.bindPrefix + "/Settings/Alarm/LowStarterVoltageClear" - allowed: defaultAllowed && firstDataItem.isValid && secondDataItem.isValid + preferredVisible: firstDataItem.isValid && secondDataItem.isValid } ListRangeSlider { @@ -66,7 +66,7 @@ ObjectModel { slider.secondColor: Theme.color_red firstDataItem.uid: root.bindPrefix + "/Settings/Alarm/HighStarterVoltageClear" secondDataItem.uid: root.bindPrefix + "/Settings/Alarm/HighStarterVoltage" - allowed: defaultAllowed && firstDataItem.isValid && secondDataItem.isValid + preferredVisible: firstDataItem.isValid && secondDataItem.isValid } ListRangeSlider { @@ -80,7 +80,7 @@ ObjectModel { secondDataItem.uid: root.bindPrefix + "/Settings/Alarm/LowBatteryTemperatureClear" secondDataItem.sourceUnit: Units.unitToVeUnit(VenusOS.Units_Temperature_Kelvin) secondDataItem.displayUnit: Units.unitToVeUnit(Global.systemSettings.temperatureUnit) - allowed: defaultAllowed && firstDataItem.isValid && secondDataItem.isValid + preferredVisible: firstDataItem.isValid && secondDataItem.isValid } ListRangeSlider { @@ -94,6 +94,6 @@ ObjectModel { secondDataItem.uid: root.bindPrefix + "/Settings/Alarm/HighBatteryTemperature" secondDataItem.sourceUnit: Units.unitToVeUnit(VenusOS.Units_Temperature_Kelvin) secondDataItem.displayUnit: Units.unitToVeUnit(Global.systemSettings.temperatureUnit) - allowed: defaultAllowed && firstDataItem.isValid && secondDataItem.isValid + preferredVisible: firstDataItem.isValid && secondDataItem.isValid } } diff --git a/pages/settings/devicelist/battery/BatterySettingsRelayModel.qml b/pages/settings/devicelist/battery/BatterySettingsRelayModel.qml index 67498ff12..380adc9fb 100644 --- a/pages/settings/devicelist/battery/BatterySettingsRelayModel.qml +++ b/pages/settings/devicelist/battery/BatterySettingsRelayModel.qml @@ -36,20 +36,20 @@ ObjectModel { //% "Always open (don't use the relay)" { display: qsTrId("batterysettingrelay_always_open_dont_use_the_relay"), value: 3 }, ] - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListSwitch { text: CommonWords.state dataItem.uid: root.bindPrefix + "/Relay/0/State" enabled: mode.dataItem.isValid && mode.dataItem.value === 2 - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } PrimaryListLabel { //% "Note that changing the Low state-of-charge setting also changes the Time-to-go discharge floor setting in the battery menu." text: qsTrId("batterysettingrelay_low_state_of_charge_setting_note") - allowed: dischargeFloorLinkedToRelay.isValid && dischargeFloorLinkedToRelay.value !== 0 && lowSoc.visible + preferredVisible: dischargeFloorLinkedToRelay.isValid && dischargeFloorLinkedToRelay.value !== 0 && lowSoc.visible VeQuickItem { id: dischargeFloorLinkedToRelay @@ -66,7 +66,7 @@ ObjectModel { slider.secondColor: Theme.color_green firstDataItem.uid: root.bindPrefix + "/Settings/Relay/LowSoc" secondDataItem.uid: root.bindPrefix + "/Settings/Relay/LowSocClear" - allowed: defaultAllowed && firstDataItem.isValid && secondDataItem.isValid && showSetting(0, 1) + preferredVisible: firstDataItem.isValid && secondDataItem.isValid && showSetting(0, 1) } ListRangeSlider { @@ -78,7 +78,7 @@ ObjectModel { slider.secondColor: Theme.color_green firstDataItem.uid: root.bindPrefix + "/Settings/Relay/LowVoltage" secondDataItem.uid: root.bindPrefix + "/Settings/Relay/LowVoltageClear" - allowed: defaultAllowed && firstDataItem.isValid && secondDataItem.isValid && showSetting(0, 1) + preferredVisible: firstDataItem.isValid && secondDataItem.isValid && showSetting(0, 1) } ListRangeSlider { @@ -90,7 +90,7 @@ ObjectModel { slider.secondColor: Theme.color_red firstDataItem.uid: root.bindPrefix + "/Settings/Relay/HighVoltageClear" secondDataItem.uid: root.bindPrefix + "/Settings/Relay/HighVoltage" - allowed: defaultAllowed && firstDataItem.isValid && secondDataItem.isValid && showSetting(0) + preferredVisible: firstDataItem.isValid && secondDataItem.isValid && showSetting(0) } ListRangeSlider { @@ -102,7 +102,7 @@ ObjectModel { slider.secondColor: Theme.color_green firstDataItem.uid: root.bindPrefix + "/Settings/Relay/LowStarterVoltage" secondDataItem.uid: root.bindPrefix + "/Settings/Relay/LowStarterVoltageClear" - allowed: defaultAllowed && firstDataItem.isValid && secondDataItem.isValid && showSetting(0) + preferredVisible: firstDataItem.isValid && secondDataItem.isValid && showSetting(0) } ListRangeSlider { @@ -114,14 +114,14 @@ ObjectModel { slider.secondColor: Theme.color_red firstDataItem.uid: root.bindPrefix + "/Settings/Relay/HighStarterVoltageClear" secondDataItem.uid: root.bindPrefix + "/Settings/Relay/HighStarterVoltage" - allowed: defaultAllowed && firstDataItem.isValid && secondDataItem.isValid && showSetting(0) + preferredVisible: firstDataItem.isValid && secondDataItem.isValid && showSetting(0) } ListSwitch { //% "Fuse blown" text: qsTrId("batterysettingrelay_fuse_blown") dataItem.uid: root.bindPrefix + "/Settings/Relay/FuseBlown" - allowed: defaultAllowed && dataItem.isValid && showSetting(0) + preferredVisible: dataItem.isValid && showSetting(0) } ListRangeSlider { @@ -135,7 +135,7 @@ ObjectModel { secondDataItem.uid: root.bindPrefix + "/Settings/Relay/LowBatteryTemperatureClear" secondDataItem.sourceUnit: Units.unitToVeUnit(VenusOS.Units_Temperature_Kelvin) secondDataItem.displayUnit: Units.unitToVeUnit(Global.systemSettings.temperatureUnit) - allowed: defaultAllowed && firstDataItem.isValid && secondDataItem.isValid && showSetting(0) + preferredVisible: firstDataItem.isValid && secondDataItem.isValid && showSetting(0) } ListRangeSlider { @@ -149,6 +149,6 @@ ObjectModel { secondDataItem.uid: root.bindPrefix + "/Settings/Relay/HighBatteryTemperature" secondDataItem.sourceUnit: Units.unitToVeUnit(VenusOS.Units_Temperature_Kelvin) secondDataItem.displayUnit: Units.unitToVeUnit(Global.systemSettings.temperatureUnit) - allowed: defaultAllowed && firstDataItem.isValid && secondDataItem.isValid && showSetting(0) + preferredVisible: firstDataItem.isValid && secondDataItem.isValid && showSetting(0) } } diff --git a/pages/settings/devicelist/battery/PageBattery.qml b/pages/settings/devicelist/battery/PageBattery.qml index c2eccb7ec..fbd860e1f 100644 --- a/pages/settings/devicelist/battery/PageBattery.qml +++ b/pages/settings/devicelist/battery/PageBattery.qml @@ -25,7 +25,7 @@ Page { ListRadioButtonGroup { text: CommonWords.switch_mode dataItem.uid: root.bindPrefix + "/Mode" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid optionModel: [ { display: CommonWords.off, value: 4, readOnly: true }, { display: CommonWords.standby, value: 0xfc }, @@ -36,7 +36,7 @@ Page { ListText { text: CommonWords.state dataItem.uid: root.bindPrefix + "/State" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid secondaryText: { if (!dataItem.isValid) { return "" @@ -84,7 +84,7 @@ Page { ListText { text: CommonWords.error dataItem.uid: root.bindPrefix + "/ErrorCode" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid secondaryText: BmsError.description(dataItem.value) } @@ -92,7 +92,7 @@ Page { //% "Battery bank error" text: qsTrId("battery_bank_error") dataItem.uid: root.bindPrefix + "/ErrorCode" - allowed: defaultAllowed && (errorComm.isValid || errorVoltage.isValid || errorNrOfBatteries.isValid || errorInvalidConfig.isValid) + preferredVisible: errorComm.isValid || errorVoltage.isValid || errorNrOfBatteries.isValid || errorInvalidConfig.isValid secondaryText: { if (errorComm.isValid && errorComm.value) { //% "Communication error" @@ -145,7 +145,7 @@ Page { //% "Total Capacity" text: qsTrId("devicelist_battery_total_capacity") dataItem.uid: root.bindPrefix + "/Capacity" - allowed: defaultAllowed && root.isParallelBms + preferredVisible: root.isParallelBms unit: VenusOS.Units_AmpHour } @@ -157,7 +157,7 @@ Page { //% "System voltage" text: qsTrId("devicelist_battery_system_voltage") dataItem.uid: BackendConnection.serviceUidFromName("com.victronenergy.battery.lynxparallel" + _n2kDeviceInstance.value, _n2kDeviceInstance.value) + "/Dc/0/Voltage" - allowed: defaultAllowed && !root.isParallelBms && batteryState.value === VenusOS.Battery_State_Pending + preferredVisible: !root.isParallelBms && batteryState.value === VenusOS.Battery_State_Pending unit: VenusOS.Units_Volt_DC VeQuickItem { @@ -171,7 +171,7 @@ Page { //% "Number of BMSes" text: qsTrId("devicelist_battery_number_of_bmses") dataItem.uid: root.bindPrefix + "/NumberOfBmses" - allowed: defaultAllowed && root.isParallelBms + preferredVisible: root.isParallelBms } ListQuantity { @@ -184,14 +184,14 @@ Page { //% "State of health" text: qsTrId("battery_state_of_health") dataItem.uid: root.bindPrefix + "/Soh" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid unit: VenusOS.Units_Percentage } ListTemperature { text: CommonWords.battery_temperature dataItem.uid: root.bindPrefix + "/Dc/0/Temperature" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid unit: Global.systemSettings.temperatureUnit } @@ -199,14 +199,14 @@ Page { //% "Air temperature" text: qsTrId("battery_air_temp") dataItem.uid: root.bindPrefix + "/AirTemperature" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListQuantity { //% "Starter voltage" text: qsTrId("battery_starter_voltage") dataItem.uid: root.bindPrefix + "/Dc/1/Voltage" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid unit: VenusOS.Units_Volt_DC } @@ -214,14 +214,14 @@ Page { //% "Bus voltage" text: qsTrId("battery_bus_voltage") dataItem.uid: root.bindPrefix + "/BusVoltage" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid unit: VenusOS.Units_Volt_DC } ListQuantity { //% "Top section voltage" text: qsTrId("battery_top_section_voltage") - allowed: midVoltage.isValid + preferredVisible: midVoltage.isValid value: midVoltage.isValid && batteryVoltage.isValid ? batteryVoltage.value - midVoltage.value : NaN unit: VenusOS.Units_Volt_DC } @@ -230,7 +230,7 @@ Page { //% "Bottom section voltage" text: qsTrId("battery_bottom_section_voltage") value: midVoltage.value === undefined ? NaN : midVoltage.value - allowed: midVoltage.isValid + preferredVisible: midVoltage.isValid unit: VenusOS.Units_Volt_DC } @@ -238,7 +238,7 @@ Page { //% "Mid-point deviation" text: qsTrId("battery_mid_point_deviation") dataItem.uid: root.bindPrefix + "/Dc/0/MidVoltageDeviation" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid unit: VenusOS.Units_Percentage } @@ -246,7 +246,7 @@ Page { //% "Consumed AmpHours" text: qsTrId("battery_consumed_amphours") dataItem.uid: root.bindPrefix + "/ConsumedAmphours" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid unit: VenusOS.Units_AmpHour } @@ -254,7 +254,7 @@ Page { //% "Bus voltage" text: qsTrId("battery_buss_voltage") dataItem.uid: root.bindPrefix + "/BussVoltage" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid unit: VenusOS.Units_Volt_DC } @@ -262,7 +262,7 @@ Page { //% "Time-to-go" text: qsTrId("battery_time_to_go") dataItem.uid: root.bindPrefix + "/TimeToGo" - allowed: defaultAllowed && dataItem.seen + preferredVisible: dataItem.seen secondaryText: Utils.secondsToString(dataItem.value) } @@ -277,7 +277,7 @@ Page { ListNavigation { //% "Details" text: qsTrId("battery_details") - allowed: defaultAllowed && batteryDetails.hasAllowedItem + preferredVisible: batteryDetails.hasAllowedItem onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageBatteryDetails.qml", { "title": text, "bindPrefix": root.bindPrefix, "details": batteryDetails }) @@ -291,7 +291,7 @@ Page { ListNavigation { text: CommonWords.alarms - allowed: !root.isParallelBms + preferredVisible: !root.isParallelBms onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageBatteryAlarms.qml", { "title": text, "bindPrefix": root.bindPrefix }) @@ -301,7 +301,7 @@ Page { ListNavigation { //% "Module level alarms" text: qsTrId("battery_module_level_alarms") - allowed: moduleAlarmModel.rowCount > 0 + preferredVisible: moduleAlarmModel.rowCount > 0 onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageBatteryModuleAlarms.qml", { "title": text, "bindPrefix": root.bindPrefix, alarmModel: moduleAlarmModel }) @@ -310,7 +310,7 @@ Page { ListNavigation { text: CommonWords.history - allowed: !isFiamm48TL && batteryHistory.hasAllowedItem + preferredVisible: !isFiamm48TL && batteryHistory.hasAllowedItem onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageBatteryHistory.qml", { "title": text, "bindPrefix": root.bindPrefix, "history": batteryHistory }) @@ -324,7 +324,7 @@ Page { ListNavigation { text: CommonWords.settings - allowed: hasSettings.value === 1 + preferredVisible: hasSettings.value === 1 onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageBatterySettings.qml", { "title": text, "bindPrefix": root.bindPrefix }) @@ -336,7 +336,7 @@ Page { //% "Diagnostics" text: qsTrId("battery_settings_diagnostics") - allowed: lastError.isValid + preferredVisible: lastError.isValid onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageLynxIonDiagnostics.qml", { "title": text, "bindPrefix": root.bindPrefix }) @@ -350,7 +350,7 @@ Page { ListNavigation { text: lynxIonDiagnostics.text - allowed: isFiamm48TL + preferredVisible: isFiamm48TL onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/battery/Page48TlDiagnostics.qml", @@ -361,7 +361,7 @@ Page { ListNavigation { //% "Fuses" text: qsTrId("battery_settings_fuses") - allowed: nrOfDistributors.isValid && nrOfDistributors.value > 0 + preferredVisible: nrOfDistributors.isValid && nrOfDistributors.value > 0 onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageLynxDistributorList.qml", @@ -377,7 +377,7 @@ Page { ListNavigation { //% "IO" text: qsTrId("battery_settings_io") - allowed: allowToCharge.isValid + preferredVisible: allowToCharge.isValid onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageLynxIonIo.qml", { "title": text, "bindPrefix": root.bindPrefix }) @@ -392,7 +392,7 @@ Page { ListNavigation { //% "System" text: qsTrId("battery_settings_system") - allowed: nrOfBatteries.isValid + preferredVisible: nrOfBatteries.isValid onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageLynxIonSystem.qml", { "title": text, "bindPrefix": root.bindPrefix }) @@ -415,7 +415,7 @@ Page { ListNavigation { //% "Parameters" text: qsTrId("battery_settings_parameters") - allowed: cvl.isValid || ccl.isValid || dcl.isValid + preferredVisible: cvl.isValid || ccl.isValid || dcl.isValid onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/battery/PageBatteryParameters.qml", { "title": text, "bindPrefix": root.bindPrefix }) @@ -443,7 +443,7 @@ Page { //% "Press to redetect" secondaryText: qsTrId("battery_press_to_redetect") enabled: redetect.value === 0 - allowed: redetect.isValid + preferredVisible: redetect.isValid writeAccessLevel: VenusOS.User_AccessType_User onClicked: { redetect.setValue(1) diff --git a/pages/settings/devicelist/battery/PageBatteryAlarms.qml b/pages/settings/devicelist/battery/PageBatteryAlarms.qml index 5b3f28fa9..23ec476fe 100644 --- a/pages/settings/devicelist/battery/PageBatteryAlarms.qml +++ b/pages/settings/devicelist/battery/PageBatteryAlarms.qml @@ -16,166 +16,166 @@ Page { ListAlarm { text: CommonWords.low_battery_voltage dataItem.uid: root.bindPrefix + "/Alarms/LowVoltage" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "High battery voltage" text: qsTrId("batteryalarms_high_battery_voltage") dataItem.uid: root.bindPrefix + "/Alarms/HighVoltage" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "High cell voltage" text: qsTrId("batteryalarms_high_cell_voltage") dataItem.uid: root.bindPrefix + "/Alarms/HighCellVoltage" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "High charge current" text: qsTrId("batteryalarms_high_charge_current") dataItem.uid: root.bindPrefix + "/Alarms/HighChargeCurrent" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "High current" text: qsTrId("batteryalarms_high_current") dataItem.uid: root.bindPrefix + "/Alarms/HighCurrent" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "High discharge current" text: qsTrId("batteryalarms_high_discharge_current") dataItem.uid: root.bindPrefix + "/Alarms/HighDischargeCurrent" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "Low SOC" text: qsTrId("batteryalarms_low_soc") dataItem.uid: root.bindPrefix + "/Alarms/LowSoc" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "State of health" text: qsTrId("batteryalarms_state_of_health") dataItem.uid: root.bindPrefix + "/Alarms/StateOfHealth" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "Low starter voltage" text: qsTrId("batteryalarms_low_starter_voltage") dataItem.uid: root.bindPrefix + "/Alarms/LowStarterVoltage" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "High starter voltage" text: qsTrId("batteryalarms_high_starter_voltage") dataItem.uid: root.bindPrefix + "/Alarms/HighStarterVoltage" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { text: CommonWords.low_temperature dataItem.uid: root.bindPrefix + "/Alarms/LowTemperature" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { text: CommonWords.high_temperature dataItem.uid: root.bindPrefix + "/Alarms/HighTemperature" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "Battery temperature sensor" text: qsTrId("batteryalarms_battery_temperature_sensor") dataItem.uid: root.bindPrefix + "/Alarms/BatteryTemperatureSensor" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "Mid-point voltage" text: qsTrId("batteryalarms_mid_point_voltage") dataItem.uid: root.bindPrefix + "/Alarms/MidVoltage" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "Fuse blown" text: qsTrId("batteryalarms_fuse_blown") dataItem.uid: root.bindPrefix + "/Alarms/FuseBlown" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "High internal temperature" text: qsTrId("batteryalarms_high_internal_temperature") dataItem.uid: root.bindPrefix + "/Alarms/HighInternalTemperature" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "Low charge temperature" text: qsTrId("batteryalarms_low_charge_temperature") dataItem.uid: root.bindPrefix + "/Alarms/LowChargeTemperature" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "High charge temperature" text: qsTrId("batteryalarms_high_charge_temperature") dataItem.uid: root.bindPrefix + "/Alarms/HighChargeTemperature" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "Internal failure" text: qsTrId("batteryalarms_internal_failure") dataItem.uid: root.bindPrefix + "/Alarms/InternalFailure" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "Circuit breaker tripped" text: qsTrId("batteryalarms_circuit_breaker_tripped") dataItem.uid: Global.system.serviceUid + "/Dc/Battery/Alarms/CircuitBreakerTripped" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "Cell imbalance" text: qsTrId("batteryalarms_cell_imbalance") dataItem.uid: root.bindPrefix + "/Alarms/CellImbalance" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "Low cell voltage" text: qsTrId("batteryalarms_low_cell_voltage") dataItem.uid: root.bindPrefix + "/Alarms/LowCellVoltage" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "BMS cable fault" text: qsTrId("batteryalarms_bms_cable") dataItem.uid: root.bindPrefix + "/Alarms/BmsCable" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { //% "Bad contactor" text: qsTrId("batteryalarms_contactor") dataItem.uid: root.bindPrefix + "/Alarms/Contactor" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } } } diff --git a/pages/settings/devicelist/battery/PageBatteryDetails.qml b/pages/settings/devicelist/battery/PageBatteryDetails.qml index b41d47d15..c5480ba97 100644 --- a/pages/settings/devicelist/battery/PageBatteryDetails.qml +++ b/pages/settings/devicelist/battery/PageBatteryDetails.qml @@ -21,7 +21,7 @@ Page { { value: details.minVoltageCellId.value, visible: details.minVoltageCellId.isValid }, { value: details.minCellVoltage.value, unit: VenusOS.Units_Volt_DC, precision: 3 }, ] - allowed: defaultAllowed && details.allowsLowestCellVoltage + preferredVisible: details.allowsLowestCellVoltage } ListQuantityGroup { @@ -31,7 +31,7 @@ Page { { value: details.maxVoltageCellId.value, visible: details.maxVoltageCellId.isValid }, { value: details.maxCellVoltage.value, unit: VenusOS.Units_Volt_DC, precision: 3 }, ] - allowed: defaultAllowed && details.allowsHighestCellVoltage + preferredVisible: details.allowsHighestCellVoltage } ListQuantityGroup { @@ -46,7 +46,7 @@ Page { unit: Global.systemSettings.temperatureUnit } ] - allowed: defaultAllowed && details.allowsMinimumCellTemperature + preferredVisible: details.allowsMinimumCellTemperature } ListQuantityGroup { @@ -61,7 +61,7 @@ Page { unit: Global.systemSettings.temperatureUnit } ] - allowed: defaultAllowed && details.allowsMaximumCellTemperature + preferredVisible: details.allowsMaximumCellTemperature } ListTextGroup { @@ -75,14 +75,14 @@ Page { //% "%1 offline" details.modulesOffline.isValid ? qsTrId("devicelist_batterydetails_modules_offline").arg(details.modulesOffline.value) : "--" ] - allowed: defaultAllowed && details.allowsBatteryModules + preferredVisible: details.allowsBatteryModules } ListTextGroup { //% "Number of modules blocking charge / discharge" text: qsTrId("batterydetails_number_of_modules_blocking_charge_discharge") textModel: [ details.nrOfModulesBlockingCharge.value, details.nrOfModulesBlockingDischarge.value ] - allowed: defaultAllowed && details.allowsNumberOfModulesBlockingChargeDischarge + preferredVisible: details.allowsNumberOfModulesBlockingChargeDischarge } ListQuantityGroup { @@ -92,14 +92,14 @@ Page { { value: details.installedCapacity.value, unit: VenusOS.Units_AmpHour }, { value: details.capacity.value, unit: VenusOS.Units_AmpHour } ] - allowed: defaultAllowed && details.allowsCapacity + preferredVisible: details.allowsCapacity } ListTextGroup { //% "Connection information" text: qsTrId("batterydetails_connection_information") textModel: [ details.connectionInformation.value ] - allowed: defaultAllowed && details.connectionInformation.isValid + preferredVisible: details.connectionInformation.isValid } } } diff --git a/pages/settings/devicelist/battery/PageBatteryHistory.qml b/pages/settings/devicelist/battery/PageBatteryHistory.qml index 3c17f488a..1ecf94dde 100644 --- a/pages/settings/devicelist/battery/PageBatteryHistory.qml +++ b/pages/settings/devicelist/battery/PageBatteryHistory.qml @@ -17,163 +17,163 @@ Page { ListQuantity { //% "Deepest discharge" text: qsTrId("batteryalarms_deepest_discharge") - allowed: defaultAllowed && root.history.allowsDeepestDischarge + preferredVisible: root.history.allowsDeepestDischarge unit: VenusOS.Units_AmpHour - value: allowed ? root.history.deepestDischarge.value : NaN + value: preferredVisible ? root.history.deepestDischarge.value : NaN } ListQuantity { //% "Last discharge" text: qsTrId("batteryhistory_last_discharge") - allowed: defaultAllowed && root.history.allowsLastDischarge + preferredVisible: root.history.allowsLastDischarge unit: VenusOS.Units_AmpHour - value: allowed ? root.history.lastDischarge.value : NaN + value: preferredVisible ? root.history.lastDischarge.value : NaN } ListQuantity { //% "Average discharge" text: qsTrId("batteryhistory_average_discharge") - allowed: defaultAllowed && root.history.allowsAverageDischarge + preferredVisible: root.history.allowsAverageDischarge unit: VenusOS.Units_AmpHour - value: allowed ? root.history.averageDischarge.value : NaN + value: preferredVisible ? root.history.averageDischarge.value : NaN } ListText { //% "Total charge cycles" text: qsTrId("batteryhistory_total_charge_cycles") - allowed: defaultAllowed && root.history.allowsChargeCycles - secondaryText: allowed ? root.history.chargeCycles.value : "" + preferredVisible: root.history.allowsChargeCycles + secondaryText: preferredVisible ? root.history.chargeCycles.value : "" } ListText { //% "Number of full discharges" text: qsTrId("batteryhistory_number_of_full_discharges") - allowed: defaultAllowed && root.history.allowsFullDischarges - secondaryText: allowed ? root.history.fullDischarges.value : "" + preferredVisible: root.history.allowsFullDischarges + secondaryText: preferredVisible ? root.history.fullDischarges.value : "" } ListQuantity { //% "Cumulative Ah drawn" text: qsTrId("batteryhistory_cumulative_ah_drawn") - allowed: defaultAllowed && root.history.allowsTotalAhDrawn + preferredVisible: root.history.allowsTotalAhDrawn unit: VenusOS.Units_AmpHour - value: allowed ? root.history.totalAhDrawn.value : NaN + value: preferredVisible ? root.history.totalAhDrawn.value : NaN } ListQuantity { text: CommonWords.minimum_voltage - allowed: defaultAllowed && root.history.allowsMinimumVoltage + preferredVisible: root.history.allowsMinimumVoltage unit: VenusOS.Units_Volt_DC - value: allowed ? root.history.minimumVoltage.value : NaN + value: preferredVisible ? root.history.minimumVoltage.value : NaN } ListQuantity { text: CommonWords.maximum_voltage - allowed: defaultAllowed && root.history.allowsMaximumVoltage + preferredVisible: root.history.allowsMaximumVoltage unit: VenusOS.Units_Volt_DC - value: allowed ? root.history.maximumVoltage.value : NaN + value: preferredVisible ? root.history.maximumVoltage.value : NaN } ListQuantity { //% "Minimum cell voltage" text: qsTrId("batteryhistory_minimum_cell_voltage") - allowed: defaultAllowed && root.history.allowsMinimumCellVoltage + preferredVisible: root.history.allowsMinimumCellVoltage unit: VenusOS.Units_Volt_DC - value: allowed ? root.history.minimumCellVoltage.value : NaN + value: preferredVisible ? root.history.minimumCellVoltage.value : NaN precision: 3 } ListQuantity { //% "Maximum cell voltage" text: qsTrId("batteryhistory_maximum_cell_voltage") - allowed: defaultAllowed && root.history.allowsMaximumCellVoltage + preferredVisible: root.history.allowsMaximumCellVoltage unit: VenusOS.Units_Volt_DC - value: allowed ? root.history.maximumCellVoltage.value : NaN + value: preferredVisible ? root.history.maximumCellVoltage.value : NaN precision: 3 } ListText { //% "Time since last full charge" text: qsTrId("batteryhistory_time_since_last_full_charge") - allowed: defaultAllowed && root.history.allowsTimeSinceLastFullCharge - secondaryText: allowed ? Utils.secondsToString(root.history.timeSinceLastFullCharge.value) : "" + preferredVisible: root.history.allowsTimeSinceLastFullCharge + secondaryText: preferredVisible ? Utils.secondsToString(root.history.timeSinceLastFullCharge.value) : "" } ListText { //% "Synchronisation count" text: qsTrId("batteryhistory_synchronisation_count") - allowed: defaultAllowed && root.history.allowsAutomaticSyncs - secondaryText: allowed ? root.history.automaticSyncs.value : "" + preferredVisible: root.history.allowsAutomaticSyncs + secondaryText: preferredVisible ? root.history.automaticSyncs.value : "" } ListText { text: CommonWords.low_voltage_alarms - allowed: defaultAllowed && root.history.allowsLowVoltageAlarms - secondaryText: allowed ? root.history.lowVoltageAlarms.value : "" + preferredVisible: root.history.allowsLowVoltageAlarms + secondaryText: preferredVisible ? root.history.lowVoltageAlarms.value : "" } ListText { text: CommonWords.high_voltage_alarms - allowed: defaultAllowed && root.history.allowsHighVoltageAlarms - secondaryText: allowed ? root.history.highVoltageAlarms.value : "" + preferredVisible: root.history.allowsHighVoltageAlarms + secondaryText: preferredVisible ? root.history.highVoltageAlarms.value : "" } ListText { //% "Low starter battery voltage alarms" text: qsTrId("batteryhistory_low_starter_bat_voltage_alarms") - allowed: defaultAllowed && root.history.allowsLowStarterVoltageAlarms - secondaryText: allowed ? root.history.lowStarterVoltageAlarms.value : "" + preferredVisible: root.history.allowsLowStarterVoltageAlarms + secondaryText: preferredVisible ? root.history.lowStarterVoltageAlarms.value : "" } ListText { //% "High starter battery voltage alarms" text: qsTrId("batteryhistory_high_starter_bat_voltage_alarms") - allowed: defaultAllowed && root.history.allowsHighStarterVoltageAlarms - secondaryText: allowed ? root.history.highStarterVoltageAlarms.value : "" + preferredVisible: root.history.allowsHighStarterVoltageAlarms + secondaryText: preferredVisible ? root.history.highStarterVoltageAlarms.value : "" } ListQuantity { //% "Minimum starter battery voltage" text: qsTrId("batteryhistory_minimum_starter_bat_voltage") - allowed: defaultAllowed && root.history.allowsMinimumStarterVoltage - value: allowed ? root.history.minimumStarterVoltage.value : NaN + preferredVisible: root.history.allowsMinimumStarterVoltage + value: preferredVisible ? root.history.minimumStarterVoltage.value : NaN unit: VenusOS.Units_Volt_DC } ListQuantity { //% "Maximum starter battery voltage" text: qsTrId("batteryhistory_maximum_starter_bat_voltage") - allowed: defaultAllowed && root.history.allowsMaximumStarterVoltage - value: allowed ? root.history.maximumStarterVoltage.value : NaN + preferredVisible: root.history.allowsMaximumStarterVoltage + value: preferredVisible ? root.history.maximumStarterVoltage.value : NaN unit: VenusOS.Units_Volt_DC } ListTemperature { text: CommonWords.minimum_temperature - allowed: defaultAllowed && root.history.allowsMinimumTemperature - value: allowed ? root.history.minimumTemperature.value : NaN + preferredVisible: root.history.allowsMinimumTemperature + value: preferredVisible ? root.history.minimumTemperature.value : NaN } ListTemperature { text: CommonWords.maximum_temperature - allowed: defaultAllowed && root.history.allowsMaximumTemperature - value: allowed ? root.history.maximumTemperature.value : NaN + preferredVisible: root.history.allowsMaximumTemperature + value: preferredVisible ? root.history.maximumTemperature.value : NaN } ListQuantity { //% "Discharged energy" text: qsTrId("batteryhistory_discharged_energy") - allowed: defaultAllowed && root.history.allowsDischargedEnergy + preferredVisible: root.history.allowsDischargedEnergy unit: VenusOS.Units_Energy_KiloWattHour - value: allowed ? root.history.dischargedEnergy.value : NaN + value: preferredVisible ? root.history.dischargedEnergy.value : NaN } ListQuantity { //% "Charged energy" text: qsTrId("batteryhistory_charged_energy") - allowed: defaultAllowed && root.history.allowsChargedEnergy + preferredVisible: root.history.allowsChargedEnergy unit: VenusOS.Units_Energy_KiloWattHour - value: allowed ? root.history.chargedEnergy.value : NaN + value: preferredVisible ? root.history.chargedEnergy.value : NaN } ListResetHistory { diff --git a/pages/settings/devicelist/battery/PageBatterySettings.qml b/pages/settings/devicelist/battery/PageBatterySettings.qml index e73d03500..169139783 100644 --- a/pages/settings/devicelist/battery/PageBatterySettings.qml +++ b/pages/settings/devicelist/battery/PageBatterySettings.qml @@ -44,7 +44,7 @@ Page { ListNavigation { text: CommonWords.alarms - allowed: alarmSettingsMonitor.hasVisibleItem + preferredVisible: alarmSettingsMonitor.hasVisibleItem onClicked: { Global.pageManager.pushPage(emptySettingsComponent, { "title": text, "model": batterySettingsAlarmModel }) @@ -54,7 +54,7 @@ Page { ListNavigation { //% "Relay (on battery monitor)" text: qsTrId("batterysettings_relay_on_battery_monitor") - allowed: relaySettingsMonitor.hasVisibleItem + preferredVisible: relaySettingsMonitor.hasVisibleItem onClicked: { Global.pageManager.pushPage(emptySettingsComponent, { "title": text, "model": batterySettingsRelayModel }) @@ -66,7 +66,7 @@ Page { text: qsTrId("batterysettings_restore_factory_defaults") //% "Press to restore" secondaryText: qsTrId("batterysettings_press_to_restore") - allowed: defaultAllowed && restoreDefaults.isValid + preferredVisible: restoreDefaults.isValid onClicked: Global.dialogLayer.open(confirmationDialogComponent) Component { @@ -92,7 +92,7 @@ Page { //% "Bluetooth Enabled" text: qsTrId("batterysettings_bluetooth_enabled") dataItem.uid: root.bindPrefix + "/Settings/BluetoothMode" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } } } diff --git a/pages/settings/devicelist/battery/PageBatterySettingsBattery.qml b/pages/settings/devicelist/battery/PageBatterySettingsBattery.qml index 140cdd10f..6afdba2ef 100644 --- a/pages/settings/devicelist/battery/PageBatterySettingsBattery.qml +++ b/pages/settings/devicelist/battery/PageBatterySettingsBattery.qml @@ -31,13 +31,13 @@ Page { //% "48 Volt" { display: qsTrId("batterysettingsbattery_48_volt"), value: 48 }, ] - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListSpinBox { //% "Capacity" text: qsTrId("batterysettingsbattery_capacity") - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid enabled: !root.locked dataItem.uid: root.bindPrefix + "/Settings/Battery/Capacity" suffix: "Ah" @@ -46,7 +46,7 @@ Page { ListSpinBox { //% "Charged voltage" text: qsTrId("batterysettingsbattery_charged_voltage") - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid enabled: !root.locked dataItem.uid: root.bindPrefix + "/Settings/Battery/ChargedVoltage" suffix: "V" @@ -58,7 +58,7 @@ Page { //% "Tail current" text: qsTrId("batterysettingsbattery_tail_current") enabled: !root.locked - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: root.bindPrefix + "/Settings/Battery/TailCurrent" suffix: "%" decimals: 1 @@ -69,7 +69,7 @@ Page { //% "Charged detection time" text: qsTrId("batterysettingsbattery_charged_detection_time") enabled: !root.locked - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: root.bindPrefix + "/Settings/Battery/ChargedDetectionTime" suffix: "min" } @@ -78,7 +78,7 @@ Page { //% "Peukert exponent" text: qsTrId("batterysettingsbattery_peukert_exponent") enabled: !root.locked - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: root.bindPrefix + "/Settings/Battery/PeukertExponent" decimals: 2 stepSize: 0.01 @@ -88,7 +88,7 @@ Page { //% "Charge efficiency factor" text: qsTrId("batterysettingsbattery_charge_efficiency_factor") enabled: !root.locked - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: root.bindPrefix + "/Settings/Battery/ChargeEfficiency" suffix: "%" } @@ -97,7 +97,7 @@ Page { //% "Current threshold" text: qsTrId("batterysettingsbattery_current_threshold") enabled: !root.locked - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: root.bindPrefix + "/Settings/Battery/CurrentThreshold" suffix: Units.defaultUnitString(VenusOS.Units_Amp) decimals: 2 @@ -108,7 +108,7 @@ Page { //% "Time-to-go averaging period" text: qsTrId("batterysettingsbattery_time_to_go_averaging_period") enabled: !root.locked - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: root.bindPrefix + "/Settings/Battery/TTGAveragingPeriod" suffix: "min" } @@ -116,7 +116,7 @@ Page { PrimaryListLabel { //% "Note that changing the Time-to-go discharge floor setting also changes the Low state-of-charge setting in the relay menu." text: qsTrId("batterysettingsbattery_time_to_go_discharge_note") - allowed: dischargeFloorLinkedToRelay.isValid && dischargeFloorLinkedToRelay.value !== 0 + preferredVisible: dischargeFloorLinkedToRelay.isValid && dischargeFloorLinkedToRelay.value !== 0 VeQuickItem { id: dischargeFloorLinkedToRelay @@ -128,7 +128,7 @@ Page { //% "Time-to-go discharge floor" text: qsTrId("batterysettingsbattery_time_to_go_discharge_floor") enabled: !root.locked - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: root.bindPrefix + "/Settings/Battery/DischargeFloor" suffix: "%" } @@ -137,7 +137,7 @@ Page { //% "Current offset" text: qsTrId("batterysettingsbattery_current_offset") dataItem.uid: root.bindPrefix + "/Settings/Battery/CurrentOffset" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListButton { @@ -147,7 +147,7 @@ Page { secondaryText: qsTrId("batterysettingsbattery_press_to_sync") enabled: !root.locked onClicked: sync.setValue(1) - allowed: sync.isValid + preferredVisible: sync.isValid VeQuickItem { id: sync @@ -161,7 +161,7 @@ Page { //% "Press to set to 0" secondaryText: qsTrId("batterysettingsbattery_press_to_set_to_0") onClicked: zero.setValue(1) - allowed: zero.isValid + preferredVisible: zero.isValid VeQuickItem { id: zero diff --git a/pages/settings/devicelist/battery/PageLynxDistributorList.qml b/pages/settings/devicelist/battery/PageLynxDistributorList.qml index 516e0b4e6..4fa692ba8 100644 --- a/pages/settings/devicelist/battery/PageLynxDistributorList.qml +++ b/pages/settings/devicelist/battery/PageLynxDistributorList.qml @@ -35,7 +35,7 @@ Page { //% "Distributor %1" text: qsTrId("batterylynxdistibutor_distributor").arg(distributor) - allowed: status.isValid && status.value !== 0 + preferredVisible: status.isValid && status.value !== 0 secondaryText: { if (!status.isValid) { return "--" @@ -82,7 +82,7 @@ Page { header: PrimaryListLabel { //% "No information available, see previous page for Distributor status." text: qsTrId("lynxdistributor_no_information_available") - allowed: !distributorDelegate.connected + preferredVisible: !distributorDelegate.connected } model: distributorDelegate.connected ? distributorDelegate.fuseInfoList : 0 delegate: ListText { @@ -105,7 +105,7 @@ Page { } } // First 4 fuses are always visible; last 4 only shown if status is valid. - allowed: model.index < 4 ? defaultAllowed : defaultAllowed && fuseStatus >= 0 + preferredVisible: model.index < 4 ? true : fuseStatus >= 0 } } } diff --git a/pages/settings/devicelist/battery/PageLynxIonDiagnostics.qml b/pages/settings/devicelist/battery/PageLynxIonDiagnostics.qml index cba50f79b..fa02a57cb 100644 --- a/pages/settings/devicelist/battery/PageLynxIonDiagnostics.qml +++ b/pages/settings/devicelist/battery/PageLynxIonDiagnostics.qml @@ -17,7 +17,7 @@ Page { //% "Shutdowns due error" text: qsTrId("lynxiondiagnostics_shutdowns_due_error") dataItem.uid: root.bindPrefix + "/Diagnostics/ShutDownsDueError" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } Column { diff --git a/pages/settings/devicelist/battery/PageLynxIonIo.qml b/pages/settings/devicelist/battery/PageLynxIonIo.qml index 1970619b9..5b2d89d45 100644 --- a/pages/settings/devicelist/battery/PageLynxIonIo.qml +++ b/pages/settings/devicelist/battery/PageLynxIonIo.qml @@ -36,7 +36,7 @@ Page { //% "External relay" text: qsTrId("lynxionio_external_relay") dataItem.uid: root.bindPrefix + "/Io/ExternalRelay" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid secondaryText: CommonWords.activeOrInactive(dataItem.value) } @@ -44,7 +44,7 @@ Page { //% "Programmable Contact" text: qsTrId("lynxionio_programmable_contact") dataItem.uid: root.bindPrefix + "/Io/ProgrammableContact" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid secondaryText: CommonWords.activeOrInactive(dataItem.value) } } diff --git a/pages/settings/devicelist/battery/PageLynxIonSystem.qml b/pages/settings/devicelist/battery/PageLynxIonSystem.qml index 6126fe2d7..a9469c356 100644 --- a/pages/settings/devicelist/battery/PageLynxIonSystem.qml +++ b/pages/settings/devicelist/battery/PageLynxIonSystem.qml @@ -17,7 +17,7 @@ Page { //% "Capacity" text: qsTrId("lynxionsystem_capacity") dataItem.uid: root.bindPrefix + "/Capacity" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListText { @@ -50,7 +50,7 @@ Page { { value: minCellVoltage.value, unit: VenusOS.Units_Volt_DC, precision: 3 }, { value: maxCellVoltage.value, unit: VenusOS.Units_Volt_DC, precision: 3 }, ] - allowed: minCellVoltage.isValid && maxCellVoltage.isValid + preferredVisible: minCellVoltage.isValid && maxCellVoltage.isValid VeQuickItem { id: minCellVoltage @@ -76,7 +76,7 @@ Page { unit: Global.systemSettings.temperatureUnit } ] - allowed: minCellTemperature.isValid && maxCellTemperature.isValid + preferredVisible: minCellTemperature.isValid && maxCellTemperature.isValid VeQuickItem { id: minCellTemperature @@ -93,7 +93,7 @@ Page { //% "Balancing" text: qsTrId("lynxionsystem_balancing") dataItem.uid: root.bindPrefix + "/Balancing" - allowed: defaultAllowed && dataItem.seen + preferredVisible: dataItem.seen secondaryText: CommonWords.activeOrInactive(dataItem.value) } @@ -101,7 +101,7 @@ Page { //% "Balancer status" text: qsTrId("lynxionsystem_balancer_status") dataItem.uid: root.bindPrefix + "/Balancer/Status" - allowed: defaultAllowed && dataItem.seen + preferredVisible: dataItem.seen secondaryText: { switch (dataItem.value) { case VenusOS.Battery_Balancer_Balanced: diff --git a/pages/settings/devicelist/dc-in/PageAlternatorModel.qml b/pages/settings/devicelist/dc-in/PageAlternatorModel.qml index be6f8ba03..4c1fb1984 100644 --- a/pages/settings/devicelist/dc-in/PageAlternatorModel.qml +++ b/pages/settings/devicelist/dc-in/PageAlternatorModel.qml @@ -16,7 +16,7 @@ ObjectModel { dataItem.uid: root.bindPrefix + "/Mode" valueTrue: 1 valueFalse: 4 - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListDcInputQuantityGroup { @@ -31,13 +31,13 @@ ObjectModel { //% "Alternator Temperature" text: qsTrId("alternator_temperature") dataItem.uid: root.bindPrefix + "/Dc/0/Temperature" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListText { text: CommonWords.state secondaryText: Global.system.systemStateToText(dataItem.value) - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: root.bindPrefix + "/State" } @@ -45,20 +45,20 @@ ObjectModel { text: CommonWords.network_status secondaryText: Global.systemSettings.networkStatusToText(dataItem.value) dataItem.uid: root.bindPrefix + "/Link/NetworkStatus" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListText { text: CommonWords.error dataItem.uid: root.bindPrefix + "/ErrorCode" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid secondaryText: dataItem.isValid ? ChargerError.description(dataItem.value) : dataItem.invalidText } ListText { text: CommonWords.error dataItem.uid: root.bindPrefix + "/Error/0/Id" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid secondaryText: dataItem.isValid ? AlternatorError.description(dataItem.value) : dataItem.invalidText } @@ -67,7 +67,7 @@ ObjectModel { text: qsTrId("alternator_wakespeed_field_drive") dataItem.uid: root.bindPrefix + "/FieldDrive" unit: VenusOS.Units_Percentage - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListQuantity { @@ -75,14 +75,14 @@ ObjectModel { text: qsTrId("alternator_wakespeed_utilization") dataItem.uid: root.bindPrefix + "/Utilization" unit: VenusOS.Units_Percentage - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListQuantity { text: CommonWords.speed dataItem.uid: root.bindPrefix + "/Speed" unit: VenusOS.Units_RevolutionsPerMinute - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListQuantity { @@ -90,19 +90,19 @@ ObjectModel { text: qsTrId("alternator_wakespeed_engine_speed") dataItem.uid: root.bindPrefix + "/Engine/Speed" unit: VenusOS.Units_RevolutionsPerMinute - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListTemperature { //% "Engine Temperature" text: qsTrId("engine_temperature") dataItem.uid: root.bindPrefix + "/Engine/Temperature" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListNavigation { text: CommonWords.overall_history - allowed: overallHistoryMonitor.hasVisibleItem + preferredVisible: overallHistoryMonitor.hasVisibleItem onClicked: { Global.pageManager.pushPage(overallHistoryComponent, { "title": text }) } @@ -121,7 +121,7 @@ ObjectModel { text: qsTrId("alternator_wakespeed_operation_time") secondaryText: Utils.secondsToString(dataItem.value, true) dataItem.uid: root.bindPrefix + "/History/Cumulative/User/OperationTime" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListQuantity { @@ -130,35 +130,35 @@ ObjectModel { dataItem.uid: root.bindPrefix + "/History/Cumulative/User/ChargedAh" unit: VenusOS.Units_AmpHour precision: 0 - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListText { //% "Cycles started" text: qsTrId("alternator_wakespeed_cycles_started") dataItem.uid: root.bindPrefix + "/History/Cumulative/User/CyclesStarted" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListText { //% "Cycles completed" text: qsTrId("alternator_wakespeed_cycles_completed") dataItem.uid: root.bindPrefix + "/History/Cumulative/User/CyclesCompleted" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListText { //% "Number of power-ups" text: qsTrId("alternator_wakespeed_nr_of_power_ups") dataItem.uid: root.bindPrefix + "/History/Cumulative/User/NrOfPowerups" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListText { //% "Number of deep discharges" text: qsTrId("alternator_wakespeed_nr_of_deep_discharges") dataItem.uid: root.bindPrefix + "/History/Cumulative/User/NrOfDeepDischarges" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } } @@ -176,7 +176,7 @@ ObjectModel { ListNavigation { //% "Charge cycle history" text: qsTrId("alternator_wakespeed_charge_cycle_history") - allowed: historyCyclesAvailable.isValid + preferredVisible: historyCyclesAvailable.isValid onClicked: { Global.pageManager.pushPage(chargeHistoryComponent, { "title": text }) } diff --git a/pages/settings/devicelist/dc-in/PageDcDcConverter.qml b/pages/settings/devicelist/dc-in/PageDcDcConverter.qml index 175d10134..e0b3d95c1 100644 --- a/pages/settings/devicelist/dc-in/PageDcDcConverter.qml +++ b/pages/settings/devicelist/dc-in/PageDcDcConverter.qml @@ -25,7 +25,7 @@ Page { dataItem.uid: root.bindPrefix + "/Mode" valueTrue: 1 valueFalse: 4 - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListDcInputQuantityGroup { @@ -39,7 +39,7 @@ Page { ListTemperature { text: CommonWords.battery_temperature dataItem.uid: root.bindPrefix + "/Dc/0/Temperature" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid unit: Global.systemSettings.temperatureUnit } diff --git a/pages/settings/devicelist/dc-in/PageDcMeterAlarms.qml b/pages/settings/devicelist/dc-in/PageDcMeterAlarms.qml index b883b1cdc..03ff39a42 100644 --- a/pages/settings/devicelist/dc-in/PageDcMeterAlarms.qml +++ b/pages/settings/devicelist/dc-in/PageDcMeterAlarms.qml @@ -15,7 +15,7 @@ Page { header: PrimaryListLabel { //% "No alarms" text: qsTrId("dcmeter_alarms_no_alarms") - allowed: !lowVoltage.visible + preferredVisible: !lowVoltage.visible && !highVoltage.visible && !lowAuxVoltage.visible && !highAuxVoltage.visible @@ -30,7 +30,7 @@ Page { //% "Low voltage" text: qsTrId("dcmeter_alarms_low_voltage") dataItem.uid: root.bindPrefix + "/Alarms/LowVoltage" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { @@ -39,7 +39,7 @@ Page { //% "High voltage" text: qsTrId("dcmeter_alarms_high_voltage") dataItem.uid: root.bindPrefix + "/Alarms/HighVoltage" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { @@ -48,7 +48,7 @@ Page { //% "Low aux voltage" text: qsTrId("dcmeter_alarms_low_aux_voltage") dataItem.uid: root.bindPrefix + "/Alarms/LowStarterVoltage" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { @@ -57,7 +57,7 @@ Page { //% "High aux voltage" text: qsTrId("dcmeter_alarms_high_aux_voltage") dataItem.uid: root.bindPrefix + "/Alarms/HighStarterVoltage" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { @@ -65,7 +65,7 @@ Page { text: CommonWords.low_temperature dataItem.uid: root.bindPrefix + "/Alarms/LowTemperature" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { @@ -73,7 +73,7 @@ Page { text: CommonWords.high_temperature dataItem.uid: root.bindPrefix + "/Alarms/HighTemperature" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } } } diff --git a/pages/settings/devicelist/dc-in/PageDcMeterHistory.qml b/pages/settings/devicelist/dc-in/PageDcMeterHistory.qml index 20e50b063..57b4a3ab6 100644 --- a/pages/settings/devicelist/dc-in/PageDcMeterHistory.qml +++ b/pages/settings/devicelist/dc-in/PageDcMeterHistory.qml @@ -29,48 +29,48 @@ Page { ListQuantity { text: CommonWords.minimum_voltage dataItem.uid: root.bindPrefix + "/History/MinimumVoltage" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid unit: VenusOS.Units_Volt_DC } ListQuantity { text: CommonWords.maximum_voltage dataItem.uid: root.bindPrefix + "/History/MaximumVoltage" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid unit: VenusOS.Units_Volt_DC } ListText { text: CommonWords.low_voltage_alarms dataItem.uid: root.bindPrefix + "/History/LowVoltageAlarms" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListText { text: CommonWords.high_voltage_alarms dataItem.uid: root.bindPrefix + "/History/HighVoltageAlarms" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListText { //% "Low aux voltage alarms" text: qsTrId("dcmeter_history_low_aux_voltage_alarms") dataItem.uid: visible ? root.bindPrefix + "/History/LowStarterVoltageAlarms" : "" - allowed: defaultAllowed && root.showStarterVoltage + preferredVisible: root.showStarterVoltage } ListText { //% "High aux voltage alarms" text: qsTrId("dcmeter_history_high_aux_voltage_alarms") dataItem.uid: visible ? root.bindPrefix + "/History/HighStarterVoltageAlarms" : "" - allowed: defaultAllowed && root.showStarterVoltage + preferredVisible: root.showStarterVoltage } ListQuantity { //% "Minimum aux voltage" text: qsTrId("dcmeter_history_minimum_aux_voltage") dataItem.uid: visible ? root.bindPrefix + "/History/MinimumStarterVoltage" : "" - allowed: defaultAllowed && root.showStarterVoltage + preferredVisible: root.showStarterVoltage unit: VenusOS.Units_Volt_DC } @@ -78,19 +78,19 @@ Page { //% "Maximum aux voltage" text: qsTrId("dcmeter_history_maximum_aux_voltage") dataItem.uid: visible ? root.bindPrefix + "/History/MaximumStarterVoltage" : "" - allowed: defaultAllowed && root.showStarterVoltage + preferredVisible: root.showStarterVoltage unit: VenusOS.Units_Volt_DC } ListTemperature { text: CommonWords.minimum_temperature - allowed: defaultAllowed && showTemperature + preferredVisible: showTemperature dataItem.uid: root.bindPrefix + "/History/MinimumTemperature" } ListTemperature { text: CommonWords.maximum_temperature - allowed: defaultAllowed && showTemperature + preferredVisible: showTemperature dataItem.uid: root.bindPrefix + "/History/MaximumTemperature" } @@ -98,7 +98,7 @@ Page { //% "Produced energy" text: qsTrId("dcmeter_history_produced_energy") dataItem.uid: root.bindPrefix + "/History/EnergyOut" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid unit: VenusOS.Units_Energy_KiloWattHour } @@ -106,7 +106,7 @@ Page { //% "Consumed energy" text: qsTrId("dcmeter_history_consumed_energy") dataItem.uid: root.bindPrefix + "/History/EnergyIn" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid unit: VenusOS.Units_Energy_KiloWattHour } diff --git a/pages/settings/devicelist/dc-in/PageDcMeterModel.qml b/pages/settings/devicelist/dc-in/PageDcMeterModel.qml index 2ac65d629..0576dc734 100644 --- a/pages/settings/devicelist/dc-in/PageDcMeterModel.qml +++ b/pages/settings/devicelist/dc-in/PageDcMeterModel.qml @@ -29,7 +29,7 @@ ObjectModel { ListTemperature { text: CommonWords.temperature dataItem.uid: root.bindPrefix + "/Dc/0/Temperature" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListQuantity { @@ -37,7 +37,7 @@ ObjectModel { text: qsTrId("dcmeter_aux_voltage") dataItem.uid: root.bindPrefix + "/Dc/1/Voltage" unit: VenusOS.Units_Volt_DC - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListRelayState { @@ -50,7 +50,7 @@ ObjectModel { ListNavigation { text: CommonWords.alarms - allowed: !isSssDcEnergyMeter + preferredVisible: !isSssDcEnergyMeter onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/dc-in/PageDcMeterAlarms.qml", { "title": text, "bindPrefix": root.bindPrefix }) @@ -59,7 +59,7 @@ ObjectModel { ListNavigation { text: CommonWords.history - allowed: !isSssDcEnergyMeter + preferredVisible: !isSssDcEnergyMeter onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/dc-in/PageDcMeterHistory.qml", { "title": text, "bindPrefix": root.bindPrefix }) diff --git a/pages/settings/devicelist/delegates/DeviceListDelegate_multi.qml b/pages/settings/devicelist/delegates/DeviceListDelegate_multi.qml index e3720dc09..943000a22 100644 --- a/pages/settings/devicelist/delegates/DeviceListDelegate_multi.qml +++ b/pages/settings/devicelist/delegates/DeviceListDelegate_multi.qml @@ -9,5 +9,5 @@ import Victron.VenusOS DeviceListDelegate { // multi devices are not shown in the Device List; they are shown as part of the // "Devices" list in the acsystem page (PageRsSystem) instead. - allowed: false + preferredVisible: false } diff --git a/pages/settings/devicelist/delegates/DeviceListDelegate_vebus.qml b/pages/settings/devicelist/delegates/DeviceListDelegate_vebus.qml index a0b869a13..1cd19df39 100644 --- a/pages/settings/devicelist/delegates/DeviceListDelegate_vebus.qml +++ b/pages/settings/devicelist/delegates/DeviceListDelegate_vebus.qml @@ -11,7 +11,7 @@ DeviceListDelegate { // vebus devices may also show up as AC inputs or batteries, so ensure they do not // appear multiple times in the list. - allowed: sourceModel === Global.inverterChargers.veBusDevices + preferredVisible: sourceModel === Global.inverterChargers.veBusDevices secondaryText: Global.system.systemStateToText(state.value) onClicked: { diff --git a/pages/settings/devicelist/inverter/PageInverter.qml b/pages/settings/devicelist/inverter/PageInverter.qml index 1b1129caa..2b1a71246 100644 --- a/pages/settings/devicelist/inverter/PageInverter.qml +++ b/pages/settings/devicelist/inverter/PageInverter.qml @@ -64,7 +64,7 @@ Page { ListQuantityGroup { //% "PV" text: qsTrId("inverter_pv") - allowed: pvV.isValid || pvYield.isValid + preferredVisible: pvV.isValid || pvYield.isValid textModel: [ { value: pvV.value, unit: VenusOS.Units_Volt_DC }, { value: pvYield.value, unit: VenusOS.Units_Watt }, @@ -84,7 +84,7 @@ Page { ListQuantity { //% "Total yield" text: qsTrId("inverter_total_yield") - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid unit: VenusOS.Units_Energy_KiloWattHour dataItem.uid: root.bindPrefix + "/Yield/User" } @@ -92,14 +92,14 @@ Page { ListQuantity { //% "System yield" text: qsTrId("inverter_system_yield") - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid unit: VenusOS.Units_Energy_KiloWattHour dataItem.uid: root.bindPrefix + "/Yield/System" } ListQuantity { text: CommonWords.state_of_charge - allowed: defaultAllowed && root.isInverterCharger + preferredVisible: root.isInverterCharger unit: VenusOS.Units_Percentage dataItem.uid: root.bindPrefix + "/Soc" } @@ -107,13 +107,13 @@ Page { ListTemperature { text: CommonWords.battery_temperature dataItem.uid: root.bindPrefix + "/Dc/0/Temperature" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListText { text: CommonWords.error dataItem.uid: root.bindPrefix + "/ErrorCode" - allowed: defaultAllowed && root.isInverterCharger + preferredVisible: root.isInverterCharger secondaryText: ChargerError.description(dataItem.value) } @@ -125,7 +125,7 @@ Page { property SolarHistory solarHistory text: CommonWords.daily_history - allowed: (numberOfTrackers.value || 0) > 0 + preferredVisible: (numberOfTrackers.value || 0) > 0 onClicked: { if (!solarHistory) { solarHistory = solarHistoryComponent.createObject(root) @@ -158,7 +158,7 @@ Page { ListNavigation { text: CommonWords.overall_history - allowed: root.isInverterCharger + preferredVisible: root.isInverterCharger onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/inverter/PageSolarStats.qml", { "title": text, "bindPrefix": root.bindPrefix }) @@ -167,7 +167,7 @@ Page { ListNavigation { text: CommonWords.alarm_status - allowed: root.isInverterCharger + preferredVisible: root.isInverterCharger onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/rs/PageRsAlarms.qml", { "title": text, "bindPrefix": root.bindPrefix }) @@ -176,7 +176,7 @@ Page { ListNavigation { text: CommonWords.alarm_setup - allowed: root.isInverterCharger + preferredVisible: root.isInverterCharger onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/rs/PageRsAlarmSettings.qml", { "title": text, "bindPrefix": root.bindPrefix }) diff --git a/pages/settings/devicelist/inverter/PageSolarStats.qml b/pages/settings/devicelist/inverter/PageSolarStats.qml index 291d32557..67f6b8225 100644 --- a/pages/settings/devicelist/inverter/PageSolarStats.qml +++ b/pages/settings/devicelist/inverter/PageSolarStats.qml @@ -18,7 +18,7 @@ Page { text: qsTrId("inverter_maximum_pv_voltage") dataItem.uid: root.bindPrefix + "/History/Overall/MaxPvVoltage" unit: VenusOS.Units_Volt_DC - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListQuantity { @@ -26,7 +26,7 @@ Page { text: qsTrId("inverter_maximum_battery_voltage") dataItem.uid: root.bindPrefix + "/History/Overall/MaxBatteryVoltage" unit: VenusOS.Units_Volt_DC - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListQuantity { @@ -34,7 +34,7 @@ Page { text: qsTrId("inverter_minimum_battery_voltage") dataItem.uid: root.bindPrefix + "/History/Overall/MinBatteryVoltage" unit: VenusOS.Units_Volt_DC - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } Column { diff --git a/pages/settings/devicelist/rs/PageMultiRs.qml b/pages/settings/devicelist/rs/PageMultiRs.qml index ff074e6ae..3a602fde3 100644 --- a/pages/settings/devicelist/rs/PageMultiRs.qml +++ b/pages/settings/devicelist/rs/PageMultiRs.qml @@ -62,7 +62,7 @@ Page { ListTemperature { text: CommonWords.battery_temperature dataItem.uid: root.bindPrefix + "/Dc/0/Temperature" - allowed: dataItem.isValid + preferredVisible: dataItem.isValid } ListActiveAcInput { @@ -89,7 +89,7 @@ Page { ListQuantity { //% "Total yield" text: qsTrId("settings_multirs_total_yield") - allowed: root.trackerCount > 0 + preferredVisible: root.trackerCount > 0 unit: VenusOS.Units_Energy_KiloWattHour dataItem.uid: root.bindPrefix + "/Yield/User" } @@ -97,7 +97,7 @@ Page { ListQuantity { //% "System yield" text: qsTrId("settings_multirs_system_yield") - allowed: root.trackerCount > 0 + preferredVisible: root.trackerCount > 0 unit: VenusOS.Units_Energy_KiloWattHour dataItem.uid: root.bindPrefix + "/Yield/System" } @@ -114,7 +114,7 @@ Page { ListNavigation { text: CommonWords.daily_history - allowed: root.trackerCount > 0 + preferredVisible: root.trackerCount > 0 onClicked: { //: Multi RS historic PV data information. %1 = Multi RS name //% "%1 History" @@ -133,7 +133,7 @@ Page { ListNavigation { text: CommonWords.overall_history - allowed: root.trackerCount > 0 + preferredVisible: root.trackerCount > 0 onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/inverter/PageSolarStats.qml", { "title": text, "bindPrefix": root.bindPrefix }) diff --git a/pages/settings/devicelist/rs/PageRsAlarmSettings.qml b/pages/settings/devicelist/rs/PageRsAlarmSettings.qml index d611fccc8..360c92436 100644 --- a/pages/settings/devicelist/rs/PageRsAlarmSettings.qml +++ b/pages/settings/devicelist/rs/PageRsAlarmSettings.qml @@ -21,22 +21,22 @@ Page { for (let i = 0; i < settingsListView.count; ++i) { const listItem = settingsListView.itemAtIndex(i) if (listItem && listItem.visible) { - allowed = false + preferredVisible = false return } } - allowed = true + preferredVisible = true } //% "No alarms to be configured" text: qsTrId("rs_alarm_no_alarms_to_be_configured") - allowed: false + preferredVisible: false } delegate: ListAlarmLevelRadioButtonGroup { text: modelData.text dataItem.uid: root.bindPrefix + modelData.pathSuffix - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid onVisibleChanged: settingsListView.headerItem.updateVisibility() } } diff --git a/pages/settings/devicelist/rs/PageRsSystemAlarms.qml b/pages/settings/devicelist/rs/PageRsSystemAlarms.qml index d782231a4..e279d72a0 100644 --- a/pages/settings/devicelist/rs/PageRsSystemAlarms.qml +++ b/pages/settings/devicelist/rs/PageRsSystemAlarms.qml @@ -62,6 +62,6 @@ Page { } GradientListView { - model: phaseRotationAlarm.allowed || temperatureAlarm.allowed || overloadAlarm.allowed ? validAlarmsModel : noAlarmsModel + model: phaseRotationAlarm.preferredVisible || temperatureAlarm.preferredVisible || overloadAlarm.preferredVisible ? validAlarmsModel : noAlarmsModel } } diff --git a/pages/settings/devicelist/rs/PageRsSystemEss.qml b/pages/settings/devicelist/rs/PageRsSystemEss.qml index 3dc4c3871..3c14b2abc 100644 --- a/pages/settings/devicelist/rs/PageRsSystemEss.qml +++ b/pages/settings/devicelist/rs/PageRsSystemEss.qml @@ -39,7 +39,7 @@ Page { //% "Minimum SOC (unless grid fails)" text: qsTrId("settings_rs_ess_min_soc") button.text: Units.getCombinedDisplayText(VenusOS.Units_Percentage, essMinSocItem.value) - allowed: defaultAllowed && root.isModeOptimized + preferredVisible: root.isModeOptimized onClicked: Global.dialogLayer.open(minSocDialogComponent) Component { @@ -55,8 +55,7 @@ Page { ListQuantity { //% "Active SOC limit" text: qsTrId("settings_rs_active_soc_limit") - allowed: defaultAllowed - && essMode.dataItem.value === VenusOS.Ess_State_OptimizedWithBatteryLife + preferredVisible: essMode.dataItem.value === VenusOS.Ess_State_OptimizedWithBatteryLife dataItem.uid: root.bindPrefix + "/Ess/ActiveSocLimit" unit: VenusOS.Units_Percentage } @@ -69,7 +68,7 @@ Page { ? qsTrId("scheduled_charge_active").arg(Units.getCombinedDisplayText(VenusOS.Units_Percentage, scheduleSoc.value)) //% "Inactive" : qsTrId("scheduled_charge_inactive") - allowed: defaultAllowed && root.isModeOptimized + preferredVisible: root.isModeOptimized onClicked: { Global.pageManager.pushPage(scheduledChargeComponent, { title: text }) } @@ -96,7 +95,7 @@ Page { ListNavigation { //% "Dynamic ESS" text: qsTrId("settings_rs_ess_dess") - allowed: dEssModeItem.value > 0 || Global.systemSettings.canAccess(VenusOS.User_AccessType_Service) + preferredVisible: dEssModeItem.value > 0 || Global.systemSettings.canAccess(VenusOS.User_AccessType_Service) onClicked: { Global.pageManager.pushPage("/pages/settings/PageSettingsDynamicEss.qml", { title: text }) diff --git a/pages/settings/devicelist/tank/PageTankSensor.qml b/pages/settings/devicelist/tank/PageTankSensor.qml index 0843a6db0..e2ebe1e28 100644 --- a/pages/settings/devicelist/tank/PageTankSensor.qml +++ b/pages/settings/devicelist/tank/PageTankSensor.qml @@ -45,7 +45,7 @@ Page { ListTemperature { text: CommonWords.temperature dataItem.uid: root.bindPrefix + "/Temperature" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListQuantity { @@ -53,19 +53,19 @@ Page { text: qsTrId("devicelist_tanksensor_sensor_battery") dataItem.uid: root.bindPrefix + "/BatteryVoltage" unit: VenusOS.Units_Volt_DC - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { text: CommonWords.low_level_alarm dataItem.uid: root.bindPrefix + "/Alarms/Low/State" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { text: CommonWords.high_level_alarm dataItem.uid: root.bindPrefix + "/Alarms/High/State" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListNavigation { diff --git a/pages/settings/devicelist/tank/PageTankSetup.qml b/pages/settings/devicelist/tank/PageTankSetup.qml index 656ed78c9..a025cab70 100644 --- a/pages/settings/devicelist/tank/PageTankSetup.qml +++ b/pages/settings/devicelist/tank/PageTankSetup.qml @@ -31,7 +31,7 @@ Page { //% "Sensor type" text: qsTrId("devicelist_tanksetup_sensor_type") dataItem.uid: root.bindPrefix + "/SenseType" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid optionModel: [ { display: CommonWords.voltage, value: 1 }, { display: CommonWords.current_amps, value: 2 }, @@ -44,7 +44,7 @@ Page { //% "Standard" text: qsTrId("devicelist_tanksetup_standard") dataItem.uid: root.bindPrefix + "/Standard" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid optionModel: [ //% "European (0 to 180 Ohm)" { display: qsTrId("devicelist_tanksetup_european_(0_to_180_ohm)"), value: 0 }, @@ -58,7 +58,7 @@ Page { ListSpinBox { //% "Sensor value when empty" text: qsTrId("devicelist_tanksetup_sensor_value_when_empty") - allowed: dataItem.seen && (!standard.dataItem.isValid || standard.currentValue === 2) + preferredVisible: dataItem.seen && (!standard.dataItem.isValid || standard.currentValue === 2) dataItem.uid: root.bindPrefix + "/RawValueEmpty" suffix: rawUnit.value || "" decimals: 3 @@ -68,7 +68,7 @@ Page { ListSpinBox { //% "Sensor value when full" text: qsTrId("devicelist_tanksetup_sensor_value_when_full") - allowed: dataItem.seen && (!standard.dataItem.isValid || standard.currentValue === 2) + preferredVisible: dataItem.seen && (!standard.dataItem.isValid || standard.currentValue === 2) dataItem.uid: root.bindPrefix + "/RawValueFull" suffix: rawUnit.value || "" decimals: 3 @@ -87,7 +87,7 @@ Page { ListSpinBox { //% "Butane ratio" text: qsTrId("devicelist_tanksetup_butane_ratio") - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: root.bindPrefix + "/ButaneRatio" suffix: "%" } @@ -97,7 +97,7 @@ Page { ListNavigation { //% "Custom shape" text: qsTrId("devicelist_tanksetup_custom_shape") - allowed: shape.seen + preferredVisible: shape.seen onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/tank/PageTankShape.qml", @@ -114,7 +114,7 @@ Page { //% "Averaging time" text: qsTrId("devicelist_tanksetup_averaging_time") dataItem.uid: root.bindPrefix + "/FilterLength" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid suffix: "s" } @@ -122,13 +122,13 @@ Page { //% "Sensor value" text: qsTrId("devicelist_tanksetup_sensor_value") dataItem.uid: root.bindPrefix + "/RawValue" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid secondaryText: dataItem.isValid ? Units.formatNumber(dataItem.value, 1) + (rawUnit.value || "") : "--" } ListNavigation { text: CommonWords.low_level_alarm - allowed: low.seen + preferredVisible: low.seen onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/tank/PageTankAlarm.qml", @@ -143,7 +143,7 @@ Page { ListNavigation { text: CommonWords.high_level_alarm - allowed: high.seen + preferredVisible: high.seen onClicked: { Global.pageManager.pushPage("/pages/settings/devicelist/tank/PageTankAlarm.qml", diff --git a/pages/settings/devicelist/tank/PageTankShape.qml b/pages/settings/devicelist/tank/PageTankShape.qml index f355d962c..99da3304f 100644 --- a/pages/settings/devicelist/tank/PageTankShape.qml +++ b/pages/settings/devicelist/tank/PageTankShape.qml @@ -75,7 +75,7 @@ Page { header: PrimaryListLabel { //% "No custom shape defined. You may define one with up to ten points. Note that 0% and 100% are implied." text: qsTrId("devicelist_tankshape_empty") - allowed: pointsListView.count === 0 + preferredVisible: pointsListView.count === 0 } delegate: ListTextGroup { diff --git a/pages/settings/devicelist/temperature/PageTemperatureSensor.qml b/pages/settings/devicelist/temperature/PageTemperatureSensor.qml index 2f840174a..a8c6e48f3 100644 --- a/pages/settings/devicelist/temperature/PageTemperatureSensor.qml +++ b/pages/settings/devicelist/temperature/PageTemperatureSensor.qml @@ -33,7 +33,7 @@ Page { ListText { text: CommonWords.status dataItem.uid: root.bindPrefix + "/Status" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid secondaryText: { switch (dataItem.value) { case 0: @@ -67,7 +67,7 @@ Page { text: qsTrId("temperature_humidity") dataItem.uid: bindPrefix + "/Humidity" unit: VenusOS.Units_Percentage - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListQuantity { @@ -75,7 +75,7 @@ Page { text: qsTrId("temperature_pressure") dataItem.uid: bindPrefix + "/Pressure" unit: VenusOS.Units_Hectopascal - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListItem { @@ -83,7 +83,7 @@ Page { //% "Sensor battery" text: qsTrId("temperature_sensor_battery") - allowed: defaultAllowed && batteryVoltage.isValid + preferredVisible: batteryVoltage.isValid content.children: [ QuantityLabel { diff --git a/pages/settings/devicelist/temperature/PageTemperatureSensorSetup.qml b/pages/settings/devicelist/temperature/PageTemperatureSensorSetup.qml index 35a1a9650..2cd04647d 100644 --- a/pages/settings/devicelist/temperature/PageTemperatureSensorSetup.qml +++ b/pages/settings/devicelist/temperature/PageTemperatureSensorSetup.qml @@ -26,7 +26,7 @@ Page { ListRadioButtonGroup { text: CommonWords.type dataItem.uid: bindPrefix + "/TemperatureType" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid optionModel: [ { display: Global.environmentInputs.temperatureTypeToText(VenusOS.Temperature_DeviceType_Battery), value: VenusOS.Temperature_DeviceType_Battery }, { display: Global.environmentInputs.temperatureTypeToText(VenusOS.Temperature_DeviceType_Fridge), value: VenusOS.Temperature_DeviceType_Fridge }, @@ -42,7 +42,7 @@ Page { //% "Offset" text: qsTrId("temperature_offset") dataItem.uid: root.bindPrefix + "/Offset" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid from: -100 to: 100 } @@ -51,7 +51,7 @@ Page { //% "Scale" text: qsTrId("temperature_scale") dataItem.uid: root.bindPrefix + "/Scale" - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid from: 0 to: 10 decimals: 1 @@ -60,7 +60,7 @@ Page { ListQuantity { //% "Sensor voltage" text: qsTrId("temperature_sensor_voltage") - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid dataItem.uid: root.bindPrefix + "/RawValue" unit: VenusOS.Units_Volt_DC } diff --git a/pages/solar/PvInverterPage.qml b/pages/solar/PvInverterPage.qml index ba1300e88..42bbab0f5 100644 --- a/pages/solar/PvInverterPage.qml +++ b/pages/solar/PvInverterPage.qml @@ -88,7 +88,7 @@ Page { ListText { text: CommonWords.zero_feed_in_power_limit dataItem.uid: root.pvInverter.serviceUid + "/Ac/PowerLimit" - allowed: dataItem.isValid + preferredVisible: dataItem.isValid } ListAcInError { diff --git a/pages/solar/SolarChargerAlarmsAndErrorsPage.qml b/pages/solar/SolarChargerAlarmsAndErrorsPage.qml index 15dd36e53..a2c267dc2 100644 --- a/pages/solar/SolarChargerAlarmsAndErrorsPage.qml +++ b/pages/solar/SolarChargerAlarmsAndErrorsPage.qml @@ -17,7 +17,7 @@ Page { model: ObjectModel { PrimaryListLabel { - allowed: lowBatteryAlarm.visible || highBatteryAlarm.visible || highTemperatureAlarm.visible || shortCircuitAlarm.visible + preferredVisible: lowBatteryAlarm.visible || highBatteryAlarm.visible || highTemperatureAlarm.visible || shortCircuitAlarm.visible leftPadding: 0 color: Theme.color_listItem_secondaryText font.pixelSize: Theme.font_size_caption @@ -30,7 +30,7 @@ Page { //% "Low battery voltage alarm" text: qsTrId("charger_alarms_low_battery_voltage_alarm") dataItem.uid: root.solarCharger.serviceUid + "/Alarms/LowVoltage" - allowed: dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { @@ -39,7 +39,7 @@ Page { //% "High battery voltage alarm" text: qsTrId("charger_alarms_high_battery_voltage_alarm") dataItem.uid: root.solarCharger.serviceUid + "/Alarms/HighVoltage" - allowed: dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { @@ -48,7 +48,7 @@ Page { //% "High temperature alarm" text: qsTrId("charger_alarms_high_temperature_alarm") dataItem.uid: root.solarCharger.serviceUid + "/Alarms/HighTemperature" - allowed: dataItem.isValid + preferredVisible: dataItem.isValid } ListAlarm { @@ -57,11 +57,11 @@ Page { //% "Short circuit alarm" text: qsTrId("charger_alarms_short_circuit_alarm") dataItem.uid: root.solarCharger.serviceUid + "/Alarms/ShortCircuit" - allowed: dataItem.isValid + preferredVisible: dataItem.isValid } PrimaryListLabel { - allowed: root.solarCharger.errorCode > 0 + preferredVisible: root.solarCharger.errorCode > 0 leftPadding: 0 color: Theme.color_listItem_secondaryText font.pixelSize: Theme.font_size_caption @@ -70,7 +70,7 @@ Page { } ListText { - allowed: root.solarCharger.errorCode > 0 + preferredVisible: root.solarCharger.errorCode > 0 text: ChargerError.description(root.solarCharger.errorCode) } } diff --git a/pages/solar/SolarChargerNetworkedOperationPage.qml b/pages/solar/SolarChargerNetworkedOperationPage.qml index 23806e519..1a6277a80 100644 --- a/pages/solar/SolarChargerNetworkedOperationPage.qml +++ b/pages/solar/SolarChargerNetworkedOperationPage.qml @@ -21,7 +21,7 @@ Page { //% "Networked" text: qsTrId("charger_networked") dataItem.uid: root.solarCharger.serviceUid + "/Link/NetworkMode" - allowed: dataItem.isValid + preferredVisible: dataItem.isValid secondaryText: dataItem.isValid ? CommonWords.yesOrNo(dataItem.value & 1) : "" } @@ -69,7 +69,7 @@ Page { } } dataItem.uid: root.solarCharger.serviceUid + "/Link/NetworkMode" - allowed: dataItem.isValid && networkModeEnabled.dataItem.value + preferredVisible: dataItem.isValid && networkModeEnabled.dataItem.value } ListText { @@ -97,21 +97,21 @@ Page { } } dataItem.uid: root.solarCharger.serviceUid + "/Link/NetworkMode" - allowed: dataItem.isValid && networkModeEnabled.dataItem.value && ((dataItem.value & 0x30) > 0x00) + preferredVisible: dataItem.isValid && networkModeEnabled.dataItem.value && ((dataItem.value & 0x30) > 0x00) } ListQuantity { //% "Charge voltage" text: qsTrId("charger_charge_voltage") dataItem.uid: root.solarCharger.serviceUid + "/Link/ChargeVoltage" - allowed: dataItem.isValid && networkModeEnabled.dataItem.value > 0 && (networkModeMode.dataItem.value & 0x04) + preferredVisible: dataItem.isValid && networkModeEnabled.dataItem.value > 0 && (networkModeMode.dataItem.value & 0x04) unit: VenusOS.Units_Volt_DC } ListText { text: CommonWords.charge_current dataItem.uid: root.solarCharger.serviceUid + "/Link/ChargeCurrent" - allowed: dataItem.isValid && networkModeEnabled.dataItem.value > 0 && (networkModeMode.dataItem.value & 0x08) + preferredVisible: dataItem.isValid && networkModeEnabled.dataItem.value > 0 && (networkModeMode.dataItem.value & 0x08) } ListText { @@ -120,14 +120,14 @@ Page { text: qsTrId("charger_network_bms_controlled") secondaryText: CommonWords.yesOrNo(dataItem.value) dataItem.uid: root.solarCharger.serviceUid + "/Settings/BmsPresent" - allowed: dataItem.isValid + preferredVisible: dataItem.isValid } ListButton { //% "BMS control" text: qsTrId("charger_network_bms_control") button.text: CommonWords.reset - allowed: bmsControlled.dataItem.value === 1 + preferredVisible: bmsControlled.dataItem.value === 1 onClicked: { bmsControlled.dataItem.setValue(0) } @@ -141,7 +141,7 @@ Page { font.pixelSize: Theme.font_size_caption color: Theme.color_font_secondary leftPadding: infoIcon.x + infoIcon.width + infoIcon.x/2 - allowed: bmsControlled.dataItem.value === 1 + preferredVisible: bmsControlled.dataItem.value === 1 CP.IconImage { id: infoIcon diff --git a/pages/solar/SolarChargerPage.qml b/pages/solar/SolarChargerPage.qml index a1e4d7331..2054d8901 100644 --- a/pages/solar/SolarChargerPage.qml +++ b/pages/solar/SolarChargerPage.qml @@ -117,13 +117,13 @@ Page { text: qsTrId("charger_load") dataItem.uid: root.solarCharger.serviceUid + "/Load/I" unit: VenusOS.Units_Amp - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid } ListText { text: loadQuantityItem.text dataItem.uid: root.solarCharger.serviceUid + "/Load/State" - allowed: defaultAllowed && dataItem.isValid && !loadQuantityItem.visible + preferredVisible: dataItem.isValid && !loadQuantityItem.visible secondaryText: CommonWords.yesOrNo(dataItem.value) } @@ -131,7 +131,7 @@ Page { text: CommonWords.relay checked: root.solarCharger.relayOn secondaryText: CommonWords.onOrOff(root.solarCharger.relayOn) - allowed: root.solarCharger.relayValid + preferredVisible: root.solarCharger.relayValid enabled: false } @@ -182,7 +182,7 @@ Page { ListNavigation { text: CommonWords.history - allowed: root.solarCharger.history.valid + preferredVisible: root.solarCharger.history.valid onClicked: { //: Solar charger historic data information. %1 = charger name //% "%1 History" diff --git a/pages/vebusdevice/PageVeBus.qml b/pages/vebusdevice/PageVeBus.qml index 373ee4d49..b28badeb0 100644 --- a/pages/vebusdevice/PageVeBus.qml +++ b/pages/vebusdevice/PageVeBus.qml @@ -93,7 +93,7 @@ Page { //% "A new MK3 version is available.\nNOTE: The update might temporarily stop the system." text: qsTrId("vebus_mk3_new_version_available") - allowed: mkVersion.value === 1170212 && mk3Update.value === 0 + preferredVisible: mkVersion.value === 1170212 && mk3Update.value === 0 } ListButton { @@ -101,7 +101,7 @@ Page { text: qsTrId("vebus_device_update_the_mk3") //% "Press to update" secondaryText: qsTrId("vebus_device_press_to_update") - allowed: mk3firmware.visible + preferredVisible: mk3firmware.visible onClicked: { //% "Updating the MK3, values will reappear after the update is complete" Global.showToastNotification(VenusOS.Notification_Info, qsTrId("vebus_device_updating_the_mk3"), 10000) @@ -139,7 +139,7 @@ Page { text: qsTrId("vebus_device_charging_to_100") //% "In progress" secondaryText: qsTrId("vebus_device_in_progress") - allowed: preferRenewableEnergy.value === 2 + preferredVisible: preferRenewableEnergy.value === 2 } ListNavigation { @@ -155,7 +155,7 @@ Page { : //% "Charge the battery to 100%" qsTrId("vebus_device_charge_the_battery_to_100") - allowed: preferRenewableEnergy.isValid && preferRenewableEnergy.value !== 2 + preferredVisible: preferRenewableEnergy.isValid && preferRenewableEnergy.value !== 2 onClicked: Global.pageManager.pushPage(newPageComponent) Component { @@ -226,20 +226,20 @@ Page { } ListQuantity { - allowed: defaultAllowed && root.isMulti + preferredVisible: root.isMulti dataItem.uid: root.bindPrefix + "/Soc" text: CommonWords.state_of_charge unit:VenusOS.Units_Percentage } ListTemperature { - allowed: defaultAllowed && dataItem.isValid && root.isMulti + preferredVisible: dataItem.isValid && root.isMulti dataItem.uid: root.bindPrefix + "/Dc/0/Temperature" text: CommonWords.battery_temperature } ListActiveAcInput { - allowed: defaultAllowed && root.isMulti + preferredVisible: root.isMulti bindPrefix: root.bindPrefix } @@ -278,19 +278,19 @@ Page { PrimaryListLabel { //% "A VE.Bus BMS automatically turns the system off when needed to protect the battery. Controlling the system from the Color Control is therefore not possible." text: qsTrId("vebus_device_bms_message") - allowed: bmsMode.isValid + preferredVisible: bmsMode.isValid } PrimaryListLabel { //% "A BMS assistant is installed configured for a VE.Bus BMS, but the VE.Bus BMS is not found!" text: qsTrId("vebus_device_bms_not_found") - allowed: bmsType.value === VenusOS.VeBusDevice_Bms_Type_VeBus && !bmsMode.isValid + preferredVisible: bmsType.value === VenusOS.VeBusDevice_Bms_Type_VeBus && !bmsMode.isValid } ListNavigation { //% "VE.Bus BMS" text: qsTrId("vebus_device_vebus_bms") - allowed: bmsExpected.value === 1 + preferredVisible: bmsExpected.value === 1 onClicked: Global.pageManager.pushPage("/pages/vebusdevice/PageVeBusBms.qml", { "title": text, "bindPrefix": root.bindPrefix diff --git a/pages/vebusdevice/PageVeBusAdvanced.qml b/pages/vebusdevice/PageVeBusAdvanced.qml index 61d3ddb65..83e853995 100644 --- a/pages/vebusdevice/PageVeBusAdvanced.qml +++ b/pages/vebusdevice/PageVeBusAdvanced.qml @@ -116,7 +116,7 @@ Page { return qsTrId("vebus_device_press_to_start") } enabled: !isNaN(setChargerState.value) && !isNaN(vebusSubState.value) && !startTimer.running && !interruptTimer.running - allowed: defaultAllowed && root.isMulti + preferredVisible: root.isMulti onClicked: { if (firmwareVersion.value < 0x400) { @@ -176,7 +176,7 @@ Page { } ] currentIndex: 1 // float state is always selected - allowed: false + preferredVisible: false onOptionClicked: function(index) { const localValue = optionModel[index].value if (localValue !== VenusOS.VeBusDevice_ChargeState_InitializingCharger) { @@ -222,7 +222,7 @@ Page { text: qsTrId("vebus_device_ac_input_1_ignored") secondaryText: dataItem.value ? CommonWords.yes : CommonWords.no dataItem.uid: root.bindPrefix + "/Ac/State/IgnoreAcIn1" - allowed: dataItem.isValid && isMulti + preferredVisible: dataItem.isValid && isMulti } ListText { @@ -230,7 +230,7 @@ Page { text: qsTrId("vebus_device_ac_input_2_ignored") secondaryText: dataItem.value ? CommonWords.yes : CommonWords.no dataItem.uid: root.bindPrefix + "/Ac/State/IgnoreAcIn2" - allowed: dataItem.isValid && isMulti + preferredVisible: dataItem.isValid && isMulti } ListRadioButtonGroup { @@ -238,7 +238,7 @@ Page { text: qsTrId("vebus_device_ess_relay_test") dataItem.uid: root.bindPrefix + "/Devices/0/ExtendStatus/WaitingForRelayTest" enabled: false - allowed: dataItem.isValid && isEssOrHub4 && isMulti + preferredVisible: dataItem.isValid && isEssOrHub4 && isMulti optionModel: [ //% "Completed" { display: qsTrId("vebus_device_ess_relay_test_completed"), value: 0 }, @@ -252,7 +252,7 @@ Page { //% "VE.Bus diagnostics" text: qsTrId("vebus_diagnostics") showAccessLevel: VenusOS.User_AccessType_Service - allowed: defaultAllowed && masterHasNetworkQuality.isValid + preferredVisible: masterHasNetworkQuality.isValid onClicked: Global.pageManager.pushPage(vebusDiagnosticsPage, {"title": text}) Component { @@ -271,7 +271,7 @@ Page { //% "Network quality counter Phase L%1, device %2 (%3)" text: qsTrId("vebus_veice_network_quality_counter").arg((index % 3) + 1).arg(Math.floor(index / 3) + 1).arg(index) dataItem.uid: root.bindPrefix + "/Devices/" + index + "/ExtendStatus/VeBusNetworkQualityCounter" - allowed: dataItem.isValid + preferredVisible: dataItem.isValid } } } diff --git a/pages/vebusdevice/PageVeBusAlarmSettings.qml b/pages/vebusdevice/PageVeBusAlarmSettings.qml index 7f0fd5ba1..2d238da6e 100644 --- a/pages/vebusdevice/PageVeBusAlarmSettings.qml +++ b/pages/vebusdevice/PageVeBusAlarmSettings.qml @@ -25,7 +25,7 @@ Page { delegate: ListAlarmLevelRadioButtonGroup { text: alarmSettingsModel.displayTexts[model.index] dataItem.uid: root.bindPrefix + "/Settings/Alarm/Vebus" + model.pathSuffix - allowed: model.multiPhaseOnly ? isMulti : true + preferredVisible: model.multiPhaseOnly ? isMulti : true } footer: ListRadioButtonGroup { text: CommonWords.vebus_error diff --git a/pages/vebusdevice/PageVeBusAlarms.qml b/pages/vebusdevice/PageVeBusAlarms.qml index 0f48c6953..8b5970a21 100644 --- a/pages/vebusdevice/PageVeBusAlarms.qml +++ b/pages/vebusdevice/PageVeBusAlarms.qml @@ -51,7 +51,7 @@ Page { multiPhase: alarmDelegate.multiPhase alarmSuffix: pathSuffix errorItem: alarmDelegate.errorItem - allowed: defaultAllowed && (!showOnlyIfMulti || root.isMulti) + preferredVisible: !showOnlyIfMulti || root.isMulti } } } diff --git a/pages/vebusdevice/PageVeBusBms.qml b/pages/vebusdevice/PageVeBusBms.qml index 3d1267c65..ba2cd757c 100644 --- a/pages/vebusdevice/PageVeBusBms.qml +++ b/pages/vebusdevice/PageVeBusBms.qml @@ -31,7 +31,7 @@ Page { text: qsTrId("vebus_device_bms_error") secondaryText: CommonWords.yesOrNo(dataItem.value) dataItem.uid: bindPrefix + "/Bms/Error" - allowed: dataItem.value === VenusOS.VeBusDevice_Bms_Type_VeBus + preferredVisible: dataItem.value === VenusOS.VeBusDevice_Bms_Type_VeBus } } } diff --git a/pages/vebusdevice/PageVeBusError11Device.qml b/pages/vebusdevice/PageVeBusError11Device.qml index 5248c06a5..cb9b7aa7c 100644 --- a/pages/vebusdevice/PageVeBusError11Device.qml +++ b/pages/vebusdevice/PageVeBusError11Device.qml @@ -38,14 +38,14 @@ Page { text: CommonWords.error_colon //% "BF safety test in progress" secondaryText: qsTrId("vebus_device_bf_safety_test_in_progress") - allowed: code.isValid && (code.value & 0x01) != 0 + preferredVisible: code.isValid && (code.value & 0x01) != 0 } ListText { text: CommonWords.error_colon //% "BF safety test OK" secondaryText: qsTrId("vebus_device_bf_safety_test_ok") - allowed: code.isValid && (code.value & 0x02) != 0 + preferredVisible: code.isValid && (code.value & 0x02) != 0 } /* Removed "Error occurred" (bit 3) since it is a status flag which is @@ -57,63 +57,63 @@ Page { text: CommonWords.error_colon //% "AC0 /AC1 mismatch" secondaryText: qsTrId("vebus_device_ac0_ac1_mismatch") - allowed: code.isValid && (code.value & 0x08) != 0 + preferredVisible: code.isValid && (code.value & 0x08) != 0 } ListText { text: CommonWords.error_colon //% "Communication error" secondaryText: qsTrId("vebus_device_communication_error") - allowed: code.isValid && (code.value & 0x10) != 0 + preferredVisible: code.isValid && (code.value & 0x10) != 0 } ListText { text: CommonWords.error_colon //% "GND Relay Error" secondaryText: qsTrId("vebus_device_ground_relay_error") - allowed: code.isValid && (code.value & 0x20) != 0 + preferredVisible: code.isValid && (code.value & 0x20) != 0 } ListText { text: CommonWords.error_colon //% "UMains mismatch" secondaryText: qsTrId("vebus_device_umains_mismatch") - allowed: code.isValid && (code.value & 0x1000) != 0 + preferredVisible: code.isValid && (code.value & 0x1000) != 0 } ListText { text: CommonWords.error_colon //% "Period Time mismatch" secondaryText: qsTrId("vebus_device_period_time_mismatch") - allowed: code.isValid && (code.value & 0x2000) != 0 + preferredVisible: code.isValid && (code.value & 0x2000) != 0 } ListText { text: CommonWords.error_colon //% "Drive of BF relay mismatch" secondaryText: qsTrId("vebus_device_drive_of_bf_relay_mismatch") - allowed: code.isValid && (code.value & 0x4000) != 0 + preferredVisible: code.isValid && (code.value & 0x4000) != 0 } ListText { text: CommonWords.error_colon //% "Error: PE2 open" secondaryText: qsTrId("vebus_device_error_pe2_open") - allowed: code.isValid && (code.value & 0x10000) != 0 + preferredVisible: code.isValid && (code.value & 0x10000) != 0 } ListText { text: CommonWords.error_colon //% "Error: PE2 closed" secondaryText: qsTrId("vebus_device_error_pe2_closed") - allowed: code.isValid && (code.value & 0x20000) != 0 + preferredVisible: code.isValid && (code.value & 0x20000) != 0 } ListText { text: CommonWords.error_colon //% "Failing step: %1" secondaryText: qsTrId("vebus_device_failing_step").arg(code.isValid ? (code.value & 0xF00) >> 8 : "--") - allowed: code.isValid && code.value > 0 + preferredVisible: code.isValid && code.value > 0 } } } diff --git a/pages/vebusdevice/PageVeBusError11Menu.qml b/pages/vebusdevice/PageVeBusError11Menu.qml index 02200221a..c9f338a1a 100644 --- a/pages/vebusdevice/PageVeBusError11Menu.qml +++ b/pages/vebusdevice/PageVeBusError11Menu.qml @@ -33,7 +33,7 @@ ListNavigation { //% "Phase L%1, device %2 (%3)" text: qsTrId("vebus_device_phase_x_device_x_index_x").arg((_index % 3) + 1).arg(Math.floor(_index / 3) + 1).arg(_index) secondaryText: counter.text + " " + code.text - allowed: code.isValid + preferredVisible: code.isValid onClicked: Global.pageManager.pushPage("/pages/vebusdevice/PageVeBusError11Device.qml", { bindPrefix: devPrefix, title: text diff --git a/pages/vebusdevice/PageVeBusError11View.qml b/pages/vebusdevice/PageVeBusError11View.qml index 82f69413c..0996f057b 100644 --- a/pages/vebusdevice/PageVeBusError11View.qml +++ b/pages/vebusdevice/PageVeBusError11View.qml @@ -23,7 +23,7 @@ Page { PrimaryListLabel { //% "VE.Bus Error 11 reporting requires minimum VE.Bus firmware version 454." text: qsTrId("vebus_error_11_reporting_requires_v454") - allowed: !firstCode.seen + preferredVisible: !firstCode.seen } Column { diff --git a/pages/vebusdevice/PageVeBusSerialNumbers.qml b/pages/vebusdevice/PageVeBusSerialNumbers.qml index f6e49d8e8..66a5f2253 100644 --- a/pages/vebusdevice/PageVeBusSerialNumbers.qml +++ b/pages/vebusdevice/PageVeBusSerialNumbers.qml @@ -38,7 +38,7 @@ Page { Repeater { model: tableModel delegate: ListText { - allowed: defaultAllowed && dataItem.isValid + preferredVisible: dataItem.isValid text: name(model.id) dataItem.uid: model.uid + "/SerialNumber" }