Ticket #12809: 0003-Add-Unfinished-recording-filter.patch
File 0003-Add-Unfinished-recording-filter.patch, 9.8 KB (added by , 8 years ago) |
---|
-
mythtv/programs/mythfrontend/playbackbox.cpp
From 1695a554526200556c043031ae9f4c8a868bbb04 Mon Sep 17 00:00:00 2001 From: Roger Siddons <rsiddons@mythtv.org> Date: Mon, 20 Jun 2016 08:55:43 +0100 Subject: [PATCH 3/3] Add Unfinished recording filter Adds a new filter that shows recordings with a last played position i.e. they've been partly watched Ordered by last played position, with 'most progressed' at top. Only implemented on MythCenter-Wide theme. diff --git a/mythtv/programs/mythfrontend/playbackbox.cpp b/mythtv/programs/mythfrontend/playbackbox.cpp index 76d8ac8..108a547 100644
a b PlaybackBox::PlaybackBox(MythScreenStack *parent, QString name, 393 393 // Recording Group settings 394 394 m_groupDisplayName(ProgramInfo::i18n("All Programs")), 395 395 m_recGroup("All Programs"), 396 m_liveTvGroupName(tr("Live TV")), 397 m_liveTvGroupLabel(m_liveTvGroupName.toLower()), 396 398 m_watchGroupName(tr("Watch List")), 397 399 m_watchGroupLabel(m_watchGroupName.toLower()), 400 m_unfinishedGroupName(tr("Unfinished")), 401 m_unfinishedGroupLabel(m_unfinishedGroupName.toLower()), 398 402 m_viewMask(VIEW_TITLES), 399 403 400 404 // General m_popupMenu support … … bool PlaybackBox::UpdateUILists(void) 1627 1631 1628 1632 QMap<QString, QString> sortedList; 1629 1633 QMap<int, QString> searchRule; 1634 QMap<uint, ProgramInfo*> unfinished; 1630 1635 1631 1636 m_programInfoCache.Refresh(); 1632 1637 … … bool PlaybackBox::UpdateUILists(void) 1722 1727 if (m_recGroup != "LiveTV" && 1723 1728 pRecgroup == "LiveTV" && (m_viewMask & VIEW_LIVETVGRP)) 1724 1729 { 1725 QString tmpTitle = tr("Live TV"); 1726 sortedList[tmpTitle.toLower()] = tmpTitle; 1727 m_progLists[tmpTitle.toLower()].push_front(p); 1728 m_progLists[tmpTitle.toLower()].setAutoDelete(false); 1730 m_progLists[m_liveTvGroupLabel].push_front(p); 1731 m_progLists[m_liveTvGroupLabel].setAutoDelete(false); 1729 1732 continue; 1730 1733 } 1731 1734 … … bool PlaybackBox::UpdateUILists(void) 1778 1781 { 1779 1782 m_watchlist.Add(p); 1780 1783 } 1784 1785 if ((m_viewMask & VIEW_UNFINISHED) && p->GetProgressPercent() > 0) 1786 { 1787 unfinished.insert(p->GetProgressPercent(), p); 1788 } 1781 1789 } 1782 1790 } 1783 1791 1784 1792 if (sortedList.empty()) 1785 1793 { 1786 LOG(VB_GENERAL, LOG_WARNING, LOC + "SortedList is Empty");1787 m_progLists[""];1794 LOG(VB_GENERAL, LOG_WARNING, LOC + 1795 "No recordings selected for display (formerly SortedList is Empty)"); 1788 1796 m_titleList << ""; 1789 1797 m_playList.clear(); 1790 1798 … … bool PlaybackBox::UpdateUILists(void) 1860 1868 m_progLists[m_watchGroupLabel].setAutoDelete(false); 1861 1869 } 1862 1870 1863 m_titleList = QStringList(""); 1871 m_titleList = QStringList(""); // All Progs always at top 1872 1864 1873 if (m_progLists[m_watchGroupLabel].size() > 0) 1865 1874 m_titleList << m_watchGroupName; 1866 if ((m_progLists["livetv"].size() > 0) && 1867 (!sortedList.values().contains(tr("Live TV")))) 1868 m_titleList << tr("Live TV"); 1875 1876 if (!unfinished.isEmpty()) 1877 { 1878 // Most progressed at top 1879 foreach (ProgramInfo* p, unfinished) 1880 m_progLists[m_unfinishedGroupLabel].push_front(p); 1881 1882 m_progLists[m_unfinishedGroupLabel].setAutoDelete(false); 1883 m_titleList << m_unfinishedGroupName; 1884 } 1885 1886 if (m_progLists[m_liveTvGroupLabel].size() > 0 1887 && !sortedList.values().contains(m_liveTvGroupName)) 1888 m_titleList << m_liveTvGroupName; 1889 1869 1890 m_titleList << sortedList.values(); 1870 1891 1871 1892 // Populate list of recording groups … … bool ChangeView::Create() 4874 4895 m_parentScreen, SLOT(toggleRecGroupView(bool))); 4875 4896 } 4876 4897 4877 // TODO Do we need two separate settings to determine whether the watchlist4878 // is shown? The filter setting be enough?4879 checkBox = dynamic_cast<MythUICheckBox*>(GetChild("watchlist"));4880 if (checkBox)4881 {4882 if (m_viewMask & PlaybackBox::VIEW_WATCHLIST)4883 checkBox->SetCheckState(MythUIStateType::Full);4884 connect(checkBox, SIGNAL(toggled(bool)),4885 m_parentScreen, SLOT(toggleWatchListView(bool)));4886 }4887 //4888 4889 4898 checkBox = dynamic_cast<MythUICheckBox*>(GetChild("searches")); 4890 4899 if (checkBox) 4891 4900 { … … bool ChangeView::Create() 4895 4904 m_parentScreen, SLOT(toggleSearchView(bool))); 4896 4905 } 4897 4906 4898 // TODO Do we need two separate settings to determine whether livetv 4899 // recordings are shown? Same issue as the watchlist above 4900 checkBox = dynamic_cast<MythUICheckBox*>(GetChild("livetv")); 4901 if (checkBox) 4902 { 4903 if (m_viewMask & PlaybackBox::VIEW_LIVETVGRP) 4904 checkBox->SetCheckState(MythUIStateType::Full); 4905 connect(checkBox, SIGNAL(toggled(bool)), 4906 m_parentScreen, SLOT(toggleLiveTVView(bool))); 4907 } 4908 // 4907 checkBox = dynamic_cast<MythUICheckBox*>(GetChild("watchlist")); 4908 if (checkBox) 4909 { 4910 if (m_viewMask & PlaybackBox::VIEW_WATCHLIST) 4911 checkBox->SetCheckState(MythUIStateType::Full); 4912 connect(checkBox, SIGNAL(toggled(bool)), 4913 m_parentScreen, SLOT(toggleWatchListView(bool))); 4914 } 4915 4916 checkBox = dynamic_cast<MythUICheckBox*>(GetChild("unfinished")); 4917 if (checkBox) 4918 { 4919 if (m_viewMask & PlaybackBox::VIEW_UNFINISHED) 4920 checkBox->SetCheckState(MythUIStateType::Full); 4921 connect(checkBox, SIGNAL(toggled(bool)), 4922 m_parentScreen, SLOT(toggleUnfinishedView(bool))); 4923 } 4924 4925 checkBox = dynamic_cast<MythUICheckBox*>(GetChild("livetv")); 4926 if (checkBox) 4927 { 4928 if (m_viewMask & PlaybackBox::VIEW_LIVETVGRP) 4929 checkBox->SetCheckState(MythUIStateType::Full); 4930 connect(checkBox, SIGNAL(toggled(bool)), 4931 m_parentScreen, SLOT(toggleLiveTVView(bool))); 4932 } 4909 4933 4910 4934 checkBox = dynamic_cast<MythUICheckBox*>(GetChild("watched")); 4911 4935 if (checkBox) -
mythtv/programs/mythfrontend/playbackbox.h
diff --git a/mythtv/programs/mythfrontend/playbackbox.h b/mythtv/programs/mythfrontend/playbackbox.h index b01d13a..cda12ca 100644
a b class PlaybackBox : public ScheduleCommon 153 153 VIEW_WATCHLIST = 0x0008, 154 154 VIEW_SEARCHES = 0x0010, 155 155 VIEW_LIVETVGRP = 0x0020, 156 VIEW_UNFINISHED = 0x0040, 156 157 // insert new entries above here 157 158 VIEW_WATCHED = 0x8000 158 159 } ViewMask; … … class PlaybackBox : public ScheduleCommon 264 265 void toggleCategoryView(bool setOn) { toggleView(VIEW_CATEGORIES, setOn); } 265 266 void toggleRecGroupView(bool setOn) { toggleView(VIEW_RECGROUPS, setOn); } 266 267 void toggleWatchListView(bool setOn) { toggleView(VIEW_WATCHLIST, setOn); } 268 void toggleUnfinishedView(bool setOn){ toggleView(VIEW_UNFINISHED, setOn); } 267 269 void toggleSearchView(bool setOn) { toggleView(VIEW_SEARCHES, setOn); } 268 270 void toggleLiveTVView(bool setOn) { toggleView(VIEW_LIVETVGRP, setOn); } 269 271 void toggleWatchedView(bool setOn) { toggleView(VIEW_WATCHED, setOn); } … … class PlaybackBox : public ScheduleCommon 437 439 QString m_recGroup; 438 440 QString m_curGroupPassword; 439 441 QString m_newRecGroup; 442 QString m_liveTvGroupName; 443 QString m_liveTvGroupLabel; 440 444 QString m_watchGroupName; 441 445 QString m_watchGroupLabel; 446 QString m_unfinishedGroupName; 447 QString m_unfinishedGroupLabel; 442 448 ViewMask m_viewMask; 443 449 444 450 // Watchlist support -
mythtv/themes/MythCenter-wide/recordings-ui.xml
diff --git a/mythtv/themes/MythCenter-wide/recordings-ui.xml b/mythtv/themes/MythCenter-wide/recordings-ui.xml index 0abbb29..1857e74 100644
a b 513 513 </textarea> 514 514 515 515 <checkbox name="recgroups" from="basecheckbox"> 516 <position>90,1 90</position>516 <position>90,180</position> 517 517 </checkbox> 518 518 519 519 <textarea name="grouplabel" from="titlelabel"> 520 <position>140,1 90</position>520 <position>140,180</position> 521 521 <value>Show Recording Groups</value> 522 522 </textarea> 523 523 524 524 <checkbox name="watchlist" from="basecheckbox"> 525 <position>90,2 40</position>525 <position>90,220</position> 526 526 </checkbox> 527 527 528 528 <textarea name="watchlabel" from="titlelabel"> 529 <position>140,2 40</position>529 <position>140,220</position> 530 530 <value>Show Watch List</value> 531 531 </textarea> 532 532 533 <checkbox name="unfinished" from="basecheckbox"> 534 <position>90,260</position> 535 </checkbox> 536 537 <textarea name="unfinishedlabel" from="titlelabel"> 538 <position>140,260</position> 539 <value>Show Unfinished</value> 540 </textarea> 541 533 542 <checkbox name="searches" from="basecheckbox"> 534 <position>90, 290</position>543 <position>90,300</position> 535 544 </checkbox> 536 545 537 546 <textarea name="searchlabel" from="titlelabel"> 538 <position>140, 290</position>547 <position>140,300</position> 539 548 <value>Show Searches</value> 540 549 </textarea> 541 550 … … 549 558 </textarea> 550 559 551 560 <checkbox name="watched" from="basecheckbox"> 552 <position>90,3 90</position>561 <position>90,380</position> 553 562 </checkbox> 554 563 555 564 <textarea name="watchedlabel" from="titlelabel"> 556 <position>140,3 90</position>565 <position>140,380</position> 557 566 <value>Show Watched Programs</value> 558 567 </textarea> 559 568