Ticket #3096: EPGSortReverse.patch

File EPGSortReverse.patch, 2.8 KB (added by lscotte@…, 17 years ago)

Patch to sort EPG in reverse order

  • libs/libmythtv/guidegrid.h

     
    154154
    155155    bool selectState;
    156156    bool showFavorites;
     157    bool sortReverse;
    157158    QString channelFormat;
    158159
    159160    int desiredDisplayChans;
  • libs/libmythtv/guidegrid.cpp

     
    137137    }
    138138
    139139    scrolltype = gContext->GetNumSetting("EPGScrollType", 1);
     140    sortReverse = gContext->GetNumSetting("EPGSortReverse", 0);
    140141
    141142    selectChangesChannel = gContext->GetNumSetting("SelectChangesChannel", 0);
    142143    selectRecThreshold = gContext->GetNumSetting("SelChangeRecThreshold", 16);
     
    582583    bool startingset = false;
    583584    for (uint i = 0; i < channels.size(); i++)
    584585    {
     586        uint chan=i;
     587        if (sortReverse)
     588        {
     589            chan=channels.size()-i-1;
     590        }
    585591        ChannelInfo val;
    586         val.chanstr  = channels[i].channum;
    587         val.chanid   = channels[i].chanid;
    588         val.callsign = channels[i].callsign;
    589         val.favid    = channels[i].favorite;
    590         val.channame = channels[i].name;
    591         val.iconpath = channels[i].icon;
     592        val.chanstr  = channels[chan].channum;
     593        val.chanid   = channels[chan].chanid;
     594        val.callsign = channels[chan].callsign;
     595        val.favid    = channels[chan].favorite;
     596        val.channame = channels[chan].name;
     597        val.iconpath = channels[chan].icon;
    592598        val.iconload = false;
    593599
    594600        // set starting channel index if it hasn't been set
  • programs/mythfrontend/globalsettings.cpp

     
    21152115    return gc;
    21162116}
    21172117
     2118static HostCheckBox *EPGSortReverse()
     2119{
     2120    HostCheckBox *gc = new HostCheckBox("EPGSortReverse");
     2121    gc->setLabel(QObject::tr("Reverse Channel Order"));
     2122    gc->setValue(false);
     2123    gc->setHelpText(QObject::tr("If enabled, the program guide will be sorted "
     2124                    "in reverse order with lower numbered channels towards "
     2125                    "the bottom."));
     2126    return gc;
     2127}
     2128
    21182129static HostComboBox *EPGFillType()
    21192130{
    21202131    HostComboBox *gc = new HostComboBox("EPGFillType");
     
    36793690    epg->addChild(EPGShowCategoryColors());
    36803691    epg->addChild(EPGShowCategoryText());
    36813692    epg->addChild(EPGScrollType());
     3693    epg->addChild(EPGSortReverse());
    36823694    epg->addChild(EPGShowChannelIcon());
    36833695    epg->addChild(EPGShowFavorites());
    36843696    epg->addChild(WatchTVGuide());