Merge pull request #4732 from jmarshallnz/pvr_fixes
authorjmarshallnz <jcmarsha@gmail.com>
Sat, 17 May 2014 21:05:20 +0000 (09:05 +1200)
committerTrent Nelson <trent.nelson@pivosgroup.com>
Sat, 7 Jun 2014 05:27:39 +0000 (13:27 +0800)
PVR: A couple of fixes in guide search dialog

xbmc/pvr/dialogs/GUIDialogPVRGuideSearch.cpp

index b932971..7d3b36e 100644 (file)
@@ -71,7 +71,7 @@ void CGUIDialogPVRGuideSearch::UpdateChannelSpin(void)
   if (!pSpin || !pSpinGroups)
     return;
 
-  int iChannelGroup = pSpin->GetValue();
+  int iChannelGroup = pSpinGroups->GetValue();
 
   pSpin->Clear();
   pSpin->AddLabel(g_localizeStrings.Get(19217), EPG_SEARCH_UNSET);
@@ -92,6 +92,8 @@ void CGUIDialogPVRGuideSearch::UpdateChannelSpin(void)
     int iChannelNumber = group->GetChannelNumber(*channel->GetPVRChannelInfoTag());
     pSpin->AddLabel(channel->GetPVRChannelInfoTag()->ChannelName().c_str(), iChannelNumber);
   }
+
+  pSpin->SetValue(m_searchFilter->m_iChannelNumber);
 }
 
 void CGUIDialogPVRGuideSearch::UpdateGroupsSpin(void)
@@ -103,6 +105,8 @@ void CGUIDialogPVRGuideSearch::UpdateGroupsSpin(void)
   std::vector<CPVRChannelGroupPtr> group;
   std::vector<CPVRChannelGroupPtr>::const_iterator it;
 
+  pSpin->Clear();
+
   /* tv groups */
   group = g_PVRChannelGroups->GetTV()->GetMembers();
   for (it = group.begin(); it != group.end(); ++it)
@@ -342,13 +346,13 @@ void CGUIDialogPVRGuideSearch::Update()
   pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_START_TIME);
   if (pEdit)
   {
-    pEdit->SetLabel2(m_searchFilter->m_endDateTime.GetAsLocalizedTime("", false));
+    pEdit->SetLabel2(m_searchFilter->m_startDateTime.GetAsLocalizedTime("", false));
     pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_TIME, 14066);
   }
   pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_STOP_TIME);
   if (pEdit)
   {
-    pEdit->SetLabel2(m_searchFilter->m_startDateTime.GetAsLocalizedTime("", false));
+    pEdit->SetLabel2(m_searchFilter->m_endDateTime.GetAsLocalizedTime("", false));
     pEdit->SetInputType(CGUIEditControl::INPUT_TYPE_TIME, 14066);
   }
   pEdit = (CGUIEditControl *)GetControl(CONTROL_EDIT_START_DATE);