bool CPVRGUIActions::HideChannel(const CFileItemPtr &item) const { const CPVRChannelPtr channel(item->GetPVRChannelInfoTag()); /* check if the channel tag is valid */ if (!channel || channel->ChannelNumber() <= 0) return false; if (!CGUIDialogYesNo::ShowAndGetInput(CVariant{19054}, // "Hide channel" CVariant{19039}, // "Are you sure you want to hide this channel?" CVariant{""}, CVariant{channel->ChannelName()})) return false; if (!g_PVRChannelGroups->GetGroupAll(channel->IsRadio())->RemoveFromGroup(channel)) return false; CGUIWindowPVRBase *pvrWindow = dynamic_cast<CGUIWindowPVRBase *>(g_windowManager.GetWindow(g_windowManager.GetActiveWindow())); if (pvrWindow) pvrWindow->DoRefresh(); else CLog::Log(LOGERROR, "CPVRGUIActions - %s - called on non-pvr window. no refresh possible.", __FUNCTION__); return true; }
bool CPVRGUIActions::MarkUnwatched(const CFileItemPtr &item) const { if (!g_PVRRecordings->SetRecordingsPlayCount(item, 0)) return false; CGUIWindowPVRBase *pvrWindow = dynamic_cast<CGUIWindowPVRBase *>(g_windowManager.GetWindow(g_windowManager.GetActiveWindow())); if (pvrWindow) pvrWindow->DoRefresh(); else CLog::Log(LOGERROR, "CPVRGUIActions - %s - called on non-pvr window. no refresh possible.", __FUNCTION__); return true; }
bool CPVRGUIActions::RenameTimer(const CFileItemPtr &item) const { if (!item->HasPVRTimerInfoTag()) return false; const CPVRTimerInfoTagPtr timer(item->GetPVRTimerInfoTag()); std::string strNewName(timer->m_strTitle); if (CGUIKeyboardFactory::ShowAndGetInput(strNewName, CVariant{g_localizeStrings.Get(19042)}, // "Are you sure you want to rename this timer?" false)) { if (!g_PVRTimers->RenameTimer(*item, strNewName)) return false; } CGUIWindowPVRBase *pvrWindow = dynamic_cast<CGUIWindowPVRBase *>(g_windowManager.GetWindow(g_windowManager.GetActiveWindow())); if (pvrWindow) pvrWindow->DoRefresh(); else CLog::Log(LOGERROR, "CPVRGUIActions - %s - called on non-pvr window. no refresh possible.", __FUNCTION__); return true; }