Ticket #1771: PlayBoxAllOrdering3.patch
File PlayBoxAllOrdering3.patch, 7.2 KB (added by , 18 years ago) |
---|
-
programs/mythfrontend/playbackbox.cpp
169 169 return sTitle; 170 170 } 171 171 172 static int comp_recordDate(ProgramInfo *a, ProgramInfo *b) 173 { 174 if (a->startts.date() == b->startts.date()) 175 return (a->recstartts < b->recstartts ? 1 : -1); 176 else 177 return (a->startts.date() < b->startts.date() ? 1 : -1); 178 } 179 180 static int comp_recordDate_rev(ProgramInfo *a, ProgramInfo *b) 181 { 182 if (a->startts.date() == b->startts.date()) 183 return (a->recstartts > b->recstartts ? 1 : -1); 184 else 185 return (a->startts.date() > b->startts.date() ? 1 : -1); 186 } 187 172 188 PlaybackBox::PlaybackBox(BoxType ltype, MythMainWindow *parent, 173 189 const char *name) 174 190 : MythDialog(parent, name), … … 240 256 formatTime = gContext->GetSetting("TimeFormat", "h:mm AP"); 241 257 recGroup = gContext->GetSetting("DisplayRecGroup","All Programs"); 242 258 listOrder = gContext->GetNumSetting("PlayBoxOrdering", 1); 259 allOrder = gContext->GetNumSetting("PlayBoxAllOrdering", 1); 243 260 groupnameAsAllProg = gContext->GetNumSetting("DispRecGroupAsAllProg", 0); 244 261 watchList = gContext->GetNumSetting("PlaybackWatchList", 1); 245 262 watchListAutoExpire= gContext->GetNumSetting("PlaybackWLAutoExpire", 0); … … 1507 1524 { 1508 1525 clearProgramCache(); 1509 1526 1510 progCache = RemoteGetRecordedList( listOrder == 0 || type == Delete);1527 progCache = RemoteGetRecordedList(allOrder == 0 || type == Delete); 1511 1528 } 1512 1529 1513 1530 if (progCache) … … 1640 1657 } 1641 1658 } 1642 1659 } 1660 else if (episodeSort == "Date") 1661 { 1662 QMap<QString, ProgramList>::Iterator Iprog; 1663 for (Iprog = progLists.begin(); Iprog != progLists.end(); ++Iprog) 1664 { 1665 if (!Iprog.key().isEmpty()) 1666 { 1667 if (listOrder == 0 || type == Delete) 1668 Iprog.data().Sort(comp_recordDate_rev); 1669 else 1670 Iprog.data().Sort(comp_recordDate); 1671 } 1672 } 1673 } 1674 1643 1675 if (progLists[watchGroup].count() > 1) 1644 1676 { 1645 1677 QDateTime now = QDateTime::currentDateTime(); … … 1843 1875 1844 1876 if (oldtitle != watchGroup) 1845 1877 { 1846 if ( listOrder == 0 || type == Delete)1878 if (titleIndex == 0) 1847 1879 { 1848 if ( episodeSort == "OrigAirDate" && titleIndex > 0)1880 if (allOrder == 0 || type == Delete) 1849 1881 { 1850 if (old originalAirDate > p->originalAirDate)1882 if (oldstartts > p->recstartts) 1851 1883 break; 1852 1884 } 1853 else if (episodeSort == "Id" && titleIndex > 0) 1854 { 1855 if (oldprogramid > p->programid) 1856 break; 1885 else { 1886 if (oldstartts < p->recstartts) 1887 break; 1857 1888 } 1858 else1859 {1860 if (oldstartts > p->recstartts)1861 break;1862 }1863 1889 } 1864 1890 else 1865 1891 { 1866 if ( episodeSort == "OrigAirDate" && titleIndex > 0)1892 if (listOrder == 0 || type == Delete) 1867 1893 { 1868 if (oldoriginalAirDate < p->originalAirDate) 1869 break; 1894 if (episodeSort == "OrigAirDate") 1895 { 1896 if (oldoriginalAirDate > p->originalAirDate) 1897 break; 1898 } 1899 else if (episodeSort == "Id") 1900 { 1901 if (oldprogramid > p->programid) 1902 break; 1903 } 1904 else 1905 { 1906 if (oldstartts > p->recstartts) 1907 break; 1908 } 1870 1909 } 1871 else if (episodeSort == "Id" && titleIndex > 0)1872 {1873 if (oldprogramid < p->programid)1874 break;1875 }1876 1910 else 1877 1911 { 1878 if (oldstartts < p->recstartts) 1879 break; 1912 if (episodeSort == "OrigAirDate") 1913 { 1914 if (oldoriginalAirDate < p->originalAirDate) 1915 break; 1916 } 1917 else if (episodeSort == "Id") 1918 { 1919 if (oldprogramid < p->programid) 1920 break; 1921 } 1922 else 1923 { 1924 if (oldstartts < p->recstartts) 1925 break; 1926 } 1880 1927 } 1881 1928 } 1882 1929 } -
programs/mythfrontend/globalsettings.cpp
716 716 return gc; 717 717 } 718 718 719 static HostCheckBox *PlayBoxAllOrdering() 720 { 721 HostCheckBox *gc = new HostCheckBox("PlayBoxAllOrdering"); 722 gc->setLabel(QObject::tr("All Programs: List Newest Recording First")); 723 gc->setValue(true); 724 gc->setHelpText(QObject::tr("When enabled, the most recent recording " 725 "will be listed first in the 'All Programs' or 'Default' " 726 "section of the 'Watch Recordings' screen, otherwise " 727 "the oldest recording will be listed first.")); 728 return gc; 729 } 730 719 731 static HostComboBox *PlayBoxEpisodeSort() 720 732 { 721 733 HostComboBox *gc = new HostComboBox("PlayBoxEpisodeSort"); … … 3536 3548 VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false); 3537 3549 pbox->setLabel(QObject::tr("View Recordings")); 3538 3550 pbox->addChild(PlayBoxOrdering()); 3551 pbox->addChild(PlayBoxAllOrdering()); 3539 3552 pbox->addChild(PlayBoxEpisodeSort()); 3540 3553 pbox->addChild(GeneratePreviewPixmaps()); 3541 3554 pbox->addChild(PreviewPixmapOffset()); -
programs/mythfrontend/playbackbox.h
323 323 bool arrowAccel; 324 324 /// if true keypress events are ignored 325 325 bool ignoreKeyPressEvents; 326 /// allOrder controls the ordering of the "All Programs" list 327 int allOrder; 326 328 /// listOrder controls the ordering of the recordings in the list 327 329 int listOrder; 328 330 /// Number of items in selector that can be shown on the screen at once