Ticket #1771: PlayBoxAllOrdering4.patch
File PlayBoxAllOrdering4.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), … … 241 257 formatTime = gContext->GetSetting("TimeFormat", "h:mm AP"); 242 258 recGroup = gContext->GetSetting("DisplayRecGroup","All Programs"); 243 259 listOrder = gContext->GetNumSetting("PlayBoxOrdering", 1); 260 allOrder = gContext->GetNumSetting("PlayBoxAllOrdering", 1); 244 261 useSearches = gContext->GetNumSetting("PlaybackSearches", 0); 245 262 useWatchList = gContext->GetNumSetting("PlaybackWatchList", 1); 246 263 watchListAutoExpire= gContext->GetNumSetting("PlaybackWLAutoExpire", 0); … … 1503 1520 { 1504 1521 clearProgramCache(); 1505 1522 1506 progCache = RemoteGetRecordedList( listOrder == 0 || type == Delete);1523 progCache = RemoteGetRecordedList(allOrder == 0 || type == Delete); 1507 1524 } 1508 1525 1509 1526 if (progCache) … … 1666 1683 } 1667 1684 } 1668 1685 } 1686 else if (episodeSort == "Date") 1687 { 1688 QMap<QString, ProgramList>::Iterator Iprog; 1689 for (Iprog = progLists.begin(); Iprog != progLists.end(); ++Iprog) 1690 { 1691 if (!Iprog.key().isEmpty()) 1692 { 1693 if (listOrder == 0 || type == Delete) 1694 Iprog.data().Sort(comp_recordDate_rev); 1695 else 1696 Iprog.data().Sort(comp_recordDate); 1697 } 1698 } 1699 } 1700 1669 1701 if (progLists[watchGroup].count() > 1) 1670 1702 { 1671 1703 QDateTime now = QDateTime::currentDateTime(); … … 1869 1901 1870 1902 if (oldtitle != watchGroup) 1871 1903 { 1872 if ( listOrder == 0 || type == Delete)1904 if (titleIndex == 0) 1873 1905 { 1874 if ( episodeSort == "OrigAirDate" && titleIndex > 0)1906 if (allOrder == 0 || type == Delete) 1875 1907 { 1876 if (old originalAirDate > p->originalAirDate)1908 if (oldstartts > p->recstartts) 1877 1909 break; 1878 1910 } 1879 else if (episodeSort == "Id" && titleIndex > 0) 1880 { 1881 if (oldprogramid > p->programid) 1882 break; 1911 else { 1912 if (oldstartts < p->recstartts) 1913 break; 1883 1914 } 1884 else1885 {1886 if (oldstartts > p->recstartts)1887 break;1888 }1889 1915 } 1890 1916 else 1891 1917 { 1892 if ( episodeSort == "OrigAirDate" && titleIndex > 0)1918 if (listOrder == 0 || type == Delete) 1893 1919 { 1894 if (oldoriginalAirDate < p->originalAirDate) 1895 break; 1920 if (episodeSort == "OrigAirDate") 1921 { 1922 if (oldoriginalAirDate > p->originalAirDate) 1923 break; 1924 } 1925 else if (episodeSort == "Id") 1926 { 1927 if (oldprogramid > p->programid) 1928 break; 1929 } 1930 else 1931 { 1932 if (oldstartts > p->recstartts) 1933 break; 1934 } 1896 1935 } 1897 else if (episodeSort == "Id" && titleIndex > 0)1898 {1899 if (oldprogramid < p->programid)1900 break;1901 }1902 1936 else 1903 1937 { 1904 if (oldstartts < p->recstartts) 1905 break; 1938 if (episodeSort == "OrigAirDate") 1939 { 1940 if (oldoriginalAirDate < p->originalAirDate) 1941 break; 1942 } 1943 else if (episodeSort == "Id") 1944 { 1945 if (oldprogramid < p->programid) 1946 break; 1947 } 1948 else 1949 { 1950 if (oldstartts < p->recstartts) 1951 break; 1952 } 1906 1953 } 1907 1954 } 1908 1955 } -
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"); … … 3554 3566 VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false); 3555 3567 pbox->setLabel(QObject::tr("View Recordings")); 3556 3568 pbox->addChild(PlayBoxOrdering()); 3569 pbox->addChild(PlayBoxAllOrdering()); 3557 3570 pbox->addChild(PlayBoxEpisodeSort()); 3558 3571 pbox->addChild(GeneratePreviewPixmaps()); 3559 3572 pbox->addChild(PreviewPixmapOffset()); -
programs/mythfrontend/playbackbox.h
326 326 bool arrowAccel; 327 327 /// if true keypress events are ignored 328 328 bool ignoreKeyPressEvents; 329 /// allOrder controls the ordering of the "All Programs" list 330 int allOrder; 329 331 /// listOrder controls the ordering of the recordings in the list 330 332 int listOrder; 331 333 /// Number of items in selector that can be shown on the screen at once