Ticket #3642: translate-key-presses_alternate_approach_v5.diff

File translate-key-presses_alternate_approach_v5.diff, 2.2 KB (added by ylee@…, 16 years ago)

A slightly-modified version of Roo's v4 patch

  • mythtv/libs/libmythui/mythmainwindow.cpp

     
    726726    if (allowJumps &&
    727727        d->jumpMap.count(keynum) > 0 && d->exitmenucallback == NULL)
    728728    {
     729        JumpData *jd = d->jumpMap[keynum];
     730        QString destination = jd->destination;
     731
     732        QWidget *current = currentWidget();
     733        if (current)
     734        {
     735            QString origin = current->name();
     736
     737            if (origin == "video playback window")
     738            {
     739                // Demote jump point - use local binding
     740                if (destination == "Program Finder")
     741                {
     742                    actions = QString("FINDER");
     743                    return true;
     744                }
     745
     746                // Demote jump point - use local binding
     747                if (destination == "Program Guide")
     748                {
     749                    actions = QString("GUIDE");
     750                    return true;
     751                }
     752            }
     753
     754            if (origin == "guidegrid")
     755            {
     756                // Already there; act as toggle
     757                if (destination == "Program Guide")
     758                {
     759                    actions = QString("ESCAPE");
     760                    return true;
     761                }
     762
     763                // Turn Finder jumppoint off
     764                if (destination == "Program Finder")
     765                {
     766                    return false;
     767                }
     768            }
     769
     770            if (origin == "program finder")
     771            {
     772                // Already there; act as toggle
     773                if (destination == "Program Finder")
     774                {
     775                    actions = QString("ESCAPE");
     776                    return true;
     777                }
     778
     779                // Turn Guide jumppoint off
     780                if (destination == "Program Guide")
     781                {
     782                    return false;
     783                }
     784            }
     785        }
     786
    729787        d->exitingtomain = true;
    730788        d->exitmenucallback = d->jumpMap[keynum]->callback;
    731789        QApplication::postEvent(this, new ExitToMainMenuEvent());