Ticket #8049: playbackbox.diff

File playbackbox.diff, 4.1 KB (added by stuartm, 10 years ago)
  • mythtv/programs/mythfrontend/playbackbox.cpp

     
    729729    }
    730730}
    731731
     732static const char *disp_flags[] = { "playlist", "watched", "preserve",
     733                                    "cutlist", "autoexpire", "editing",
     734                                    "bookmark", "inuse", "commflagged",
     735                                    "transcoded" };
     736
     737void PlaybackBox::SetItemIcons(MythUIButtonListItem *item, ProgramInfo* pginfo)
     738{
     739    bool disp_flag_stat[sizeof(disp_flags)/sizeof(char*)];
     740
     741    disp_flag_stat[0] = !m_playList.filter(pginfo->MakeUniqueKey()).empty();
     742    disp_flag_stat[1] = pginfo->programflags & FL_WATCHED;
     743    disp_flag_stat[2] = pginfo->programflags & FL_PRESERVED;
     744    disp_flag_stat[3] = pginfo->programflags & FL_CUTLIST;
     745    disp_flag_stat[4] = pginfo->programflags & FL_AUTOEXP;
     746    disp_flag_stat[5] = pginfo->programflags & FL_EDITING;
     747    disp_flag_stat[6] = pginfo->programflags & FL_BOOKMARK;
     748    disp_flag_stat[7] = pginfo->programflags & FL_INUSEPLAYING;
     749    disp_flag_stat[8] = pginfo->programflags & FL_COMMFLAG;
     750    disp_flag_stat[9] = pginfo->programflags & FL_TRANSCODED;
     751
     752    for (uint i = 0; i < sizeof(disp_flags) / sizeof(char*); ++i)
     753        item->DisplayState(disp_flag_stat[i]?"yes":"no", disp_flags[i]);
     754}
     755
    732756void PlaybackBox::UpdateUIListItem(
    733757    MythUIButtonListItem *item, bool is_sel, bool force_preview_reload)
    734758{
     
    770794    QString job = extract_job_state(*pginfo);
    771795    item->DisplayState(job, "jobstate");
    772796
    773     // Watched status
    774 //     QString watched =
    775 //     item->DisplayState(, "watched");
     797    SetItemIcons(item, pginfo);
    776798
    777799    QString rating = QString::number((int)((pginfo->stars * 10.0) + 0.5));
    778800
     
    11471169
    11481170    ProgramList &progList = *pmit;
    11491171
    1150     static const char *disp_flags[] = { "playlist", "watched", "preserve",
    1151                                         "cutlist", "autoexpire", "editing",
    1152                                         "bookmark", "inuse", "commflagged",
    1153                                         "transcoded" };
    1154     bool disp_flag_stat[sizeof(disp_flags)/sizeof(char*)];
    1155 
    11561172    QMap<AudioProps, QString> audioFlags;
    11571173    audioFlags[AUD_DOLBY] = "dolby";
    11581174    audioFlags[AUD_SURROUND] = "surround";
     
    12021218        item->DisplayState(QString::number((int)((*it)->stars + 0.5)),
    12031219                            "ratingstate");
    12041220
    1205         disp_flag_stat[0] = !m_playList.filter((*it)->MakeUniqueKey()).empty();
    1206         disp_flag_stat[1] = (*it)->programflags & FL_WATCHED;
    1207         disp_flag_stat[2] = (*it)->programflags & FL_PRESERVED;
    1208         disp_flag_stat[3] = (*it)->programflags & FL_CUTLIST;
    1209         disp_flag_stat[4] = (*it)->programflags & FL_AUTOEXP;
    1210         disp_flag_stat[5] = (*it)->programflags & FL_EDITING;
    1211         disp_flag_stat[6] = (*it)->programflags & FL_BOOKMARK;
    1212         disp_flag_stat[7] = (*it)->programflags & FL_INUSEPLAYING;
    1213         disp_flag_stat[8] = (*it)->programflags & FL_COMMFLAG;
    1214         disp_flag_stat[9] = (*it)->programflags & FL_TRANSCODED;
     1221        SetItemIcons(item, (*it));
    12151222
    1216         for (uint i = 0; i < sizeof(disp_flags) / sizeof(char*); ++i)
    1217             item->DisplayState(disp_flag_stat[i]?"yes":"no", disp_flags[i]);
    1218 
    12191223        QMap<AudioProps, QString>::iterator ait;
    12201224        for (ait = audioFlags.begin(); ait != audioFlags.end(); ++ait)
    12211225        {
  • mythtv/programs/mythfrontend/playbackbox.h

     
    302302    void UpdateUsageUI(void);
    303303    void updateGroupInfo(const QString &groupname, const QString &grouplabel);
    304304
     305    void SetItemIcons(MythUIButtonListItem *item, ProgramInfo* pginfo);
    305306    void UpdateUIListItem(
    306307        ProgramInfo *ProgramInfo_pointer_from_FindProgramInUILists);
    307308    void UpdateUIListItem(MythUIButtonListItem *item, bool is_sel,