Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add file selector for LUA widget options #5573

Open
1 task done
wimalopaan opened this issue Sep 30, 2024 · 7 comments · May be fixed by #5605
Open
1 task done

Add file selector for LUA widget options #5573

wimalopaan opened this issue Sep 30, 2024 · 7 comments · May be fixed by #5605
Labels
enhancement ✨ New feature or request

Comments

@wimalopaan
Copy link
Contributor

Is there an existing issue for this feature request?

  • I have searched the existing issues

Is your feature request related to a problem?

LUA widgets can have options which select sources or values, but not files (on SD card)

Describe the solution you'd like

A new option type FILE wich gives a drop-down list of files in a specific directory

Describe alternatives you've considered

No response

Additional context

No response

@wimalopaan wimalopaan added the enhancement ✨ New feature or request label Sep 30, 2024
@philmoz
Copy link
Collaborator

philmoz commented Sep 30, 2024

The file selector popup is limited to a single directory (it does not support folder navigation) - so you would be limited to only being able to pick files from one place.
The folder to choose from would have to be fixed in the option definition, something like:

  { "File", FILE, "/SOUNDS/en" },

which might be a problem if you want to allow users to select a sound from a different language for example.

@wimalopaan
Copy link
Contributor Author

I think, this limitation would be absolutely acceptable for the use cases in my mind: choose config files for LUA-widgets. The widget has a special folder for this.

@philmoz
Copy link
Collaborator

philmoz commented Oct 4, 2024

Another question - string options are limited to max 8 chars for the user input value.
I don't think this would be long enough for filenames; but increasing the length will increase RAM usage.

What is a reasonable size limit to cater for filenames?
Increase to 12 would cater for short file names (8.3) - is this enough?

@wimalopaan
Copy link
Contributor Author

Increase to 12 would cater for short file names (8.3) - is this enough?

IMHO: yes

@gagarinlg
Copy link
Member

Another question - string options are limited to max 8 chars for the user input value. I don't think this would be long enough for filenames; but increasing the length will increase RAM usage.

Is it worth it? People will complain about less free RAM on the older radios

@wimalopaan
Copy link
Contributor Author

Maybe I misunderstand something, but we are talking only about Widget-Options, not strings in general. So, B&W radios are not affected. And then also only those who use widget-options of the new FILE type.

@philmoz
Copy link
Collaborator

philmoz commented Oct 4, 2024

Maybe I misunderstand something, but we are talking only about Widget-Options, not strings in general. So, B&W radios are not affected. And then also only those who use widget-options of the new FILE type.

Yes it's color only so the extra RAM should not be a concern.
Unfortunately because of the way the firmware works the extra RAM is needed regardless of whether you use the widget option or not, everything is statically allocated. But we are only talking about few KB and color radios have 6MB+ free RAM.

@philmoz philmoz linked a pull request Oct 11, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants