Ticket #2170: exit_with_left_key_from_video_listing_like_from_recording_listing.diff

File exit_with_left_key_from_video_listing_like_from_recording_listing.diff, 2.2 KB (added by Pekka Jääskeläinen <pekka.jaaskelainen@…>, 18 years ago)
  • mythvideo/mythvideo/videotree.cpp

    old new  
    1717
    1818#include "videofilter.h"
    1919#include "videolist.h"
     20
    2021const long WATCHED_WATERMARK = 10000; // Less than this and the chain of videos will
    2122                                      // not be followed when playing.
    2223
     
    8485            video_tree_list->moveUp();
    8586        else if (action == "DOWN")
    8687            video_tree_list->moveDown();
    87         else if (action == "LEFT")
    88             video_tree_list->popUp();
     88        else if (action == "LEFT")
     89        {
     90            if (video_tree_list->getCurrentNode()->getParent() != video_tree_root)
     91            {
     92                video_tree_list->popUp();
     93            } else
     94            {
     95                // if we are at root, exit from the dialog, to make
     96                // the behavior similar to the recorded shows dialog
     97                done(1);
     98            }
     99        }
    89100        else if (action == "RIGHT")
    90101            video_tree_list->pushDown();
    91102        else if (action == "PAGEUP")
     
    109120            handled = false;
    110121    }
    111122
    112         if (!handled)
     123    if (!handled)
    113124    {
    114125   
    115     gContext->GetMainWindow()->TranslateKeyPress("TV Frontend", e, actions);
     126        gContext->GetMainWindow()->TranslateKeyPress("TV Frontend", e, actions);
    116127
    117128        for (unsigned int i = 0; i < actions.size() && !handled; i++)
    118129        {
     
    125136        }           
    126137    }
    127138
    128    
    129139    if (!handled)
    130140        MythThemedDialog::keyPressEvent(e);
    131141}
     
    241251    int file_browser = gContext->GetNumSetting("VideoTreeNoDB", 0);
    242252
    243253    video_tree_root = video_list->buildVideoList(file_browser, false,
    244                                                 current_parental_level);
     254                                                 current_parental_level);
    245255    if (video_tree_root->childCount() > 0)
    246256        video_tree_data = video_tree_root->getChildAt(0,0);
    247257    else video_tree_data = video_tree_root;