Fix page up/down in page mode

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@648 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
focus
2010-07-03 13:32:04 +00:00
parent c2cfa8862b
commit 69a33a7458

View File

@@ -870,14 +870,23 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu
switch (this->currentSwapMode) { switch (this->currentSwapMode) {
case SwapMode_ByPage: case SwapMode_ByPage:
{ {
int selectedChannelEntryIndex = this->selectedChannelEntry->index;
selectedChannelEntryIndex += this->maxNumberOfDisplayableEntries;
if (selectedChannelEntryIndex > this->channelList->getSize () - 1) int selected = this->selectedChannelEntry->index;
selectedChannelEntryIndex = 0; int prev_selected = selected;
int step = this->maxNumberOfDisplayableEntries;
int listSize = this->channelList->getSize();
this->createChannelEntries (selectedChannelEntryIndex); selected += step;
if(selected >= listSize) {
if((listSize - step -1 < prev_selected) && (prev_selected != (listSize - 1)))
selected = listSize - 1;
else if (((listSize / step) + 1) * step == listSize + step) // last page has full entries
selected = 0;
else
selected = ((selected < (((listSize / step)+1) * step))) ? (listSize - 1) : 0;
}
this->createChannelEntries (selected);
this->paint (); this->paint ();
} }
break; break;
@@ -911,14 +920,19 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu
switch (this->currentSwapMode) { switch (this->currentSwapMode) {
case SwapMode_ByPage: case SwapMode_ByPage:
{ {
int selectedChannelEntryIndex = this->selectedChannelEntry->index; int selected = this->selectedChannelEntry->index;
selectedChannelEntryIndex -= this->maxNumberOfDisplayableEntries; int prev_selected = selected;
int step = this->maxNumberOfDisplayableEntries;
if (selectedChannelEntryIndex < 0) selected -= step;
selectedChannelEntryIndex = this->channelList->getSize () - 1; if((prev_selected-step) < 0) {
if(prev_selected != 0 && step != 1)
this->createChannelEntries (selectedChannelEntryIndex); selected = 0;
else
selected = this->channelList->getSize() - 1;
}
this->createChannelEntries (selected);
this->paint (); this->paint ();
} }
break; break;