diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 6215be853..9ad842612 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1761,6 +1761,7 @@ moviebrowser.book_type_forward Überspringen moviebrowser.browser_additional Zusätzliche Informationen moviebrowser.browser_cut_long_rowtext Text in Spalten abschneiden moviebrowser.browser_frame_high Anzeigehöhe oberes Fenster [%] +moviebrowser.browser_frame_high_additional Anzeigehöhe oberes Fenster mit Zusatzinfos [%] moviebrowser.browser_row_head Spalten Einstellungen moviebrowser.browser_row_item Spalteninfo moviebrowser.browser_row_nr Anzahl Spalten diff --git a/data/locale/english.locale b/data/locale/english.locale index 856d56ba4..1150599e9 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1761,6 +1761,7 @@ moviebrowser.book_type_forward Jump over moviebrowser.browser_additional Additional informations moviebrowser.browser_cut_long_rowtext Cut long row text moviebrowser.browser_frame_high Browser height [%] +moviebrowser.browser_frame_high_additional Browser height with additional info [%] moviebrowser.browser_row_head Row settings moviebrowser.browser_row_item Row item moviebrowser.browser_row_nr Number of rows diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 6c9e8ea7b..85d26edbc 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -372,10 +372,10 @@ void CMovieBrowser::init(void) if (m_settings.parentalLock >= MB_PARENTAL_LOCK_MAX_NUMBER) m_settings.parentalLock = MB_PARENTAL_LOCK_OFF; + m_settings.browserFrameHeight = m_settings.browserAdditional ? m_settings.browserFrameHeightAdditional : m_settings.browserFrameHeightGeneral; /* convert from old pixel-based to new percent values */ if (m_settings.browserFrameHeight > 100) m_settings.browserFrameHeight = 50; - if (m_settings.browserFrameHeight < MIN_BROWSER_FRAME_HEIGHT) m_settings.browserFrameHeight = MIN_BROWSER_FRAME_HEIGHT; if (m_settings.browserFrameHeight > MAX_BROWSER_FRAME_HEIGHT) @@ -470,7 +470,9 @@ void CMovieBrowser::initGlobalSettings(void) initGlobalStorageSettings(); /***** Browser List **************/ - m_settings.browserFrameHeight = 65; /* percent */ + m_settings.browserFrameHeightGeneral = 65; /* percent */ + m_settings.browserFrameHeightAdditional = 75; /* percent */ + m_settings.browserFrameHeight = m_settings.browserFrameHeightGeneral; /* percent */ m_settings.browserCutLongRowText = 1; m_settings.browserRowNr = 7; @@ -535,6 +537,8 @@ void CMovieBrowser::initFrames(void) m_cBoxFrameBrowserList.iWidth = m_cBoxFrame.iWidth / 3 * 2; else m_cBoxFrameBrowserList.iWidth = m_cBoxFrame.iWidth; + + m_settings.browserFrameHeight = m_settings.browserAdditional ? m_settings.browserFrameHeightAdditional : m_settings.browserFrameHeightGeneral; m_cBoxFrameBrowserList.iHeight = m_cBoxFrame.iHeight * m_settings.browserFrameHeight / 100; @@ -669,7 +673,9 @@ bool CMovieBrowser::loadSettings(MB_SETTINGS* settings) settings->store.storageDirUsed[i] = configfile.getInt32("mb_dir_used" + to_string(i), false); } /* these variables are used for the listframes */ - settings->browserFrameHeight = configfile.getInt32("mb_browserFrameHeight", 50); + settings->browserFrameHeightGeneral = configfile.getInt32("mb_browserFrameHeightGeneral", 65); + settings->browserFrameHeightAdditional = configfile.getInt32("mb_browserFrameHeightAdditional", 75); + settings->browserFrameHeight = configfile.getInt32("mb_browserFrameHeight", settings->browserFrameHeightGeneral); 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++) @@ -737,7 +743,9 @@ bool CMovieBrowser::saveSettings(MB_SETTINGS* settings) configfile.setInt32("mb_dir_used" + to_string(i), settings->store.storageDirUsed[i]); // do not save this so far } /* these variables are used for the listframes */ - configfile.setInt32("mb_browserFrameHeight", settings->browserFrameHeight); + configfile.setInt32("mb_browserFrameHeightGeneral", settings->browserFrameHeightGeneral); + configfile.setInt32("mb_browserFrameHeightAdditional", settings->browserFrameHeightAdditional); + configfile.setInt32("mb_browserFrameHeight", settings->browserAdditional ? settings->browserFrameHeightAdditional : settings->browserFrameHeightGeneral); configfile.setInt32("mb_browserCutLongRowText", settings->browserCutLongRowText); configfile.setInt32("mb_browserRowNr",settings->browserRowNr); @@ -3515,6 +3523,7 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) return res; } + int CMovieBrowser::showMovieCutMenu() { CMenuWidget movieCutMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); @@ -3546,6 +3555,23 @@ int CMovieBrowser::showMovieCutMenu() return res; } +void CMovieBrowser::changeBrowserHeight(CMenuForwarder* fw1, CMenuForwarder* fw2) +{ + if (m_settings.browserAdditional) + { + fw1->setActive(false); + fw2->setActive(true); + } + else + { + fw1->setActive(true); + fw2->setActive(false); + } + + fw1->paint(); + fw2->paint(); +} + bool CMovieBrowser::showMenu(bool calledExternally) { /* first clear screen */ @@ -3599,15 +3625,29 @@ bool CMovieBrowser::showMenu(bool calledExternally) int oldAdditional = m_settings.browserAdditional; CIntInput playMaxUserIntInput(LOCALE_MOVIEBROWSER_LAST_PLAY_MAX_ITEMS, (int *)&m_settings.lastPlayMaxItems, 3, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CIntInput recMaxUserIntInput(LOCALE_MOVIEBROWSER_LAST_RECORD_MAX_ITEMS, (int *)&m_settings.lastRecordMaxItems, 3, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); - CIntInput browserFrameUserIntInput(LOCALE_MOVIEBROWSER_BROWSER_FRAME_HIGH, (int *)&m_settings.browserFrameHeight, 3, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); + + CIntInput* browserFrameUserIntInputAdd = new CIntInput(LOCALE_MOVIEBROWSER_BROWSER_FRAME_HIGH, (int *)&m_settings.browserFrameHeightAdditional, 3, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); + CIntInput* browserFrameUserIntInputGen = new CIntInput(LOCALE_MOVIEBROWSER_BROWSER_FRAME_HIGH, (int *)&m_settings.browserFrameHeightGeneral, 3, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); + CIntInput browserRowNrIntInput(LOCALE_MOVIEBROWSER_BROWSER_ROW_NR, (int *)&m_settings.browserRowNr, 1, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CMenuWidget optionsMenuBrowser(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); optionsMenuBrowser.addIntroItems(LOCALE_MOVIEBROWSER_OPTION_BROWSER); optionsMenuBrowser.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_LAST_PLAY_MAX_ITEMS, true, playMaxUserIntInput.getValue(), &playMaxUserIntInput)); 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(GenericMenuSeparatorLine); + + CMenuForwarder* fw1 = new CMenuForwarder(LOCALE_MOVIEBROWSER_BROWSER_FRAME_HIGH, !m_settings.browserAdditional, browserFrameUserIntInputGen->getValue(), browserFrameUserIntInputGen); + CMenuForwarder* fw2 = new CMenuForwarder(LOCALE_MOVIEBROWSER_BROWSER_FRAME_HIGH_ADDITIONAL, m_settings.browserAdditional, browserFrameUserIntInputAdd->getValue(), browserFrameUserIntInputAdd); + + CMenuOptionChooser *oj = new CMenuOptionChooser(LOCALE_MOVIEBROWSER_BROWSER_ADDITIONAL, (int*)(&m_settings.browserAdditional), MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true); + oj->OnAfterChangeOption.connect(sigc::bind(sigc::mem_fun(*this, &CMovieBrowser::changeBrowserHeight), fw1, fw2)); + + optionsMenuBrowser.addItem(oj); + optionsMenuBrowser.addItem(fw1); + optionsMenuBrowser.addItem(fw2); + + optionsMenuBrowser.addItem(GenericMenuSeparatorLine); 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)); @@ -3677,10 +3717,13 @@ bool CMovieBrowser::showMenu(bool calledExternally) // post menu handling if (m_parentalLock != MB_PARENTAL_LOCK_OFF_TMP) m_settings.parentalLock = m_parentalLock; + + m_settings.browserFrameHeight = m_settings.browserAdditional ? m_settings.browserFrameHeightAdditional : m_settings.browserFrameHeightGeneral; if (m_settings.browserFrameHeight < MIN_BROWSER_FRAME_HEIGHT) m_settings.browserFrameHeight = MIN_BROWSER_FRAME_HEIGHT; if (m_settings.browserFrameHeight > MAX_BROWSER_FRAME_HEIGHT) m_settings.browserFrameHeight = MAX_BROWSER_FRAME_HEIGHT; + if (m_settings.browserRowNr > MB_MAX_ROWS) m_settings.browserRowNr = MB_MAX_ROWS; if (m_settings.browserRowNr < 1) @@ -3704,20 +3747,6 @@ bool CMovieBrowser::showMenu(bool calledExternally) ); if (reInitFrames) { -#if 1 - if (oldAdditional != m_settings.browserAdditional) - { - /* - Bad 'hack' to force a smaller m_pcInfo1 box. - This can be reconfigured by user later. - It's just to align view to channellist's view. - */ - if (m_settings.browserAdditional) - m_settings.browserFrameHeight = 75; - else - m_settings.browserFrameHeight = 65; - } -#endif initFrames(); hide(); paint(); diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index f3382143d..68934f342 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -99,6 +99,8 @@ typedef struct /* these variables are used for the listframes */ int browserFrameHeight; + int browserFrameHeightGeneral; + int browserFrameHeightAdditional; int browserRowNr; MB_INFO_ITEM browserRowItem[MB_MAX_ROWS]; int browserRowWidth[MB_MAX_ROWS]; @@ -376,6 +378,8 @@ class CMovieBrowser : public CMenuTarget, public CProgressSignals void clearSelection(); bool supportedExtension(CFile &file); bool addFile(CFile &file, int dirItNr); + + void changeBrowserHeight(CMenuForwarder* fw1, CMenuForwarder* fw2); }; // I tried a lot to use the menu.cpp as ListBox selection, and I got three solution which are all garbage. diff --git a/src/system/locals.h b/src/system/locals.h index 79c1ca120..05bfc80da 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1788,6 +1788,7 @@ typedef enum LOCALE_MOVIEBROWSER_BROWSER_ADDITIONAL, LOCALE_MOVIEBROWSER_BROWSER_CUT_LONG_ROWTEXT, LOCALE_MOVIEBROWSER_BROWSER_FRAME_HIGH, + LOCALE_MOVIEBROWSER_BROWSER_FRAME_HIGH_ADDITIONAL, LOCALE_MOVIEBROWSER_BROWSER_ROW_HEAD, LOCALE_MOVIEBROWSER_BROWSER_ROW_ITEM, LOCALE_MOVIEBROWSER_BROWSER_ROW_NR, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index ca3cefe6d..e273a7dcc 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1788,6 +1788,7 @@ const char * locale_real_names[] = "moviebrowser.browser_additional", "moviebrowser.browser_cut_long_rowtext", "moviebrowser.browser_frame_high", + "moviebrowser.browser_frame_high_additional", "moviebrowser.browser_row_head", "moviebrowser.browser_row_item", "moviebrowser.browser_row_nr",