Ticket #6318: recGroup-ui-v2.1.patch

File recGroup-ui-v2.1.patch, 4.1 KB (added by jppoet@…, 16 years ago)

Update for r22552

  • programs/mythfrontend/playbackbox.cpp

    old new PlaybackBox::~PlaybackBox(void)  
    434434bool PlaybackBox::Create()
    435435{
    436436    if (!LoadWindowFromXML("recordings-ui.xml", "watchrecordings", this))
    437437        return false;
    438438
     439    m_recgroupList  = dynamic_cast<MythUIButtonList *> (GetChild("recgroups"));
    439440    m_groupList     = dynamic_cast<MythUIButtonList *> (GetChild("groups"));
    440441    m_recordingList = dynamic_cast<MythUIButtonList *> (GetChild("recordings"));
    441442
    442443    m_noRecordingsText = dynamic_cast<MythUIText *> (GetChild("norecordings"));
    443444
    bool PlaybackBox::Create()  
    450451    {
    451452        VERBOSE(VB_IMPORTANT, "Theme is missing critical theme elements.");
    452453        return false;
    453454    }
    454455
     456    if (m_recgroupList)
     457        m_recgroupList->SetCanTakeFocus(false);
     458
    455459    connect(m_groupList, SIGNAL(itemSelected(MythUIButtonListItem*)),
    456460            SLOT(updateRecList(MythUIButtonListItem*)));
    457461    connect(m_groupList, SIGNAL(itemClicked(MythUIButtonListItem*)),
    458462            SLOT(SwitchList()));
    459463    connect(m_recordingList, SIGNAL(itemSelected(MythUIButtonListItem*)),
    void PlaybackBox::updateUsage()  
    897901        usedProgress->SetTotal(m_freeSpaceTotal);
    898902        usedProgress->SetUsed(m_freeSpaceUsed);
    899903    }
    900904}
    901905
     906/*
     907 * \fn PlaybackBox::updateRecGroupList(void)
     908 * \brief called when the list of recording groups may have changed
     909 */
     910void PlaybackBox::updateRecGroupList(void)
     911{
     912    if (m_recGroupIdx < 0 || !m_recgroupList)
     913        return;
     914
     915    m_recgroupList->Reset();
     916
     917    QStringList::iterator it;
     918    int idx;
     919    MythUIButtonListItem *item = NULL;
     920    QString name;
     921    QString state;
     922
     923    for (it = m_recGroups.begin(), idx = 0;
     924         it != m_recGroups.end(); ++it, ++idx)
     925    {
     926        name = (*it).simplified();
     927        if (name == "All Programs")
     928            name = "All";
     929
     930        item = new MythUIButtonListItem(m_recgroupList, "",
     931                                        qVariantFromValue(name.toLower()));
     932
     933        if (idx == m_recGroupIdx)
     934            m_recgroupList->SetItemCurrent(item);
     935
     936        item->SetText(name);
     937    }
     938}
     939
    902940void PlaybackBox::updateGroupList()
    903941{
    904942    m_groupList->Reset();
    905943
    906944    if (!m_titleList.isEmpty())
    bool PlaybackBox::FillList(bool useCache  
    11651203    m_progsInDB = 0;
    11661204    m_titleList.clear();
    11671205    m_progLists.clear();
    11681206    m_recordingList->Reset();
    11691207    m_groupList->Reset();
     1208    if (m_recgroupList)
     1209        m_recgroupList->Reset();
    11701210    // Clear autoDelete for the "all" list since it will share the
    11711211    // objects with the title lists.
    11721212    m_progLists[""] = ProgramList(false);
    11731213    m_progLists[""].setAutoDelete(false);
    11741214
    bool PlaybackBox::FillList(bool useCache  
    16271667            if (m_recGroupIdx < 0)
    16281668                m_recGroupIdx = 0;
    16291669        }
    16301670    }
    16311671
     1672    updateRecGroupList();
    16321673    updateGroupList();
    16331674    updateUsage();
    16341675
    16351676    if (m_currentItem)
    16361677    {
  • programs/mythfrontend/playbackbox.h

    old new class PlaybackBox : public ScheduleCommo  
    312312    bool loadArtwork(QString artworkFile, MythUIImage *image, QTimer *timer,
    313313                     int delay = 500, bool resetImage = false);
    314314    QString findArtworkFile(QString &seriesID, QString &titleIn,
    315315                            QString imagetype, QString host);
    316316
     317    void updateRecGroupList();
    317318    void updateGroupList();
    318319    void updateIcons(const ProgramInfo *pginfo = NULL);
    319320    void updateUsage();
    320321    void updateGroupInfo(const QString &groupname, const QString &grouplabel);
    321322    void UpdateProgramInfo(MythUIButtonListItem *item, bool is_sel,
    class PlaybackBox : public ScheduleCommo  
    325326
    326327    void HandlePreviewEvent(const ProgramInfo &evinfo);
    327328
    328329    void ShowMenu(void);
    329330
     331    MythUIButtonList *m_recgroupList;
    330332    MythUIButtonList *m_groupList;
    331333    MythUIButtonList *m_recordingList;
    332334
    333335    MythUIText *m_noRecordingsText;
    334336