summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-07-23 05:40:45 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-07-23 05:40:45 +0000
commitfe2b376060cfedb2d53b6025fcdef9cdd8604733 (patch)
treec13a789bac4c522757f0ccf245b524a1d76f8566 /apps
parent8584a6bb5d8520b603b89d3fec8ffd13e399143c (diff)
downloadrockbox-fe2b376060cfedb2d53b6025fcdef9cdd8604733.zip
rockbox-fe2b376060cfedb2d53b6025fcdef9cdd8604733.tar.gz
rockbox-fe2b376060cfedb2d53b6025fcdef9cdd8604733.tar.bz2
rockbox-fe2b376060cfedb2d53b6025fcdef9cdd8604733.tar.xz
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
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/option_select.c17
-rw-r--r--apps/gui/option_select.h3
-rw-r--r--apps/menu.c8
-rw-r--r--apps/plugin.h7
-rw-r--r--apps/plugins/lib/playback_control.c6
5 files changed, 24 insertions, 17 deletions
diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c
index 11352fd..6bb69c2 100644
--- a/apps/gui/option_select.c
+++ b/apps/gui/option_select.c
@@ -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 */
diff --git a/apps/gui/option_select.h b/apps/gui/option_select.h
index 8fc19db..e46570f 100644
--- a/apps/gui/option_select.h
+++ b/apps/gui/option_select.h
@@ -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
{
diff --git a/apps/menu.c b/apps/menu.c
index a9bc0d4..60f2424 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -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;
}
diff --git a/apps/plugin.h b/apps/plugin.h
index db520c3..9adefc1 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -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));
diff --git a/apps/plugins/lib/playback_control.c b/apps/plugins/lib/playback_control.c
index 94f0d69..38021bc 100644
--- a/apps/plugins/lib/playback_control.c
+++ b/apps/plugins/lib/playback_control.c
@@ -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))