summaryrefslogtreecommitdiff
path: root/apps/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/apps/tree.c b/apps/tree.c
index 9935d8263d..e61fdc50cb 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -46,12 +46,12 @@
46#include "rolo.h" 46#include "rolo.h"
47#include "icons.h" 47#include "icons.h"
48#include "lang.h" 48#include "lang.h"
49#include "viewer.h"
50#include "language.h" 49#include "language.h"
51#include "screens.h" 50#include "screens.h"
52#include "keyboard.h" 51#include "keyboard.h"
53#include "onplay.h" 52#include "onplay.h"
54#include "buffer.h" 53#include "buffer.h"
54#include "plugin.h"
55 55
56#ifdef HAVE_LCD_BITMAP 56#ifdef HAVE_LCD_BITMAP
57#include "widgets.h" 57#include "widgets.h"
@@ -318,6 +318,8 @@ static int showdir(char *path, int start)
318 else if (!strcasecmp(&entry->d_name[len-4], ".mod")) 318 else if (!strcasecmp(&entry->d_name[len-4], ".mod"))
319#endif 319#endif
320 dptr->attr |= TREE_ATTR_MOD; 320 dptr->attr |= TREE_ATTR_MOD;
321 else if (!strcasecmp(&entry->d_name[len-5], ".rock"))
322 dptr->attr |= TREE_ATTR_ROCK;
321 } 323 }
322 324
323 /* filter out all non-playlist files */ 325 /* filter out all non-playlist files */
@@ -468,6 +470,10 @@ static int showdir(char *path, int start)
468 icon_type = Mod_Ajz; 470 icon_type = Mod_Ajz;
469 break; 471 break;
470 472
473 case TREE_ATTR_ROCK:
474 icon_type = Plugin;
475 break;
476
471#ifdef HAVE_LCD_BITMAP 477#ifdef HAVE_LCD_BITMAP
472 case TREE_ATTR_FONT: 478 case TREE_ATTR_FONT:
473 icon_type = Font; 479 icon_type = Font;
@@ -962,7 +968,7 @@ bool dirbrowse(char *root)
962 break; 968 break;
963 969
964 case TREE_ATTR_TXT: 970 case TREE_ATTR_TXT:
965 viewer_run(buf); 971 plugin_load("/.rockbox/rocks/viewer.rock",buf);
966 restore = true; 972 restore = true;
967 break; 973 break;
968 974
@@ -998,6 +1004,14 @@ bool dirbrowse(char *root)
998 rolo_load(buf); 1004 rolo_load(buf);
999 break; 1005 break;
1000#endif 1006#endif
1007
1008 /* plugin file */
1009 case TREE_ATTR_ROCK:
1010 if (plugin_load(buf,NULL) == PLUGIN_USB_CONNECTED)
1011 reload_root = true;
1012 else
1013 restore = true;
1014 break;
1001 } 1015 }
1002 1016
1003 if ( play ) { 1017 if ( play ) {
@@ -1194,6 +1208,7 @@ bool dirbrowse(char *root)
1194 /* the sub-screen might've ruined the margins */ 1208 /* the sub-screen might've ruined the margins */
1195 lcd_setmargins(MARGIN_X,MARGIN_Y); /* leave room for cursor and 1209 lcd_setmargins(MARGIN_X,MARGIN_Y); /* leave room for cursor and
1196 icon */ 1210 icon */
1211 lcd_setfont(FONT_UI);
1197#endif 1212#endif
1198 numentries = showdir(currdir, dirstart); 1213 numentries = showdir(currdir, dirstart);
1199 update_all = true; 1214 update_all = true;