Ejemplo n.º 1
0
void ProgFinder::updateTimesList()
{
    InfoMap infoMap;

    m_timesList->Reset();

    if (m_showData.size() > 0)
    {
        QString itemText;
        QDateTime starttime;
        for (uint i = 0; i < m_showData.size(); ++i)
        {
            starttime = m_showData[i]->GetScheduledStartTime();
            itemText = MythDateTimeToString(starttime,
                                            kDateTimeFull | kSimplify);

            MythUIButtonListItem *item =
                new MythUIButtonListItem(m_timesList, "");

            m_showData[i]->ToMap(infoMap);
            item->SetTextFromMap(infoMap);

            QString state = toUIState(m_showData[i]->GetRecordingStatus());
            item->SetText(itemText, "buttontext", state);
            item->DisplayState(state, "status");
        }
    }
}
Ejemplo n.º 2
0
void ViewScheduleDiff::updateUIList(void)
{
    for (uint i = 0; i < m_recList.size(); i++)
    {
        class ProgramStruct s = m_recList[i];
        class ProgramInfo *pginfo = s.after;
        if (!pginfo)
            pginfo = s.before;

        MythUIButtonListItem *item = new MythUIButtonListItem(
            m_conflictList, "", qVariantFromValue(pginfo));

        InfoMap infoMap;
        pginfo->ToMap(infoMap);

        QString state = toUIState(pginfo->GetRecordingStatus());

        item->DisplayState(state, "status");
        item->SetTextFromMap(infoMap, state);

        if (s.before)
            item->SetText(toString(s.before->GetRecordingStatus(),
                                   s.before->GetCardID()), "statusbefore",
                          state);
        else
            item->SetText("-", "statusbefore");

        if (s.after)
            item->SetText(toString(s.after->GetRecordingStatus(),
                                   s.after->GetCardID()), "statusafter",
                          state);
        else
            item->SetText("-", "statusafter");
    }

    if (m_noChangesText)
    {
        if (m_recList.empty())
            m_noChangesText->Show();
        else
            m_noChangesText->Hide();
    }
}