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 return false; // CGUIWindowPVR will handle any default actions
204 bool CGUIWindowPVRCommon::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
206 if (itemNumber < 0 || itemNumber >= (int) m_parent->m_vecItems->Size())
208 CFileItemPtr pItem = m_parent->m_vecItems->Get(itemNumber);
210 return (OnContextButtonSortAsc(pItem.get(), button) ||
211 OnContextButtonSortBy(pItem.get(), button) ||
212 OnContextButtonSortByChannel(pItem.get(), button) ||
213 OnContextButtonSortByName(pItem.get(), button) ||
214 OnContextButtonSortByDate(pItem.get(), button) ||
215 OnContextButtonFind(pItem.get(), button) ||
216 OnContextButtonMenuHooks(pItem.get(), button));
219 bool CGUIWindowPVRCommon::OnContextButtonSortByDate(CFileItem *item, CONTEXT_BUTTON button)
221 bool bReturn = false;
223 if (button == CONTEXT_BUTTON_SORTBY_DATE)
227 if (m_iSortMethod != SortByDate)
229 m_iSortMethod = SortByDate;
230 m_iSortOrder = SortOrderAscending;
231 CGUIMessage message(GUI_MSG_CHANGE_SORT_METHOD, m_parent->GetID(), 0, m_iSortMethod, 0);
232 m_parent->OnMessage(message);
236 m_iSortOrder = m_iSortOrder == SortOrderAscending ? SortOrderDescending : SortOrderAscending;
238 CGUIMessage message(GUI_MSG_CHANGE_SORT_DIRECTION, m_parent->GetID(), 0, m_iSortOrder, 0);
239 m_parent->OnMessage(message);
246 bool CGUIWindowPVRCommon::OnContextButtonSortByName(CFileItem *item, CONTEXT_BUTTON button)
248 bool bReturn = false;
250 if (button == CONTEXT_BUTTON_SORTBY_NAME)
254 if (m_iSortMethod != SortByLabel)
256 m_iSortMethod = SortByLabel;
257 m_iSortOrder = SortOrderAscending;
258 CGUIMessage message(GUI_MSG_CHANGE_SORT_METHOD, m_parent->GetID(), 0, m_iSortMethod, 0);
259 m_parent->OnMessage(message);
263 m_iSortOrder = m_iSortOrder == SortOrderAscending ? SortOrderDescending : SortOrderAscending;
265 CGUIMessage message(GUI_MSG_CHANGE_SORT_DIRECTION, m_parent->GetID(), 0, m_iSortOrder, 0);
266 m_parent->OnMessage(message);
273 bool CGUIWindowPVRCommon::OnContextButtonSortByChannel(CFileItem *item, CONTEXT_BUTTON button)
275 bool bReturn = false;
277 if (button == CONTEXT_BUTTON_SORTBY_CHANNEL)
281 if (m_iSortMethod != SortByChannel)
283 m_iSortMethod = SortByChannel;
284 m_iSortOrder = SortOrderAscending;
288 m_iSortOrder = m_iSortOrder == SortOrderAscending ? SortOrderDescending : SortOrderAscending;
297 bool CGUIWindowPVRCommon::OnContextButtonSortAsc(CFileItem *item, CONTEXT_BUTTON button)
299 bool bReturn = false;
301 if (button == CONTEXT_BUTTON_SORTASC)
305 if (m_parent->m_guiState.get())
306 m_parent->m_guiState->SetNextSortOrder();
307 m_parent->UpdateFileList();
313 bool CGUIWindowPVRCommon::OnContextButtonSortBy(CFileItem *item, CONTEXT_BUTTON button)
315 bool bReturn = false;
317 if (button == CONTEXT_BUTTON_SORTBY)
321 if (m_parent->m_guiState.get())
322 m_parent->m_guiState->SetNextSortMethod();
324 m_parent->UpdateFileList();
330 bool CGUIWindowPVRCommon::OnContextButtonMenuHooks(CFileItem *item, CONTEXT_BUTTON button)
332 bool bReturn = false;
334 if (button == CONTEXT_BUTTON_MENU_HOOKS)
338 if (item->IsEPG() && item->GetEPGInfoTag()->HasPVRChannel())
339 g_PVRClients->ProcessMenuHooks(item->GetEPGInfoTag()->ChannelTag()->ClientID(), PVR_MENUHOOK_EPG, item);
340 else if (item->IsPVRChannel())
341 g_PVRClients->ProcessMenuHooks(item->GetPVRChannelInfoTag()->ClientID(), PVR_MENUHOOK_CHANNEL, item);
342 else if (item->IsPVRRecording())
343 g_PVRClients->ProcessMenuHooks(item->GetPVRRecordingInfoTag()->m_iClientId, PVR_MENUHOOK_RECORDING, item);
344 else if (item->IsPVRTimer())
345 g_PVRClients->ProcessMenuHooks(item->GetPVRTimerInfoTag()->m_iClientId, PVR_MENUHOOK_TIMER, item);
351 bool CGUIWindowPVRCommon::ActionDeleteTimer(CFileItem *item)
353 /* check if the timer tag is valid */
354 CPVRTimerInfoTag *timerTag = item->GetPVRTimerInfoTag();
355 if (!timerTag || timerTag->m_iClientIndex < 0)
358 /* show a confirmation dialog */
359 CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
362 pDialog->SetHeading(122);
363 pDialog->SetLine(0, 19040);
364 pDialog->SetLine(1, "");
365 pDialog->SetLine(2, timerTag->m_strTitle);
368 /* prompt for the user's confirmation */
369 if (!pDialog->IsConfirmed())
372 /* delete the timer */
373 return g_PVRTimers->DeleteTimer(*item);
376 bool CGUIWindowPVRCommon::ShowNewTimerDialog(void)
380 CPVRTimerInfoTag *newTimer = new CPVRTimerInfoTag;
381 CFileItem *newItem = new CFileItem(*newTimer);
382 if (ShowTimerSettings(newItem))
384 /* Add timer to backend */
385 bReturn = g_PVRTimers->AddTimer(*newItem->GetPVRTimerInfoTag());
394 bool CGUIWindowPVRCommon::ActionShowTimer(CFileItem *item)
396 bool bReturn = false;
398 /* Check if "Add timer..." entry is pressed by OK, if yes
399 create a new timer and open settings dialog, otherwise
400 open settings for selected timer entry */
401 if (item->GetPath() == "pvr://timers/add.timer")
403 bReturn = ShowNewTimerDialog();
407 if (ShowTimerSettings(item))
409 /* Update timer on pvr backend */
410 bReturn = g_PVRTimers->UpdateTimer(*item);
417 bool CGUIWindowPVRCommon::ActionRecord(CFileItem *item)
419 bool bReturn = false;
421 CEpgInfoTag *epgTag = item->GetEPGInfoTag();
425 CPVRChannelPtr channel = epgTag->ChannelTag();
426 if (!channel || !g_PVRManager.CheckParentalLock(*channel))
429 if (epgTag->Timer() == NULL)
431 /* create a confirmation dialog */
432 CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*) g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
436 pDialog->SetHeading(264);
437 pDialog->SetLine(0, "");
438 pDialog->SetLine(1, epgTag->Title());
439 pDialog->SetLine(2, "");
442 /* prompt for the user's confirmation */
443 if (!pDialog->IsConfirmed())
446 CPVRTimerInfoTag *newTimer = CPVRTimerInfoTag::CreateFromEpg(*epgTag);
449 bReturn = g_PVRTimers->AddTimer(*newTimer);
459 CGUIDialogOK::ShowAndGetInput(19033,19034,0,0);
467 bool CGUIWindowPVRCommon::ActionDeleteRecording(CFileItem *item)
469 bool bReturn = false;
471 /* check if the recording tag is valid */
472 CPVRRecording *recTag = (CPVRRecording *) item->GetPVRRecordingInfoTag();
473 if (!recTag || recTag->m_strRecordingId.empty())
476 /* show a confirmation dialog */
477 CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
480 pDialog->SetHeading(122);
481 pDialog->SetLine(0, 19043);
482 pDialog->SetLine(1, "");
483 pDialog->SetLine(2, recTag->m_strTitle);
486 /* prompt for the user's confirmation */
487 if (!pDialog->IsConfirmed())
490 /* delete the recording */
491 if (g_PVRRecordings->DeleteRecording(*item))
493 g_PVRManager.TriggerRecordingsUpdate();
500 bool CGUIWindowPVRCommon::ActionPlayChannel(CFileItem *item)
502 bool bReturn = false;
504 if (item->GetPath() == "pvr://channels/.add.channel")
506 /* show "add channel" dialog */
507 CGUIDialogOK::ShowAndGetInput(19033,0,19038,0);
513 bReturn = PlayFile(item, CSettings::Get().GetBool("pvrplayback.playminimized"));
519 bool CGUIWindowPVRCommon::ActionPlayEpg(CFileItem *item)
521 CPVRChannelPtr channel;
522 if (item && item->HasEPGInfoTag() && item->GetEPGInfoTag()->HasPVRChannel())
523 channel = item->GetEPGInfoTag()->ChannelTag();
525 if (!channel || !g_PVRManager.CheckParentalLock(*channel))
528 CFileItem channelItem = CFileItem(*channel);
529 g_application.SwitchToFullScreen();
530 if (!PlayFile(&channelItem))
532 // CHANNELNAME could not be played. Check the log for details.
533 CStdString msg = StringUtils::Format(g_localizeStrings.Get(19035).c_str(), channel->ChannelName().c_str());
534 CGUIDialogOK::ShowAndGetInput(19033, 0, msg, 0);
541 bool CGUIWindowPVRCommon::ActionDeleteChannel(CFileItem *item)
543 CPVRChannel *channel = item->GetPVRChannelInfoTag();
545 /* check if the channel tag is valid */
546 if (!channel || channel->ChannelNumber() <= 0)
549 /* show a confirmation dialog */
550 CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*) g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
553 pDialog->SetHeading(19039);
554 pDialog->SetLine(0, "");
555 pDialog->SetLine(1, channel->ChannelName());
556 pDialog->SetLine(2, "");
559 /* prompt for the user's confirmation */
560 if (!pDialog->IsConfirmed())
563 g_PVRChannelGroups->GetGroupAll(channel->IsRadio())->RemoveFromGroup(*channel);
569 bool CGUIWindowPVRCommon::UpdateEpgForChannel(CFileItem *item)
571 CPVRChannel *channel = item->GetPVRChannelInfoTag();
572 CEpg *epg = channel->GetEPG();
580 bool CGUIWindowPVRCommon::ShowTimerSettings(CFileItem *item)
582 /* Check item is TV timer information tag */
583 if (!item->IsPVRTimer())
585 CLog::Log(LOGERROR, "CGUIWindowPVRTimers: Can't open timer settings dialog, no timer info tag!");
589 /* Load timer settings dialog */
590 CGUIDialogPVRTimerSettings* pDlgInfo = (CGUIDialogPVRTimerSettings*)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_TIMER_SETTING);
595 /* inform dialog about the file item */
596 pDlgInfo->SetTimer(item);
598 /* Open dialog window */
601 /* Get modify flag from window and return it to caller */
602 return pDlgInfo->GetOK();
606 bool CGUIWindowPVRCommon::PlayRecording(CFileItem *item, bool bPlayMinimized /* = false */)
608 if (!item->HasPVRRecordingInfoTag())
611 CStdString stream = item->GetPVRRecordingInfoTag()->m_strStreamURL;
614 CApplicationMessenger::Get().PlayFile(*item, false);
618 /* Isolate the folder from the filename */
619 size_t found = stream.find_last_of("/");
620 if (found == CStdString::npos)
621 found = stream.find_last_of("\\");
623 if (found != CStdString::npos)
625 /* Check here for asterisk at the begin of the filename */
626 if (stream[found+1] == '*')
628 /* Create a "stack://" url with all files matching the extension */
629 CStdString ext = URIUtils::GetExtension(stream);
630 CStdString dir = stream.substr(0, found).c_str();
633 CDirectory::GetDirectory(dir, items);
634 items.Sort(SortByFile, SortOrderAscending);
637 for (int i = 0; i < items.Size(); ++i)
639 if (URIUtils::HasExtension(items[i]->GetPath(), ext))
643 if (stack.size() > 0)
645 /* If we have a stack change the path of the item to it */
647 CStdString stackPath = dir.ConstructStackPath(items, stack);
648 item->SetPath(stackPath);
653 /* If no asterisk is present play only the given stream URL */
654 item->SetPath(stream);
659 CLog::Log(LOGERROR, "PVRManager - %s - can't open recording: no valid filename", __FUNCTION__);
660 CGUIDialogOK::ShowAndGetInput(19033,0,19036,0);
664 CApplicationMessenger::Get().PlayFile(*item, false);
669 bool CGUIWindowPVRCommon::PlayFile(CFileItem *item, bool bPlayMinimized /* = false */)
671 if (item->m_bIsFolder)
676 if (item->GetPath() == g_application.CurrentFile())
678 CGUIMessage msg(GUI_MSG_FULLSCREEN, 0, m_parent->GetID());
679 g_windowManager.SendMessage(msg);
683 CMediaSettings::Get().SetVideoStartWindowed(bPlayMinimized);
685 if (item->HasPVRRecordingInfoTag())
687 return PlayRecording(item, bPlayMinimized);
691 bool bSwitchSuccessful(false);
693 CPVRChannel *channel = item->HasPVRChannelInfoTag() ? item->GetPVRChannelInfoTag() : NULL;
695 if (channel && g_PVRManager.CheckParentalLock(*channel))
697 /* try a fast switch */
698 if (channel && (g_PVRManager.IsPlayingTV() || g_PVRManager.IsPlayingRadio()) &&
699 (channel->IsRadio() == g_PVRManager.IsPlayingRadio()))
701 if (channel->StreamURL().empty())
702 bSwitchSuccessful = g_application.m_pPlayer->SwitchChannel(*channel);
705 if (!bSwitchSuccessful)
707 CApplicationMessenger::Get().PlayFile(*item, false);
712 if (!bSwitchSuccessful)
714 CStdString channelName = g_localizeStrings.Get(19029); // Channel
716 channelName = channel->ChannelName();
717 CStdString msg = StringUtils::Format(g_localizeStrings.Get(19035).c_str(), channelName.c_str()); // CHANNELNAME could not be played. Check the log for details.
719 CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Error,
720 g_localizeStrings.Get(19166), // PVR information
729 bool CGUIWindowPVRCommon::StartRecordFile(CFileItem *item)
731 if (!item->HasEPGInfoTag())
734 CEpgInfoTag *tag = item->GetEPGInfoTag();
735 CPVRChannelPtr channel;
737 channel = tag->ChannelTag();
739 if (!channel || !g_PVRManager.CheckParentalLock(*channel))
742 CFileItemPtr timer = g_PVRTimers->GetTimerForEpgTag(item);
743 if (timer && timer->HasPVRTimerInfoTag())
745 CGUIDialogOK::ShowAndGetInput(19033,19034,0,0);
749 CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
752 pDialog->SetHeading(264);
753 pDialog->SetLine(0, tag->PVRChannelName());
754 pDialog->SetLine(1, "");
755 pDialog->SetLine(2, tag->Title());
758 if (!pDialog->IsConfirmed())
761 CPVRTimerInfoTag *newTimer = CPVRTimerInfoTag::CreateFromEpg(*tag);
765 bReturn = g_PVRTimers->AddTimer(*newTimer);
771 bool CGUIWindowPVRCommon::StopRecordFile(CFileItem *item)
773 if (!item->HasEPGInfoTag())
776 CEpgInfoTag *tag = item->GetEPGInfoTag();
777 if (!tag || !tag->HasPVRChannel())
780 CFileItemPtr timer = g_PVRTimers->GetTimerForEpgTag(item);
781 if (!timer || !timer->HasPVRTimerInfoTag() || timer->GetPVRTimerInfoTag()->m_bIsRepeating)
784 return g_PVRTimers->DeleteTimer(*timer);
787 void CGUIWindowPVRCommon::ShowEPGInfo(CFileItem *item)
789 CFileItem *tag = NULL;
790 bool bHasChannel(false);
794 tag = new CFileItem(*item);
795 if (item->GetEPGInfoTag()->HasPVRChannel())
797 channel = *item->GetEPGInfoTag()->ChannelTag();
801 else if (item->IsPVRChannel())
804 channel = *item->GetPVRChannelInfoTag();
806 if (!item->GetPVRChannelInfoTag()->GetEPGNow(epgnow))
808 CGUIDialogOK::ShowAndGetInput(19033,0,19055,0);
811 tag = new CFileItem(epgnow);
816 if (!bHasChannel || g_PVRManager.CheckParentalLock(channel))
818 CGUIDialogPVRGuideInfo* pDlgInfo = (CGUIDialogPVRGuideInfo*)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_GUIDE_INFO);
821 pDlgInfo->SetProgInfo(tag);
829 void CGUIWindowPVRCommon::ShowRecordingInfo(CFileItem *item)
831 if (!item->IsPVRRecording())
834 CGUIDialogPVRRecordingInfo* pDlgInfo = (CGUIDialogPVRRecordingInfo*)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_RECORDING_INFO);
838 pDlgInfo->SetRecording(item);
842 bool CGUIWindowPVRCommon::OnContextButtonFind(CFileItem *item, CONTEXT_BUTTON button)
844 bool bReturn = false;
846 if (button == CONTEXT_BUTTON_FIND)
849 if (m_parent->m_windowSearch)
852 m_parent->m_windowSearch->m_searchfilter.Reset();
854 m_parent->m_windowSearch->m_searchfilter.m_strSearchTerm = "\"" + item->GetEPGInfoTag()->Title() + "\"";
855 else if (item->IsPVRChannel() && item->GetPVRChannelInfoTag()->GetEPGNow(tag))
856 m_parent->m_windowSearch->m_searchfilter.m_strSearchTerm = "\"" + tag.Title() + "\"";
857 else if (item->IsPVRRecording())
858 m_parent->m_windowSearch->m_searchfilter.m_strSearchTerm = "\"" + item->GetPVRRecordingInfoTag()->m_strTitle + "\"";
859 else if (item->IsPVRTimer())
860 m_parent->m_windowSearch->m_searchfilter.m_strSearchTerm = "\"" + item->GetPVRTimerInfoTag()->m_strTitle + "\"";
862 m_parent->m_windowSearch->m_bSearchConfirmed = true;
863 m_parent->SetLabel(m_iControlButton, 0);
864 m_parent->SetActiveView(m_parent->m_windowSearch);
865 m_parent->m_windowSearch->UpdateData();
866 m_parent->SetLabel(m_iControlList, 0);
867 m_parent->m_viewControl.SetFocused();
874 void CGUIWindowPVRCommon::ShowBusyItem(void)
876 // FIXME: display a temporary entry so that the list can keep its focus
877 // busy_items has to be static, because m_viewControl holds the pointer to it
878 static CFileItemList busy_items;
879 if (busy_items.IsEmpty())
881 CFileItemPtr pItem(new CFileItem(g_localizeStrings.Get(1040)));
882 busy_items.AddFront(pItem, 0);
884 m_parent->m_viewControl.SetItems(busy_items);