summaryrefslogtreecommitdiff
path: root/apps/menu.h
diff options
context:
space:
mode:
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 {
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##_}};