void CGUIWindowPVRBase::ShowEPGInfo(CFileItem *item)
{
    CFileItem *tag = NULL;
    bool bHasChannel(false);
    CPVRChannel channel;
    if (item->IsEPG())
    {
        tag = new CFileItem(*item);
        if (item->GetEPGInfoTag()->HasPVRChannel())
        {
            channel = *item->GetEPGInfoTag()->ChannelTag();
            bHasChannel = true;
        }
    }
    else if (item->IsPVRChannel())
    {
        CEpgInfoTag epgnow;
        channel = *item->GetPVRChannelInfoTag();
        bHasChannel = true;
        if (!item->GetPVRChannelInfoTag()->GetEPGNow(epgnow))
        {
            CGUIDialogOK::ShowAndGetInput(19033,0,19055,0);
            return;
        }
        tag = new CFileItem(epgnow);
    }

    CGUIDialogPVRGuideInfo* pDlgInfo = (CGUIDialogPVRGuideInfo*)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_GUIDE_INFO);
    if (tag && (!bHasChannel || g_PVRManager.CheckParentalLock(channel)) && pDlgInfo)
    {
        pDlgInfo->SetProgInfo(tag);
        pDlgInfo->DoModal();
    }

    delete tag;
}
Beispiel #2
0
  bool CPVRGUIActions::ShowEPGInfo(const CFileItemPtr &item) const
  {
    const CPVRChannelPtr channel(CPVRItem(item).GetChannel());
    if (channel && !g_PVRManager.CheckParentalLock(channel))
      return false;

    const CEpgInfoTagPtr epgTag(CPVRItem(item).GetEpgInfoTag());
    if (!epgTag)
    {
      CLog::Log(LOGERROR, "CPVRGUIActions - %s - no epg tag!", __FUNCTION__);
      return false;
    }

    CGUIDialogPVRGuideInfo* pDlgInfo = dynamic_cast<CGUIDialogPVRGuideInfo*>(g_windowManager.GetWindow(WINDOW_DIALOG_PVR_GUIDE_INFO));
    if (!pDlgInfo)
    {
      CLog::Log(LOGERROR, "CPVRGUIActions - %s - unable to get WINDOW_DIALOG_PVR_GUIDE_INFO!", __FUNCTION__);
      return false;
    }

    pDlgInfo->SetProgInfo(epgTag);
    pDlgInfo->Open();
    return true;
  }