Ticket #6318: recGroup-ui-v4.patch

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

Compatibility with r23048

  • programs/mythfrontend/playbackbox.cpp

     
    474474    if (!LoadWindowFromXML("recordings-ui.xml", "watchrecordings", this))
    475475        return false;
    476476
     477    m_recgroupList  = dynamic_cast<MythUIButtonList *> (GetChild("recgroups"));
    477478    m_groupList     = dynamic_cast<MythUIButtonList *> (GetChild("groups"));
    478479    m_recordingList = dynamic_cast<MythUIButtonList *> (GetChild("recordings"));
    479480
     
    491492        return false;
    492493    }
    493494
     495    if (m_recgroupList)
     496        m_recgroupList->SetCanTakeFocus(false);
     497
    494498    connect(m_groupList, SIGNAL(itemSelected(MythUIButtonListItem*)),
    495499            SLOT(updateRecList(MythUIButtonListItem*)));
    496500    connect(m_groupList, SIGNAL(itemClicked(MythUIButtonListItem*)),
     
    993997    }
    994998}
    995999
     1000/*
     1001 * \fn PlaybackBox::updateUIRecGroupList(void)
     1002 * \brief called when the list of recording groups may have changed
     1003 */
     1004void PlaybackBox::UpdateUIRecGroupList(void)
     1005{
     1006    if (m_recGroupIdx < 0 || !m_recgroupList || m_recGroups.size() < 2)
     1007        return;
     1008
     1009    m_recgroupList->Reset();
     1010
     1011    QStringList::iterator it;
     1012    int idx;
     1013    MythUIButtonListItem *item = NULL;
     1014    QString name;
     1015    QString state;
     1016
     1017    for (it = m_recGroups.begin(), idx = 0;
     1018         it != m_recGroups.end(); ++it, ++idx)
     1019    {
     1020        name = (*it).simplified();
     1021        if (name == "All Programs")
     1022            name = "All";
     1023
     1024        item = new MythUIButtonListItem(m_recgroupList, "",
     1025                                        qVariantFromValue(name.toLower()));
     1026
     1027        if (idx == m_recGroupIdx)
     1028            m_recgroupList->SetItemCurrent(item);
     1029
     1030        item->SetText(name);
     1031    }
     1032}
     1033
    9961034void PlaybackBox::UpdateUIGroupList(const QStringList &groupPreferences)
    9971035{
    9981036    m_groupList->Reset();
     
    12351273    m_progLists.clear();
    12361274    m_recordingList->Reset();
    12371275    m_groupList->Reset();
     1276    if (m_recgroupList)
     1277        m_recgroupList->Reset();
    12381278    // Clear autoDelete for the "all" list since it will share the
    12391279    // objects with the title lists.
    12401280    m_progLists[""] = ProgramList(false);
     
    16781718        }
    16791719    }
    16801720
     1721    UpdateUIRecGroupList();
    16811722    UpdateUIGroupList(groupSelPref);
    16821723    UpdateUsageUI();
    16831724
  • programs/mythfrontend/playbackbox.h

     
    259259  private:
    260260    bool UpdateUILists(void);
    261261    void UpdateUIGroupList(const QStringList &groupPreferences);
     262    void UpdateUIRecGroupList(void);
    262263
    263264    void UpdateProgressBar(void);
    264265
     
    323324    QString CreateProgramInfoString(const ProgramInfo &program) const;
    324325
    325326  private:
     327    MythUIButtonList *m_recgroupList;
    326328    MythUIButtonList *m_groupList;
    327329    MythUIButtonList *m_recordingList;
    328330