Exemplo n.º 1
0
bool CGUIWindowPVRCommon::ActionRecord(CFileItem *item)
{
  bool bReturn = false;

  CPVREpgInfoTag *epgTag = (CPVREpgInfoTag *) item->GetEPGInfoTag();
  if (!epgTag)
    return bReturn;

  const CPVRChannel *channel = epgTag->ChannelTag();
  if (!channel || channel->ChannelNumber() > 0)
    return bReturn;

  if (epgTag->Timer() == NULL)
  {
    /* create a confirmation dialog */
    CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*) g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
    if (!pDialog)
      return bReturn;

    pDialog->SetHeading(264);
    pDialog->SetLine(0, "");
    pDialog->SetLine(1, epgTag->Title());
    pDialog->SetLine(2, "");
    pDialog->DoModal();

    /* prompt for the user's confirmation */
    if (!pDialog->IsConfirmed())
      return bReturn;

    CPVRTimerInfoTag *newtimer = CPVRTimerInfoTag::CreateFromEpg(*epgTag);
    CFileItem *item = new CFileItem(*newtimer);

    if (CPVRManager::GetTimers()->AddTimer(*item))
      CPVRManager::GetTimers()->Update();

    bReturn = true;
  }
  else
  {
    CGUIDialogOK::ShowAndGetInput(19033,19034,0,0);
    bReturn = true;
  }

  return bReturn;
}
Exemplo n.º 2
0
void CGUIDialogPVRGuideInfo::Update()
{
  // set recording button label
  CPVREpgInfoTag* tag = (CPVREpgInfoTag *) m_progItem->GetEPGInfoTag();
  if (tag->End() > CDateTime::GetCurrentDateTime())
  {
    if (tag->Timer() == NULL)
    {
      if (tag->Start() < CDateTime::GetCurrentDateTime())
        SET_CONTROL_LABEL(CONTROL_BTN_RECORD, 264);
      else
        SET_CONTROL_LABEL(CONTROL_BTN_RECORD, 19061);
    }
    else
    {
      if (tag->Start() < CDateTime::GetCurrentDateTime())
        SET_CONTROL_LABEL(CONTROL_BTN_RECORD, 19059);
      else
        SET_CONTROL_LABEL(CONTROL_BTN_RECORD, 19060);
    }
  }
  else
    SET_CONTROL_HIDDEN(CONTROL_BTN_RECORD);
}