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; 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"; QString stringFormat = item->GetText(); if (stringFormat.isEmpty()) stringFormat = "<num> <sign> \"<name>\""; item->SetText(chanInfo->GetFormatted(stringFormat), fontState); item->SetText(chanInfo->chanstr, "channum", fontState); item->SetText(chanInfo->callsign, "callsign", fontState); item->SetText(chanInfo->channame, "name", fontState); item->SetText(QString().setNum(chanInfo->sourceid), "sourceid", fontState); item->SetText(chanInfo->sourcename, "sourcename", 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()); }
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()); }
void ChannelRecPriority::updateInfo(MythUIButtonListItem *item) { if (!item) return; ChannelInfo *channelItem = qVariantValue<ChannelInfo *>(item->GetData()); if (!m_channelData.isEmpty() && channelItem) { QString rectype; if (m_iconImage) { m_iconImage->SetFilename(channelItem->iconpath); m_iconImage->Load(); } if (m_chanstringText) m_chanstringText->SetText(channelItem->GetFormatted(m_longchannelformat)); if (m_callsignText) m_callsignText->SetText(channelItem->callsign); if (m_channumText) m_channumText->SetText(channelItem->chanstr); if (m_channameText) m_channameText->SetText(channelItem->channame); if (m_sourcenameText) m_sourcenameText->SetText(channelItem->sourcename); if (m_sourceidText) m_sourceidText->SetText(QString().setNum(channelItem->sourceid)); if (m_priorityText) m_priorityText->SetText(channelItem->recpriority); } MythUIText *norecordingText = dynamic_cast<MythUIText*> (GetChild("norecordings_info")); if (norecordingText) norecordingText->SetVisible(m_channelData.isEmpty()); }