Ticket #4504: 4504-v1.patch

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

Mark's patch + theme parts of 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/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/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/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

     
    108108    void paintPrograms(QPainter *);
    109109    void paintCurrentInfo(QPainter *);
    110110    void paintInfo(QPainter *);
     111
     112    bool isUnavailable(uint chanid, uint chanNumber, bool &channelsChanged);
    111113 
    112114    void resizeImage(QPixmap *, QString);
    113115    void LoadWindow(QDomElement &);
     
    210212    bool jumpToChannelActive;
    211213    bool jumpToChannelHasRect;
    212214    QTimer *jumpToChannelTimer;
     215
     216    QMap<uint,bool> chan_unavailable;
    213217};
    214218
    215219#endif
  • mythtv/libs/libmythtv/guidegrid.cpp

     
    10511051    QRect tempRect;
    10521052    bool isCurrent = false;
    10531053
     1054    bool channelsChanged = false;
     1055
     1056    uint chanNumber = row + m_currentStartChannel;
     1057    if (chanNumber >= m_channelInfos.size())
     1058        chanNumber -= m_channelInfos.size();
     1059
     1060    PixmapChannel *chinfo = GetChannelInfo(chanNumber);
     1061
     1062    bool unavStat = isUnavailable(chinfo->chanid, chanNumber, channelsChanged);
     1063
    10541064    for (int x = 0; x < DISPLAY_TIMES; x++)
    10551065    {
    10561066        proginfo = m_programInfos[row][x];
     
    11471157
    11481158                type->SetProgramInfo(row, cnt, tempRect, proginfo->title,
    11491159                                     proginfo->category, arrow, recFlag,
    1150                                      recStat, isCurrent);
     1160                                     recStat, unavStat, isCurrent);
    11511161
    11521162                cnt++;
    11531163            }
     
    11821192
    11831193    if (r.intersects(channelRect) && paintChannels(&p))
    11841194    {
     1195        chan_unavailable.clear();
    11851196        fillProgramInfos();
    11861197        update(programRect|curInfoRect|r);
    11871198        qApp->unlock();
     
    13251336    UIImageType *itype = NULL;
    13261337    container = theme->GetSet("chanbar");
    13271338    infocontainer = theme->GetSet("program_info");
     1339
    13281340    if (container)
    13291341        type = (UIBarType *)container->GetType("chans");
    13301342    if (infocontainer)
     
    13461358        if (chanNumber >= m_channelInfos.size())
    13471359            chanNumber -= m_channelInfos.size();
    13481360        if (chanNumber >= m_channelInfos.size())
    1349             break; 
     1361            break;
    13501362
    13511363        chinfo = GetChannelInfo(chanNumber);
    13521364
    1353         bool unavailable = false;
    1354         if (m_player && !m_player->IsTunable(chinfo->chanid, true))
    1355         {
    1356             unavailable = true;
     1365        bool unavailable = isUnavailable(chinfo->chanid, chanNumber, channelsChanged);
    13571366
    1358             // Try alternates with same channum if applicable
    1359             uint alt = GetAlternateChannelIndex(chanNumber, true);
    1360             if (alt != m_channelInfoIdx[chanNumber])
    1361             {
    1362                 unavailable = false;
    1363                 m_channelInfoIdx[chanNumber] = alt;
    1364                 chinfo = GetChannelInfo(chanNumber);
    1365                 channelsChanged = true;
    1366             }
     1367        if (channelsChanged)
     1368            chinfo = GetChannelInfo(chanNumber);
    13671369
    1368             // Try alternates with different channum if applicable
    1369             if (unavailable && GetProgramList(chinfo->chanid).count())
    1370             {
    1371                 alt = GetAlternateChannelIndex(chanNumber, false);
    1372                 unavailable = (alt == m_channelInfoIdx[chanNumber]);
    1373             }
    1374         }
     1370        if (!chinfo || (chanNumber >= m_channelInfos.size()))
     1371            break;
    13751372
    13761373        if ((y == (unsigned int)2 && scrolltype != 1) ||
    13771374            ((signed int)y == m_currentRow && scrolltype == 1))
     
    15661563    p->drawPixmap(pr.topLeft(), pix);
    15671564}
    15681565
     1566bool GuideGrid::isUnavailable(uint chanid, uint chanNumber, bool &channelsChanged)
     1567{
     1568    if (chan_unavailable.contains(chanNumber))
     1569      return chan_unavailable[chanNumber];
     1570
     1571    bool unavailable = false;
     1572    if (m_player && !m_player->IsTunable(chanid, true))
     1573    {
     1574        unavailable = true;
     1575
     1576        // Try alternates with same channum if applicable
     1577        uint alt = GetAlternateChannelIndex(chanNumber, true);
     1578        if (alt != m_channelInfoIdx[chanNumber])
     1579        {
     1580            unavailable = false;
     1581            m_channelInfoIdx[chanNumber] = alt;
     1582            channelsChanged = true;
     1583        }
     1584
     1585        // Try alternates with different channum if applicable
     1586        if (unavailable && GetProgramList(chanid).count())
     1587        {
     1588            alt = GetAlternateChannelIndex(chanNumber, false);
     1589            unavailable = (alt == m_channelInfoIdx[chanNumber]);
     1590        }
     1591    }
     1592
     1593    chan_unavailable[chanNumber] = unavailable;
     1594
     1595    return unavailable;
     1596}
     1597
    15691598void GuideGrid::toggleGuideListing()
    15701599{
    15711600    showFavorites = (!showFavorites);
     
    19001929
    19011930void GuideGrid::enter()
    19021931{
     1932    bool channelsChanged = false;
     1933
     1934    uint chanNumber = m_currentRow + m_currentStartChannel;
     1935    if (chanNumber >= m_channelInfos.size())
     1936        chanNumber -= m_channelInfos.size();
     1937
     1938    PixmapChannel *chinfo = GetChannelInfo(chanNumber);
     1939
     1940    if (isUnavailable(chinfo->chanid, chanNumber, channelsChanged))
     1941      return;
     1942
    19031943    if (timeCheck)
    19041944    {
    19051945        timeCheck->stop();
  • mythtv/libs/libmyth/xmlparse.cpp

     
    725725    QString selcolor = "";
    726726    QString reccolor = "";
    727727    QString concolor = "";
     728    QString unavcolor = "";
    728729    QRect area;
    729730    QPoint textoff = QPoint(0, 0);
    730731    bool cutdown = true;
     
    799800            {
    800801                concolor = getFirstText(info);
    801802            }
     803            else if (info.tagName() == "unavailablecolor")
     804            {
     805                unavcolor = getFirstText(info);
     806            }
    802807            else if (info.tagName() == "multiline")
    803808            {
    804809                if (getFirstText(info).lower() == "yes")
     
    884889    guide->SetTextOffset(textoff);
    885890    if (concolor == "")
    886891        concolor = reccolor;
    887     guide->SetRecordingColors(reccolor, concolor);
     892    guide->SetRecordingColors(reccolor, concolor, unavcolor);
    888893    guide->SetSelectorColor(selcolor);
    889894    for (int i = 1; i <= 7; i++)
    890895        guide->LoadImage(i, recImgs[i]);
  • mythtv/libs/libmyth/uitypes.cpp

     
    1 
    21#include <iostream>
    32#include <math.h>
    43
     
    613612    {
    614613        for (data = allData[i].first(); data; data = allData[i].next())
    615614        {
    616             if (data->recStat == 0)
     615            if (data->unavStat && (data->recStat != 1))
     616                drawBox(dr, data, unavcolor);
     617            else if (data->recStat == 0)
    617618                drawBackground(dr, data);
    618619            else if (data->recStat == 1)
    619620                drawBox(dr, data, reccolor);
     
    842843
    843844void UIGuideType::SetProgramInfo(int row, int col, const QRect &area,
    844845                                 const QString &title, const QString &genre,
    845                                  int arrow, int recType, int recStat,
     846                                 int arrow, int recType, int recStat, bool unavStat,
    846847                                 bool selected)
    847848{
    848849    (void)col;
    849     UIGTCon *data = new UIGTCon(area, title, genre, arrow, recType, recStat);
     850    UIGTCon *data = new UIGTCon(area, title, genre, arrow, recType, recStat, unavStat);
    850851
    851852    allData[row].append(data);
    852853
    853854    if (drawCategoryColors)
    854855    {
    855856        data->categoryColor = categoryColors[data->category.lower()];
     857
    856858        if (!data->categoryColor.isValid())
    857859            data->categoryColor = categoryColors["none"];
    858860    }
  • mythtv/libs/libmyth/uitypes.h

     
    232232    UIGuideType(const QString &name, int order);
    233233    ~UIGuideType();
    234234
    235     enum FillType { Alpha = 10, Dense, Eco, Solid };
     235    enum FillType { Alpha = 10, Dense, Eco, Solid, Unavailable };
    236236
    237237    void Draw(QPainter *dr, int drawlayer, int context);
    238238
     
    246246    void SetNumRows(int numRows) { this->numRows = numRows; }
    247247    void SetWindow(MythDialog *win) { window = win; }
    248248
    249     void SetRecordingColors(const QString &reccol, const QString &concol)
    250                   { reccolor = QColor(reccol); concolor = QColor(concol); }
     249    void SetRecordingColors(const QString &reccol, const QString &concol,
     250                            const QString &unavcol)
     251                  { reccolor = QColor(reccol); concolor = QColor(concol);
     252                    unavcolor = QColor(unavcol); }
    251253    void SetSelectorColor(const QString &col) { selcolor = QColor(col); }
    252254    void SetSolidColor(const QString &col) { solidcolor = QColor(col); }
    253255    void SetCategoryColors(const QMap<QString, QString> &catColors);
     
    259261    void LoadImage(int, const QString &file);
    260262    void SetProgramInfo(int row, int col, const QRect &area,
    261263                        const QString &title, const QString &category,
    262                         int arrow, int recType, int recStat, bool selected);
     264                        int arrow, int recType, int recStat, bool unavStat,
     265                        bool selected);
    263266    void ResetData();
    264267    void ResetRow(int row);
    265268    void SetProgPast(int ppast);
     
    269272    class UIGTCon
    270273    {
    271274      public:
    272         UIGTCon() { arrow = recType = recStat = 0; };
     275        UIGTCon() { arrow = recType = recStat = 0; unavStat = false; };
    273276        UIGTCon(const QRect &drawArea, const QString &title,
    274                 const QString &category, int arrow, int recType, int recStat)
     277                const QString &category, int arrow, int recType,
     278                int recStat, bool unavStat)
    275279        {
    276280            this->drawArea = drawArea;
    277281            this->title = title;
     
    279283            this->arrow = arrow;
    280284            this->recType = recType;
    281285            this->recStat = recStat;
     286            this->unavStat = unavStat;
    282287        }
    283288
    284289        UIGTCon(const UIGTCon &o)
     
    290295            arrow = o.arrow;
    291296            recType = o.recType;
    292297            recStat = o.recStat;
     298            unavStat = o.unavStat;
    293299        }
    294300
    295301        QRect drawArea;
     
    299305        int arrow;
    300306        int recType;
    301307        int recStat;
     308        bool unavStat;
    302309    };
    303310
    304311    void drawBackground(QPainter *dr, UIGTCon *data);
     
    331338
    332339    QColor reccolor;
    333340    QColor concolor;
     341    QColor unavcolor;
    334342
    335343    int filltype;
    336344    bool cutdown;