summaryrefslogtreecommitdiff
path: root/apps/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c43
1 files changed, 32 insertions, 11 deletions
diff --git a/apps/tree.c b/apps/tree.c
index d9d23d277a..721fb8c1ef 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -735,6 +735,20 @@ static int dirbrowse(void)
735 oldbutton = button; 735 oldbutton = button;
736 gui_synclist_do_button(&tree_lists, &button); 736 gui_synclist_do_button(&tree_lists, &button);
737 tc.selected_item = gui_synclist_get_sel_pos(&tree_lists); 737 tc.selected_item = gui_synclist_get_sel_pos(&tree_lists);
738 int customaction = ONPLAY_NO_CUSTOMACTION;
739 bool do_restore_display = true;
740 #ifdef HAVE_TAGCACHE
741 if (id3db && (button == ACTION_STD_OK || button == ACTION_STD_CONTEXT))
742 {
743 customaction = tagtree_get_custom_action(&tc);
744 if (customaction == ONPLAY_CUSTOMACTION_SHUFFLE_SONGS)
745 {
746 /* The code to insert shuffled is on the context branch of the switch so we always go here */
747 button = ACTION_STD_CONTEXT;
748 do_restore_display = false;
749 }
750 }
751 #endif
738 switch ( button ) { 752 switch ( button ) {
739 case ACTION_STD_OK: 753 case ACTION_STD_OK:
740 /* nothing to do if no files to display */ 754 /* nothing to do if no files to display */
@@ -773,7 +787,7 @@ static int dirbrowse(void)
773 default: 787 default:
774 break; 788 break;
775 } 789 }
776 restore = true; 790 restore = do_restore_display;
777 break; 791 break;
778 792
779 case ACTION_STD_CANCEL: 793 case ACTION_STD_CANCEL:
@@ -798,12 +812,12 @@ static int dirbrowse(void)
798 if (ft_exit(&tc) == 3) 812 if (ft_exit(&tc) == 3)
799 exit_func = true; 813 exit_func = true;
800 814
801 restore = true; 815 restore = do_restore_display;
802 break; 816 break;
803 817
804 case ACTION_TREE_STOP: 818 case ACTION_TREE_STOP:
805 if (list_stop_handler()) 819 if (list_stop_handler())
806 restore = true; 820 restore = do_restore_display;
807 break; 821 break;
808 822
809 case ACTION_STD_MENU: 823 case ACTION_STD_MENU:
@@ -851,7 +865,7 @@ static int dirbrowse(void)
851 skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_ALL); 865 skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_ALL);
852 } 866 }
853 867
854 restore = true; 868 restore = do_restore_display;
855 break; 869 break;
856 } 870 }
857#endif 871#endif
@@ -872,7 +886,7 @@ static int dirbrowse(void)
872 break; 886 break;
873 887
874 if(!numentries) 888 if(!numentries)
875 onplay_result = onplay(NULL, 0, curr_context, hotkey); 889 onplay_result = onplay(NULL, 0, curr_context, hotkey, customaction);
876 else { 890 else {
877#ifdef HAVE_TAGCACHE 891#ifdef HAVE_TAGCACHE
878 if (id3db) 892 if (id3db)
@@ -902,7 +916,7 @@ static int dirbrowse(void)
902 ft_assemble_path(buf, sizeof(buf), currdir, entry->name); 916 ft_assemble_path(buf, sizeof(buf), currdir, entry->name);
903 917
904 } 918 }
905 onplay_result = onplay(buf, attr, curr_context, hotkey); 919 onplay_result = onplay(buf, attr, curr_context, hotkey, customaction);
906 } 920 }
907 switch (onplay_result) 921 switch (onplay_result)
908 { 922 {
@@ -911,7 +925,7 @@ static int dirbrowse(void)
911 break; 925 break;
912 926
913 case ONPLAY_OK: 927 case ONPLAY_OK:
914 restore = true; 928 restore = do_restore_display;
915 break; 929 break;
916 930
917 case ONPLAY_RELOAD_DIR: 931 case ONPLAY_RELOAD_DIR:
@@ -988,7 +1002,7 @@ static int dirbrowse(void)
988 1002
989 lastfilter = *tc.dirfilter; 1003 lastfilter = *tc.dirfilter;
990 lastsortcase = global_settings.sort_case; 1004 lastsortcase = global_settings.sort_case;
991 restore = true; 1005 restore = do_restore_display;
992 } 1006 }
993 1007
994 if (exit_func) 1008 if (exit_func)
@@ -1005,7 +1019,7 @@ static int dirbrowse(void)
1005 } 1019 }
1006 } 1020 }
1007 } 1021 }
1008 return true; 1022 return GO_TO_ROOT;
1009} 1023}
1010 1024
1011int create_playlist(void) 1025int create_playlist(void)
@@ -1101,12 +1115,13 @@ int rockbox_browse(struct browse_context *browse)
1101 ret_val = dirbrowse(); 1115 ret_val = dirbrowse();
1102 } 1116 }
1103 } 1117 }
1118
1119 tc.is_browsing = false;
1120
1104 backup_count--; 1121 backup_count--;
1105 if (backup_count >= 0) 1122 if (backup_count >= 0)
1106 tc = backups[backup_count]; 1123 tc = backups[backup_count];
1107 1124
1108 tc.is_browsing = false;
1109
1110 return ret_val; 1125 return ret_val;
1111} 1126}
1112 1127
@@ -1251,6 +1266,12 @@ static void say_filetype(int attr)
1251 1266
1252static int ft_play_dirname(char* name) 1267static int ft_play_dirname(char* name)
1253{ 1268{
1269#ifdef HAVE_MULTIVOLUME
1270 int vol = path_get_volume_id(name);
1271 if (talk_volume_id(vol))
1272 return 1;
1273#endif
1274
1254 return talk_file(tc.currdir, name, dir_thumbnail_name, NULL, 1275 return talk_file(tc.currdir, name, dir_thumbnail_name, NULL,
1255 global_settings.talk_filetype ? 1276 global_settings.talk_filetype ?
1256 TALK_IDARRAY(VOICE_DIR) : NULL, 1277 TALK_IDARRAY(VOICE_DIR) : NULL,