summaryrefslogtreecommitdiff
path: root/apps/main_menu.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-08-23 12:32:52 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-08-23 12:32:52 +0000
commitb285076925fed906d95573b64115cb3f6bdafe65 (patch)
tree6d959f585fc210acf39e667991038d21aef48d13 /apps/main_menu.c
parentad4a92eb87eb98ff316f54f06650f1c5e1dcd7ca (diff)
downloadrockbox-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/main_menu.c')
-rw-r--r--apps/main_menu.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/apps/main_menu.c b/apps/main_menu.c
index 2cb9bda9bd..885deea6c4 100644
--- a/apps/main_menu.c
+++ b/apps/main_menu.c
@@ -105,7 +105,7 @@ int show_logo( void )
105 return 0; 105 return 0;
106} 106}
107 107
108void show_credits(void) 108Menu show_credits(void)
109{ 109{
110 int j = 0; 110 int j = 0;
111 int btn; 111 int btn;
@@ -120,22 +120,23 @@ void show_credits(void)
120 120
121 btn = button_get(false); 121 btn = button_get(false);
122 if (btn != BUTTON_NONE && !(btn & BUTTON_REL)) 122 if (btn != BUTTON_NONE && !(btn & BUTTON_REL))
123 return; 123 return MENU_OK;
124 } 124 }
125 roll_credits(); 125 roll_credits();
126 return MENU_OK;
126} 127}
127 128
128#ifdef SIMULATOR 129#ifdef SIMULATOR
129#define mp3buf 0 130#define mp3buf 0
130#define mp3end 0 131#define mp3end 0
131 132
132extern void simulate_usb(void); 133extern Menu simulate_usb(void);
133#else 134#else
134/* defined in linker script */ 135/* defined in linker script */
135extern unsigned char mp3buf[]; 136extern unsigned char mp3buf[];
136extern unsigned char mp3end[]; 137extern unsigned char mp3end[];
137#endif 138#endif
138void show_info(void) 139Menu show_info(void)
139{ 140{
140 char s[32]; 141 char s[32];
141 int buflen = ((mp3end - mp3buf) * 100) / 0x100000; 142 int buflen = ((mp3end - mp3buf) * 100) / 0x100000;
@@ -181,11 +182,14 @@ void show_info(void)
181 if(button_get(false) & ~BUTTON_REL) 182 if(button_get(false) & ~BUTTON_REL)
182 done = true; 183 done = true;
183 } 184 }
185
186 return MENU_OK;
184} 187}
185 188
186void main_menu(void) 189Menu main_menu(void)
187{ 190{
188 int m; 191 int m;
192 Menu result;
189 193
190 /* main menu */ 194 /* main menu */
191 struct menu_items items[] = { 195 struct menu_items items[] = {
@@ -208,11 +212,13 @@ void main_menu(void)
208#ifdef HAVE_LCD_CHARCELLS 212#ifdef HAVE_LCD_CHARCELLS
209 lcd_icon(ICON_PARAM, true); 213 lcd_icon(ICON_PARAM, true);
210#endif 214#endif
211 menu_run(m); 215 result = menu_run(m);
212#ifdef HAVE_LCD_CHARCELLS 216#ifdef HAVE_LCD_CHARCELLS
213 lcd_icon(ICON_PARAM, false); 217 lcd_icon(ICON_PARAM, false);
214#endif 218#endif
215 menu_exit(m); 219 menu_exit(m);
216 220
217 settings_save(); 221 settings_save();
222
223 return result;
218} 224}