mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 08:51:04 +02:00
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
Origin commit data
------------------
Branch: ni/coolstream
Commit: 69a33a7458
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2010-07-03 (Sat, 03 Jul 2010)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -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;
|
||||||
|
Reference in New Issue
Block a user