Index: apps/onplay.c
===================================================================
RCS file: /cvsroot/rockbox/apps/onplay.c,v
retrieving revision 1.65
diff -u -3 -p -u -r1.65 onplay.c
--- apps/onplay.c	5 Dec 2005 22:44:41 -0000	1.65
+++ apps/onplay.c	26 Dec 2005 09:42:38 -0000
@@ -49,6 +49,9 @@
 #include "action.h"
 #include "splash.h"
 #include "yesno.h"
+#include "tagcache.h"
+#include "tagtree.h"
+#include "logf.h"
 
 #ifdef HAVE_LCD_BITMAP
 #include "icons.h"
@@ -61,6 +64,7 @@ static int context;
 static char* selected_file = NULL;
 static int selected_file_attr = 0;
 static int onplay_result = ONPLAY_OK;
+static struct tree_context* tc;
 
 /* For playlist options */
 struct playlist_args {
@@ -170,7 +174,7 @@ static bool add_to_playlist(int position
         playlist_create(NULL, NULL);
 
     if ((selected_file_attr & TREE_ATTR_MASK) == TREE_ATTR_MPA)
-        playlist_insert_track(NULL, selected_file, position, queue);
+        playlist_insert_track(NULL, selected_file, position, queue, true);
     else if (selected_file_attr & ATTR_DIRECTORY)
     {
         bool recurse = false;
@@ -457,6 +461,21 @@ static bool rename_file(void)
     return false;
 }
 
+static bool rename_tag(void)
+{
+/*    struct tagcache_search tcs;
+    char newname[MAX_PATH];
+    
+    strncpy(newname, dptr->name, sizeof newname);
+    if (!kbd_input(newname, sizeof newname)) {
+        tagtree_rename_tag(tc);
+                 
+        onplay_result = ONPLAY_RELOAD_DIR;
+    }
+*/
+    return false;
+}
+
 bool create_dir(void)
 {
     char dirname[MAX_PATH];
@@ -503,7 +522,7 @@ static int onplay_callback(int key, int 
     return key;
 }
 
-int onplay(char* file, int attr, int from)
+int onplay(char* file, int attr, int from, struct tree_context* c)
 {
     struct menu_item items[8]; /* increase this if you add entries! */
     int m, i=0, result;
@@ -513,6 +532,7 @@ int onplay(char* file, int attr, int fro
     exit_to_main = false;
     selected_file = file;
     selected_file_attr = attr;
+    tc = c;
 
     if (context == CONTEXT_WPS)
     {
@@ -531,6 +551,13 @@ int onplay(char* file, int attr, int fro
         i++;
     }
 
+    if (context == CONTEXT_ID3DB)
+    {
+        items[i].desc = ID2P(LANG_RENAME);
+        items[i].function = rename_tag;
+        i++;
+    }
+    
     if (context == CONTEXT_WPS)
     {
         items[i].desc = ID2P(LANG_BOOKMARK_MENU);
