Skip to content

Commit

Permalink
Merge pull request #7875 from metaron-uk/timeVis
Browse files Browse the repository at this point in the history
[PVR] Timer settings dialog: Start/End display fix
  • Loading branch information
ksooo committed Aug 30, 2015
2 parents c336ec1 + 83af6be commit ee4768c
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp
Expand Up @@ -563,8 +563,14 @@ void CGUIDialogPVRTimerSettings::Save()
m_timerInfoTag->m_iClientId = m_timerType->GetClientId();
}

m_timerInfoTag->m_bStartAnyTime = m_bStartAnyTime;
m_timerInfoTag->m_bEndAnyTime = m_bEndAnyTime;
if (m_timerType->SupportsStartAnyTime() && m_timerType->IsEpgBased()) // Start anytime toggle is displayed
m_timerInfoTag->m_bStartAnyTime = m_bStartAnyTime;
else
m_bStartAnyTime = false; // Assume start time change needs checking for
if (m_timerType->SupportsEndAnyTime() && m_timerType->IsEpgBased()) // End anytime toggle is displayed
m_timerInfoTag->m_bEndAnyTime = m_bEndAnyTime;
else
m_bEndAnyTime = false; // Assume end time change needs checking for
// Begin and end time
const CDateTime now(CDateTime::GetCurrentDateTime());
if (!m_bStartAnyTime && !m_bEndAnyTime)
Expand Down Expand Up @@ -1129,6 +1135,10 @@ bool CGUIDialogPVRTimerSettings::StartAnytimeSetCondition(const std::string &con
if (!pThis->m_timerType->IsEpgBased())
return true;

// If 'Start anytime' option isn't supported, don't hide start time
if (!pThis->m_timerType->SupportsStartAnyTime())
return true;

std::string cond(condition);
cond.erase(cond.find(START_ANYTIME_DEP_VISIBI_COND_ID_POSTFIX));

Expand Down Expand Up @@ -1168,6 +1178,10 @@ bool CGUIDialogPVRTimerSettings::EndAnytimeSetCondition(const std::string &condi
if (!pThis->m_timerType->IsEpgBased())
return true;

// If 'End anytime' option isn't supported, don't hide end time
if (!pThis->m_timerType->SupportsEndAnyTime())
return true;

std::string cond(condition);
cond.erase(cond.find(END_ANYTIME_DEP_VISIBI_COND_ID_POSTFIX));

Expand Down

0 comments on commit ee4768c

Please sign in to comment.