summaryrefslogtreecommitdiff
path: root/apps/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/apps/tree.c b/apps/tree.c
index 71a7ee3f62..b4cd9d77b0 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -735,6 +735,17 @@ 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 customaction = tagtree_get_custom_action(&tc);
743 if (customaction == ONPLAY_CUSTOMACTION_SHUFFLE_SONGS) {
744 button = ACTION_STD_CONTEXT; /** The code to insert shuffled is on the context branch of the switch so we always go here */
745 do_restore_display = false;
746 }
747 }
748 #endif
738 switch ( button ) { 749 switch ( button ) {
739 case ACTION_STD_OK: 750 case ACTION_STD_OK:
740 /* nothing to do if no files to display */ 751 /* nothing to do if no files to display */
@@ -773,7 +784,7 @@ static int dirbrowse(void)
773 default: 784 default:
774 break; 785 break;
775 } 786 }
776 restore = true; 787 restore = do_restore_display;
777 break; 788 break;
778 789
779 case ACTION_STD_CANCEL: 790 case ACTION_STD_CANCEL:
@@ -798,12 +809,12 @@ static int dirbrowse(void)
798 if (ft_exit(&tc) == 3) 809 if (ft_exit(&tc) == 3)
799 exit_func = true; 810 exit_func = true;
800 811
801 restore = true; 812 restore = do_restore_display;
802 break; 813 break;
803 814
804 case ACTION_TREE_STOP: 815 case ACTION_TREE_STOP:
805 if (list_stop_handler()) 816 if (list_stop_handler())
806 restore = true; 817 restore = do_restore_display;
807 break; 818 break;
808 819
809 case ACTION_STD_MENU: 820 case ACTION_STD_MENU:
@@ -851,7 +862,7 @@ static int dirbrowse(void)
851 skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_ALL); 862 skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_ALL);
852 } 863 }
853 864
854 restore = true; 865 restore = do_restore_display;
855 break; 866 break;
856 } 867 }
857#endif 868#endif
@@ -872,7 +883,7 @@ static int dirbrowse(void)
872 break; 883 break;
873 884
874 if(!numentries) 885 if(!numentries)
875 onplay_result = onplay(NULL, 0, curr_context, hotkey); 886 onplay_result = onplay(NULL, 0, curr_context, hotkey, customaction);
876 else { 887 else {
877#ifdef HAVE_TAGCACHE 888#ifdef HAVE_TAGCACHE
878 if (id3db) 889 if (id3db)
@@ -902,7 +913,7 @@ static int dirbrowse(void)
902 ft_assemble_path(buf, sizeof(buf), currdir, entry->name); 913 ft_assemble_path(buf, sizeof(buf), currdir, entry->name);
903 914
904 } 915 }
905 onplay_result = onplay(buf, attr, curr_context, hotkey); 916 onplay_result = onplay(buf, attr, curr_context, hotkey, customaction);
906 } 917 }
907 switch (onplay_result) 918 switch (onplay_result)
908 { 919 {
@@ -911,7 +922,7 @@ static int dirbrowse(void)
911 break; 922 break;
912 923
913 case ONPLAY_OK: 924 case ONPLAY_OK:
914 restore = true; 925 restore = do_restore_display;
915 break; 926 break;
916 927
917 case ONPLAY_RELOAD_DIR: 928 case ONPLAY_RELOAD_DIR:
@@ -988,7 +999,7 @@ static int dirbrowse(void)
988 999
989 lastfilter = *tc.dirfilter; 1000 lastfilter = *tc.dirfilter;
990 lastsortcase = global_settings.sort_case; 1001 lastsortcase = global_settings.sort_case;
991 restore = true; 1002 restore = do_restore_display;
992 } 1003 }
993 1004
994 if (exit_func) 1005 if (exit_func)