2 * Copyright (C) 2012-2013 Team XBMC
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
21 #include "GUIWindowPVRCommon.h"
23 #include "Application.h"
24 #include "ApplicationMessenger.h"
25 #include "dialogs/GUIDialogKaiToast.h"
26 #include "dialogs/GUIDialogOK.h"
27 #include "dialogs/GUIDialogYesNo.h"
28 #include "filesystem/StackDirectory.h"
29 #include "guilib/GUIMessage.h"
30 #include "guilib/GUIWindowManager.h"
31 #include "guilib/Key.h"
32 #include "guilib/LocalizeStrings.h"
33 #include "pvr/PVRManager.h"
34 #include "pvr/channels/PVRChannelGroupsContainer.h"
35 #include "pvr/dialogs/GUIDialogPVRGuideInfo.h"
36 #include "pvr/dialogs/GUIDialogPVRRecordingInfo.h"
37 #include "pvr/dialogs/GUIDialogPVRTimerSettings.h"
39 #include "pvr/timers/PVRTimers.h"
40 #include "pvr/addons/PVRClients.h"
41 #include "pvr/windows/GUIWindowPVR.h"
42 #include "pvr/windows/GUIWindowPVRSearch.h"
43 #include "pvr/recordings/PVRRecordings.h"
44 #include "settings/MediaSettings.h"
45 #include "settings/Settings.h"
46 #include "utils/log.h"
47 #include "utils/URIUtils.h"
48 #include "GUIUserMessages.h"
49 #include "cores/IPlayer.h"
55 CGUIWindowPVRCommon::CGUIWindowPVRCommon(CGUIWindowPVR *parent, PVRWindow window,
56 unsigned int iControlButton, unsigned int iControlList)
60 m_iControlButton = iControlButton;
61 m_iControlList = iControlList;
62 m_bUpdateRequired = false;
64 m_iSortOrder = SortOrderAscending;
65 m_iSortMethod = SortByDate;
66 m_iSortAttributes = SortAttributeNone;
67 if( m_parent->GetViewState() )
69 SortDescription sorting = m_parent->GetViewState()->GetSortMethod();
70 m_iSortOrder = sorting.sortOrder;
71 m_iSortMethod = sorting.sortBy;
72 m_iSortAttributes = sorting.sortAttributes;
76 bool CGUIWindowPVRCommon::operator ==(const CGUIWindowPVRCommon &right) const
78 return (this == &right || m_window == right.m_window);
81 bool CGUIWindowPVRCommon::operator !=(const CGUIWindowPVRCommon &right) const
83 return !(*this == right);
86 const char *CGUIWindowPVRCommon::GetName(void) const
92 case PVR_WINDOW_CHANNELS_RADIO:
94 case PVR_WINDOW_CHANNELS_TV:
96 case PVR_WINDOW_RECORDINGS:
98 case PVR_WINDOW_SEARCH:
100 case PVR_WINDOW_TIMERS:
107 bool CGUIWindowPVRCommon::IsFocused(void) const
109 return !g_application.IsPlayingFullScreenVideo() &&
110 g_windowManager.GetFocusedWindow() == WINDOW_PVR &&
114 bool CGUIWindowPVRCommon::IsVisible(void) const
116 return !g_application.IsPlayingFullScreenVideo() &&
117 g_windowManager.GetActiveWindow() == WINDOW_PVR &&
121 bool CGUIWindowPVRCommon::IsActive(void) const
123 CGUIWindowPVRCommon *window = m_parent->GetActiveView();
124 return (window && *window == *this);
127 bool CGUIWindowPVRCommon::IsSavedView(void) const
129 CGUIWindowPVRCommon *window = m_parent->GetSavedView();
130 return (window && *window == *this);
133 bool CGUIWindowPVRCommon::IsSelectedButton(CGUIMessage &message) const
135 return (message.GetSenderId() == (int) m_iControlButton);
138 bool CGUIWindowPVRCommon::IsSelectedControl(CGUIMessage &message) const
140 return (message.GetControlId() == (int) m_iControlButton);
143 bool CGUIWindowPVRCommon::IsSelectedList(CGUIMessage &message) const
145 return (message.GetSenderId() == (int) m_iControlList);
148 void CGUIWindowPVRCommon::SetInvalid()
150 for (int iItemPtr = 0; iItemPtr < m_parent->m_vecItems->Size(); iItemPtr++)
151 m_parent->m_vecItems->Get(iItemPtr)->SetInvalid();
152 m_parent->SetInvalid();
155 void CGUIWindowPVRCommon::OnInitWindow()
157 m_parent->m_viewControl.SetCurrentView(m_iControlList);
160 bool CGUIWindowPVRCommon::SelectPlayingFile(void)
164 if (g_PVRManager.IsPlaying())
166 m_parent->m_viewControl.SetSelectedItem(g_application.CurrentFile());
173 bool CGUIWindowPVRCommon::OnMessageFocus(CGUIMessage &message)
175 bool bReturn = false;
177 if (message.GetMessage() == GUI_MSG_FOCUSED &&
178 (IsSelectedControl(message) || IsSavedView()))
180 CLog::Log(LOGDEBUG, "CGUIWindowPVRCommon - %s - focus set to window '%s'", __FUNCTION__, GetName());
181 bool bIsActive = IsActive();
182 m_parent->SetActiveView(this);
184 if (!bIsActive || m_bUpdateRequired)
193 void CGUIWindowPVRCommon::OnWindowUnload(void)
195 m_iSelected = m_parent->m_viewControl.GetSelectedItem();
196 m_history = m_parent->m_history;
199 bool CGUIWindowPVRCommon::OnAction(const CAction &action)
201 bool bReturn = false;
203 if (action.GetID() == ACTION_NAV_BACK ||
204 action.GetID() == ACTION_PREVIOUS_MENU)
206 g_windowManager.PreviousWindow();
213 bool CGUIWindowPVRCommon::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
215 if (itemNumber < 0 || itemNumber >= (int) m_parent->m_vecItems->Size())
217 CFileItemPtr pItem = m_parent->m_vecItems->Get(itemNumber);
219 return (OnContextButtonSortAsc(pItem.get(), button) ||
220 OnContextButtonSortBy(pItem.get(), button) ||
221 OnContextButtonSortByChannel(pItem.get(), button) ||
222 OnContextButtonSortByName(pItem.get(), button) ||
223 OnContextButtonSortByDate(pItem.get(), button) ||
224 OnContextButtonFind(pItem.get(), button) ||
225 OnContextButtonMenuHooks(pItem.get(), button));
228 bool CGUIWindowPVRCommon::OnContextButtonSortByDate(CFileItem *item, CONTEXT_BUTTON button)
230 bool bReturn = false;
232 if (button == CONTEXT_BUTTON_SORTBY_DATE)
236 if (m_iSortMethod != SortByDate)
238 m_iSortMethod = SortByDate;
239 m_iSortOrder = SortOrderAscending;
240 CGUIMessage message(GUI_MSG_CHANGE_SORT_METHOD, m_parent->GetID(), 0, m_iSortMethod, 0);
241 m_parent->OnMessage(message);
245 m_iSortOrder = m_iSortOrder == SortOrderAscending ? SortOrderDescending : SortOrderAscending;
247 CGUIMessage message(GUI_MSG_CHANGE_SORT_DIRECTION, m_parent->GetID(), 0, m_iSortOrder, 0);
248 m_parent->OnMessage(message);
255 bool CGUIWindowPVRCommon::OnContextButtonSortByName(CFileItem *item, CONTEXT_BUTTON button)
257 bool bReturn = false;
259 if (button == CONTEXT_BUTTON_SORTBY_NAME)
263 if (m_iSortMethod != SortByLabel)
265 m_iSortMethod = SortByLabel;
266 m_iSortOrder = SortOrderAscending;
267 CGUIMessage message(GUI_MSG_CHANGE_SORT_METHOD, m_parent->GetID(), 0, m_iSortMethod, 0);
268 m_parent->OnMessage(message);
272 m_iSortOrder = m_iSortOrder == SortOrderAscending ? SortOrderDescending : SortOrderAscending;
274 CGUIMessage message(GUI_MSG_CHANGE_SORT_DIRECTION, m_parent->GetID(), 0, m_iSortOrder, 0);
275 m_parent->OnMessage(message);
282 bool CGUIWindowPVRCommon::OnContextButtonSortByChannel(CFileItem *item, CONTEXT_BUTTON button)
284 bool bReturn = false;
286 if (button == CONTEXT_BUTTON_SORTBY_CHANNEL)
290 if (m_iSortMethod != SortByChannel)
292 m_iSortMethod = SortByChannel;
293 m_iSortOrder = SortOrderAscending;
297 m_iSortOrder = m_iSortOrder == SortOrderAscending ? SortOrderDescending : SortOrderAscending;
306 bool CGUIWindowPVRCommon::OnContextButtonSortAsc(CFileItem *item, CONTEXT_BUTTON button)
308 bool bReturn = false;
310 if (button == CONTEXT_BUTTON_SORTASC)
314 if (m_parent->m_guiState.get())
315 m_parent->m_guiState->SetNextSortOrder();
316 m_parent->UpdateFileList();
322 bool CGUIWindowPVRCommon::OnContextButtonSortBy(CFileItem *item, CONTEXT_BUTTON button)
324 bool bReturn = false;
326 if (button == CONTEXT_BUTTON_SORTBY)
330 if (m_parent->m_guiState.get())
331 m_parent->m_guiState->SetNextSortMethod();
333 m_parent->UpdateFileList();
339 bool CGUIWindowPVRCommon::OnContextButtonMenuHooks(CFileItem *item, CONTEXT_BUTTON button)
341 bool bReturn = false;
343 if (button == CONTEXT_BUTTON_MENU_HOOKS)
347 if (item->IsEPG() && item->GetEPGInfoTag()->HasPVRChannel())
348 g_PVRClients->ProcessMenuHooks(item->GetEPGInfoTag()->ChannelTag()->ClientID(), PVR_MENUHOOK_EPG, item);
349 else if (item->IsPVRChannel())
350 g_PVRClients->ProcessMenuHooks(item->GetPVRChannelInfoTag()->ClientID(), PVR_MENUHOOK_CHANNEL, item);
351 else if (item->IsPVRRecording())
352 g_PVRClients->ProcessMenuHooks(item->GetPVRRecordingInfoTag()->m_iClientId, PVR_MENUHOOK_RECORDING, item);
353 else if (item->IsPVRTimer())
354 g_PVRClients->ProcessMenuHooks(item->GetPVRTimerInfoTag()->m_iClientId, PVR_MENUHOOK_TIMER, item);
360 bool CGUIWindowPVRCommon::ActionDeleteTimer(CFileItem *item)
362 /* check if the timer tag is valid */
363 CPVRTimerInfoTag *timerTag = item->GetPVRTimerInfoTag();
364 if (!timerTag || timerTag->m_iClientIndex < 0)
367 /* show a confirmation dialog */
368 CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
371 pDialog->SetHeading(122);
372 pDialog->SetLine(0, 19040);
373 pDialog->SetLine(1, "");
374 pDialog->SetLine(2, timerTag->m_strTitle);
377 /* prompt for the user's confirmation */
378 if (!pDialog->IsConfirmed())
381 /* delete the timer */
382 return g_PVRTimers->DeleteTimer(*item);
385 bool CGUIWindowPVRCommon::ShowNewTimerDialog(void)
389 CPVRTimerInfoTag *newTimer = new CPVRTimerInfoTag;
390 CFileItem *newItem = new CFileItem(*newTimer);
391 if (ShowTimerSettings(newItem))
393 /* Add timer to backend */
394 bReturn = g_PVRTimers->AddTimer(*newItem->GetPVRTimerInfoTag());
403 bool CGUIWindowPVRCommon::ActionShowTimer(CFileItem *item)
405 bool bReturn = false;
407 /* Check if "Add timer..." entry is pressed by OK, if yes
408 create a new timer and open settings dialog, otherwise
409 open settings for selected timer entry */
410 if (item->GetPath() == "pvr://timers/add.timer")
412 bReturn = ShowNewTimerDialog();
416 if (ShowTimerSettings(item))
418 /* Update timer on pvr backend */
419 bReturn = g_PVRTimers->UpdateTimer(*item);
426 bool CGUIWindowPVRCommon::ActionRecord(CFileItem *item)
428 bool bReturn = false;
430 CEpgInfoTag *epgTag = item->GetEPGInfoTag();
434 CPVRChannelPtr channel = epgTag->ChannelTag();
435 if (!channel || !g_PVRManager.CheckParentalLock(*channel))
438 if (epgTag->Timer() == NULL)
440 /* create a confirmation dialog */
441 CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*) g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
445 pDialog->SetHeading(264);
446 pDialog->SetLine(0, "");
447 pDialog->SetLine(1, epgTag->Title());
448 pDialog->SetLine(2, "");
451 /* prompt for the user's confirmation */
452 if (!pDialog->IsConfirmed())
455 CPVRTimerInfoTag *newTimer = CPVRTimerInfoTag::CreateFromEpg(*epgTag);
458 bReturn = g_PVRTimers->AddTimer(*newTimer);
468 CGUIDialogOK::ShowAndGetInput(19033,19034,0,0);
476 bool CGUIWindowPVRCommon::ActionDeleteRecording(CFileItem *item)
478 bool bReturn = false;
480 /* check if the recording tag is valid */
481 CPVRRecording *recTag = (CPVRRecording *) item->GetPVRRecordingInfoTag();
482 if (!recTag || recTag->m_strRecordingId.IsEmpty())
485 /* show a confirmation dialog */
486 CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
489 pDialog->SetHeading(122);
490 pDialog->SetLine(0, 19043);
491 pDialog->SetLine(1, "");
492 pDialog->SetLine(2, recTag->m_strTitle);
495 /* prompt for the user's confirmation */
496 if (!pDialog->IsConfirmed())
499 /* delete the recording */
500 if (g_PVRRecordings->DeleteRecording(*item))
502 g_PVRManager.TriggerRecordingsUpdate();
509 bool CGUIWindowPVRCommon::ActionPlayChannel(CFileItem *item)
511 bool bReturn = false;
513 if (item->GetPath() == "pvr://channels/.add.channel")
515 /* show "add channel" dialog */
516 CGUIDialogOK::ShowAndGetInput(19033,0,19038,0);
522 bReturn = PlayFile(item, CSettings::Get().GetBool("pvrplayback.playminimized"));
528 bool CGUIWindowPVRCommon::ActionPlayEpg(CFileItem *item)
530 CEpgInfoTag *epgTag = item->GetEPGInfoTag();
534 CPVRChannelPtr channel = epgTag->ChannelTag();
535 if (!channel || channel->ChannelNumber() > 0 ||
536 !g_PVRManager.CheckParentalLock(*channel))
539 PlayBackRet ret = g_application.PlayFile(CFileItem(*channel));
541 if (ret == PLAYBACK_FAIL)
544 msg.Format(g_localizeStrings.Get(19035).c_str(), channel->ChannelName().c_str()); // CHANNELNAME could not be played. Check the log for details.
545 CGUIDialogOK::ShowAndGetInput(19033, 0, msg, 0);
548 return ret == PLAYBACK_OK;
551 bool CGUIWindowPVRCommon::ActionDeleteChannel(CFileItem *item)
553 CPVRChannel *channel = item->GetPVRChannelInfoTag();
555 /* check if the channel tag is valid */
556 if (!channel || channel->ChannelNumber() <= 0)
559 /* show a confirmation dialog */
560 CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*) g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
563 pDialog->SetHeading(19039);
564 pDialog->SetLine(0, "");
565 pDialog->SetLine(1, channel->ChannelName());
566 pDialog->SetLine(2, "");
569 /* prompt for the user's confirmation */
570 if (!pDialog->IsConfirmed())
573 g_PVRChannelGroups->GetGroupAll(channel->IsRadio())->RemoveFromGroup(*channel);
579 bool CGUIWindowPVRCommon::UpdateEpgForChannel(CFileItem *item)
581 CPVRChannel *channel = item->GetPVRChannelInfoTag();
582 CEpg *epg = channel->GetEPG();
590 bool CGUIWindowPVRCommon::ShowTimerSettings(CFileItem *item)
592 /* Check item is TV timer information tag */
593 if (!item->IsPVRTimer())
595 CLog::Log(LOGERROR, "CGUIWindowPVRTimers: Can't open timer settings dialog, no timer info tag!");
599 /* Load timer settings dialog */
600 CGUIDialogPVRTimerSettings* pDlgInfo = (CGUIDialogPVRTimerSettings*)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_TIMER_SETTING);
605 /* inform dialog about the file item */
606 pDlgInfo->SetTimer(item);
608 /* Open dialog window */
611 /* Get modify flag from window and return it to caller */
612 return pDlgInfo->GetOK();
616 bool CGUIWindowPVRCommon::PlayRecording(CFileItem *item, bool bPlayMinimized /* = false */)
618 if (!item->HasPVRRecordingInfoTag())
621 CStdString stream = item->GetPVRRecordingInfoTag()->m_strStreamURL;
624 CApplicationMessenger::Get().PlayFile(*item, false);
628 /* Isolate the folder from the filename */
629 size_t found = stream.find_last_of("/");
630 if (found == CStdString::npos)
631 found = stream.find_last_of("\\");
633 if (found != CStdString::npos)
635 /* Check here for asterisk at the begin of the filename */
636 if (stream[found+1] == '*')
638 /* Create a "stack://" url with all files matching the extension */
639 CStdString ext = URIUtils::GetExtension(stream);
640 CStdString dir = stream.substr(0, found).c_str();
643 CDirectory::GetDirectory(dir, items);
644 items.Sort(SortByFile, SortOrderAscending);
647 for (int i = 0; i < items.Size(); ++i)
649 if (URIUtils::HasExtension(items[i]->GetPath(), ext))
653 if (stack.size() > 0)
655 /* If we have a stack change the path of the item to it */
657 CStdString stackPath = dir.ConstructStackPath(items, stack);
658 item->SetPath(stackPath);
663 /* If no asterisk is present play only the given stream URL */
664 item->SetPath(stream);
669 CLog::Log(LOGERROR, "PVRManager - %s - can't open recording: no valid filename", __FUNCTION__);
670 CGUIDialogOK::ShowAndGetInput(19033,0,19036,0);
674 CApplicationMessenger::Get().PlayFile(*item, false);
679 bool CGUIWindowPVRCommon::PlayFile(CFileItem *item, bool bPlayMinimized /* = false */)
681 if (item->m_bIsFolder)
686 if (item->GetPath() == g_application.CurrentFile())
688 CGUIMessage msg(GUI_MSG_FULLSCREEN, 0, m_parent->GetID());
689 g_windowManager.SendMessage(msg);
693 CMediaSettings::Get().SetVideoStartWindowed(bPlayMinimized);
695 if (item->HasPVRRecordingInfoTag())
697 return PlayRecording(item, bPlayMinimized);
701 bool bSwitchSuccessful(false);
703 CPVRChannel *channel = item->HasPVRChannelInfoTag() ? item->GetPVRChannelInfoTag() : NULL;
705 if (channel && g_PVRManager.CheckParentalLock(*channel))
707 /* try a fast switch */
708 if (channel && (g_PVRManager.IsPlayingTV() || g_PVRManager.IsPlayingRadio()) &&
709 (channel->IsRadio() == g_PVRManager.IsPlayingRadio()))
711 if (channel->StreamURL().IsEmpty())
712 bSwitchSuccessful = g_application.m_pPlayer->SwitchChannel(*channel);
715 if (!bSwitchSuccessful)
717 CApplicationMessenger::Get().PlayFile(*item, false);
722 if (!bSwitchSuccessful)
725 CStdString channelName = g_localizeStrings.Get(19029); // Channel
727 channelName = channel->ChannelName();
728 msg.Format(g_localizeStrings.Get(19035).c_str(), channelName.c_str()); // CHANNELNAME could not be played. Check the log for details.
730 CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Error,
731 g_localizeStrings.Get(19166), // PVR information
740 bool CGUIWindowPVRCommon::StartRecordFile(CFileItem *item)
742 if (!item->HasEPGInfoTag())
745 CEpgInfoTag *tag = item->GetEPGInfoTag();
746 CPVRChannelPtr channel;
748 channel = tag->ChannelTag();
750 if (!channel || !g_PVRManager.CheckParentalLock(*channel))
753 CFileItemPtr timer = g_PVRTimers->GetTimerForEpgTag(item);
754 if (timer && timer->HasPVRTimerInfoTag())
756 CGUIDialogOK::ShowAndGetInput(19033,19034,0,0);
760 CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
763 pDialog->SetHeading(264);
764 pDialog->SetLine(0, tag->PVRChannelName());
765 pDialog->SetLine(1, "");
766 pDialog->SetLine(2, tag->Title());
769 if (!pDialog->IsConfirmed())
772 CPVRTimerInfoTag *newTimer = CPVRTimerInfoTag::CreateFromEpg(*tag);
776 bReturn = g_PVRTimers->AddTimer(*newTimer);
782 bool CGUIWindowPVRCommon::StopRecordFile(CFileItem *item)
784 if (!item->HasEPGInfoTag())
787 CEpgInfoTag *tag = item->GetEPGInfoTag();
788 if (!tag || !tag->HasPVRChannel())
791 CFileItemPtr timer = g_PVRTimers->GetTimerForEpgTag(item);
792 if (!timer || !timer->HasPVRTimerInfoTag() || timer->GetPVRTimerInfoTag()->m_bIsRepeating)
795 return g_PVRTimers->DeleteTimer(*timer);
798 void CGUIWindowPVRCommon::ShowEPGInfo(CFileItem *item)
800 CFileItem *tag = NULL;
801 bool bHasChannel(false);
805 tag = new CFileItem(*item);
806 if (item->GetEPGInfoTag()->HasPVRChannel())
808 channel = *item->GetEPGInfoTag()->ChannelTag();
812 else if (item->IsPVRChannel())
815 channel = *item->GetPVRChannelInfoTag();
817 if (!item->GetPVRChannelInfoTag()->GetEPGNow(epgnow))
819 CGUIDialogOK::ShowAndGetInput(19033,0,19055,0);
822 tag = new CFileItem(epgnow);
827 if (!bHasChannel || g_PVRManager.CheckParentalLock(channel))
829 CGUIDialogPVRGuideInfo* pDlgInfo = (CGUIDialogPVRGuideInfo*)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_GUIDE_INFO);
832 pDlgInfo->SetProgInfo(tag);
840 void CGUIWindowPVRCommon::ShowRecordingInfo(CFileItem *item)
842 if (!item->IsPVRRecording())
845 CGUIDialogPVRRecordingInfo* pDlgInfo = (CGUIDialogPVRRecordingInfo*)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_RECORDING_INFO);
849 pDlgInfo->SetRecording(item);
853 bool CGUIWindowPVRCommon::OnContextButtonFind(CFileItem *item, CONTEXT_BUTTON button)
855 bool bReturn = false;
857 if (button == CONTEXT_BUTTON_FIND)
860 if (m_parent->m_windowSearch)
863 m_parent->m_windowSearch->m_searchfilter.Reset();
865 m_parent->m_windowSearch->m_searchfilter.m_strSearchTerm = "\"" + item->GetEPGInfoTag()->Title() + "\"";
866 else if (item->IsPVRChannel() && item->GetPVRChannelInfoTag()->GetEPGNow(tag))
867 m_parent->m_windowSearch->m_searchfilter.m_strSearchTerm = "\"" + tag.Title() + "\"";
868 else if (item->IsPVRRecording())
869 m_parent->m_windowSearch->m_searchfilter.m_strSearchTerm = "\"" + item->GetPVRRecordingInfoTag()->m_strTitle + "\"";
870 else if (item->IsPVRTimer())
871 m_parent->m_windowSearch->m_searchfilter.m_strSearchTerm = "\"" + item->GetPVRTimerInfoTag()->m_strTitle + "\"";
873 m_parent->m_windowSearch->m_bSearchConfirmed = true;
874 m_parent->SetLabel(m_iControlButton, 0);
875 m_parent->SetActiveView(m_parent->m_windowSearch);
876 m_parent->m_windowSearch->UpdateData();
877 m_parent->SetLabel(m_iControlList, 0);
878 m_parent->m_viewControl.SetFocused();
885 void CGUIWindowPVRCommon::ShowBusyItem(void)
887 // FIXME: display a temporary entry so that the list can keep its focus
888 // busy_items has to be static, because m_viewControl holds the pointer to it
889 static CFileItemList busy_items;
890 if (busy_items.IsEmpty())
892 CFileItemPtr pItem(new CFileItem(g_localizeStrings.Get(1040)));
893 busy_items.AddFront(pItem, 0);
895 m_parent->m_viewControl.SetItems(busy_items);