Ticket #3642: translate-key-presses.diff

File translate-key-presses.diff, 2.9 KB (added by Roo, 17 years ago)

Filter jumppoints in MythMainWindow::TranslateKeyPress?

  • mythtv/libs/libmythtv/tv_play.cpp

     
    21862186    if (ignoreKeys)
    21872187    {
    21882188        if (!gContext->GetMainWindow()->TranslateKeyPress(
    2189                 "TV Playback", e, actions))
     2189                "TV Playback", e, actions, true, QStringList() << "Program Guide"))
    21902190        {
    21912191            return;
    21922192        }
     
    22642264    }
    22652265
    22662266    if (!gContext->GetMainWindow()->TranslateKeyPress(
    2267             "TV Playback", e, actions))
     2267            "TV Playback", e, actions, true, QStringList() << "Program Guide"))
    22682268    {
    22692269        return;
    22702270    }
  • mythtv/libs/libmythui/mythmainwindow.cpp

     
    718718
    719719bool MythMainWindow::TranslateKeyPress(const QString &context,
    720720                                       QKeyEvent *e, QStringList &actions,
    721                                        bool allowJumps)
     721                                       bool allowJumps,
     722                                       const QStringList &excludedJumpDestinations)
    722723{
    723724    actions.clear();
    724725    int keynum = d->TranslateKeyNum(e);
     726    QString destination = "";
     727   
     728    // Create iterator to retrieve jump destination
     729    QMap<int, JumpData*>::Iterator it;
     730    it = d->jumpMap.find(keynum);
    725731
     732    // Retrieve jump destination
     733    if ( it != d->jumpMap.end())
     734    {
     735        JumpData *jd = it.data();
     736        destination = jd->destination;
     737    }
     738
    726739    if (allowJumps &&
    727         d->jumpMap.count(keynum) > 0 && d->exitmenucallback == NULL)
     740        d->jumpMap.count(keynum) > 0 &&
     741        d->exitmenucallback == NULL &&
     742        excludedJumpDestinations.contains(destination) == 0)
    728743    {
    729744        d->exitingtomain = true;
    730745        d->exitmenucallback = d->jumpMap[keynum]->callback;
     
    893908    }
    894909}
    895910
    896 
    897911void MythMainWindow::BindJump(const QString &destination, const QString &key)
    898912{
    899913    /* make sure the jump point exists */
  • mythtv/libs/libmythui/mythmainwindow.h

     
    6262    MythScreenStack *GetMainStack();
    6363
    6464    bool TranslateKeyPress(const QString &context, QKeyEvent *e,
    65                            QStringList &actions, bool allowJumps = true);
     65                           QStringList &actions, bool allowJumps = true,
     66                           const QStringList &excludedJumpDestinations = QStringList());
    6667
    6768    void ClearKey(const QString &context, const QString &action);
    6869    void BindKey(const QString &context, const QString &action,