Skip to content

Switches: add adjustable setting to CustomName and Group#2843

Open
ybott-qinetic wants to merge 1 commit intomainfrom
ttomkins/read-only-channel-settings
Open

Switches: add adjustable setting to CustomName and Group#2843
ybott-qinetic wants to merge 1 commit intomainfrom
ttomkins/read-only-channel-settings

Conversation

@ybott-qinetic
Copy link
Contributor

Adds "/Settings/Adjustable" to settings, this provides a readonly
flag for settings. Currently only protects CustomName and Group.

Contributes to #2790

Adds "/Settings/Adjustable" to settings, this provides a readonly
flag for settings. Currently only protects CustomName and Group.

Contributes to #2790
uid: root.switchableOutput.uid + "/Settings/Adjustable"
}

readonly property bool _readOnly: _adjustable.valid && _adjustable.value == 0 ? 1 : 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can assign a bool rather than a number as the value?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "writeable" is nicer than "read-only", to allow the list items to use this property without a negation (interactive: root._writeable instead of interactive: !root._readOnly).


required property SwitchableOutput switchableOutput

readonly property VeQuickItem _adjustable: VeQuickItem {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't need to be a property, as the root type is an Item

dataItem.uid: root.switchableOutput.uid + "/Settings/Group"
dataItem.invalidate: false
writeAccessLevel: VenusOS.User_AccessType_User
interactive: !_readOnly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per #2790 (comment), the Adjustable value should affect the writeability of all settings, not just the group and custom name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants