From c6851f5bbd42c61176655994900c3149a00be91c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 14 Nov 2016 10:09:34 +0100 Subject: [PATCH] moviebrowser: add PREVPLAYDATE/RECORDDATE sort buttons to footer Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2f23aaedea8d219f068f569929f26d6804509e34 Author: vanhofen Date: 2016-11-14 (Mon, 14 Nov 2016) Origin message was: ------------------ - moviebrowser: add PREVPLAYDATE/RECORDDATE sort buttons to footer --- src/gui/moviebrowser/mb.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 4a768d856..0a59121f2 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -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++))); }