summaryrefslogtreecommitdiff
path: root/apps/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/apps/tree.c b/apps/tree.c
index 6c250edf5c..29903e05cd 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -627,7 +627,9 @@ static int onplay_screen(char* dir, char* file)
627 bool used = false; 627 bool used = false;
628 bool playing = mpeg_status() & MPEG_STATUS_PLAY; 628 bool playing = mpeg_status() & MPEG_STATUS_PLAY;
629 char buf[MAX_PATH]; 629 char buf[MAX_PATH];
630 630 struct entry* f = &dircache[dirstart + dircursor];
631 bool isdir = f->attr & ATTR_DIRECTORY;
632
631 if ((dir[0]=='/') && (dir[1]==0)) 633 if ((dir[0]=='/') && (dir[1]==0))
632 snprintf(buf, sizeof buf, "%s%s", dir, file); 634 snprintf(buf, sizeof buf, "%s%s", dir, file);
633 else 635 else
@@ -650,11 +652,14 @@ static int onplay_screen(char* dir, char* file)
650 LCD_WIDTH/2 - 3, LCD_HEIGHT/2 - 4, 7, 8, true); 652 LCD_WIDTH/2 - 3, LCD_HEIGHT/2 - 4, 7, 8, true);
651 } 653 }
652 654
653 ptr = str(LANG_DELETE); 655 /* don't delete directories */
654 lcd_getstringsize(ptr,&w,&h); 656 if (!isdir) {
655 lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h/2, ptr); 657 ptr = str(LANG_DELETE);
656 lcd_bitmap(bitmap_icons_7x8[Icon_FastForward], 658 lcd_getstringsize(ptr,&w,&h);
657 LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8, true); 659 lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h/2, ptr);
660 lcd_bitmap(bitmap_icons_7x8[Icon_FastForward],
661 LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8, true);
662 }
658 663
659 lcd_putsxy(0, LCD_HEIGHT/2 - h/2, str(LANG_RENAME)); 664 lcd_putsxy(0, LCD_HEIGHT/2 - h/2, str(LANG_RENAME));
660 lcd_bitmap(bitmap_icons_7x8[Icon_FastBackward], 665 lcd_bitmap(bitmap_icons_7x8[Icon_FastBackward],
@@ -693,6 +698,9 @@ static int onplay_screen(char* dir, char* file)
693 698
694 case BUTTON_RIGHT: 699 case BUTTON_RIGHT:
695 case BUTTON_ON | BUTTON_RIGHT: 700 case BUTTON_ON | BUTTON_RIGHT:
701 /* don't delete directories */
702 if (isdir)
703 break;
696 lcd_clear_display(); 704 lcd_clear_display();
697#ifdef HAVE_LCD_CHARCELLS 705#ifdef HAVE_LCD_CHARCELLS
698 lcd_puts(0,0,file); 706 lcd_puts(0,0,file);
@@ -746,9 +754,11 @@ static int onplay_screen(char* dir, char* file)
746 exit = true; 754 exit = true;
747 break; 755 break;
748 756
757#ifdef HAVE_RECORDER_KEYPAD
749 case BUTTON_OFF: 758 case BUTTON_OFF:
750 exit = true; 759 exit = true;
751 break; 760 break;
761#endif
752 } 762 }
753 } 763 }
754 764