-use right/left pagedown/pageup in timerlist

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1209 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
satbaby
2011-02-26 06:33:39 +00:00
parent 31982a5ac4
commit 7f061572d3

View File

@@ -501,7 +501,7 @@ int CTimerList::show()
} }
} }
else if ( ( msg == CRCInput::RC_timeout ) || else if ( ( msg == CRCInput::RC_timeout ) ||
( msg == CRCInput::RC_home) ) ( msg == CRCInput::RC_home) || (msg == CRCInput::RC_left) )
{ //Exit after timeout or cancel key { //Exit after timeout or cancel key
if ( fadeIn ) { if ( fadeIn ) {
g_RCInput->killTimer(fadeTimer); g_RCInput->killTimer(fadeTimer);
@@ -516,16 +516,17 @@ int CTimerList::show()
} else } else
loop=false; loop=false;
} }
else if ((msg == CRCInput::RC_up) && !(timerlist.empty())) else if ((msg == CRCInput::RC_up || msg == (unsigned int)g_settings.key_channelList_pageup) && !(timerlist.empty()))
{ {
int prevselected=selected; int step = 0;
if (selected==0) int prev_selected = selected;
{
selected = timerlist.size()-1; step = (msg == (unsigned int)g_settings.key_channelList_pageup) ? listmaxshow : 1; // browse or step 1
} selected -= step;
else if((prev_selected-step) < 0) // because of uint
selected--; selected = timerlist.size() - 1;
paintItem(prevselected - liststart);
paintItem(prev_selected - liststart);
unsigned int oldliststart = liststart; unsigned int oldliststart = liststart;
liststart = (selected/listmaxshow)*listmaxshow; liststart = (selected/listmaxshow)*listmaxshow;
if (oldliststart!=liststart) if (oldliststart!=liststart)
@@ -537,11 +538,23 @@ int CTimerList::show()
paintItem(selected - liststart); paintItem(selected - liststart);
} }
} }
else if ((msg == CRCInput::RC_down) && !(timerlist.empty())) else if ((msg == CRCInput::RC_down || msg == (unsigned int)g_settings.key_channelList_pagedown) && !(timerlist.empty()))
{ {
int prevselected=selected; unsigned int step = 0;
selected = (selected+1)%timerlist.size(); int prev_selected = selected;
paintItem(prevselected - liststart);
step = (msg == (unsigned int)g_settings.key_channelList_pagedown) ? listmaxshow : 1; // browse or step 1
selected += step;
if(selected >= timerlist.size())
{
if (((timerlist.size() / listmaxshow) + 1) * listmaxshow == timerlist.size() + listmaxshow) // last page has full entries
selected = 0;
else
selected = ((step == listmaxshow) && (selected < (((timerlist.size() / listmaxshow) + 1) * listmaxshow))) ? (timerlist.size() - 1) : 0;
}
paintItem(prev_selected - liststart);
unsigned int oldliststart = liststart; unsigned int oldliststart = liststart;
liststart = (selected/listmaxshow)*listmaxshow; liststart = (selected/listmaxshow)*listmaxshow;
if (oldliststart!=liststart) if (oldliststart!=liststart)
@@ -553,7 +566,7 @@ int CTimerList::show()
paintItem(selected - liststart); paintItem(selected - liststart);
} }
} }
else if ((msg == CRCInput::RC_ok) && !(timerlist.empty())) else if ((msg == CRCInput::RC_right || msg == CRCInput::RC_ok) && !(timerlist.empty()))
{ {
if (modifyTimer()==menu_return::RETURN_EXIT_ALL) if (modifyTimer()==menu_return::RETURN_EXIT_ALL)
{ {