summaryrefslogtreecommitdiffstats
path: root/apps/menu.h
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-03-18 07:03:43 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-03-18 07:03:43 +0000
commite54d8e1388fff7825fdd3ae40a04b1338b03ca81 (patch)
treee18b92ba8c2ab3489578aa12c4fa02ee21f372e1 /apps/menu.h
parentb5e587c0811e670efaf19cd81c32e0035a276fdb (diff)
downloadrockbox-e54d8e1388fff7825fdd3ae40a04b1338b03ca81.tar.gz
rockbox-e54d8e1388fff7825fdd3ae40a04b1338b03ca81.tar.bz2
rockbox-e54d8e1388fff7825fdd3ae40a04b1338b03ca81.zip
Remove the exit_value variable.. set the MENU_FUNC_CHECK_RETVAL fla and
return 1 if you want your funciton to quit the menus. save settings after clearing the background so it persists git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12827 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/menu.h')
-rw-r--r--apps/menu.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/apps/menu.h b/apps/menu.h
index ded25500bf..3a7a2de42f 100644
--- a/apps/menu.h
+++ b/apps/menu.h
@@ -46,7 +46,6 @@ struct menu_func {
int (*function)(void);
};
void *param; /* passed to function_w_param */
- int exit_value; /* exit do_menu() if function returns this value */
};
#define MENU_TYPE_MASK 0xF /* MT_* type */
@@ -151,24 +150,23 @@ bool do_setting_from_menu(const struct menu_item_ex *temp);
/* Use this to put a function call into the menu.
When the user selects this item the function will be run,
- unless MENU_FUNC_IGNORE_RETVAL is set, when it exits the user
- will be back in the menu and return value is ignored,
- else if it returns exit_if do_mneu() will exit */
+ unless MENU_FUNC_IGNORE_RETVAL is set, the return value
+ will be checked, returning 1 will exit do_menu(); */
#define MENUITEM_FUNCTION(name, flags, str, func, param, \
- exit_if, callback, icon) \
+ callback, icon) \
static const struct menu_callback_with_desc name##_ = {callback,str,icon}; \
- static const struct menu_func name##__ = {{(void*)func}, param, exit_if}; \
+ static const struct menu_func name##__ = {{(void*)func}, param}; \
/* should be const, but recording_settings wont let us do that */ \
const struct menu_item_ex name = \
{ MT_FUNCTION_CALL|MENU_HAS_DESC|flags, \
{ .function = & name##__}, {.callback_and_desc = & name##_}};
/* As above, except the text is dynamic */
-#define MENUITEM_FUNCTION_DYNTEXT(name, flags, func, param, exit_if, \
+#define MENUITEM_FUNCTION_DYNTEXT(name, flags, func, param, \
text_callback, text_cb_data, callback, icon) \
static const struct menu_get_name_and_icon name##_ \
= {callback,text_callback,text_cb_data,icon}; \
- static const struct menu_func name##__ = {{(void*)func}, param, exit_if}; \
+ static const struct menu_func name##__ = {{(void*)func}, param}; \
static const struct menu_item_ex name = \
{ MT_FUNCTION_CALL|MENU_DYNAMIC_DESC|flags, \
{ .function = & name##__}, {.menu_get_name_and_icon = & name##_}};