Skip to content

Commit

Permalink
[PVR] Search window: Fixed OnPrepareFileItems only to search if reque…
Browse files Browse the repository at this point in the history
…sted to do so and not just a simple window refresh is ongoing.
  • Loading branch information
ksooo committed Sep 27, 2015
1 parent b048cdb commit b8d1957
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions xbmc/pvr/windows/GUIWindowPVRSearch.cpp
Expand Up @@ -150,20 +150,19 @@ bool CGUIWindowPVRSearch::OnContextButton(const CFileItem &item, CONTEXT_BUTTON

void CGUIWindowPVRSearch::OnPrepareFileItems(CFileItemList &items)
{
items.Clear();

CFileItemPtr item(new CFileItem("pvr://guide/searchresults/search/", true));
item->SetLabel(g_localizeStrings.Get(19140));
item->SetLabelPreformated(true);
item->SetSpecialSort(SortSpecialOnTop);
items.Add(item);
bool bAddSpecialSearchItem = items.IsEmpty();

if (m_bSearchConfirmed)
{
m_bSearchConfirmed = false;

items.Clear();
bAddSpecialSearchItem = true;

CGUIDialogProgress* dlgProgress = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
if (dlgProgress)
{
dlgProgress->SetHeading(CVariant{194});
dlgProgress->SetHeading(CVariant{194}); // "Searching..."
dlgProgress->SetText(CVariant{m_searchfilter.m_strSearchTerm});
dlgProgress->Open();
dlgProgress->Progress();
Expand All @@ -176,10 +175,17 @@ void CGUIWindowPVRSearch::OnPrepareFileItems(CFileItemList &items)
dlgProgress->Close();

if (items.IsEmpty())
{
CGUIDialogOK::ShowAndGetInput(CVariant{194}, CVariant{284});
m_bSearchConfirmed = false;
}
CGUIDialogOK::ShowAndGetInput(CVariant{194}, // "Searching..."
CVariant{284}); // "No results found"
}

if (bAddSpecialSearchItem)
{
CFileItemPtr item(new CFileItem("pvr://guide/searchresults/search/", true));
item->SetLabel(g_localizeStrings.Get(19140)); // "Search..."
item->SetLabelPreformated(true);
item->SetSpecialSort(SortSpecialOnTop);
items.Add(item);
}
}

Expand Down

0 comments on commit b8d1957

Please sign in to comment.