Ticket #1771: PlayBoxAllOrdering5b.patch
File PlayBoxAllOrdering5b.patch, 7.7 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), … … 265 281 titleList << ""; 266 282 playList.clear(); 267 283 284 // Split out sort order modes 285 // Done using a switch instead of a bit-map to maintain 286 // backward compatibility 287 switch (listOrder) { 288 case 0: 289 allOrder = 0; 290 break; 291 case 1: 292 allOrder = 1; 293 break; 294 case 2: 295 listOrder = 1; 296 allOrder = 0; 297 break; 298 case 3: 299 listOrder = 0; 300 allOrder = 1; 301 break; 302 } 303 268 304 // recording group stuff 269 305 recGroupType.clear(); 270 306 recGroupType[recGroup] = (displayCat) ? "category" : "recgroup"; … … 1503 1539 { 1504 1540 clearProgramCache(); 1505 1541 1506 progCache = RemoteGetRecordedList( listOrder == 0 || type == Delete);1542 progCache = RemoteGetRecordedList(allOrder == 0 || type == Delete); 1507 1543 } 1508 1544 1509 1545 if (progCache) … … 1666 1702 } 1667 1703 } 1668 1704 } 1705 else if (episodeSort == "Date") 1706 { 1707 QMap<QString, ProgramList>::Iterator Iprog; 1708 for (Iprog = progLists.begin(); Iprog != progLists.end(); ++Iprog) 1709 { 1710 if (!Iprog.key().isEmpty()) 1711 { 1712 if (listOrder == 0 || type == Delete) 1713 Iprog.data().Sort(comp_recordDate_rev); 1714 else 1715 Iprog.data().Sort(comp_recordDate); 1716 } 1717 } 1718 } 1719 1669 1720 if (progLists[watchGroup].count() > 1) 1670 1721 { 1671 1722 QDateTime now = QDateTime::currentDateTime(); … … 1869 1920 1870 1921 if (oldtitle != watchGroup) 1871 1922 { 1872 if ( listOrder == 0 || type == Delete)1923 if (titleIndex == 0) 1873 1924 { 1874 if ( episodeSort == "OrigAirDate" && titleIndex > 0)1925 if (allOrder == 0 || type == Delete) 1875 1926 { 1876 if (old originalAirDate > p->originalAirDate)1927 if (oldstartts > p->recstartts) 1877 1928 break; 1878 1929 } 1879 else if (episodeSort == "Id" && titleIndex > 0) 1880 { 1881 if (oldprogramid > p->programid) 1882 break; 1930 else { 1931 if (oldstartts < p->recstartts) 1932 break; 1883 1933 } 1884 else1885 {1886 if (oldstartts > p->recstartts)1887 break;1888 }1889 1934 } 1890 1935 else 1891 1936 { 1892 if ( episodeSort == "OrigAirDate" && titleIndex > 0)1937 if (listOrder == 0 || type == Delete) 1893 1938 { 1894 if (oldoriginalAirDate < p->originalAirDate) 1895 break; 1939 if (episodeSort == "OrigAirDate") 1940 { 1941 if (oldoriginalAirDate > p->originalAirDate) 1942 break; 1943 } 1944 else if (episodeSort == "Id") 1945 { 1946 if (oldprogramid > p->programid) 1947 break; 1948 } 1949 else 1950 { 1951 if (oldstartts > p->recstartts) 1952 break; 1953 } 1896 1954 } 1897 else if (episodeSort == "Id" && titleIndex > 0)1898 {1899 if (oldprogramid < p->programid)1900 break;1901 }1902 1955 else 1903 1956 { 1904 if (oldstartts < p->recstartts) 1905 break; 1957 if (episodeSort == "OrigAirDate") 1958 { 1959 if (oldoriginalAirDate < p->originalAirDate) 1960 break; 1961 } 1962 else if (episodeSort == "Id") 1963 { 1964 if (oldprogramid < p->programid) 1965 break; 1966 } 1967 else 1968 { 1969 if (oldstartts < p->recstartts) 1970 break; 1971 } 1906 1972 } 1907 1973 } 1908 1974 } -
programs/mythfrontend/globalsettings.cpp
704 704 return vcg; 705 705 } 706 706 707 static HostC heckBox *PlayBoxOrdering()707 static HostComboBox *PlayBoxOrdering() 708 708 { 709 HostCheckBox *gc = new HostCheckBox("PlayBoxOrdering"); 710 gc->setLabel(QObject::tr("List Newest Recording First")); 711 gc->setValue(true); 712 gc->setHelpText(QObject::tr("When enabled, the most recent recording " 713 "will be listed first in the 'Watch Recordings' " 714 "screen, otherwise the oldest recording will be " 715 "listed first.")); 709 HostComboBox *gc = new HostComboBox("PlayBoxOrdering"); 710 gc->setLabel(QObject::tr("(sub)Title sort order")); 711 gc->addSelection(QObject::tr("Sort all sub-titles/multi-titles Ascending"), "0"); 712 gc->addSelection(QObject::tr("Sort all sub-titles/multi-titles Descending"), "1"); 713 gc->addSelection(QObject::tr("Sort sub-titles Descending, multi-titles Ascending"), "2"); 714 gc->addSelection(QObject::tr("Sort sub-titles Ascending, multi-titles Descending"), "3"); 715 gc->setValue(1); 716 gc->setHelpText(QObject::tr("Selects how to sort show episodes. " 717 "Sub-titles refers to the episodes listed " 718 "under a specific show title. " 719 "multi-title refers to sections " 720 "(e.g. \"All Programs\") which list " 721 "multiple titles. Sections in parentheses " 722 "are not affected.")); 716 723 return gc; 717 724 } 718 725 -
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