Ticket #8297: channeleditor.patch

File channeleditor.patch, 3.1 KB (added by lynchmv@…, 16 years ago)

patch for channeleditor.*

  • channeleditor.cpp

     
    140140    MythUIButtonList *sortList = dynamic_cast<MythUIButtonList *>(GetChild("sorting"));
    141141    m_sourceList = dynamic_cast<MythUIButtonList *>(GetChild("source"));
    142142    m_channelList = dynamic_cast<MythUIButtonList *>(GetChild("channels"));
     143    m_preview = dynamic_cast<MythUIImage *>(GetChild("preview"));
     144    m_channame = dynamic_cast<MythUIText *>(GetChild("name"));
     145    m_channum = dynamic_cast<MythUIText *>(GetChild("channum"));
     146    m_callsign = dynamic_cast<MythUIText *>(GetChild("callsign"));
     147    m_chanid = dynamic_cast<MythUIText *>(GetChild("chanid"));
     148    m_sourcename = dynamic_cast<MythUIText *>(GetChild("sourcename"));
     149    m_compoundname = dynamic_cast<MythUIText *>(GetChild("compoundname"));
    143150
    144151    MythUIButton *deleteButton = dynamic_cast<MythUIButton *>(GetChild("delete"));
    145152    MythUIButton *scanButton = dynamic_cast<MythUIButton *>(GetChild("scan"));
     
    210217    // Other signals
    211218    connect(m_channelList, SIGNAL(itemClicked(MythUIButtonListItem *)),
    212219            SLOT(edit(MythUIButtonListItem *)));
     220    connect(m_channelList, SIGNAL(itemSelected(MythUIButtonListItem *)),
     221            SLOT(itemChanged(MythUIButtonListItem *)));
    213222    connect(scanButton, SIGNAL(Clicked()), SLOT(scan()));
    214223    connect(deleteButton,  SIGNAL(Clicked()), SLOT(deleteChannels()));
    215224
     
    248257    return handled;
    249258}
    250259
     260void ChannelEditor::itemChanged(MythUIButtonListItem *item)
     261{
     262    if (!item)
     263        return;
     264
     265    if (m_preview)
     266    {
     267        m_preview->Reset();
     268        QString iconpath = item->GetImage();
     269        if (!iconpath.isEmpty())
     270        {
     271            m_preview->SetFilename(iconpath);
     272            m_preview->Load();
     273        }
     274    }
     275
     276    if (m_channame)
     277        m_channame->SetText(item->GetText("name"));
     278
     279    if (m_channum)
     280        m_channum->SetText(item->GetText("channum"));
     281
     282    if (m_callsign)
     283        m_callsign->SetText(item->GetText("callsign"));
     284
     285    if (m_chanid)
     286        m_chanid->SetText(item->GetText("chanid"));
     287
     288    if (m_sourcename)
     289        m_sourcename->SetText(item->GetText("sourcename"));
     290
     291    if (m_compoundname)
     292        m_compoundname->SetText(item->GetText("compoundname"));
     293}
     294
    251295void ChannelEditor::fillList(void)
    252296{
    253297    QString currentValue = m_channelList->GetValue();
  • channeleditor.h

     
    3333    void setHideMode(bool hide);
    3434    void fillList();
    3535
     36  private slots:
     37    void itemChanged(MythUIButtonListItem *item);
     38
    3639  private:
    3740    enum sourceFilter {
    3841        FILTER_ALL = -1,
     
    4649
    4750    MythUIButtonList *m_channelList;
    4851    MythUIButtonList *m_sourceList;
     52
     53    MythUIImage      *m_preview;
     54    MythUIText       *m_channame;
     55    MythUIText       *m_channum;
     56    MythUIText       *m_callsign;
     57    MythUIText       *m_chanid;
     58    MythUIText       *m_sourcename;
     59    MythUIText       *m_compoundname;
    4960};
    5061
    5162class ChannelID;