Give all menus using the old API a nice title and icons (except plugins)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13068 a1c6a512-1295-4272-9138-f99709370657
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index be77699..48e67b5 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -2390,7 +2390,7 @@
     };
 
     m=menu_init( items, sizeof items / sizeof(struct menu_item), NULL,
-                 NULL, NULL, NULL);
+                 "Debug Menu", NULL, NULL);
     result = menu_run(m);
     menu_exit(m);
 
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 336beec..69900c5 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -10727,3 +10727,17 @@
     *: ""
   </voice>
 </phrase>
+<phrase>
+  id: LANG_ONPLAY_MENU_TITLE
+  desc: title for the onplay menus
+  user:
+  <source>
+    *: "Context Menu"
+  </source>
+  <dest>
+    *: "Context Menu"
+  </dest>
+  <voice>
+    *: "Context Menu"
+  </voice>
+</phrase>
diff --git a/apps/menu.c b/apps/menu.c
index b1ba9ea..34a6d0e 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -61,6 +61,7 @@
 /* needed for the old menu system */
 struct menu {
     struct menu_item* items;
+    char *title;
     int count;
     int (*callback)(int, int);
     int current_selection;
@@ -659,9 +660,6 @@
 int menu_init(const struct menu_item* mitems, int count, int (*callback)(int, int),
               const char *button1, const char *button2, const char *button3)
 {
-    (void)button1;
-    (void)button2;
-    (void)button3;
     int menu=menu_find_free();
     if(menu==-1)/* Out of menus */
         return -1;
@@ -669,6 +667,9 @@
     menus[menu].count = count;
     menus[menu].callback = callback;
     menus[menu].current_selection = 0;
+    if ((button2 == NULL) && (button3 == NULL))
+        menus[menu].title = button1;
+    else menus[menu].title = NULL;
     return menu;
 }
 
@@ -702,6 +703,14 @@
     unsigned char* desc = menus[(intptr_t)data].items[selected_item].desc;
     return P2STR(desc);
 }
+
+#ifdef HAVE_LCD_BITMAP
+static void oldmenu_get_icon(int selected_item, void * data, ICON * icon)
+{
+    *icon = bitmap_icons_6x8[Icon_Menu_functioncall];
+}
+#endif
+
 static void init_oldmenu(const struct menu_item_ex *menu,
                      struct gui_synclist *lists, int selected, bool callback)
 {
@@ -711,6 +720,11 @@
     gui_synclist_set_nb_items(lists, MENU_GET_COUNT(menu->flags));
     gui_synclist_limit_scroll(lists, true);
     gui_synclist_select_item(lists, selected);
+#ifdef HAVE_LCD_BITMAP
+    gui_synclist_set_title(lists, menus[menu->value].title,
+                           bitmap_icons_6x8[Icon_Submenu_Entered]);
+    gui_synclist_set_icon_callback(lists, oldmenu_get_icon);
+#endif
 }
 
 static void menu_talk_selected(int m)
@@ -729,7 +743,7 @@
     {
         oldmenuwrapper_callback, 
         oldmenuwrapper_getname,
-        (void*)(intptr_t)m, Icon_NOICON
+        (void*)(intptr_t)m, Icon_Submenu
     };
 
     menu.flags = (MENU_TYPE_MASK&MT_OLD_MENU) | MENU_DYNAMIC_DESC |
diff --git a/apps/menu.h b/apps/menu.h
index 365af53..a861553 100644
--- a/apps/menu.h
+++ b/apps/menu.h
@@ -189,6 +189,7 @@
     bool (*function) (void); /* return true if USB was connected */
 };
 
+/* if button2 == button3 == NULL, button1 is the menu title */
 int menu_init(const struct menu_item* mitems, int count,
                 int (*callback)(int, int),
                 const char *button1, const char *button2, const char *button3);
diff --git a/apps/onplay.c b/apps/onplay.c
index fb3ed24..573511d 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -107,7 +107,7 @@
         }
     }
 
-    m=menu_init( items, i, NULL, NULL, NULL, NULL );
+    m=menu_init( items, i, NULL, str(LANG_BOOKMARK_MENU), NULL, NULL );
 
 #ifdef HAVE_LCD_CHARCELLS
     status_set_param(true);
@@ -256,7 +256,7 @@
         i++;
     }
 
-    m = menu_init( items, i, NULL, NULL, NULL, NULL );
+    m = menu_init( items, i, NULL, str(LANG_CATALOG), NULL, NULL );
     result = menu_show(m);
     if(result >= 0)
         ret = items[result].function();
@@ -373,7 +373,7 @@
         }
     }
 
-    m = menu_init( items, i, NULL, NULL, NULL, NULL );
+    m = menu_init( items, i, NULL, str(LANG_PLAYLIST_MENU), NULL, NULL );
     result = menu_show(m);
     if (result >= 0 && result < pstart)
         ret = items[result].function();
@@ -1048,7 +1048,8 @@
     /* DIY menu handling, since we want to exit after selection */
     if (i)
     {
-        m = menu_init( items, i, onplay_callback, NULL, NULL, NULL );
+        m = menu_init( items, i, onplay_callback,
+                       str(LANG_ONPLAY_MENU_TITLE), NULL, NULL );
 #ifdef HAVE_TAGCACHE      
         do 
         {
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c
index aae2101..d065ad3 100644
--- a/apps/playlist_viewer.c
+++ b/apps/playlist_viewer.c
@@ -440,7 +440,7 @@
     items[i].desc = ID2P(LANG_CATALOG_ADD_TO_NEW);
     i++;
 
-    m = menu_init(items, i, NULL, NULL, NULL, NULL);
+    m = menu_init(items, i, NULL, str(LANG_PLAYLIST_MENU), NULL, NULL);
     result = menu_show(m);
     if (result == MENU_ATTACHED_USB)
     {