diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-08-23 12:32:52 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-08-23 12:32:52 +0000 |
commit | b285076925fed906d95573b64115cb3f6bdafe65 (patch) | |
tree | 6d959f585fc210acf39e667991038d21aef48d13 /apps/menu.c | |
parent | ad4a92eb87eb98ff316f54f06650f1c5e1dcd7ca (diff) | |
download | rockbox-b285076925fed906d95573b64115cb3f6bdafe65.tar.gz rockbox-b285076925fed906d95573b64115cb3f6bdafe65.zip |
Remade the menu system slightly. All functions invoked from menus now use
the Menu typedef as return type, and *ALL* menus that intercept USB connect
can then return MENU_REFRESH_DIR so that the parent (any parent really) that
do file or dir-accesses knows that and can do the refresh. If no refresh
is needed by the parent, MENU_OK is returned.
Somewhat biggish commit this close to 1.3, but we need to sort out this
refresh-after-usb-connected business.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1948 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/menu.c')
-rw-r--r-- | apps/menu.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/menu.c b/apps/menu.c index 418ccf309d..b0060f4df4 100644 --- a/apps/menu.c +++ b/apps/menu.c | |||
@@ -212,13 +212,14 @@ void menu_exit(int m) | |||
212 | inuse[m] = false; | 212 | inuse[m] = false; |
213 | } | 213 | } |
214 | 214 | ||
215 | void menu_run(int m) | 215 | Menu menu_run(int m) |
216 | { | 216 | { |
217 | #ifndef SIMULATOR | 217 | #ifndef SIMULATOR |
218 | #ifdef HAVE_LCD_BITMAP | 218 | #ifdef HAVE_LCD_BITMAP |
219 | bool laststate; | 219 | bool laststate; |
220 | #endif | 220 | #endif |
221 | #endif | 221 | #endif |
222 | Menu result = MENU_OK; | ||
222 | 223 | ||
223 | menu_draw(m); | 224 | menu_draw(m); |
224 | 225 | ||
@@ -273,7 +274,7 @@ void menu_run(int m) | |||
273 | case BUTTON_MENU: | 274 | case BUTTON_MENU: |
274 | #endif | 275 | #endif |
275 | lcd_stop_scroll(); | 276 | lcd_stop_scroll(); |
276 | return; | 277 | return result; |
277 | 278 | ||
278 | #ifdef HAVE_RECORDER_KEYPAD | 279 | #ifdef HAVE_RECORDER_KEYPAD |
279 | case BUTTON_F3: | 280 | case BUTTON_F3: |
@@ -298,6 +299,7 @@ void menu_run(int m) | |||
298 | #else | 299 | #else |
299 | lcd_icon(ICON_PARAM, true); | 300 | lcd_icon(ICON_PARAM, true); |
300 | #endif | 301 | #endif |
302 | result = MENU_REFRESH_DIR; | ||
301 | break; | 303 | break; |
302 | #endif | 304 | #endif |
303 | 305 | ||
@@ -308,4 +310,6 @@ void menu_run(int m) | |||
308 | status_draw(); | 310 | status_draw(); |
309 | lcd_update(); | 311 | lcd_update(); |
310 | } | 312 | } |
313 | |||
314 | return result; | ||
311 | } | 315 | } |