mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
simplelist: Fix simplelist_set_line_count() so it actually sets the count
(hopefully) Fixes FS#12838 Change-Id: I932184afaf7b65121a0c459cd03c8482e3bad22b
This commit is contained in:
parent
be394af7d4
commit
087ff2e590
2 changed files with 32 additions and 2 deletions
|
@ -1838,6 +1838,31 @@ static bool dbg_save_roms(void)
|
||||||
}
|
}
|
||||||
#endif /* CPU */
|
#endif /* CPU */
|
||||||
|
|
||||||
|
static int radio_callback(int btn, struct gui_synclist *lists)
|
||||||
|
{
|
||||||
|
(void)lists;
|
||||||
|
if (btn == ACTION_STD_CANCEL)
|
||||||
|
return btn;
|
||||||
|
simplelist_set_line_count(1);
|
||||||
|
simplelist_addline("test one");
|
||||||
|
simplelist_addline("test two");
|
||||||
|
simplelist_addline("test dsaf");
|
||||||
|
simplelist_addline("test asdfsad");
|
||||||
|
simplelist_addline("-------------");
|
||||||
|
return ACTION_REDRAW;
|
||||||
|
}
|
||||||
|
static bool dbg_fm_radio(void)
|
||||||
|
{
|
||||||
|
struct simplelist_info info;
|
||||||
|
info.scroll_all = true;
|
||||||
|
simplelist_info_init(&info, "FM Radio", 1, NULL);
|
||||||
|
simplelist_set_line_count(0);
|
||||||
|
simplelist_addline("HW detected: %s", "no");
|
||||||
|
|
||||||
|
info.action_callback = radio_callback;
|
||||||
|
info.hide_selection = true;
|
||||||
|
return simplelist_show_list(&info);
|
||||||
|
}
|
||||||
#ifndef SIMULATOR
|
#ifndef SIMULATOR
|
||||||
#if CONFIG_TUNER
|
#if CONFIG_TUNER
|
||||||
|
|
||||||
|
@ -2324,6 +2349,7 @@ static const struct {
|
||||||
{ "FM Radio", dbg_fm_radio },
|
{ "FM Radio", dbg_fm_radio },
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
{ "TEST HERE", dbg_fm_radio},
|
||||||
#if defined(HAVE_EEPROM) && !defined(HAVE_EEPROM_SETTINGS)
|
#if defined(HAVE_EEPROM) && !defined(HAVE_EEPROM_SETTINGS)
|
||||||
{ "Write back EEPROM", dbg_write_eeprom },
|
{ "Write back EEPROM", dbg_write_eeprom },
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -843,8 +843,12 @@ void simplelist_set_line_count(int lines)
|
||||||
simplelist_line_remaining = sizeof(simplelist_buffer);
|
simplelist_line_remaining = sizeof(simplelist_buffer);
|
||||||
simplelist_line_count = 0;
|
simplelist_line_count = 0;
|
||||||
}
|
}
|
||||||
else if (lines >= SIMPLELIST_MAX_LINES)
|
else if (lines < simplelist_line_count) {
|
||||||
simplelist_line_count = SIMPLELIST_MAX_LINES;
|
char *end = simplelist_text[lines];
|
||||||
|
simplelist_line_pos = end - simplelist_buffer;
|
||||||
|
simplelist_line_remaining = sizeof(simplelist_buffer) - simplelist_line_pos;
|
||||||
|
simplelist_line_count = lines;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* get the current amount of lines shown */
|
/* get the current amount of lines shown */
|
||||||
int simplelist_get_line_count(void)
|
int simplelist_get_line_count(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue