Ticket #223: playbackbox-lcd.patch

File playbackbox-lcd.patch, 4.1 KB (added by anonymous, 20 years ago)
  • programs/mythfrontend/playbackbox.cpp

     
    3535#include "scheduledrecording.h"
    3636#include "remoteutil.h"
    3737#include "jobqueue.h"
     38#include "lcddevice.h"
    3839
    3940static int comp_programid(ProgramInfo *a, ProgramInfo *b)
    4041{
     
    952953    pix.fill(this, pr.topLeft());
    953954    QPainter tmp(&pix);
    954955
     956    class LCD * lcddev = LCD::Get();
     957    QString lcdTitle;
     958    QPtrList<LCDMenuItem> lcdItems;
     959    lcdItems.setAutoDelete(true);
     960
     961
    955962    container = theme->GetSet("selector");
    956963
    957964    ProgramInfo *tempInfo;
     
    984991
    985992            for (int cnt = 0; cnt < ltype->GetItems(); cnt++)
    986993            {
     994                QString tstring;
    987995                if (titleList[h] == "")
    988                     ltype->SetItemText(cnt, groupDisplayName);
     996                    tstring =  groupDisplayName;
    989997                else
    990                     ltype->SetItemText(cnt, titleList[h]);
     998                    tstring = titleList[h];
     999
     1000                ltype->SetItemText(cnt, tstring);
     1001                if (lcddev && inTitle) {
     1002                    lcdItems.append(new LCDMenuItem(0, NOTCHECKABLE, tstring));
     1003                }
     1004
    9911005                h = ++h % titleList.count();
    9921006             }
    9931007        }
    9941008
     1009        UITextType *typeText = (UITextType *)container->GetType("current");
     1010        if (typeText)
     1011        {
     1012            QString tstring;
     1013
     1014            if (titleList[titleIndex] == "")
     1015                tstring = groupDisplayName;
     1016            else
     1017                tstring = titleList[titleIndex];
     1018            typeText->SetText(tstring);
     1019            if (lcddev) {
     1020                if(inTitle) {
     1021                    lcdItems.append(new LCDMenuItem(1, NOTCHECKABLE, tstring));
     1022                    lcdTitle = "Recordings";
     1023                }
     1024                else
     1025                    lcdTitle = " <<" + tstring;
     1026            }
     1027        }
     1028
    9951029        ltype = (UIListType *)container->GetType("bottomtitles");
    9961030        if (ltype)
    9971031        {
     
    10011035            int h = titleIndex + 1;
    10021036            h = h % titleList.count();
    10031037
     1038            QString tstring;
     1039
    10041040            for (int cnt = 0; cnt < ltype->GetItems(); cnt++)
    10051041            {
    10061042                if (titleList[h] == "")
    1007                     ltype->SetItemText(cnt, groupDisplayName);
     1043                    tstring = groupDisplayName;
    10081044                else
    1009                     ltype->SetItemText(cnt, titleList[h]);
     1045                    tstring = titleList[h];
     1046
     1047                ltype->SetItemText(cnt, tstring);
     1048                if (lcddev && inTitle) {
     1049                    lcdItems.append(new LCDMenuItem(0, NOTCHECKABLE, tstring));
     1050                }
    10101051                h = ++h % titleList.count();
    10111052            }
    10121053        }
    10131054
    1014         UITextType *typeText = (UITextType *)container->GetType("current");
    1015         if (typeText)
    1016         {
    1017             if (titleList[titleIndex] == "")
    1018                 typeText->SetText(groupDisplayName);
    1019             else
    1020                 typeText->SetText(titleList[titleIndex]);
    1021         }
    1022 
    10231055        ltype = (UIListType *)container->GetType("showing");
    10241056        if (ltype)
    10251057        {
     
    10721104                    curitem = new ProgramInfo(*tempInfo);
    10731105                    ltype->SetItemCurrent(cnt);
    10741106                }
     1107                if (lcddev && !inTitle) {
     1108                    lcdItems.append(new LCDMenuItem(skip + cnt == progIndex,
     1109                                       NOTCHECKABLE,
     1110                                       tempSubTitle.replace ('"', "'") +
     1111                                                        " " + tempDate));
     1112                }
    10751113
    10761114                ltype->SetItemText(cnt, 1, tempSubTitle);
    10771115                ltype->SetItemText(cnt, 2, tempDate);
     
    10941132            }
    10951133        }
    10961134    }
     1135    if (lcddev) {
     1136            if (!lcdItems.isEmpty())
     1137                lcddev->switchToMenu(&lcdItems, lcdTitle);
     1138    }
    10971139
    10981140    // DRAW LAYERS
    10991141    if (container && type != Delete)