Ticket #6318: recGroup-ui-v2a.patch

File recGroup-ui-v2a.patch, 3.0 KB (added by jppoet@…, 15 years ago)

Cleaned up

  • programs/mythfrontend/playbackbox.cpp

     
    406406    if (!LoadWindowFromXML("recordings-ui.xml", "watchrecordings", this))
    407407        return false;
    408408
     409    m_recgroupList  = dynamic_cast<MythUIButtonList *> (GetChild("recgroups"));
    409410    m_groupList     = dynamic_cast<MythUIButtonList *> (GetChild("groups"));
    410411    m_recordingList = dynamic_cast<MythUIButtonList *> (GetChild("recordings"));
    411412
     
    434435    m_groupList->SetLCDTitles(tr("Groups"));
    435436    m_recordingList->SetLCDTitles(tr("Recordings"), "titlesubtitle|shortdate|starttime");
    436437
     438    if (m_recgroupList)
     439        m_recgroupList->SetCanTakeFocus(false);
     440
    437441    if (!m_player && !m_recGroupPassword.isEmpty())
    438442        displayRecGroup(m_recGroup);
    439443    else if (gContext->GetNumSetting("QueryInitialFilter", 0) == 1)
     
    815819    }
    816820}
    817821
     822/*
     823 * \fn PlaybackBox::updateRecGroupList(void)
     824 * \brief called when the list of recording groups may have changed
     825 */
     826void PlaybackBox::updateRecGroupList(void)
     827{
     828    if (m_recGroupIdx < 0 || !m_recgroupList)
     829        return;
     830
     831    m_recgroupList->Reset();
     832
     833    QStringList::iterator it;
     834    int idx;
     835    MythUIButtonListItem *item = NULL;
     836    QString name;
     837    QString state;
     838
     839    for (it = m_recGroups.begin(), idx = 0;
     840         it != m_recGroups.end(); ++it, ++idx)
     841    {
     842        name = (*it).simplified();
     843        if (name == "All Programs")
     844            name = "All";
     845
     846        item = new MythUIButtonListItem(m_recgroupList, "",
     847                                        qVariantFromValue(name.toLower()));
     848
     849        if (idx == m_recGroupIdx)
     850            m_recgroupList->SetItemCurrent(item);
     851
     852        item->SetText(name);
     853    }
     854}
     855
    818856void PlaybackBox::updateGroupList()
    819857{
    820858    m_groupList->Reset();
     
    10281066    m_progLists.clear();
    10291067    m_recordingList->Reset();
    10301068    m_groupList->Reset();
     1069    if (m_recgroupList)
     1070        m_recgroupList->Reset();
    10311071    // Clear autoDelete for the "all" list since it will share the
    10321072    // objects with the title lists.
    10331073    m_progLists[""] = ProgramList(false);
     
    14881528        }
    14891529    }
    14901530
     1531    updateRecGroupList();
    14911532    updateGroupList();
    14921533    updateUsage();
    14931534
  • programs/mythfrontend/playbackbox.h

     
    307307    QString testImageFiles(QString &testDirectory,
    308308                           QString &seriesID, QString &titleIn);
    309309
     310    void updateRecGroupList();
    310311    void updateGroupList();
    311312    void updateIcons(const ProgramInfo *pginfo = NULL);
    312313    void updateUsage();
     
    318319
    319320    void HandlePreviewEvent(const ProgramInfo &evinfo);
    320321
     322    MythUIButtonList *m_recgroupList;
    321323    MythUIButtonList *m_groupList;
    322324    MythUIButtonList *m_recordingList;
    323325