aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Marshall <jmarshall@never.you.mind>2012-10-15 15:54:19 +1300
committerJonathan Marshall <jmarshall@never.you.mind>2012-10-15 16:12:18 +1300
commit9f77981c42bfc4399826f87d09fdfe6dee98ba43 (patch)
tree86ac51bf5ead1ad7557051c4b58b64e2a1bd7f74
parent12329005de650a4e2d1c9c6df809d2ec15315fdf (diff)
EPG grid container didn't wrap around when moving to the end of the channel list. Fixes #13388
-rw-r--r--xbmc/epg/GUIEPGGridContainer.cpp19
-rw-r--r--xbmc/epg/GUIEPGGridContainer.h3
2 files changed, 12 insertions, 10 deletions
diff --git a/xbmc/epg/GUIEPGGridContainer.cpp b/xbmc/epg/GUIEPGGridContainer.cpp
index 35974ba556..e130dc8ae3 100644
--- a/xbmc/epg/GUIEPGGridContainer.cpp
+++ b/xbmc/epg/GUIEPGGridContainer.cpp
@@ -66,7 +66,6 @@ CGUIEPGGridContainer::CGUIEPGGridContainer(int parentID, int controlID, float po
m_item = NULL;
m_lastItem = NULL;
m_lastChannel = NULL;
- m_channelWrapAround = true; /// get from settings?
m_orientation = orientation;
m_programmeLayout = NULL;
m_focusedProgrammeLayout= NULL;
@@ -914,7 +913,7 @@ void CGUIEPGGridContainer::ProgrammesScroll(int amount)
ScrollToBlockOffset(offset);
}
-bool CGUIEPGGridContainer::MoveChannel(bool direction)
+bool CGUIEPGGridContainer::MoveChannel(bool direction, bool wrapAround)
{
if (direction)
{
@@ -927,7 +926,7 @@ bool CGUIEPGGridContainer::MoveChannel(bool direction)
ScrollToChannelOffset(m_channelOffset - 1);
SetChannel(0);
}
- else if (m_channelWrapAround)
+ else if (wrapAround)
{
int offset = m_channels - m_channelsPerPage;
@@ -954,7 +953,7 @@ bool CGUIEPGGridContainer::MoveChannel(bool direction)
SetChannel(m_channelsPerPage - 1);
}
}
- else if (m_channelWrapAround)
+ else if (wrapAround)
{
SetChannel(0);
ScrollToChannelOffset(0);
@@ -1080,9 +1079,10 @@ bool CGUIEPGGridContainer::MoveProgrammes(bool direction)
void CGUIEPGGridContainer::OnUp()
{
+ bool wrapAround = m_actionUp.GetNavigation() == GetID() || !m_actionUp.HasActionsMeetingCondition();
if (m_orientation == VERTICAL)
{
- if (!MoveChannel(true))
+ if (!MoveChannel(true, wrapAround))
CGUIControl::OnUp();
}
else
@@ -1094,9 +1094,10 @@ void CGUIEPGGridContainer::OnUp()
void CGUIEPGGridContainer::OnDown()
{
+ bool wrapAround = m_actionDown.GetNavigation() == GetID() || !m_actionDown.HasActionsMeetingCondition();
if (m_orientation == VERTICAL)
{
- if (!MoveChannel(false))
+ if (!MoveChannel(false, wrapAround))
CGUIControl::OnDown();
}
else
@@ -1108,6 +1109,7 @@ void CGUIEPGGridContainer::OnDown()
void CGUIEPGGridContainer::OnLeft()
{
+ bool wrapAround = m_actionLeft.GetNavigation() == GetID() || !m_actionLeft.HasActionsMeetingCondition();
if (m_orientation == VERTICAL)
{
if (!MoveProgrammes(true))
@@ -1115,13 +1117,14 @@ void CGUIEPGGridContainer::OnLeft()
}
else
{
- if (!MoveChannel(true))
+ if (!MoveChannel(true, wrapAround))
CGUIControl::OnLeft();
}
}
void CGUIEPGGridContainer::OnRight()
{
+ bool wrapAround = m_actionRight.GetNavigation() == GetID() || !m_actionRight.HasActionsMeetingCondition();
if (m_orientation == VERTICAL)
{
if (!MoveProgrammes(false))
@@ -1129,7 +1132,7 @@ void CGUIEPGGridContainer::OnRight()
}
else
{
- if (!MoveChannel(false))
+ if (!MoveChannel(false, wrapAround))
CGUIControl::OnRight();
}
}
diff --git a/xbmc/epg/GUIEPGGridContainer.h b/xbmc/epg/GUIEPGGridContainer.h
index 57442500aa..60bcf3718c 100644
--- a/xbmc/epg/GUIEPGGridContainer.h
+++ b/xbmc/epg/GUIEPGGridContainer.h
@@ -120,7 +120,7 @@ namespace EPG
int GetBlock(const CGUIListItemPtr &item, const int &channel);
int GetRealBlock(const CGUIListItemPtr &item, const int &channel);
void MoveToRow(int row);
- bool MoveChannel(bool direction);
+ bool MoveChannel(bool direction, bool wrapAround);
bool MoveProgrammes(bool direction);
CGUIListItemLayout *GetFocusedLayout() const;
@@ -213,7 +213,6 @@ namespace EPG
unsigned int m_renderTime;
int m_scrollTime;
- bool m_channelWrapAround;
bool m_gridWrapAround; //! only when no more data available should this be true
int m_programmeScrollLastTime;