Fix the text for settings which have a different title than what is shown in the menu (i.e scroll options)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13962 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
8584a6bb5d
commit
fe2b376060
5 changed files with 24 additions and 17 deletions
|
@ -276,7 +276,8 @@ static void bool_funcwrapper(int value)
|
|||
boolfunction(false);
|
||||
}
|
||||
|
||||
bool option_screen(struct settings_list *setting, bool use_temp_var)
|
||||
bool option_screen(struct settings_list *setting,
|
||||
bool use_temp_var, unsigned char* option_title)
|
||||
{
|
||||
int action;
|
||||
bool done = false;
|
||||
|
@ -286,7 +287,7 @@ bool option_screen(struct settings_list *setting, bool use_temp_var)
|
|||
bool allow_wrap = ((int*)setting->setting != &global_settings.volume);
|
||||
int var_type = setting->flags&F_T_MASK;
|
||||
void (*function)(int) = NULL;
|
||||
|
||||
char *title;
|
||||
if (var_type == F_T_INT || var_type == F_T_UINT)
|
||||
{
|
||||
variable = use_temp_var ? &temp_var: (int*)setting->setting;
|
||||
|
@ -303,11 +304,11 @@ bool option_screen(struct settings_list *setting, bool use_temp_var)
|
|||
gui_synclist_init(&lists, value_setting_get_name_cb,
|
||||
(void*)setting, false, 1);
|
||||
if (setting->lang_id == -1)
|
||||
gui_synclist_set_title(&lists,
|
||||
(char*)setting->cfg_vals, Icon_Questionmark);
|
||||
title = (char*)setting->cfg_vals;
|
||||
else
|
||||
gui_synclist_set_title(&lists,
|
||||
str(setting->lang_id), Icon_Questionmark);
|
||||
title = P2STR(option_title);
|
||||
|
||||
gui_synclist_set_title(&lists, title, Icon_Questionmark);
|
||||
gui_synclist_set_icon_callback(&lists, NULL);
|
||||
|
||||
/* set the number of items and current selection */
|
||||
|
@ -466,7 +467,7 @@ bool set_option(const char* string, void* variable, enum optiontype type,
|
|||
data.desc = (void*)strings; /* shutup gcc... */
|
||||
data.option_callback = function;
|
||||
item.choice_setting = &data;
|
||||
option_screen(&item, false);
|
||||
option_screen(&item, false, NULL);
|
||||
if (type == BOOL)
|
||||
{
|
||||
*(bool*)variable = (temp == 1? true: false);
|
||||
|
@ -496,7 +497,7 @@ bool set_int_ex(const unsigned char* string,
|
|||
item.lang_id = -1;
|
||||
item.cfg_vals = (char*)string;
|
||||
item.setting = variable;
|
||||
return option_screen(&item, false);
|
||||
return option_screen(&item, false, NULL);
|
||||
}
|
||||
|
||||
/* to be replaced */
|
||||
|
|
|
@ -21,7 +21,8 @@
|
|||
#define _GUI_OPTION_SELECT_H_
|
||||
#include "settings.h"
|
||||
|
||||
bool option_screen(struct settings_list *setting, bool use_temp_var);
|
||||
bool option_screen(struct settings_list *setting,
|
||||
bool use_temp_var, unsigned char* option_title);
|
||||
|
||||
struct option_select
|
||||
{
|
||||
|
|
|
@ -253,15 +253,19 @@ static void talk_menu_item(const struct menu_item_ex *menu,
|
|||
}
|
||||
}
|
||||
#define MAX_OPTIONS 32
|
||||
/* returns true if the menu needs to be redrwan */
|
||||
bool do_setting_from_menu(const struct menu_item_ex *temp)
|
||||
{
|
||||
int setting_id;
|
||||
const struct settings_list *setting = find_setting(
|
||||
temp->variable,
|
||||
&setting_id);
|
||||
char *title;
|
||||
if ((temp->flags&MENU_TYPE_MASK) == MT_SETTING_W_TEXT)
|
||||
title = temp->callback_and_desc->desc;
|
||||
else
|
||||
title = ID2P(setting->lang_id);
|
||||
option_screen((struct settings_list *)setting,
|
||||
setting->flags&F_TEMPVAR);
|
||||
setting->flags&F_TEMPVAR, title);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -112,12 +112,12 @@
|
|||
#define PLUGIN_MAGIC 0x526F634B /* RocK */
|
||||
|
||||
/* increase this every time the api struct changes */
|
||||
#define PLUGIN_API_VERSION 64
|
||||
#define PLUGIN_API_VERSION 65
|
||||
|
||||
/* update this to latest version if a change to the api struct breaks
|
||||
backwards compatibility (and please take the opportunity to sort in any
|
||||
new function which are "waiting" at the end of the function table) */
|
||||
#define PLUGIN_MIN_API_VERSION 64
|
||||
#define PLUGIN_MIN_API_VERSION 65
|
||||
|
||||
/* plugin return codes */
|
||||
enum plugin_status {
|
||||
|
@ -499,7 +499,8 @@ struct plugin_api {
|
|||
|
||||
/* options */
|
||||
const struct settings_list* (*find_setting)(void* variable, int *id);
|
||||
bool (*option_screen)(struct settings_list *setting, bool use_temp_var);
|
||||
bool (*option_screen)(struct settings_list *setting,
|
||||
bool use_temp_var, unsigned char* option_title);
|
||||
bool (*set_option)(const char* string, void* variable,
|
||||
enum optiontype type, const struct opt_items* options,
|
||||
int numoptions, void (*function)(int));
|
||||
|
|
|
@ -61,14 +61,14 @@ static bool volume(void)
|
|||
{
|
||||
const struct settings_list* vol =
|
||||
api->find_setting(&api->global_settings->volume, NULL);
|
||||
return api->option_screen((struct settings_list*)vol, false);
|
||||
return api->option_screen((struct settings_list*)vol, false, NULL);
|
||||
}
|
||||
|
||||
static bool shuffle(void)
|
||||
{
|
||||
const struct settings_list* shuffle =
|
||||
api->find_setting(&api->global_settings->playlist_shuffle, NULL);
|
||||
return api->option_screen((struct settings_list*)shuffle, false);
|
||||
return api->option_screen((struct settings_list*)shuffle, false, NULL);
|
||||
}
|
||||
|
||||
static bool repeat_mode(void)
|
||||
|
@ -77,7 +77,7 @@ static bool repeat_mode(void)
|
|||
api->find_setting(&api->global_settings->repeat_mode, NULL);
|
||||
int old_repeat = api->global_settings->repeat_mode;
|
||||
|
||||
api->option_screen((struct settings_list*)repeat, false);
|
||||
api->option_screen((struct settings_list*)repeat, false, NULL);
|
||||
|
||||
if (old_repeat != api->global_settings->repeat_mode &&
|
||||
(api->audio_status() & AUDIO_STATUS_PLAY))
|
||||
|
|
Loading…
Reference in a new issue