From 90364f9ab1de68e8f893d9af6b7a97628f62e54c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 9 May 2019 00:05:58 +0200 Subject: [PATCH] moviebrowser/mb.cpp: avoid possible empty menue entries in showMenu() Empty entries don't look good if no movie infos are available but it seems to be better to show movie name beside entry name. If movie title not available show menu entry with an "edit" hint. So the menu should be more intuitive. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/82efff9ad8bafc73e586e95d375b2c7882faa57b Author: Thilo Graf Date: 2019-05-09 (Thu, 09 May 2019) Origin message was: ------------------ moviebrowser/mb.cpp: avoid possible empty menue entries in showMenu() Empty entries don't look good if no movie infos are available but it seems to be better to show movie name beside entry name. If movie title not available show menu entry with an "edit" hint. So the menu should be more intuitive. ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/moviebrowser/mb.cpp | 21 +++++++++++---------- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index e2180e59e..f01725fd9 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2021,6 +2021,7 @@ moviebrowser.menu_cut Film schneiden moviebrowser.menu_cut_head Kopieren, Schneiden und Kürzen moviebrowser.menu_data_request Online-Datenbank abfragen moviebrowser.menu_directories_head Verzeichnisse de/aktivieren +moviebrowser.menu_edit bearbeiten moviebrowser.menu_main_bookmarks Markierungen moviebrowser.menu_main_head Film-Info und Einstellungen moviebrowser.menu_nfs_head NFS Einstellung diff --git a/data/locale/english.locale b/data/locale/english.locale index b61a6c892..fbdefe22a 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2021,6 +2021,7 @@ moviebrowser.menu_cut Cut movie moviebrowser.menu_cut_head Copy, cut and truncate moviebrowser.menu_data_request Online database request moviebrowser.menu_directories_head Directories de/activate +moviebrowser.menu_edit edit moviebrowser.menu_main_bookmarks Bookmarks moviebrowser.menu_main_head Movie info and settings moviebrowser.menu_nfs_head NFS settings diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 409206bb9..15ce318c8 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3628,20 +3628,21 @@ bool CMovieBrowser::showMenu(bool calledExternally) if (!calledExternally) { CMenuWidget mainMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); mainMenu.addIntroItems(LOCALE_MOVIEBROWSER_MENU_MAIN_HEAD); + std::string title = g_Locale->getText(LOCALE_MOVIEBROWSER_MENU_EDIT); if (m_movieSelectionHandler) { - mainMenu.addItem(new CMenuForwarder(m_movieSelectionHandler->epgTitle, false)); - mainMenu.addItem(GenericMenuSeparator); + if (!m_movieSelectionHandler->epgTitle.empty()) + title = m_movieSelectionHandler->epgTitle; } - mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_info_menu", CRCInput::RC_red)); - mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_CUT_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_cut_menu", CRCInput::RC_green)); - mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_DELETE_MOVIE, (m_movieSelectionHandler != NULL), NULL, this, "delete_movie", CRCInput::RC_yellow)); - mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, true, NULL, this, "reload_movie_info", CRCInput::RC_blue)); + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_HEAD, (m_movieSelectionHandler != NULL), title, this, "show_movie_info_menu", CRCInput::RC_red)); + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_CUT_HEAD, (m_movieSelectionHandler != NULL), NULL , this, "show_movie_cut_menu", CRCInput::RC_green)); + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_DELETE_MOVIE, (m_movieSelectionHandler != NULL), NULL , this, "delete_movie", CRCInput::RC_yellow)); + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, true, NULL , this, "reload_movie_info", CRCInput::RC_blue)); mainMenu.addItem(GenericMenuSeparatorLine); - mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_SETTINGS, true, NULL, &optionsMenu,NULL, CRCInput::RC_1)); - mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_DIRECTORIES_HEAD, true, NULL, &dirMenu, NULL, CRCInput::RC_2)); -// mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, true, NULL, this, "reload_movie_info",CRCInput::RC_3)); -// mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_NFS_HEAD, true, NULL, nfs, NULL, CRCInput::RC_setup)); + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_SETTINGS, true, NULL , &optionsMenu,NULL, CRCInput::RC_1)); + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_DIRECTORIES_HEAD, true, NULL , &dirMenu, NULL, CRCInput::RC_2)); +// mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, true, NULL , this, "reload_movie_info",CRCInput::RC_3)); +// mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_NFS_HEAD, true, NULL , nfs, NULL, CRCInput::RC_setup)); mainMenu.exec(NULL, " "); } else diff --git a/src/system/locals.h b/src/system/locals.h index d4c816f18..f1b7d0b2a 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2048,6 +2048,7 @@ typedef enum LOCALE_MOVIEBROWSER_MENU_CUT_HEAD, LOCALE_MOVIEBROWSER_MENU_DATA_REQUEST, LOCALE_MOVIEBROWSER_MENU_DIRECTORIES_HEAD, + LOCALE_MOVIEBROWSER_MENU_EDIT, LOCALE_MOVIEBROWSER_MENU_MAIN_BOOKMARKS, LOCALE_MOVIEBROWSER_MENU_MAIN_HEAD, LOCALE_MOVIEBROWSER_MENU_NFS_HEAD, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 52886ed45..98d7edbc5 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2048,6 +2048,7 @@ const char * locale_real_names[] = "moviebrowser.menu_cut_head", "moviebrowser.menu_data_request", "moviebrowser.menu_directories_head", + "moviebrowser.menu_edit", "moviebrowser.menu_main_bookmarks", "moviebrowser.menu_main_head", "moviebrowser.menu_nfs_head",