Ticket #13234: 20180315_1936_menus_and_bookmark.patch
| File 20180315_1936_menus_and_bookmark.patch, 8.9 KB (added by , 8 years ago) |
|---|
-
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 31 31 #define ACTION_VIEWSCHEDULED "VIEWSCHEDULED" 32 32 #define ACTION_PREVRECORDED "PREVRECORDED" 33 33 #define ACTION_SIGNALMON "SIGNALMON" 34 #define ACTION_SETBOOKMARK "SETBOOKMARK" 35 #define ACTION_TOGGLEBOOKMARK "TOGGLEBOOKMARK" 34 36 35 37 /* Navigation */ 36 38 #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) 600 600 REG_KEY("TV Frontend", ACTION_LISTRECORDEDEPISODES, QT_TRANSLATE_NOOP("MythControls", 601 601 "List recorded episodes"), ""); 602 602 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); 603 629 REG_KEY("TV Playback", "BACK", QT_TRANSLATE_NOOP("MythControls", 604 630 "Exit or return to DVD menu"), "Esc"); 605 631 REG_KEY("TV Playback", ACTION_MENUCOMPACT, QT_TRANSLATE_NOOP("MythControls", … … void TV::InitKeys(void) 607 633 REG_KEY("TV Playback", ACTION_CLEAROSD, QT_TRANSLATE_NOOP("MythControls", 608 634 "Clear OSD"), "Backspace"); 609 635 REG_KEY("TV Playback", ACTION_PAUSE, QT_TRANSLATE_NOOP("MythControls", 610 "Pause"), "P ");636 "Pause"), "P,Space"); 611 637 REG_KEY("TV Playback", ACTION_SEEKFFWD, QT_TRANSLATE_NOOP("MythControls", 612 638 "Fast Forward"), "Right"); 613 639 REG_KEY("TV Playback", ACTION_SEEKRWND, QT_TRANSLATE_NOOP("MythControls", … … bool TV::ActivePostQHandleAction(PlayerContext *ctx, const QStringList &actions) 5043 5069 bool isdvd = state == kState_WatchingDVD; 5044 5070 bool isdisc = isdvd || state == kState_WatchingBD; 5045 5071 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)) 5047 5082 { 5048 5083 if (!islivetv || !CommitQueuedInput(ctx)) 5049 5084 { 5050 5085 ctx->LockDeletePlayer(__FILE__, __LINE__); 5051 SetBookmark(ctx, db_toggle_bookmark &&ctx->player->GetBookmark());5086 SetBookmark(ctx, ctx->player->GetBookmark()); 5052 5087 ctx->UnlockDeletePlayer(__FILE__, __LINE__); 5053 5088 } 5054 5089 } … … void TV::OSDDialogEvent(int result, QString text, QString action) 11065 11100 DoQueueTranscode(actx, "Medium Quality"); 11066 11101 else if (action == "QUEUETRANSCODE_LOW") 11067 11102 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 } 11068 11112 else 11069 11113 { 11070 11114 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() 1657 1657 return gc; 1658 1658 } 1659 1659 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 1677 1660 static HostCheckBoxSetting *UseProgStartMark() 1678 1661 { 1679 1662 HostCheckBoxSetting *gc = new HostCheckBoxSetting("UseProgStartMark"); … … void PlaybackSettings::Load(void) 4017 4000 general->addChild(AudioReadAhead()); 4018 4001 general->addChild(JumpToProgramOSD()); 4019 4002 general->addChild(ClearSavedPosition()); 4020 general->addChild(AltClearSavedPosition());4021 4003 general->addChild(UseProgStartMark()); 4022 4004 general->addChild(AutomaticSetWatched()); 4023 4005 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) 137 137 QString action = actions[i]; 138 138 handled = true; 139 139 140 if (action == "INFO" )140 if (action == "INFO" || action == "SELECT") 141 141 { 142 142 m_infoList.Toggle(); 143 143 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() 2472 2472 m_menuPopup = new MythDialogBox(menu, m_popupStack, "videomenupopup"); 2473 2473 2474 2474 if (m_menuPopup->Create()) 2475 { 2475 2476 m_popupStack->AddScreen(m_menuPopup); 2477 connect(m_menuPopup, SIGNAL(Closed(QString,int)), SLOT(popupClosed(QString,int))); 2478 } 2476 2479 else 2477 2480 delete m_menuPopup; 2478 2481 } … … void VideoDialog::DisplayMenu() 2536 2539 m_menuPopup = new MythDialogBox(menu, m_popupStack, "videomenupopup"); 2537 2540 2538 2541 if (m_menuPopup->Create()) 2542 { 2539 2543 m_popupStack->AddScreen(m_menuPopup); 2544 connect(m_menuPopup, SIGNAL(Closed(QString,int)), SLOT(popupClosed(QString,int))); 2545 } 2540 2546 else 2541 2547 delete m_menuPopup; 2542 2548 } 2543 2549 2550 // Switch from the display menu to the actions menu on second 2551 // menu press 2552 2553 void 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 2544 2564 /** \fn VideoDialog::CreateViewMenu() 2545 2565 * \brief Create a MythMenu for MythVideo Views. 2546 2566 * \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 112 112 MythMenu* CreateSettingsMenu(); 113 113 MythMenu* CreateMetadataBrowseMenu(); 114 114 115 void popupClosed(QString which, int reason); 116 115 117 void PromptToScan(); 116 118 117 119 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 175 175 <menu text="Navigate"> 176 176 <item action="JUMPFFWD" XXXtext="Jump Ahead" /> 177 177 <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" /> 178 181 <menu text="Commercial Auto-Skip"> 179 182 <itemlist actiongroup="TOGGLECOMMSKIP" current="active" /> 180 183 <!-- Alternatively:
