- moviebrowser: add PREVPLAYDATE/RECORDDATE sort buttons to footer

This commit is contained in:
svenhoefer
2016-11-14 10:09:34 +01:00
parent 5dc6255b43
commit 2f23aaedea

View File

@@ -2014,6 +2014,18 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg)
CMenuWidget m(LOCALE_MOVIEBROWSER_FOOT_SORT, NEUTRINO_ICON_SETTINGS);
m.addIntroItems();
// add PREVPLAYDATE/RECORDDATE sort buttons to footer
m.addKey(CRCInput::RC_red, selector, to_string(MB_INFO_PREVPLAYDATE).c_str());
m.addKey(CRCInput::RC_green, selector, to_string(MB_INFO_RECORDDATE).c_str());
button_label footerButtons[] = {
{ NEUTRINO_ICON_BUTTON_RED, LOCALE_MOVIEBROWSER_INFO_PREVPLAYDATE},
{ NEUTRINO_ICON_BUTTON_GREEN, LOCALE_MOVIEBROWSER_INFO_RECORDDATE}
};
int footerButtonsCount = sizeof(footerButtons) / sizeof(button_label);
m.setFooter(footerButtons, footerButtonsCount);
// just show sorting options for displayed rows; sorted by rows
for (int row = 0; row < MB_MAX_ROWS && row < m_settings.browserRowNr; row++)
{
@@ -2022,6 +2034,10 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg)
if (sortBy[i] == NULL)
continue;
// already added to footer
if (i == MB_INFO_PREVPLAYDATE || i == MB_INFO_RECORDDATE)
continue;
if (m_settings.browserRowItem[row] == i)
m.addItem(new CMenuForwarder(g_Locale->getText(m_localizedItemName[i]), true, NULL, selector, to_string(i).c_str(), CRCInput::convertDigitToKey(directkey++)));
}