void ChannelRecPriority::updateInfo(MythUIButtonListItem *item) { if (!item) return; ChannelInfo *channelItem = item->GetData().value<ChannelInfo *>(); if (!m_channelData.isEmpty() && channelItem) { QString rectype; if (m_iconImage) { QString iconUrl = gCoreContext->GetMasterHostPrefix("ChannelIcons", channelItem->icon); m_iconImage->SetFilename(iconUrl); m_iconImage->Load(); } InfoMap chanmap; channelItem->ToMap(chanmap); SetTextFromMap(chanmap); if (m_chanstringText) m_chanstringText->SetText(channelItem->GetFormatted(ChannelInfo::kChannelLong)); } MythUIText *norecordingText = dynamic_cast<MythUIText*> (GetChild("norecordings_info")); if (norecordingText) norecordingText->SetVisible(m_channelData.isEmpty()); }
void ChannelRecPriority::updateList() { m_channelList->Reset(); QMap<QString, ChannelInfo*>::Iterator it; for (it = m_sortedChannel.begin(); it != m_sortedChannel.end(); ++it) { ChannelInfo *chanInfo = *it; MythUIButtonListItem *item = new MythUIButtonListItem(m_channelList, "", qVariantFromValue(chanInfo)); QString fontState = "default"; item->SetText(chanInfo->GetFormatted(ChannelInfo::kChannelLong), fontState); InfoMap infomap; chanInfo->ToMap(infomap); item->SetTextFromMap(infomap, fontState); item->DisplayState("normal", "status"); if (!chanInfo->icon.isEmpty()) { QString iconUrl = gCoreContext->GetMasterHostPrefix("ChannelIcons", chanInfo->icon); item->SetImage(iconUrl, "icon"); item->SetImage(iconUrl); } item->SetText(QString::number(chanInfo->recpriority), "priority", fontState); if (m_currentItem == chanInfo) m_channelList->SetItemCurrent(item); } // this textarea name is depreciated use 'nochannels_warning' instead MythUIText *noChannelsText = dynamic_cast<MythUIText*>(GetChild("norecordings_info")); if (!noChannelsText) noChannelsText = dynamic_cast<MythUIText*>(GetChild("nochannels_warning")); if (noChannelsText) noChannelsText->SetVisible(m_channelData.isEmpty()); }
void ChannelRecPriority::updateList() { m_channelList->Reset(); QMap<QString, ChannelInfo*>::Iterator it; MythUIButtonListItem *item; for (it = m_sortedChannel.begin(); it != m_sortedChannel.end(); ++it) { ChannelInfo *chanInfo = *it; item = new MythUIButtonListItem(m_channelList, "", qVariantFromValue(chanInfo)); QString fontState = "default"; if (!m_visMap[chanInfo->chanid]) fontState = "disabled"; item->SetText(chanInfo->GetFormatted(ChannelInfo::kChannelLong), fontState); InfoMap infomap; chanInfo->ToMap(infomap); item->SetTextFromMap(infomap, fontState); if (m_visMap[chanInfo->chanid]) item->DisplayState("normal", "status"); else item->DisplayState("disabled", "status"); item->SetImage(chanInfo->iconpath, "icon"); item->SetImage(chanInfo->iconpath); item->SetText(chanInfo->recpriority, "priority", fontState); if (m_currentItem == chanInfo) m_channelList->SetItemCurrent(item); } MythUIText *norecordingText = dynamic_cast<MythUIText*> (GetChild("norecordings_info")); if (norecordingText) norecordingText->SetVisible(m_channelData.isEmpty()); }