Ticket #3642: translate-key-presses_alternate_approach_v7.diff

File translate-key-presses_alternate_approach_v7.diff, 2.2 KB (added by Roo <roo.watt@…>, 16 years ago)

v7, updated for #4448

  • mythtv/libs/libmythui/mythmainwindow.cpp

     
    766766    if (allowJumps &&
    767767        d->jumpMap.count(keynum) > 0 && d->exitmenucallback == NULL)
    768768    {
     769        JumpData *jd = d->jumpMap[keynum];
     770        QString destination = jd->destination;
     771
     772        QWidget *current = currentWidget();
     773        if (current)
     774        {
     775            QString origin = current->name();
     776
     777            if (origin == "video playback window")
     778            {
     779                // Demote jump point - use local binding
     780                if (destination == "Program Finder")
     781                {
     782                    actions = QString("FINDER");
     783                    return true;
     784                }
     785
     786                // Demote jump point - use local binding
     787                if (destination == "Program Guide")
     788                {
     789                    actions = QString("GUIDE");
     790                    return true;
     791                }
     792            }
     793
     794            if (origin == "guidegrid")
     795            {
     796                // Squash jumpoint - already there
     797                if (destination == "Program Guide")
     798                {
     799                    return false;
     800                }
     801
     802                // Demote jump point - use toggle
     803                if (destination == "Program Finder")
     804                {
     805                    actions = QString("FINDER");
     806                    return true;
     807                }
     808            }
     809
     810            if (origin == "program finder")
     811            {
     812                // Squash jumpoint - already there
     813                if (destination == "Program Finder")
     814                {
     815                    return false;
     816                }
     817
     818                // Demote jump point - use toggle
     819                if (destination == "Program Guide")
     820                {
     821                    actions = QString("GUIDE");
     822                    return true;
     823                }
     824            }
     825        }
     826
    769827        d->exitingtomain = true;
    770828        d->exitmenucallback = d->jumpMap[keynum]->callback;
    771829        QApplication::postEvent(this, new ExitToMainMenuEvent());