summaryrefslogtreecommitdiff
path: root/apps/tree.c
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-05-21 14:30:54 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-05-21 14:30:54 +0000
commite493efd12b0840541be2e98df30597692ab2eb8f (patch)
treed0dd51d5e811b137246f3bcab0d5a6b0ad304c7d /apps/tree.c
parent55c7da2c2c03e002a538c210ec4235e3efe8de44 (diff)
downloadrockbox-e493efd12b0840541be2e98df30597692ab2eb8f.tar.gz
rockbox-e493efd12b0840541be2e98df30597692ab2eb8f.zip
Added main_menu access
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@643 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c45
1 files changed, 34 insertions, 11 deletions
diff --git a/apps/tree.c b/apps/tree.c
index b873b11483..d8dc779d43 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -185,18 +185,12 @@ bool dirbrowse(char *root)
185 } 185 }
186 switch(key) { 186 switch(key) {
187#ifdef HAVE_RECORDER_KEYPAD 187#ifdef HAVE_RECORDER_KEYPAD
188 case BUTTON_OFF:
189 return false;
190 break;
191 case BUTTON_LEFT: 188 case BUTTON_LEFT:
192#else 189#else
193 case BUTTON_STOP: 190 case BUTTON_STOP:
194#endif 191#endif
195 i=strlen(currdir); 192 i=strlen(currdir);
196 if (i==1) { 193 if (i>1) {
197 return false;
198 }
199 else {
200 while (currdir[i-1]!='/') 194 while (currdir[i-1]!='/')
201 i--; 195 i--;
202 strcpy(buf,&currdir[i]); 196 strcpy(buf,&currdir[i]);
@@ -222,9 +216,7 @@ bool dirbrowse(char *root)
222 if (dircursor==TREE_MAX_ON_SCREEN) 216 if (dircursor==TREE_MAX_ON_SCREEN)
223 dircursor=0; 217 dircursor=0;
224 lcd_puts(0, LINE_Y+dircursor, "-"); 218 lcd_puts(0, LINE_Y+dircursor, "-");
225#ifdef HAVE_LCD_BITMAP
226 lcd_update(); 219 lcd_update();
227#endif
228 } 220 }
229 221
230 break; 222 break;
@@ -272,9 +264,7 @@ bool dirbrowse(char *root)
272 lcd_puts(0, LINE_Y+dircursor, " "); 264 lcd_puts(0, LINE_Y+dircursor, " ");
273 dircursor--; 265 dircursor--;
274 lcd_puts(0, LINE_Y+dircursor, "-"); 266 lcd_puts(0, LINE_Y+dircursor, "-");
275#ifdef HAVE_LCD_BITMAP
276 lcd_update(); 267 lcd_update();
277#endif
278 } 268 }
279 else { 269 else {
280 if (start) { 270 if (start) {
@@ -318,6 +308,39 @@ bool dirbrowse(char *root)
318 } 308 }
319 } 309 }
320 break; 310 break;
311
312#ifdef HAVE_RECORDER_KEYPAD
313 case BUTTON_F1:
314 case BUTTON_F2:
315 case BUTTON_F3:
316#else
317 case BUTTON_MENU:
318#endif
319 main_menu();
320
321 /* restore display */
322 /* TODO: this is just a copy from BUTTON_STOP, fix it */
323 lcd_clear_display();
324#ifdef HAVE_LCD_BITMAP
325 lcd_putsxy(0,0, "[Browse]",0);
326 lcd_setmargins(0,MARGIN_Y);
327 lcd_setfont(0);
328#endif
329 if ( dirlevel < MAX_DIR_LEVELS )
330 start = dirpos[dirlevel];
331 else
332 start = 0;
333 numentries = showdir(currdir, buffer, 0, start, &at_end);
334 dircursor=0;
335 while ( (dircursor < TREE_MAX_ON_SCREEN) &&
336 (strcmp(buffer[dircursor].name,buf)!=0))
337 dircursor++;
338 if (dircursor==TREE_MAX_ON_SCREEN)
339 dircursor=0;
340 lcd_puts(0, LINE_Y+dircursor, "-");
341 lcd_update();
342
343 break;
321 } 344 }
322 } 345 }
323 346