Ticket #13234: 20180315_1936_menus_and_bookmark.patch

File 20180315_1936_menus_and_bookmark.patch, 8.9 KB (added by Peter Bennett, 3 years ago)

Updated patch, see comment:19

  • mythtv/libs/libmythtv/tv_actions.h

    diff --git a/mythtv/libs/libmythtv/tv_actions.h b/mythtv/libs/libmythtv/tv_actions.h
    index eecf714..c4d16c3 100644
    a b  
    3131#define ACTION_VIEWSCHEDULED     "VIEWSCHEDULED"
    3232#define ACTION_PREVRECORDED      "PREVRECORDED"
    3333#define ACTION_SIGNALMON         "SIGNALMON"
     34#define ACTION_SETBOOKMARK       "SETBOOKMARK"
     35#define ACTION_TOGGLEBOOKMARK    "TOGGLEBOOKMARK"
    3436
    3537/* Navigation */
    3638#define ACTION_JUMPPREV             "JUMPPREV"
  • mythtv/libs/libmythtv/tv_play.cpp

    diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
    index d6fcb27..22668db 100644
    a b void TV::InitKeys(void) 
    600600    REG_KEY("TV Frontend", ACTION_LISTRECORDEDEPISODES, QT_TRANSLATE_NOOP("MythControls",
    601601            "List recorded episodes"), "");
    602602
     603    // Bookmarks - Instead of SELECT to add or toggle,
     604    // Use separate bookmark actions. This code is to convert users
     605    // who may already be using SELECT. If they are not already using
     606    // this frontend then nothing will be assigned to bookmark actions.
     607    QString bkmKeys;
     608    QString togBkmKeys;
     609    // Check if this is a new frontend - if PAUSE returns
     610    // "?" then frontend is new, never used before, so we will not assign
     611    // any default bookmark keys
     612    QString testKey = GetMythMainWindow()->GetKey("TV Playback", ACTION_PAUSE);
     613    if (testKey != "?")
     614    {
     615        int alternate = gCoreContext->GetNumSetting("AltClearSavedPosition",0);
     616        QString selectKeys = GetMythMainWindow()->GetKey("Global", ACTION_SELECT);
     617        if (selectKeys != "?")
     618        {
     619            if (alternate)
     620                togBkmKeys = selectKeys;
     621            else
     622                bkmKeys = selectKeys;
     623        }
     624    }
     625    REG_KEY("TV Playback", ACTION_SETBOOKMARK, QT_TRANSLATE_NOOP("MythControls",
     626            "Add Bookmark"), bkmKeys);
     627    REG_KEY("TV Playback", ACTION_TOGGLEBOOKMARK, QT_TRANSLATE_NOOP("MythControls",
     628            "Toggle Bookmark"), togBkmKeys);
    603629    REG_KEY("TV Playback", "BACK", QT_TRANSLATE_NOOP("MythControls",
    604630            "Exit or return to DVD menu"), "Esc");
    605631    REG_KEY("TV Playback", ACTION_MENUCOMPACT, QT_TRANSLATE_NOOP("MythControls",
    void TV::InitKeys(void) 
    607633    REG_KEY("TV Playback", ACTION_CLEAROSD, QT_TRANSLATE_NOOP("MythControls",
    608634            "Clear OSD"), "Backspace");
    609635    REG_KEY("TV Playback", ACTION_PAUSE, QT_TRANSLATE_NOOP("MythControls",
    610             "Pause"), "P");
     636            "Pause"), "P,Space");
    611637    REG_KEY("TV Playback", ACTION_SEEKFFWD, QT_TRANSLATE_NOOP("MythControls",
    612638            "Fast Forward"), "Right");
    613639    REG_KEY("TV Playback", ACTION_SEEKRWND, QT_TRANSLATE_NOOP("MythControls",
    bool TV::ActivePostQHandleAction(PlayerContext *ctx, const QStringList &actions) 
    50435069    bool isdvd  = state == kState_WatchingDVD;
    50445070    bool isdisc = isdvd || state == kState_WatchingBD;
    50455071
    5046     if (has_action(ACTION_SELECT, actions))
     5072    if (has_action(ACTION_SETBOOKMARK, actions))
     5073    {
     5074        if (!islivetv || !CommitQueuedInput(ctx))
     5075        {
     5076            ctx->LockDeletePlayer(__FILE__, __LINE__);
     5077            SetBookmark(ctx, false);
     5078            ctx->UnlockDeletePlayer(__FILE__, __LINE__);
     5079        }
     5080    }
     5081    if (has_action(ACTION_TOGGLEBOOKMARK, actions))
    50475082    {
    50485083        if (!islivetv || !CommitQueuedInput(ctx))
    50495084        {
    50505085            ctx->LockDeletePlayer(__FILE__, __LINE__);
    5051             SetBookmark(ctx, db_toggle_bookmark && ctx->player->GetBookmark());
     5086            SetBookmark(ctx, ctx->player->GetBookmark());
    50525087            ctx->UnlockDeletePlayer(__FILE__, __LINE__);
    50535088        }
    50545089    }
    void TV::OSDDialogEvent(int result, QString text, QString action) 
    1106511100            DoQueueTranscode(actx, "Medium Quality");
    1106611101        else if (action == "QUEUETRANSCODE_LOW")
    1106711102            DoQueueTranscode(actx, "Low Quality");
     11103        else if (action == ACTION_TOGGLEBOOKMARK
     11104                || action == ACTION_SETBOOKMARK)
     11105            ActivePostQHandleAction(actx, QStringList(action));
     11106        else if (action == ACTION_JUMPBKMRK)
     11107        {
     11108            bool isDVD = actx->buffer && actx->buffer->IsDVD();
     11109            bool isMenuOrStill = actx->buffer && actx->buffer->IsInDiscMenuOrStillFrame();
     11110            ActiveHandleAction(actx, QStringList(ACTION_JUMPBKMRK), isDVD, isMenuOrStill);
     11111        }
    1106811112        else
    1106911113        {
    1107011114            LOG(VB_GENERAL, LOG_ERR, LOC +
  • mythtv/programs/mythfrontend/globalsettings.cpp

    diff --git a/mythtv/programs/mythfrontend/globalsettings.cpp b/mythtv/programs/mythfrontend/globalsettings.cpp
    index 83f8729..e638d10 100644
    a b static HostCheckBoxSetting *ClearSavedPosition() 
    16571657    return gc;
    16581658}
    16591659
    1660 static HostCheckBoxSetting *AltClearSavedPosition()
    1661 {
    1662     HostCheckBoxSetting *gc = new HostCheckBoxSetting("AltClearSavedPosition");
    1663 
    1664     gc->setLabel(PlaybackSettings::tr("Alternate clear and save bookmark"));
    1665 
    1666     gc->setValue(true);
    1667 
    1668     gc->setHelpText(PlaybackSettings::tr("During playback the SELECT key "
    1669                                          "(Enter or Space) will alternate "
    1670                                          "between \"Bookmark Saved\" and "
    1671                                          "\"Bookmark Cleared\". If disabled, "
    1672                                          "the SELECT key will save the current "
    1673                                          "position for each keypress."));
    1674     return gc;
    1675 }
    1676 
    16771660static HostCheckBoxSetting *UseProgStartMark()
    16781661{
    16791662    HostCheckBoxSetting *gc = new HostCheckBoxSetting("UseProgStartMark");
    void PlaybackSettings::Load(void) 
    40174000    general->addChild(AudioReadAhead());
    40184001    general->addChild(JumpToProgramOSD());
    40194002    general->addChild(ClearSavedPosition());
    4020     general->addChild(AltClearSavedPosition());
    40214003    general->addChild(UseProgStartMark());
    40224004    general->addChild(AutomaticSetWatched());
    40234005    general->addChild(ContinueEmbeddedTVPlay());
  • mythtv/programs/mythfrontend/progdetails.cpp

    diff --git a/mythtv/programs/mythfrontend/progdetails.cpp b/mythtv/programs/mythfrontend/progdetails.cpp
    index 6540cd3..802919b 100644
    a b bool ProgDetails::keyPressEvent(QKeyEvent *event) 
    137137        QString action = actions[i];
    138138        handled = true;
    139139
    140         if (action == "INFO")
     140        if (action == "INFO" || action == "SELECT")
    141141        {
    142142            m_infoList.Toggle();
    143143            updatePage();
  • mythtv/programs/mythfrontend/videodlg.cpp

    diff --git a/mythtv/programs/mythfrontend/videodlg.cpp b/mythtv/programs/mythfrontend/videodlg.cpp
    index 9100a2a..266b4ad 100644
    a b void VideoDialog::VideoMenu() 
    24722472    m_menuPopup = new MythDialogBox(menu, m_popupStack, "videomenupopup");
    24732473
    24742474    if (m_menuPopup->Create())
     2475    {
    24752476        m_popupStack->AddScreen(m_menuPopup);
     2477        connect(m_menuPopup, SIGNAL(Closed(QString,int)), SLOT(popupClosed(QString,int)));
     2478    }
    24762479    else
    24772480        delete m_menuPopup;
    24782481}
    void VideoDialog::DisplayMenu() 
    25362539    m_menuPopup = new MythDialogBox(menu, m_popupStack, "videomenupopup");
    25372540
    25382541    if (m_menuPopup->Create())
     2542    {
    25392543        m_popupStack->AddScreen(m_menuPopup);
     2544        connect(m_menuPopup, SIGNAL(Closed(QString,int)), SLOT(popupClosed(QString,int)));
     2545    }
    25402546    else
    25412547        delete m_menuPopup;
    25422548}
    25432549
     2550// Switch from the display menu to the actions menu on second
     2551// menu press
     2552
     2553void VideoDialog::popupClosed(QString which, int result)
     2554{
     2555    m_menuPopup = NULL;
     2556
     2557    if (result == -2)
     2558    {
     2559        if (which == "display")
     2560            VideoMenu();
     2561    }
     2562}
     2563
    25442564/** \fn VideoDialog::CreateViewMenu()
    25452565 *  \brief Create a  MythMenu for MythVideo Views.
    25462566 *  \return MythMenu.
  • mythtv/programs/mythfrontend/videodlg.h

    diff --git a/mythtv/programs/mythfrontend/videodlg.h b/mythtv/programs/mythfrontend/videodlg.h
    index 9c4f54c..ff996f6 100644
    a b class VideoDialog : public MythScreenType 
    112112    MythMenu* CreateSettingsMenu();
    113113    MythMenu* CreateMetadataBrowseMenu();
    114114
     115    void popupClosed(QString which, int reason);
     116
    115117    void PromptToScan();
    116118
    117119    void ChangeFilter();
  • mythtv/themes/default/menu_playback.xml

    diff --git a/mythtv/themes/default/menu_playback.xml b/mythtv/themes/default/menu_playback.xml
    index 7dc85ad..5cd4d7a 100644
    a b  
    175175  <menu text="Navigate">
    176176    <item action="JUMPFFWD" XXXtext="Jump Ahead" />
    177177    <item action="JUMPRWND" XXXtext="Jump Back" />
     178    <item action="SETBOOKMARK" XXXtext="Set Bookmark" />
     179    <item action="TOGGLEBOOKMARK" XXXtext="Toggle Bookmark" />
     180    <item action="JUMPBKMRK" XXXtext="Jump to Bookmark" />
    178181    <menu text="Commercial Auto-Skip">
    179182      <itemlist actiongroup="TOGGLECOMMSKIP" current="active" />
    180183      <!-- Alternatively: