From fcd10f630201eaa9705170f85cfbec553a788d1a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 5 May 2019 16:00:00 +0200 Subject: [PATCH] moviebrowser: add switch for cut of text inside rows, default enabled Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/52f85ed3d0d062c1503167affe6aaf7e30633c6c Author: Thilo Graf Date: 2019-05-05 (Sun, 05 May 2019) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 8 ++++++++ src/gui/moviebrowser/mb.h | 1 + src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 4 files changed, 11 insertions(+) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 01f1fe925..d353f4016 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -470,6 +470,7 @@ void CMovieBrowser::initGlobalSettings(void) /***** Browser List **************/ m_settings.browserFrameHeight = 65; /* percent */ + m_settings.browserCutLongRowText = 1; m_settings.browserRowNr = 6; m_settings.browserRowItem[0] = MB_INFO_TITLE; @@ -655,6 +656,7 @@ bool CMovieBrowser::loadSettings(MB_SETTINGS* settings) } /* these variables are used for the listframes */ settings->browserFrameHeight = configfile.getInt32("mb_browserFrameHeight", 50); + settings->browserCutLongRowText = configfile.getInt32("mb_browserCutLongRowText", 1); settings->browserRowNr = configfile.getInt32("mb_browserRowNr", 0); for (int i = 0; i < MB_MAX_ROWS && i < settings->browserRowNr; i++) { @@ -722,6 +724,8 @@ bool CMovieBrowser::saveSettings(MB_SETTINGS* settings) } /* these variables are used for the listframes */ configfile.setInt32("mb_browserFrameHeight", settings->browserFrameHeight); + configfile.setInt32("mb_browserCutLongRowText", settings->browserCutLongRowText); + configfile.setInt32("mb_browserRowNr",settings->browserRowNr); for (int i = 0; i < MB_MAX_ROWS && i < settings->browserRowNr; i++) { @@ -1816,6 +1820,7 @@ void CMovieBrowser::refreshLastPlayList(void) //P2 m_playListLines.marked.push_back(m_vHandlePlayList[handle]->marked); } m_pcLastPlay->setLines(&m_playListLines); + m_pcLastPlay->cutRowText(&m_settings.browserCutLongRowText); m_currentPlaySelection = m_pcLastPlay->getSelectedLine(); // update selected movie if browser is in the focus @@ -1874,6 +1879,7 @@ void CMovieBrowser::refreshLastRecordList(void) //P2 } m_pcLastRecord->setLines(&m_recordListLines); + m_pcLastRecord->cutRowText(&m_settings.browserCutLongRowText); m_currentRecordSelection = m_pcLastRecord->getSelectedLine(); // update selected movie if browser is in the focus @@ -1969,6 +1975,7 @@ void CMovieBrowser::refreshBrowserList(void) //P1 m_browserListLines.marked.push_back(m_vHandleBrowserList[handle]->marked); } m_pcBrowser->setLines(&m_browserListLines); + m_pcBrowser->cutRowText(&m_settings.browserCutLongRowText); m_currentBrowserSelection = m_pcBrowser->getSelectedLine(); // update selected movie if browser is in the focus @@ -3575,6 +3582,7 @@ bool CMovieBrowser::showMenu(bool calledExternally) optionsMenuBrowser.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_LAST_RECORD_MAX_ITEMS, true, recMaxUserIntInput.getValue(), &recMaxUserIntInput)); optionsMenuBrowser.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BROWSER_FRAME_HIGH, true, browserFrameUserIntInput.getValue(), &browserFrameUserIntInput)); optionsMenuBrowser.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_BROWSER_ADDITIONAL, (int*)(&m_settings.browserAdditional), MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true)); + optionsMenuBrowser.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_BROWSER_CUT_LONG_ROWTEXT, (int*)(&m_settings.browserCutLongRowText), MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true)); optionsMenuBrowser.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_MOVIEBROWSER_BROWSER_ROW_HEAD)); optionsMenuBrowser.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BROWSER_ROW_NR, true, browserRowNrIntInput.getValue(), &browserRowNrIntInput)); optionsMenuBrowser.addItem(GenericMenuSeparator); diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 17d168132..717333596 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -97,6 +97,7 @@ typedef struct MB_INFO_ITEM browserRowItem[MB_MAX_ROWS]; int browserRowWidth[MB_MAX_ROWS]; int browserAdditional; + int browserCutLongRowText; // to be added to config later int lastPlayMaxItems; diff --git a/src/system/locals.h b/src/system/locals.h index 53c84ba34..c0cdcbb23 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1946,6 +1946,7 @@ typedef enum LOCALE_MOVIEBROWSER_BOOK_TYPE_BACKWARD, LOCALE_MOVIEBROWSER_BOOK_TYPE_FORWARD, LOCALE_MOVIEBROWSER_BROWSER_ADDITIONAL, + LOCALE_MOVIEBROWSER_BROWSER_CUT_LONG_ROWTEXT, LOCALE_MOVIEBROWSER_BROWSER_FRAME_HIGH, LOCALE_MOVIEBROWSER_BROWSER_ROW_HEAD, LOCALE_MOVIEBROWSER_BROWSER_ROW_ITEM, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 272a693d2..27d16c019 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1946,6 +1946,7 @@ const char * locale_real_names[] = "moviebrowser.book_type_backward", "moviebrowser.book_type_forward", "moviebrowser.browser_additional", + "moviebrowser.browser_cut_long_rowtext", "moviebrowser.browser_frame_high", "moviebrowser.browser_row_head", "moviebrowser.browser_row_item",