Ticket #1771: PlayBoxAllOrdering.patch

File PlayBoxAllOrdering.patch, 5.7 KB (added by jppoet@…, 18 years ago)

"All Programs" sort order

  • programs/mythfrontend/playbackbox.cpp

     
    172172    formatTime         = gContext->GetSetting("TimeFormat", "h:mm AP");
    173173    recGroup           = gContext->GetSetting("DisplayRecGroup","All Programs");
    174174    listOrder          = gContext->GetNumSetting("PlayBoxOrdering", 1);
     175    allOrder           = gContext->GetNumSetting("PlayBoxAllOrdering", 1);
    175176    groupnameAsAllProg = gContext->GetNumSetting("DispRecGroupAsAllProg", 0);
    176177    arrowAccel         = gContext->GetNumSetting("UseArrowAccels", 1);
    177178    inTitle            = gContext->GetNumSetting("PlaybackBoxStartInTitle", 0);
     
    13771378    bool LiveTVInAllPrograms = gContext->GetNumSetting("LiveTVInAllPrograms",0);
    13781379
    13791380    vector<ProgramInfo *> *infoList;
    1380     infoList = RemoteGetRecordedList(listOrder == 0 || type == Delete);
     1381    infoList = RemoteGetRecordedList(allOrder == 0 || type == Delete);
    13811382    if (infoList)
    13821383    {
    13831384        sortedList[""] = "";
     
    15171518        {
    15181519            p = l->at(i);
    15191520
    1520             if (listOrder == 0 || type == Delete)
     1521            if (titleIndex == 0)
    15211522            {
    1522                 if (episodeSort == "OrigAirDate" && titleIndex > 0)
     1523                if (allOrder == 0 || type == Delete)
    15231524                {
    1524                     if (oldoriginalAirDate > p->originalAirDate)
     1525                    if (oldstartts > p->recstartts)
    15251526                        break;
    15261527                }
    1527                 else if (episodeSort == "Id" && titleIndex > 0)
    1528                 {
    1529                     if (oldprogramid > p->programid)
    1530                         break;
     1528                else {
     1529                    if (oldstartts < p->recstartts)
     1530                        break; 
    15311531                }
    1532                 else
    1533                 {
    1534                     if (oldstartts > p->recstartts)
    1535                         break;
    1536                 }
    15371532            }
    15381533            else
    15391534            {
    1540                 if (episodeSort == "OrigAirDate" && titleIndex > 0)
     1535                if (listOrder == 0 || type == Delete)
    15411536                {
    1542                     if (oldoriginalAirDate < p->originalAirDate)
    1543                         break;
     1537                    if (episodeSort == "OrigAirDate")
     1538                    {
     1539                        if (oldoriginalAirDate > p->originalAirDate)
     1540                            break;
     1541                    }
     1542                    else if (episodeSort == "Id")
     1543                    {
     1544                        if (oldprogramid > p->programid)
     1545                            break;
     1546                    }
     1547                    else
     1548                    {
     1549                        if (oldstartts > p->recstartts)
     1550                            break;
     1551                    }
    15441552                }
    1545                 else if (episodeSort == "Id" && titleIndex > 0)
    1546                 {
    1547                     if (oldprogramid < p->programid)
    1548                         break;
    1549                 }
    15501553                else
    15511554                {
    1552                     if (oldstartts < p->recstartts)
    1553                         break;
     1555                    if (episodeSort == "OrigAirDate")
     1556                    {
     1557                        if (oldoriginalAirDate < p->originalAirDate)
     1558                            break;
     1559                    }
     1560                    else if (episodeSort == "Id")
     1561                    {
     1562                        if (oldprogramid < p->programid)
     1563                            break;
     1564                    }
     1565                    else
     1566                    {
     1567                        if (oldstartts < p->recstartts)
     1568                            break;
     1569                    }
    15541570                }
    15551571            }
    15561572
  • programs/mythfrontend/globalsettings.cpp

     
    670670    return gc;
    671671}
    672672
     673static HostCheckBox *PlayBoxAllOrdering()
     674{
     675    HostCheckBox *gc = new HostCheckBox("PlayBoxAllOrdering");
     676    gc->setLabel(QObject::tr("All Programs: List Newest Recording First"));
     677    gc->setValue(true);
     678    gc->setHelpText(QObject::tr("When enabled, the most recent recording "
     679                    "will be listed first in the 'All Programs' or 'Default' "
     680                    "section of the 'Watch Recordings' screen, otherwise "
     681                    "the oldest recording will be listed first."));
     682    return gc;
     683}
     684
    673685static HostComboBox *PlayBoxEpisodeSort()
    674686{
    675687    HostComboBox *gc = new HostComboBox("PlayBoxEpisodeSort");
     
    32663278    VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false);
    32673279    pbox->setLabel(QObject::tr("View Recordings"));
    32683280    pbox->addChild(PlayBoxOrdering());
     3281    pbox->addChild(PlayBoxAllOrdering());
    32693282    pbox->addChild(PlayBoxEpisodeSort());
    32703283    pbox->addChild(GeneratePreviewPixmaps());
    32713284    pbox->addChild(PreviewPixmapOffset());
  • programs/mythfrontend/playbackbox.h

     
    294294    bool                arrowAccel;
    295295    /// if true keypress events are ignored 
    296296    bool                ignoreKeyPressEvents;
     297    /// allOrder controls the ordering of the "All Programs" list
     298    int                 allOrder;
    297299    /// listOrder controls the ordering of the recordings in the list
    298300    int                 listOrder;
    299301    /// Number of items in selector that can be shown on the screen at once