summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorSteve Bavin <pondlife@pondlife.me>2008-03-25 15:35:14 +0000
committerSteve Bavin <pondlife@pondlife.me>2008-03-25 15:35:14 +0000
commitae39135e2ead39a440af564b418ec929e70e09ed (patch)
treef1c8fef0b644ff03389fdaca872ec3b4b0df3a7b /apps
parentcd88e2ad93881c9516c7c712b628b42450506f4f (diff)
downloadrockbox-ae39135e2ead39a440af564b418ec929e70e09ed.tar.gz
rockbox-ae39135e2ead39a440af564b418ec929e70e09ed.zip
Oops. Mop up red.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16799 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/option_select.c73
1 files changed, 1 insertions, 72 deletions
diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c
index cb5b6eee36..d9c594bfaa 100644
--- a/apps/gui/option_select.c
+++ b/apps/gui/option_select.c
@@ -530,77 +530,6 @@ bool option_screen(struct settings_list *setting,
530 return false; 530 return false;
531} 531}
532 532
533/******************************************************
534 Compatability functions
535*******************************************************/
536#define MAX_OPTIONS 32
537const struct opt_items *set_option_options;
538void set_option_formatter(char* buf, size_t size, int item, const char* unit)
539{
540 (void)unit;
541 const unsigned char *text = set_option_options[item].string;
542 snprintf(buf, size, "%s", P2STR(text));
543}
544int32_t set_option_get_talk_id(int value, int unit)
545{
546 (void)unit;
547 return set_option_options[value].voice_id;
548}
549bool set_option(const char* string, void* variable, enum optiontype type,
550 const struct opt_items* options,
551 int numoptions, void (*function)(int))
552{
553 int temp;
554 struct settings_list item;
555 struct int_setting data = {
556 function, UNIT_INT, 0, numoptions-1, 1,
557 set_option_formatter, set_option_get_talk_id
558 };
559 set_option_options = options;
560 item.int_setting = &data;
561 item.flags = F_INT_SETTING|F_T_INT;
562 item.lang_id = -1;
563 item.cfg_vals = (char*)string;
564 item.setting = &temp;
565 if (type == BOOL)
566 temp = *(bool*)variable? 1: 0;
567 else
568 temp = *(int*)variable;
569 if (!option_screen(&item, false, NULL))
570 {
571 if (type == BOOL)
572 *(bool*)variable = (temp == 1? true: false);
573 else
574 *(int*)variable = temp;
575 return false;
576 }
577 return true;
578}
579
580bool set_int_ex(const unsigned char* string,
581 const char* unit,
582 int voice_unit,
583 int* variable,
584 void (*function)(int),
585 int step,
586 int min,
587 int max,
588 void (*formatter)(char*, size_t, int, const char*),
589 int32_t (*get_talk_id)(int, int))
590{
591 (void)unit;
592 struct settings_list item;
593 struct int_setting data = {
594 function, voice_unit, min, max, step,
595 formatter, get_talk_id
596 };
597 item.int_setting = &data;
598 item.flags = F_INT_SETTING|F_T_INT;
599 item.lang_id = -1;
600 item.cfg_vals = (char*)string;
601 item.setting = variable;
602 return option_screen(&item, false, NULL);
603}
604 533
605/* to be replaced */ 534/* to be replaced */
606void option_select_init_items(struct option_select * opt, 535void option_select_init_items(struct option_select * opt,
@@ -649,5 +578,5 @@ void option_select_prev(struct option_select * opt)
649 578
650const char * option_select_get_text(struct option_select * opt) 579const char * option_select_get_text(struct option_select * opt)
651{ 580{
652 return(P2STR(opt->items[opt->option].string)); 581 return(P2STR(opt->items[opt->option].string));
653} 582}