FS#9869 - For a setting screen, if the cursor does not move, the selected item's value is invalid.

Attached to Project: Rockbox
Opened by Yoshihisa Uchida (Uchida) - Tuesday, 03 February 2009, 10:29 GMT
Last edited by Jonathan Gordon (jdgordon) - Friday, 18 December 2009, 06:41 GMT
Task Type Bugs
Category Settings
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


For the setting screen, I do not move the cursor and I select the current item.
Then, when option_screen() returns, *(int*)setting->setting does not set the current item's value.

If the cursor moves, and the top item selects, then *(int*)setting->setting sets the current item's value.

I send this bug's patch file.

An sample program was prepared.
test_sample.c copies apps/plugins and SOURCES edits.
Then test.sample.rock builds and it runs from Rockbox.
This task depends upon

Closed by  Jonathan Gordon (jdgordon)
Friday, 18 December 2009, 06:41 GMT
Reason for closing:  Not a Bug
Additional comments about closing:  Yoshihisa, You need to fix that patch so you dont need to know if the setting was canceled, or do your own list handling.
Comment by Jonathan Gordon (jdgordon) - Tuesday, 03 February 2009, 10:39 GMT
the reason its crashing in your patch is because you are setting val to an invalid value... *value in option_screen() does get initialised correctly. If the selection isnt changed, then neither is the value, so whatever the value was before entering the screen it will be when exiting.
Comment by Yoshihisa Uchida (Uchida) - Saturday, 07 February 2009, 06:24 GMT
To know whether the item had been selected or the selection of the item had been canceled, I set an invalid value as "val" in test_sample.c.

It is not understood whether the selection of the item had been canceled from the return value and arguments of set_option() (or option_screen()).
Therefore, different processing cannot be done whether for the item to have been selected.

Then, I thought whether be able to judge that the selection of the item was canceled if the value of "val" after set_option() was executed was an invalid value.

Comment by Jonathan Gordon (jdgordon) - Saturday, 07 February 2009, 10:22 GMT
settings should never have invalid value.. why do you need to know if a setting was canceled?
Comment by Yoshihisa Uchida (Uchida) - Thursday, 12 February 2009, 11:00 GMT
For  FS#9892 , I made the patch that made it jump to the first page when the bookmark was not selected.
I found this bug while making the above patch file.

Does something good method exist?