bool CPVRGUIActions::DeleteRecording(const CFileItemPtr &item) const { if ((!item->IsPVRRecording() && !item->m_bIsFolder) || item->IsParentFolder()) return false; if (!ConfirmDeleteRecording(item)) return false; if (!g_PVRRecordings->Delete(*item)) return false; g_PVRManager.TriggerRecordingsUpdate(); return true; }
bool CPVRGUIActions::ShowRecordingInfo(const CFileItemPtr &item) const { if (!item->IsPVRRecording()) { CLog::Log(LOGERROR, "CPVRGUIActions - %s - no recording!", __FUNCTION__); return false; } CGUIDialogPVRRecordingInfo* pDlgInfo = dynamic_cast<CGUIDialogPVRRecordingInfo*>(g_windowManager.GetWindow(WINDOW_DIALOG_PVR_RECORDING_INFO)); if (!pDlgInfo) { CLog::Log(LOGERROR, "CPVRGUIActions - %s - unable to get WINDOW_DIALOG_PVR_RECORDING_INFO!", __FUNCTION__); return false; } pDlgInfo->SetRecording(item.get()); pDlgInfo->Open(); return true; }
bool CGUIWindowPVRBase::OnContextButton(int itemNumber, CONTEXT_BUTTON button) { bool bReturn = false; switch(button) { case CONTEXT_BUTTON_MENU_HOOKS: if (itemNumber >= 0 && itemNumber < m_vecItems->Size()) { CFileItemPtr item = m_vecItems->Get(itemNumber); if (item->IsEPG() && item->GetEPGInfoTag()->HasPVRChannel()) g_PVRClients->ProcessMenuHooks(item->GetEPGInfoTag()->ChannelTag()->ClientID(), PVR_MENUHOOK_EPG, item.get()); else if (item->IsPVRChannel()) g_PVRClients->ProcessMenuHooks(item->GetPVRChannelInfoTag()->ClientID(), PVR_MENUHOOK_CHANNEL, item.get()); else if (item->IsPVRRecording()) g_PVRClients->ProcessMenuHooks(item->GetPVRRecordingInfoTag()->m_iClientId, PVR_MENUHOOK_RECORDING, item.get()); else if (item->IsPVRTimer()) g_PVRClients->ProcessMenuHooks(item->GetPVRTimerInfoTag()->m_iClientId, PVR_MENUHOOK_TIMER, item.get()); bReturn = true; } break; case CONTEXT_BUTTON_FIND: { int windowSearchId = m_bRadio ? WINDOW_RADIO_SEARCH : WINDOW_TV_SEARCH; CGUIWindowPVRBase *windowSearch = (CGUIWindowPVRBase*) g_windowManager.GetWindow(windowSearchId); if (windowSearch && itemNumber >= 0 && itemNumber < m_vecItems->Size()) { CFileItemPtr item = m_vecItems->Get(itemNumber); g_windowManager.ActivateWindow(windowSearchId); bReturn = windowSearch->OnContextButton(*item.get(), button); } break; } default: bReturn = false; } return bReturn || CGUIMediaWindow::OnContextButton(itemNumber, button); }