diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-03-18 07:03:43 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-03-18 07:03:43 +0000 |
commit | e54d8e1388fff7825fdd3ae40a04b1338b03ca81 (patch) | |
tree | e18b92ba8c2ab3489578aa12c4fa02ee21f372e1 /apps/menu.h | |
parent | b5e587c0811e670efaf19cd81c32e0035a276fdb (diff) | |
download | rockbox-e54d8e1388fff7825fdd3ae40a04b1338b03ca81.tar.gz 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.h | 14 |
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 { | |||
46 | int (*function)(void); | 46 | int (*function)(void); |
47 | }; | 47 | }; |
48 | void *param; /* passed to function_w_param */ | 48 | void *param; /* passed to function_w_param */ |
49 | int exit_value; /* exit do_menu() if function returns this value */ | ||
50 | }; | 49 | }; |
51 | 50 | ||
52 | #define MENU_TYPE_MASK 0xF /* MT_* type */ | 51 | #define MENU_TYPE_MASK 0xF /* MT_* type */ |
@@ -151,24 +150,23 @@ bool do_setting_from_menu(const struct menu_item_ex *temp); | |||
151 | 150 | ||
152 | /* Use this to put a function call into the menu. | 151 | /* Use this to put a function call into the menu. |
153 | When the user selects this item the function will be run, | 152 | When the user selects this item the function will be run, |
154 | unless MENU_FUNC_IGNORE_RETVAL is set, when it exits the user | 153 | unless MENU_FUNC_IGNORE_RETVAL is set, the return value |
155 | will be back in the menu and return value is ignored, | 154 | will be checked, returning 1 will exit do_menu(); */ |
156 | else if it returns exit_if do_mneu() will exit */ | ||
157 | #define MENUITEM_FUNCTION(name, flags, str, func, param, \ | 155 | #define MENUITEM_FUNCTION(name, flags, str, func, param, \ |
158 | exit_if, callback, icon) \ | 156 | callback, icon) \ |
159 | static const struct menu_callback_with_desc name##_ = {callback,str,icon}; \ | 157 | static const struct menu_callback_with_desc name##_ = {callback,str,icon}; \ |
160 | static const struct menu_func name##__ = {{(void*)func}, param, exit_if}; \ | 158 | static const struct menu_func name##__ = {{(void*)func}, param}; \ |
161 | /* should be const, but recording_settings wont let us do that */ \ | 159 | /* should be const, but recording_settings wont let us do that */ \ |
162 | const struct menu_item_ex name = \ | 160 | const struct menu_item_ex name = \ |
163 | { MT_FUNCTION_CALL|MENU_HAS_DESC|flags, \ | 161 | { MT_FUNCTION_CALL|MENU_HAS_DESC|flags, \ |
164 | { .function = & name##__}, {.callback_and_desc = & name##_}}; | 162 | { .function = & name##__}, {.callback_and_desc = & name##_}}; |
165 | 163 | ||
166 | /* As above, except the text is dynamic */ | 164 | /* As above, except the text is dynamic */ |
167 | #define MENUITEM_FUNCTION_DYNTEXT(name, flags, func, param, exit_if, \ | 165 | #define MENUITEM_FUNCTION_DYNTEXT(name, flags, func, param, \ |
168 | text_callback, text_cb_data, callback, icon) \ | 166 | text_callback, text_cb_data, callback, icon) \ |
169 | static const struct menu_get_name_and_icon name##_ \ | 167 | static const struct menu_get_name_and_icon name##_ \ |
170 | = {callback,text_callback,text_cb_data,icon}; \ | 168 | = {callback,text_callback,text_cb_data,icon}; \ |
171 | static const struct menu_func name##__ = {{(void*)func}, param, exit_if}; \ | 169 | static const struct menu_func name##__ = {{(void*)func}, param}; \ |
172 | static const struct menu_item_ex name = \ | 170 | static const struct menu_item_ex name = \ |
173 | { MT_FUNCTION_CALL|MENU_DYNAMIC_DESC|flags, \ | 171 | { MT_FUNCTION_CALL|MENU_DYNAMIC_DESC|flags, \ |
174 | { .function = & name##__}, {.menu_get_name_and_icon = & name##_}}; | 172 | { .function = & name##__}, {.menu_get_name_and_icon = & name##_}}; |