diff options
Diffstat (limited to 'apps/tree.c')
-rw-r--r-- | apps/tree.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/apps/tree.c b/apps/tree.c index 71a7ee3f62..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) |