Ticket #3642: localAction_over_jumppoint_v1.diff

File localAction_over_jumppoint_v1.diff, 4.6 KB (added by cpinkham, 16 years ago)

Add localAction to jumppoint info to allow using local action instead of jumppoint bound to the same key

  • libs/libmythui/mythmainwindow.cpp

     
    125125    QString destination;
    126126    QString description;
    127127    bool exittomain;
     128    QString localAction;
    128129};
    129130
    130131struct MHData
     
    755756    actions.clear();
    756757    int keynum = d->TranslateKeyNum(e);
    757758
     759    QStringList localActions;
     760    if (allowJumps && (d->jumpMap.count(keynum) > 0) &&
     761        (d->jumpMap[keynum]->localAction != "") &&
     762        (d->keyContexts[context]) &&
     763        (d->keyContexts[context]->GetMapping(keynum, localActions)))
     764    {
     765        if (localActions.contains(d->jumpMap[keynum]->localAction))
     766            allowJumps = false;
     767    }
     768
    758769    if (allowJumps && d->jumpMap.count(keynum) > 0 &&
    759770            !d->jumpMap[keynum]->exittomain && d->exitmenucallback == NULL)
    760771    {
     
    973984void MythMainWindow::RegisterJump(const QString &destination,
    974985                                  const QString &description,
    975986                                  const QString &key, void (*callback)(void),
    976                                   bool exittomain)
     987                                  bool exittomain, QString localAction)
    977988{
    978989    QString keybind = key;
    979990
     
    9941005        {
    9951006            QString inskey = keybind;
    9961007
     1008#if MODIFIED_DBCHECK_CPP_TO_ADD_NEW_COLUMN
    9971009            query.prepare("INSERT INTO jumppoints (destination, description, "
    998                           "keylist, hostname) VALUES ( :DEST, :DESC, :KEYLIST, "
    999                           ":HOST );");
     1010                              "keylist, hostname, localaction) "
     1011                          "VALUES ( :DEST, :DESC, :KEYLIST, :HOST, "
     1012                              ":LOCALACTION );");
    10001013            query.bindValue(":DEST", destination);
    10011014            query.bindValue(":DESC", description);
    10021015            query.bindValue(":KEYLIST", inskey);
    10031016            query.bindValue(":HOST", gContext->GetHostName());
     1017            query.bindValue(":LOCALACTION", localAction);
    10041018
    10051019            if (!query.exec() || !query.isActive())
    10061020            {
    10071021                MythContext::DBError("Insert Jump Point", query);
    10081022            }
     1023#endif
    10091024        }
    10101025    }
    10111026
    1012     JumpData jd = { callback, destination, description, exittomain };
     1027    JumpData jd =
     1028        { callback, destination, description, exittomain, localAction };
    10131029    d->destinationMap[destination] = jd;
    10141030
    10151031    BindJump(destination, keybind);
     
    16071623    return d->uiScreenRect;
    16081624}
    16091625
     1626/* vim: set expandtab tabstop=4 shiftwidth=4: */
  • libs/libmythui/mythmainwindow.h

     
    3939#define GET_KEY(a, b) GetMythMainWindow()->GetKey(a, b)
    4040#define REG_JUMP(a, b, c, d) GetMythMainWindow()->RegisterJump(a, b, c, d)
    4141#define REG_JUMPEX(a, b, c, d, e) GetMythMainWindow()->RegisterJump(a, b, c, d, e)
     42#define REG_JUMPLOC(a, b, c, d, e) GetMythMainWindow()->RegisterJump(a, b, c, d, true, e)
    4243#define REG_MEDIA_HANDLER(a, b, c, d, e, f) GetMythMainWindow()->RegisterMediaHandler(a, b, c, d, e, f)
    4344#define REG_MEDIAPLAYER(a,b,c) GetMythMainWindow()->RegisterMediaPlugin(a, b, c)
    4445
     
    7677    void BindJump(const QString &destination, const QString &key);
    7778    void RegisterJump(const QString &destination, const QString &description,
    7879                      const QString &key, void (*callback)(void),
    79                       bool exittomain = true);
     80                      bool exittomain = true, QString localAction = "");
    8081    void RegisterMediaHandler(const QString &destination,
    8182                              const QString &description, const QString &key,
    8283                              void (*callback)(MythMediaDevice* mediadevice),
  • programs/mythfrontend/main.cpp

     
    782782{
    783783    REG_JUMP("Reload Theme", "", "", reloadTheme);
    784784    REG_JUMP("Main Menu", "", "", gotoMainMenu);
    785     REG_JUMP("Program Guide", "", "", startGuide);
    786     REG_JUMP("Program Finder", "", "", startFinder);
     785    REG_JUMPLOC("Program Guide", "", "", startGuide, "GUIDE");
     786    REG_JUMPLOC("Program Finder", "", "", startFinder, "FINDER");
    787787    //REG_JUMP("Search Listings", "", "", startSearch);
    788788    REG_JUMP("Manage Recordings / Fix Conflicts", "", "", startManaged);
    789789    REG_JUMP("Program Recording Priorities", "", "", startProgramRecPriorities);