Ticket #4504: 4504-v2.patch

File 4504-v2.patch, 22.9 KB (added by danielk, 16 years ago)

Updated patch

  • themes/blootubelite-wide/ui.xml

     
    114114        <selector type="box" color="#F0F0F0"></selector>
    115115        <recordingcolor>#00aa00</recordingcolor>
    116116        <conflictingcolor>#ff6600</conflictingcolor>
     117        <unavailablecolor>#ff0000</unavailablecolor>
    117118        <cutdown>no</cutdown>
    118119        <multiline>yes</multiline>
    119120        <textoffset>9,6</textoffset>
     
    449450        <selector type="box" color="#f0f0f0"></selector>
    450451        <recordingcolor>#00aa00</recordingcolor>
    451452        <conflictingcolor>#ff6600</conflictingcolor>
     453        <unavailablecolor>#ff0000</unavailablecolor>
    452454        <textoffset>9,6</textoffset>
    453455        <multiline>yes</multiline>
    454456                <catcolor category="Unknown" color="#222200"></catcolor>
  • themes/blootube-wide/ui.xml

     
    114114        <selector type="box" color="#F0F0F0"></selector>
    115115        <recordingcolor>#00aa00</recordingcolor>
    116116        <conflictingcolor>#ff6600</conflictingcolor>
     117        <unavailablecolor>#ff0000</unavailablecolor>
    117118        <cutdown>no</cutdown>
    118119        <multiline>yes</multiline>
    119120        <textoffset>9,6</textoffset>
     
    449450        <selector type="box" color="#f0f0f0"></selector>
    450451        <recordingcolor>#00aa00</recordingcolor>
    451452        <conflictingcolor>#ff6600</conflictingcolor>
     453        <unavailablecolor>#ff0000</unavailablecolor>
    452454        <textoffset>9,6</textoffset>
    453455        <multiline>yes</multiline>
    454456                <catcolor category="Unknown" color="#222200"></catcolor>
  • themes/ProjectGrayhem/ui.xml

     
    114114        <selector type="box" color="#808080"></selector>
    115115        <recordingcolor>#00aa00</recordingcolor>
    116116        <conflictingcolor>#ff6600</conflictingcolor>
     117        <unavailablecolor>#ff0000</unavailablecolor>
    117118        <cutdown>no</cutdown>
    118119        <multiline>yes</multiline>
    119120        <textoffset>9,6</textoffset>
     
    447448        <selector type="box" color="#808080"></selector>
    448449        <recordingcolor>#00aa00</recordingcolor>
    449450        <conflictingcolor>#ff6600</conflictingcolor>
     451        <unavailablecolor>#ff0000</unavailablecolor>
    450452        <textoffset>9,6</textoffset>
    451453        <multiline>yes</multiline>
    452454                <catcolor category="Unknown" color="#222200"></catcolor>
  • themes/neon-wide/ui.xml

     
    118118        <selector type="box" color="#F0F0F0"></selector>
    119119        <recordingcolor>#00aa00</recordingcolor>
    120120        <conflictingcolor>#ff6600</conflictingcolor>
     121        <unavailablecolor>#ff0000</unavailablecolor>
    121122        <cutdown>no</cutdown>
    122123        <multiline>yes</multiline>
    123124        <textoffset>9,2</textoffset>
     
    453454        <selector type="box" color="#f0f0f0"></selector>
    454455        <recordingcolor>#00aa00</recordingcolor>
    455456        <conflictingcolor>#ff6600</conflictingcolor>
     457        <unavailablecolor>#ff0000</unavailablecolor>
    456458        <textoffset>9,6</textoffset>
    457459        <multiline>yes</multiline>
    458460                <catcolor category="Unknown" color="#222200"></catcolor>
  • themes/ProjectGrayhem-wide/ui.xml

     
    114114        <selector type="box" color="#808080"></selector>
    115115        <recordingcolor>#00aa00</recordingcolor>
    116116        <conflictingcolor>#ff6600</conflictingcolor>
     117        <unavailablecolor>#ff0000</unavailablecolor>
    117118        <cutdown>no</cutdown>
    118119        <multiline>yes</multiline>
    119120        <textoffset>9,6</textoffset>
     
    443444        <selector type="box" color="#808080"></selector>
    444445        <recordingcolor>#00aa00</recordingcolor>
    445446        <conflictingcolor>#ff6600</conflictingcolor>
     447        <unavailablecolor>#ff0000</unavailablecolor>
    446448        <textoffset>9,6</textoffset>
    447449        <multiline>yes</multiline>
    448450                <catcolor category="Unknown" color="#222200"></catcolor>
  • themes/blootube/ui.xml

     
    114114        <selector type="box" color="#808080"></selector>
    115115        <recordingcolor>#00aa00</recordingcolor>
    116116        <conflictingcolor>#ff6600</conflictingcolor>
     117        <unavailablecolor>#ff0000</unavailablecolor>
    117118        <cutdown>no</cutdown>
    118119        <multiline>yes</multiline>
    119120        <textoffset>9,6</textoffset>
     
    447448        <selector type="box" color="#808080"></selector>
    448449        <recordingcolor>#00aa00</recordingcolor>
    449450        <conflictingcolor>#ff6600</conflictingcolor>
     451        <unavailablecolor>#ff0000</unavailablecolor>
    450452        <textoffset>9,6</textoffset>
    451453        <multiline>yes</multiline>
    452454                <catcolor category="Unknown" color="#222200"></catcolor>
  • myththemes/MythCenter/ui.xml

     
    9999        <selector type="box" color="#ffff33"></selector>
    100100        <recordingcolor>#00aa00</recordingcolor>
    101101        <conflictingcolor>#ff6600</conflictingcolor>
     102        <unavailablecolor>#ff0000</unavailablecolor>
    102103        <cutdown>no</cutdown>
    103104        <multiline>yes</multiline>
    104105        <textoffset>9,6</textoffset>
     
    261262        <selector type="box" color="#ffff33"></selector>
    262263        <recordingcolor>#00aa00</recordingcolor>
    263264        <conflictingcolor>#ff6600</conflictingcolor>
     265        <unavailablecolor>#ff0000</unavailablecolor>
    264266        <textoffset>9,6</textoffset>
    265267
    266268        <recordstatus type="SingleRecord" image="gg-rs-single.png"></recordstatus>
  • myththemes/Retro/ui.xml

     
    9999        <selector type="box" color="#ffff33"></selector>
    100100        <recordingcolor>#00aa00</recordingcolor>
    101101        <conflictingcolor>#ff6600</conflictingcolor>
     102        <unavailablecolor>#ff0000</unavailablecolor>
    102103        <cutdown>no</cutdown>
    103104        <multiline>yes</multiline>
    104105        <textoffset>9,6</textoffset>
     
    261262        <selector type="box" color="#ffff33"></selector>
    262263        <recordingcolor>#00aa00</recordingcolor>
    263264        <conflictingcolor>#ff6600</conflictingcolor>
     265        <unavailablecolor>#ff0000</unavailablecolor>
    264266        <textoffset>9,6</textoffset>
    265267
    266268        <recordstatus type="SingleRecord" image="gg-rs-single.png"></recordstatus>
  • myththemes/Minimalist-wide/ui.xml

     
    9393            <selector type="box" color="#ffff33"></selector>
    9494            <recordingcolor>#00aa00</recordingcolor>
    9595            <conflictingcolor>#ff6600</conflictingcolor>
     96            <unavailablecolor>#ff0000</unavailablecolor>
    9697            <cutdown>no</cutdown>
    9798            <multiline>yes</multiline>
    9899            <textoffset>3,3</textoffset>
     
    249250            <selector type="box" color="#ffff33"></selector>
    250251            <recordingcolor>#00aa00</recordingcolor>
    251252            <conflictingcolor>#ff6600</conflictingcolor>
     253            <unavailablecolor>#ff0000</unavailablecolor>
    252254            <cutdown>no</cutdown>
    253255            <multiline>yes</multiline>
    254256            <textoffset>3,3</textoffset>
  • myththemes/Titivillus/ui.xml

     
    9595        <selector type="box" color="#ffff33"></selector>
    9696        <recordingcolor>#00aa00</recordingcolor>
    9797        <conflictingcolor>#ff6600</conflictingcolor>
     98        <unavailablecolor>#ff0000</unavailablecolor>
    9899        <cutdown>no</cutdown>
    99100        <multiline>yes</multiline>
    100101        <textoffset>3,3</textoffset>
     
    255256        <selector type="box" color="#ffff33"></selector>
    256257        <recordingcolor>#00aa00</recordingcolor>
    257258        <conflictingcolor>#ff6600</conflictingcolor>
     259        <unavailablecolor>#ff0000</unavailablecolor>
    258260        <textoffset>3,3</textoffset>
    259261        <multiline>yes</multiline>
    260262
  • myththemes/MythCenter-wide/ui.xml

     
    140140        <selector type="box" color="#33ff33"></selector>
    141141        <recordingcolor>#00aa00</recordingcolor>
    142142        <conflictingcolor>#ff6600</conflictingcolor>
     143        <unavailablecolor>#ff0000</unavailablecolor>
    143144        <cutdown>no</cutdown>
    144145        <multiline>yes</multiline>
    145146        <textoffset>9,6</textoffset>
     
    300301        <selector type="box" color="#33ff33"></selector>
    301302        <recordingcolor>#00aa00</recordingcolor>
    302303        <conflictingcolor>#ff6600</conflictingcolor>
     304        <unavailablecolor>#ff0000</unavailablecolor>
    303305        <textoffset>9,6</textoffset>
    304306
    305307        <recordstatus type="SingleRecord" image="gg-rs-single.png"></recordstatus>
  • myththemes/Iulius/ui.xml

     
    9898        <selector type="box" color="#ffff33"></selector>
    9999        <recordingcolor>#00aa00</recordingcolor>
    100100        <conflictingcolor>#ff6600</conflictingcolor>
     101        <unavailablecolor>#ff0000</unavailablecolor>
    101102        <cutdown>no</cutdown>
    102103        <multiline>yes</multiline>
    103104        <textoffset>9,6</textoffset>
     
    271272        <selector type="box" color="#ffff33"></selector>
    272273        <recordingcolor>#00aa00</recordingcolor>
    273274        <conflictingcolor>#ff6600</conflictingcolor>
     275        <unavailablecolor>#ff0000</unavailablecolor>
    274276        <textoffset>9,6</textoffset>
    275277
    276278        <!-- customized category colors -->
  • mythtv/themes/blue/ui.xml

     
    6363        <selector type="box" color="#ffff33"></selector>
    6464        <recordingcolor>#00aa00</recordingcolor>
    6565        <conflictingcolor>#ff6600</conflictingcolor>
     66        <unavailablecolor>#ff0000</unavailablecolor>
    6667        <cutdown>no</cutdown>
    6768        <multiline>yes</multiline>
    6869        <textoffset>9,6</textoffset>
     
    187188        <selector type="box" color="#ffff33"></selector>
    188189        <recordingcolor>#00aa00</recordingcolor>
    189190        <conflictingcolor>#ff6600</conflictingcolor>
     191        <unavailablecolor>#ff0000</unavailablecolor>
    190192        <textoffset>9,6</textoffset>
    191193
    192194        <!-- customized category colors -->
  • mythtv/themes/G.A.N.T/ui.xml

     
    9898        <selector type="box" color="#ffff33"></selector>
    9999        <recordingcolor>#00aa00</recordingcolor>
    100100        <conflictingcolor>#ff6600</conflictingcolor>
     101        <unavailablecolor>#ff0000</unavailablecolor>
    101102        <cutdown>no</cutdown>
    102103        <multiline>yes</multiline>
    103104        <textoffset>9,6</textoffset>
     
    271272        <selector type="box" color="#ffff33"></selector>
    272273        <recordingcolor>#00aa00</recordingcolor>
    273274        <conflictingcolor>#ff6600</conflictingcolor>
     275        <unavailablecolor>#ff0000</unavailablecolor>
    274276        <textoffset>9,6</textoffset>
    275277
    276278        <!-- customized category colors -->
  • mythtv/libs/libmythtv/guidegrid.h

     
    153153    void paintPrograms(QPainter *);
    154154    void paintCurrentInfo(QPainter *);
    155155    void paintInfo(QPainter *);
     156
     157    bool isUnavailable(uint chanid, uint chanNumber, bool &channelsChanged);
    156158 
    157159    void resizeImage(QPixmap *, QString);
    158160    void LoadWindow(QDomElement &);
     
    247249    JumpToChannel *jumpToChannel;
    248250    bool           jumpToChannelEnabled;
    249251    bool           jumpToChannelHasRect;
     252
     253    QMap<uint,bool> chan_unavailable;
    250254};
    251255
    252256#endif
  • mythtv/libs/libmythtv/guidegrid.cpp

     
    12481248    QRect tempRect;
    12491249    bool isCurrent = false;
    12501250
     1251    bool channelsChanged = false;
     1252
     1253    uint chanNumber = row + m_currentStartChannel;
     1254    if (chanNumber >= m_channelInfos.size())
     1255        chanNumber -= m_channelInfos.size();
     1256
     1257    PixmapChannel *chinfo = GetChannelInfo(chanNumber);
     1258
     1259    bool unavStat = isUnavailable(chinfo->chanid, chanNumber, channelsChanged);
     1260
    12511261    for (int x = 0; x < DISPLAY_TIMES; x++)
    12521262    {
    12531263        proginfo = m_programInfos[row][x];
     
    13441354
    13451355                type->SetProgramInfo(row, cnt, tempRect, proginfo->title,
    13461356                                     proginfo->category, arrow, recFlag,
    1347                                      recStat, isCurrent);
     1357                                     recStat, unavStat, isCurrent);
    13481358
    13491359                cnt++;
    13501360            }
     
    13791389
    13801390    if (r.intersects(channelRect) && paintChannels(&p))
    13811391    {
     1392        chan_unavailable.clear();
    13821393        fillProgramInfos();
    13831394        update(programRect|curInfoRect|r);
    13841395        qApp->unlock();
     
    15321543    UIImageType *itype = NULL;
    15331544    container = theme->GetSet("chanbar");
    15341545    infocontainer = theme->GetSet("program_info");
     1546
    15351547    if (container)
    15361548        type = (UIBarType *)container->GetType("chans");
    15371549    if (infocontainer)
     
    15531565        if (chanNumber >= m_channelInfos.size())
    15541566            chanNumber -= m_channelInfos.size();
    15551567        if (chanNumber >= m_channelInfos.size())
    1556             break; 
     1568            break;
    15571569
    15581570        chinfo = GetChannelInfo(chanNumber);
    15591571
    1560         bool unavailable = false;
    1561         if (m_player && !m_player->IsTunable(chinfo->chanid, true))
    1562         {
    1563             unavailable = true;
     1572        bool unavailable = isUnavailable(chinfo->chanid, chanNumber, channelsChanged);
    15641573
    1565             // Try alternates with same channum if applicable
    1566             uint alt = GetAlternateChannelIndex(chanNumber, true);
    1567             if (alt != m_channelInfoIdx[chanNumber])
    1568             {
    1569                 unavailable = false;
    1570                 m_channelInfoIdx[chanNumber] = alt;
    1571                 chinfo = GetChannelInfo(chanNumber);
    1572                 channelsChanged = true;
    1573             }
     1574        if (channelsChanged)
     1575            chinfo = GetChannelInfo(chanNumber);
    15741576
    1575             // Try alternates with different channum if applicable
    1576             if (unavailable && GetProgramList(chinfo->chanid).count())
    1577             {
    1578                 alt = GetAlternateChannelIndex(chanNumber, false);
    1579                 unavailable = (alt == m_channelInfoIdx[chanNumber]);
    1580             }
    1581         }
     1577        if (!chinfo || (chanNumber >= m_channelInfos.size()))
     1578            break;
    15821579
    15831580        if ((y == (unsigned int)2 && scrolltype != 1) ||
    15841581            ((signed int)y == m_currentRow && scrolltype == 1))
     
    17751772    p->drawPixmap(pr.topLeft(), pix);
    17761773}
    17771774
     1775bool GuideGrid::isUnavailable(uint chanid, uint chanNumber, bool &channelsChanged)
     1776{
     1777    if (chan_unavailable.contains(chanNumber))
     1778      return chan_unavailable[chanNumber];
     1779
     1780    bool unavailable = false;
     1781    if (m_player && !m_player->IsTunable(chanid, true))
     1782    {
     1783        unavailable = true;
     1784
     1785        // Try alternates with same channum if applicable
     1786        uint alt = GetAlternateChannelIndex(chanNumber, true);
     1787        if (alt != m_channelInfoIdx[chanNumber])
     1788        {
     1789            unavailable = false;
     1790            m_channelInfoIdx[chanNumber] = alt;
     1791            channelsChanged = true;
     1792        }
     1793
     1794        // Try alternates with different channum if applicable
     1795        if (unavailable && GetProgramList(chanid).count())
     1796        {
     1797            alt = GetAlternateChannelIndex(chanNumber, false);
     1798            unavailable = (alt == m_channelInfoIdx[chanNumber]);
     1799        }
     1800    }
     1801
     1802    chan_unavailable[chanNumber] = unavailable;
     1803
     1804    return unavailable;
     1805}
     1806
    17781807void GuideGrid::toggleGuideListing()
    17791808{
    17801809    showFavorites = (!showFavorites);
     
    21112140
    21122141void GuideGrid::enter()
    21132142{
     2143    bool channelsChanged = false;
     2144
     2145    uint chanNumber = m_currentRow + m_currentStartChannel;
     2146    if (chanNumber >= m_channelInfos.size())
     2147        chanNumber -= m_channelInfos.size();
     2148
     2149    PixmapChannel *chinfo = GetChannelInfo(chanNumber);
     2150
     2151    if (isUnavailable(chinfo->chanid, chanNumber, channelsChanged))
     2152      return;
     2153
    21142154    if (timeCheck)
    21152155    {
    21162156        timeCheck->stop();
  • mythtv/libs/libmyth/xmlparse.cpp

     
    729729    QString selcolor = "";
    730730    QString reccolor = "";
    731731    QString concolor = "";
     732    QString unavcolor = "";
    732733    QRect area;
    733734    QPoint textoff = QPoint(0, 0);
    734735    bool cutdown = true;
     
    803804            {
    804805                concolor = getFirstText(info);
    805806            }
     807            else if (info.tagName() == "unavailablecolor")
     808            {
     809                unavcolor = getFirstText(info);
     810            }
    806811            else if (info.tagName() == "multiline")
    807812            {
    808813                if (getFirstText(info).lower() == "yes")
     
    889894    guide->SetTextOffset(textoff);
    890895    if (concolor == "")
    891896        concolor = reccolor;
    892     guide->SetRecordingColors(reccolor, concolor);
     897    guide->SetRecordingColors(reccolor, concolor, unavcolor);
    893898    guide->SetSelectorColor(selcolor);
    894899    for (int i = 1; i <= 7; i++)
    895900        guide->LoadImage(i, recImgs[i]);
  • mythtv/libs/libmyth/uitypes.cpp

     
    1 
    21#include <iostream>
    32#include <math.h>
    43
     
    639638    {
    640639        for (data = allData[i].first(); data; data = allData[i].next())
    641640        {
    642             if (data->recStat == 0)
     641            if (data->unavStat && (data->recStat != 1))
     642                drawBox(dr, data, unavcolor);
     643            else if (data->recStat == 0)
    643644                drawBackground(dr, data);
    644645            else if (data->recStat == 1)
    645646                drawBox(dr, data, reccolor);
     
    868869
    869870void UIGuideType::SetProgramInfo(int row, int col, const QRect &area,
    870871                                 const QString &title, const QString &genre,
    871                                  int arrow, int recType, int recStat,
     872                                 int arrow, int recType, int recStat, bool unavStat,
    872873                                 bool selected)
    873874{
    874875    (void)col;
    875     UIGTCon *data = new UIGTCon(area, title, genre, arrow, recType, recStat);
     876    UIGTCon *data = new UIGTCon(area, title, genre, arrow, recType, recStat, unavStat);
    876877
    877878    allData[row].append(data);
    878879
    879880    if (drawCategoryColors)
    880881    {
    881882        data->categoryColor = categoryColors[data->category.lower()];
     883
    882884        if (!data->categoryColor.isValid())
    883885            data->categoryColor = categoryColors["none"];
    884886    }
  • mythtv/libs/libmyth/uitypes.h

     
    235235    UIGuideType(const QString &name, int order);
    236236    ~UIGuideType();
    237237
    238     enum FillType { Alpha = 10, Dense, Eco, Solid };
     238    enum FillType { Alpha = 10, Dense, Eco, Solid, Unavailable };
    239239
    240240    void Draw(QPainter *dr, int drawlayer, int context);
    241241
     
    249249    void SetNumRows(int numRows) { this->numRows = numRows; }
    250250    void SetWindow(MythDialog *win) { window = win; }
    251251
    252     void SetRecordingColors(const QString &reccol, const QString &concol)
    253                   { reccolor = QColor(reccol); concolor = QColor(concol); }
     252    void SetRecordingColors(const QString &reccol, const QString &concol,
     253                            const QString &unavcol)
     254                  { reccolor = QColor(reccol); concolor = QColor(concol);
     255                    unavcolor = QColor(unavcol); }
    254256    void SetSelectorColor(const QString &col) { selcolor = QColor(col); }
    255257    void SetSolidColor(const QString &col) { solidcolor = QColor(col); }
    256258    void SetCategoryColors(const QMap<QString, QString> &catColors);
     
    262264    void LoadImage(int, const QString &file);
    263265    void SetProgramInfo(int row, int col, const QRect &area,
    264266                        const QString &title, const QString &category,
    265                         int arrow, int recType, int recStat, bool selected);
     267                        int arrow, int recType, int recStat, bool unavStat,
     268                        bool selected);
    266269    void ResetData();
    267270    void ResetRow(int row);
    268271    void SetProgPast(int ppast);
     
    272275    class UIGTCon
    273276    {
    274277      public:
    275         UIGTCon() { arrow = recType = recStat = 0; };
     278        UIGTCon() { arrow = recType = recStat = 0; unavStat = false; };
    276279        UIGTCon(const QRect &drawArea, const QString &title,
    277                 const QString &category, int arrow, int recType, int recStat)
     280                const QString &category, int arrow, int recType,
     281                int recStat, bool unavStat)
    278282        {
    279283            this->drawArea = drawArea;
    280284            this->title = title;
     
    282286            this->arrow = arrow;
    283287            this->recType = recType;
    284288            this->recStat = recStat;
     289            this->unavStat = unavStat;
    285290        }
    286291
    287292        UIGTCon(const UIGTCon &o)
     
    293298            arrow = o.arrow;
    294299            recType = o.recType;
    295300            recStat = o.recStat;
     301            unavStat = o.unavStat;
    296302        }
    297303
    298304        QRect drawArea;
     
    302308        int arrow;
    303309        int recType;
    304310        int recStat;
     311        bool unavStat;
    305312    };
    306313
    307314    void drawBackground(QPainter *dr, UIGTCon *data);
     
    334341
    335342    QColor reccolor;
    336343    QColor concolor;
     344    QColor unavcolor;
    337345
    338346    int filltype;
    339347    bool cutdown;